C 璇█瀹炵幇涓 CoDeSys 鎺ュ彛鐨勬柟娉(缁) , 濡備綍鐢熸垚鎺ュ彛 Hex 鏂囦欢-CODESYS璧勬簮涓嬭浇鍖-閰峰痉缃 - CoDeSys杞欢鏁欑▼涓嬭浇,CoDeSys宸ユ帶璧勮闂ㄦ埛
HSC6490-cn涓浗鍒堕狅紝涓浗鑺瘇
鏌ョ湅: 6825|鍥炲: 7

C 璇█瀹炵幇涓 CoDeSys 鎺ュ彛鐨勬柟娉(缁), 濡備綍鐢熸垚鎺ュ彛 Hex 鏂囦欢

  [澶嶅埗閾炬帴]

璇ョ敤鎴蜂粠鏈鍒

鍙戣〃浜 2016-5-30 00:09:11 | 鏄剧ず鍏ㄩ儴妤煎眰 |闃呰妯″紡
寰堥暱鏃堕棿娌℃湁杩涘叆璁哄潧鏌ョ湅淇℃伅浜, 杩戞湡鐪嬪埌鏈夊叧蹇 C 璇█瀹炵幇涓 CoDeSys 鎺ュ彛鐨勬柟娉 鏂囨。鐨勯棶棰, 鎰熻鍙互鏀寔涓涓, 骞跺彂甯冭鏂
濡備綍鐢熸垚鎺ュ彛 Hex 鏂囦欢, 甯屾湜瀵瑰ぇ瀹舵湁鎵甯姪.

涓嬮潰鐨勫唴瀹规槸 C 璇█瀹炵幇涓 CoDeSys 鎺ュ彛鐨勬柟娉(缁), 鏈夊叧鍐呭鍙互鏌ラ槄璇ユ枃: C 璇█瀹炵幇涓 CoDeSys 鎺ュ彛鐨勬柟娉

1. 浣跨敤 keil 缂栬瘧杞欢 (鏀寔 ARM) 缂栬瘧椤圭洰
2. 杈撳叆涓嬮潰鐨勬祴璇曟枃浠 test_ExtTest.c
-------------------------------------------------------------------------------
typedef unsigned char  U8;  //  8 bit
typedef unsigned short  U16; // 16 bit
typedef float    F32; // 32 bit
typedef struct _Lib_ExtTestType
{
U8  bInit;     // Var   鍙橀噺
U8  Execute;    // Input  鍙橀噺
U8  Done;     // Output  鍙橀噺
U8  Error;
U16  ErrorId;
F32* pData;     // In_Out 鍙橀噺 (鎸囬拡绫诲瀷)
}Lib_ExtTestType, *PLib_ExtTestType;

// 鐩存帴鎸囧畾鍔熻兘鍦板潃
// Lib_ExtTest 鍦板潃:  0x00000800 (鍙互鏍规嵁闇瑕佷换鎰忔寚瀹, 瑕佹眰鏄 4 鐨勫嶆暟, 闃叉浜х敓绯荤粺閿欒)
// Lib_ExtTestInit 鍦板潃: 0x00000900
void Lib_ExtTest  (PLib_ExtTestType pstIn)    __attribute__((section(".ARM.__at_0x800"))); // 姝e父鎵ц璋冪敤
U8  Lib_ExtTestInit (PLib_ExtTestType pstIn, U8 bRetain) __attribute__((section(".ARM.__at_0x900"))); // 鍒濆鍖栬皟鐢
// 鐩存帴鎸囧畾鍏ㄥ眬鍙橀噺鍦板潃
// g_stIn 鍦板潃:   x40001000 (鍙互鏍规嵁闇瑕佹寚瀹)
  Lib_ExtTestType g_stIn         __attribute__((section(".ARM.__at_0x40001000")));

// 鐢熸垚 hex 鏂囦欢鐨勬祴璇曚富绋嬪簭 (鍙綔涓烘ā鏉, 瀹為檯涓婁笉浣跨敤)
main (void)
{
Lib_ExtTest(&g_stIn);
}
// 鍔熻兘瀹炵幇浣撴ā鏉
void Lib_ExtTest(PLib_ExtTestType pstIn) // 姝e父鎵ц璋冪敤
{
// 瀹炵幇闇瑕佺殑鍔熻兘锛屾湰浠g爜涓烘紨绀虹ず渚
if (pstIn->Execute)
{
  pstIn->bInit = (U8) 0x1; // TRUE
  pstIn->Done  = (U8) 0x1; // TRUE
  *pstIn->pData  += (F32) 0.1;
}
else
{
  pstIn->bInit = (U8) 0x0; // false
  pstIn->Done  = (U8) 0x0; // false
}
}
U8 Lib_ExtTestInit(PLib_ExtTestType pstIn, U8 bRetain) // 鍒濆鍖栬皟鐢
{
// 鍒濆鍖栧姛鑳藉潡鍙橀噺锛岃缃ず渚嬪涓:
pstIn->bInit   = (U8) 0x0;  // FALSE
pstIn->Execute  = (U8) 0x0;  // FALSE
pstIn->Done   = (U8) 0x0;  // FALSE
pstIn->Error   = (U8) 0x0;  // FALSE
pstIn->ErrorId   = (U16) 0;
*pstIn->pData  = (F32) 0.0;  // REAL
// 褰 bRetain 涓 false 鏃讹紝鍒濆鍖栬繑鍥炲彉閲
return bRetain;
}
-------------------------------------------------------------------------------
3. 鍒涘缓 keil C 缂栬瘧椤圭洰 (閫夋嫨 ARM7 绫诲瀷), 鍖呭惈缂虹渷鐢熸垚鐨 Startup.s 鏂囦欢鍙婁笂闈㈢殑 test_ExtTest.c 鏂囦欢
4. 缂栬瘧椤圭洰, 鐢熸垚 test_ExtTest.hex 鏂囦欢 (鏂囦欢鍐呭瑙佷笅闈)
-------------------------------------------------------------------------------
:020000040000FA
:1000000018F09FE518F09FE518F09FE518F09FE5C0
:1000100018F09FE50000A0E1F0FF1FE518F09FE554
:1000200058000000400000004400000048000000AC
:100030004C000000000000005000000054000000D0
:10004000FEFFFFEAFEFFFFEAFEFFFFEAFEFFFFEA18
:10005000FEFFFFEAFEFFFFEAA0009FE5AA10A0E373
:100060005520A0E32430A0E3043080E50130A0E374
:10007000003080E50C1080E50C2080E5083090E52C
:10008000013B13E2FCFFFF0A0330A0E3003080E5F0
:100090000C1080E50C2080E564009FE50410A0E3CF
:1000A000041080E50210A0E3001080E554009FE5F5
:1000B000DBF021E300D0A0E1000040E2D7F021E333
:1000C00000D0A0E1000040E2D1F021E300D0A0E1A7
:1000D000000040E2D2F021E300D0A0E1800040E245
:1000E000D3F021E300D0A0E1080040E210F021E3CA
:1000F00000D0A0E101AB4DE20C009FE510FF2FE125
:1001000080C01FE000C01FE0E804004010010000B4
:10011000000000EB240000EB2C008FE2000C90E8C4
:1001200000A08AE000B08BE001704AE20B005AE1C7
:100130000000001A1C0000EB0F00BAE818E04FE2C4
:10014000010013E303F0471013FF2FE12804000020
:10015000380400000030B0E30040B0E30050B0E3EA
:100160000060B0E3102052E27800A128FCFFFF8A73
:10017000822EB0E13000A128003081451EFF2FE122
:1001800001C08FE21CFF2FE11FB5059886460FBC0A
:10019000009C02B07047000001C08FE21CFF2FE1FD
:1001A00030B47546AE4630BC70470000210000EB0D
:1001B0000210A0E1F1FFFFEB1CC09FE50FC08CE037
:1001C00001001CE30DE08F120FE0A0011CFF2FE1E6
:1001D00001C08FE21CFF2FE100F05EF8500000002C
:1001E0007847C04603002DE9EAFFFFEB0300BDE8B6
:1001F0002E0000EB0C009FE50C109FE504209FE50E
:1002000008309FE51EFF2FE16000004060040040C1
:100210006000004010402DE90C009FE5770100EBE5
:100220000000A0E31040BDE81EFF2FE100100040D9
:1002300070477047704700000E50A0E1180000EBB7
:1002400005E0A0E10050B0E10D10A0E10A30A0E10E
:100250000700C0E300D0A0E160D08DE220402DE98E
:10026000E3FFFFEB2040BDE80060A0E30070A0E3E7
:100270000080A0E300B0A0E30710C1E305C0A0E147
:10028000C009ACE8C009ACE8C009ACE8C009ACE8FA
:1002900001D0A0E11EFF2FE10400C046C0462000AF
:1002A000FFF79EFF00009FE51EFF2FE100000040CA
:1002B00001C08FE21CFF2FE101491820ABDFFEE7F0
:1002C000260002001EFF2FE1010030E10211214251
:1002D0005E00004A012050E00200403002108130F0
:1002E000A02BA0E1FFC4A0E381001CE1020C3C11A3
:1002F000A13B42E01C00000A02C1A0E300048CE123
:1003000001148CE131C390E00E00002A012042E28A
:100310002C04B0E1820BA0E01EFF2F317F001CE314
:1003200080C0A0E1FF045C131EFF2F31203063E288
:100330001113B0E10100C003FF045CE31EFF2F3185
:10034000060240E23A0000EA6C00A0E12004B0E1BD
:10035000820BA0E0FF001C2380C0A0E1F2FFFF0A97
:10036000FF045C131EFF2F31F4FFFFEA020C3CE197
:100370000200000AAC0010E1020100021EFF2FE1A2
:1003800010402DE9000000EB64FBBE3E04409EE4FB
:10039000040014E10200004A8120A0E1FF0452E3BE
:1003A0000900008A8030A0E1FF0453E30600008AC0
:1003B0000700001AA0CFA0E1FF0452E38CC08CE03C
:1003C00002C08CE2A1CFAC00020000EA08C0A0E3AA
:1003D000000000EAA1CFA0E18C308CE03443A0E122
:1003E000074004E204C054E20200002A04C18EE087
:1003F0001040BDE81CFF2FE10CF18FE00000A0E1F0
:10040000050000EA050000EAFFFFFFEA1040BDE832
:100410000201A0E3010540E21EFF2FE10100A0E17F
:100420001040BDE88020B0E1012472120201008278
:100430001EFF2FE1FF10B0E3A00B81E1800BB0E1C4
:100440001EFF2FE1010030E102112142A0FFFF4A0F
:10045000012050E00221223202004030021081309F
:10046000A02BA0E1FFC4A0E381001CE1020C3C1121
:10047000A13B42E03400000A02C1A0E300048CE189
:1004800001148CE131C350E00800004AFE0012E381
:100490008C00B0111000005A4004B0E1820BA0E0C3
:1004A0001EFF2F313F001CE31EFF2F11050000EA45
:1004B000012042E22C04B0E1820BA0E01EFF2F31AC
:1004C0007F001CE31EFF2F11203063E21113B0E107
:1004D000010040120100C0031EFF2FE12234A0E101
:1004E0001600000A000010E11EFF2F01A0CBB0E1B2
:1004F0000400001A0004A00108204202A0CBB0E1D1
:100500000004A001082042021E0310E32002A011F3
:1005100004208212060410E32001A011022082129E
:10052000010450E30920C2E2A000A021220433E12B
:10053000820B80001EFF2F01830FA0E11EFF2FE121
:10054000AC03B0E11EFF2F01FAFFFFEA020C3CE111
:100550000200000AAC0010E10000A0031EFF2FE122
:1005600010402DE988FFFFEB40DFF63E020121E25B
:100570001EFF2FE12C09000000000040E8040000ED
:100580005401000000000000000000000000000016
:10059000000000000000000000000000000000005B

:1007F00000000000000000000000000000000000F9
:1008000010402DE90040A0E10100D4E5000050E3D4
:100810000900000A0100A0E30000C4E50200C4E5ED
:10082000081094E5000091E520109FE5A5FEFFEB80
:10083000081094E5000081E5020000EA0000A0E352
:100840000000C4E50200C4E51040BDE81EFF2FE132
:10085000CDCCCC3D000000000000000000000000F6
:100860000000000000000000000000000000000088
:100870000000000000000000000000000000000078
:100880000000000000000000000000000000000068
:100890000000000000000000000000000000000058
:1008A0000000000000000000000000000000000048
:1008B0000000000000000000000000000000000038
:1008C0000000000000000000000000000000000028
:1008D0000000000000000000000000000000000018
:1008E0000000000000000000000000000000000008
:1008F00000000000000000000000000000000000F8
:100900000020A0E10000A0E30000C2E50100C2E574
:100910000200C2E50300C2E5B400C2E1083092E57E
:0C092000000083E50100A0E11EFF2FE1B4
:020000044000BA
:0C100000000000000000000000000000E4
:0400000500000110E6
:00000001FF
-------------------------------------------------------------------------------
5. 浠 hex 鏂囦欢鎵惧埌涓嬮潰鐨勮
-------------------------------------------------------------------------------
6. Lib_ExtTest 鍔熻兘鍦 hex 鏂囦欢涓搴旂殑淇℃伅
:1008000010402DE90040A0E10100D4E5000050E3D4
:100810000900000A0100A0E30000C4E50200C4E5ED
:10082000081094E5000091E520109FE5A5FEFFEB80
:10083000081094E5000081E5020000EA0000A0E352
:100840000000C4E50200C4E51040BDE81EFF2FE132
:10085000CDCCCC3D000000000000000000000000F6
-------------------------------------------------------------------------------
7. Lib_ExtTestInit 鍔熻兘鍦 hex 鏂囦欢涓搴旂殑淇℃伅
-------------------------------------------------------------------------------
:100900000020A0E10000A0E30000C2E50100C2E574
:100910000200C2E50300C2E5B400C2E1083092E57E
:0C092000000083E50100A0E11EFF2FE1B4
-------------------------------------------------------------------------------
8. 鍚堝苟缁勫悎鐢熸垚鏂扮殑 Test_ExtLib.hex 鏂囦欢
-------------------------------------------------------------------------------
:020000040000FA
:1008000010402DE90040A0E10100D4E5000050E3D4
:100810000900000A0100A0E30000C4E50200C4E5ED
:10082000081094E5000091E520109FE5A5FEFFEB80
:10083000081094E5000081E5020000EA0000A0E352
:100840000000C4E50200C4E51040BDE81EFF2FE132
:10085000CDCCCC3D000000000000000000000000F6
:100900000020A0E10000A0E30000C2E50100C2E574
:100910000200C2E50300C2E5B400C2E1083092E57E
:0C092000000083E50100A0E11EFF2FE1B4
:00000001FF
-------------------------------------------------------------------------------
9. 濡備綍涓嬭浇 hex 鏂囦欢鍙婅瀺鍚堢郴缁, 璇疯嚜琛岃В鍐

璇勫垎

鍙備笌浜烘暟 1閰峰竵 +10 鏀惰捣 鐞嗙敱
admin + 10 闈炲父濂界殑鏁欑▼锛屾劅璋㈠垎浜綖

鏌ョ湅鍏ㄩ儴璇勫垎

+10
涓嶈禐涓涓紵
鎵撹祻榧撳姳涓涓嬶紒
鍥炲

浣跨敤閬撳叿 涓炬姤

璇ョ敤鎴蜂粠鏈鍒

 妤间富| 鍙戣〃浜 2016-5-30 00:10:27 | 鏄剧ず鍏ㄩ儴妤煎眰
甯屾湜瀵瑰ぇ瀹舵湁鎵甯姪!
+10
涓嶈禐涓涓紵
鎵撹祻榧撳姳涓涓嬶紒
  • TA鐨勬瘡鏃ュ績鎯
    鎱垫噿
    2024-9-23 17:24
  • 绛惧埌澶╂暟: 86 澶

    [LV.6]甯镐綇灞呮皯II

    鍙戣〃浜 2019-1-25 08:16:21 | 鏄剧ず鍏ㄩ儴妤煎眰
    鍥炲鏄鍙戝笘鑰呯殑灏婃暚
    +10
    涓嶈禐涓涓紵
    鎵撹祻榧撳姳涓涓嬶紒
  • TA鐨勬瘡鏃ュ績鎯
    鏃犺亰
    2021-4-25 10:36
  • 绛惧埌澶╂暟: 5 澶

    [LV.2]鍋跺皵鐪嬬湅I

    鍙戣〃浜 2021-4-23 10:57:43 | 鏄剧ず鍏ㄩ儴妤煎眰
    鐢╒S2008缂栧啓鍔ㄦ佸簱DLL锛岀敱codesys璋冪敤姣旇繖涓鏄撳疄鐜
    +10
    涓嶈禐涓涓紵
    鎵撹祻榧撳姳涓涓嬶紒

    璇ョ敤鎴蜂粠鏈鍒

    鍙戣〃浜 2021-7-8 10:34:59 | 鏄剧ず鍏ㄩ儴妤煎眰
    ALVA2020 鍙戣〃浜 2021-4-23 10:57
    鐢╒S2008缂栧啓鍔ㄦ佸簱DLL锛岀敱codesys璋冪敤姣旇繖涓鏄撳疄鐜

    璇烽棶CodeSys搴旇濡備綍璋冪敤DLL鏂囦欢锛屾墜澶寸殑绗笁鏂硅澶囧彧鎻愪緵杩欎釜鏂囦欢
    +10
    涓嶈禐涓涓紵
    鎵撹祻榧撳姳涓涓嬶紒
  • TA鐨勬瘡鏃ュ績鎯
    鏃犺亰
    2021-4-25 10:36
  • 绛惧埌澶╂暟: 5 澶

    [LV.2]鍋跺皵鐪嬬湅I

    鍙戣〃浜 2021-7-8 10:40:38 鏉ヨ嚜鎵嬫満 | 鏄剧ず鍏ㄩ儴妤煎眰
    鏈夊閮ㄥ簱寮鍙戞帴鍙o紝鍦ㄩ厤缃枃浠堕噷娣诲姞璋冪敤鍔ㄦ佸簱鍚嶏紝浣犵敤鐨勬槸鍝鐨勭涓夋柟璁惧
    +10
    涓嶈禐涓涓紵
    鎵撹祻榧撳姳涓涓嬶紒

    璇ョ敤鎴蜂粠鏈鍒

    鍙戣〃浜 2021-7-8 10:49:05 | 鏄剧ず鍏ㄩ儴妤煎眰
    鏈笘鏈鍚庣敱 pdwabc 浜 2021-7-8 11:13 缂栬緫
    ALVA2020 鍙戣〃浜 2021-7-8 10:40
    鏈夊閮ㄥ簱寮鍙戞帴鍙o紝鍦ㄩ厤缃枃浠堕噷娣诲姞璋冪敤鍔ㄦ佸簱鍚嶏紝浣犵敤鐨勬槸鍝鐨勭涓夋柟璁惧 ...

    锛1锛夊湪鍝噷鑳藉鎵惧埌鐩稿叧璧勬枡锛岃兘璇寸殑璇︾粏涓鐐瑰悧锛熻繎鏈熼渶瑕佸仛鐨勫彟澶栦竴涓」鐩彧鑳芥壘鍒癉LL鏂囦欢锛屾病鍔炴硶2005骞寸殑FANUC鏈哄簥鑰佽澶囦簡闇瑕佹坊鍔犻泦鎴愭敼閫狅紝鏁版嵁閲囬泦绛変贡涓冨叓绯熺殑鍔熻兘锛2锛変箣鍓嶇敤LabVIEW璋冪敤鍩烘仼澹獶LL鏂囦欢宸茬粡瀹炵幇姝e父瀵瑰熀鎭╁+鐨勭浉鍏虫搷浣滐紝鍦–odeSys涓婇潰璇曠敤浜嗗ソ澶氭柟娉曢兘涓嶆垚鍔熴傛渶鍙皵鐨勬槸CodeSys鐨勫巶瀹剁珶鐒惰涓嶆敮鎸佹鍔熻兘...
    锛3锛夋湁璧勬枡鏄剧ずSysModule鍙互鐢ㄦ潵鍋氳繖浠朵簨锛屼絾鏄垜鏃犳硶鎵惧埌杩欎釜搴撴枃浠讹紝CodeSys鎶鏈鎵句粬浠殑閿鍞繕瑕佽喘涔颁粈涔堟彃浠讹紝鐪熶笉鏁㈢浉淇′粬浠簡涔颁箣鍓嶅憡璇夋垜鑳藉疄鐜拌繖浜涘姛鑳斤紝涔颁簡鍚庝笉鑳藉疄鐜板張璁╀拱涓嶇煡閬撲粈涔堜綔鐢ㄧ殑寮鍙戝寘锛屾棤璇簡

    +10
    涓嶈禐涓涓紵
    鎵撹祻榧撳姳涓涓嬶紒

    璇ョ敤鎴蜂粠鏈鍒

    鍙戣〃浜 2022-3-3 21:58:30 | 鏄剧ず鍏ㄩ儴妤煎眰
    codesysV3鎬庝箞c璇█锛屾垜鍒涘缓lib鍙互娣诲姞C Implemented Library锛屼絾鏄渶瑕佹坊鍔爋bj鏂囦欢锛宱bj鏂囦欢鎴戣嚜宸辩敓鎴愬悧锛熷府鍔╂枃妗i噷鐨凜 code modules鎬庝箞娣诲姞
    +10
    涓嶈禐涓涓紵
    鎵撹祻榧撳姳涓涓嬶紒
    鎮ㄩ渶瑕佺櫥褰曞悗鎵嶅彲浠ュ洖甯 鐧诲綍 | 绔嬪嵆娉ㄥ唽 鏂版氮寰崥鐧婚檰

    鏈増绉垎瑙勫垯

    椤堕儴qrcode搴曢儴
    鍏虫敞閰峰痉缃戣闃呭彿锛岃幏鍙栨洿澶氳祫璁紒

    QQ|灏忛粦灞|鎵嬫満鐗|Archiver|閰峰痉璁哄潧 ( 鑻廔CP澶16065247鍙-1 )|缃戠珯鍦板浘

    GMT+8, 2024-11-23 20:19 , Processed in 0.172459 second(s), 82 queries .

    閰峰痉缃

    © 2001-2013 Hicodesys. 鎶鏈敮鎸 by 閰峰痉缃

    蹇熷洖澶 杩斿洖椤堕儴 杩斿洖鍒楄〃