Examples
CAN-CBM-DP
Software Manual Rev. 2.0
89
+ -1 // motor 1 starts at byte 0, motor 2 starts at byte 8, ...
SLW 3 // means * 8: motor-index -> byte-number
SLW 3 // means * 8: byte-number -> bit-address
+ L#32
T #t000
L #t016 // get status of setup
T DBW [#t000] // save in init-list-DB
L W#16#FFFF // means: configuration in FB1 allways runs
L #t016 // status of setup
==I
SPB M014
L W#16#FFFE // means: configuration in FB1 is ready
L #t016 // status of setup
==I
SPB M011
SPA M014
M034: U #BIT14
R #BIT14
SPA M014
M011: U #BIT15
R #BIT15
SPA M014
M013: UN #BIT1
S #BIT1 // say motor-configuration is ready
L 2
T #RET_VALUE // say: configuration of Tx-ID
M014: SPA M035
M015: NOP 0
**************************************************************************
Calling FB 2: Data exchange via Page Mode
------------------------------------------------
(
1. : Page 0 -> reading the lengths (absolutely necessary !!!)
2. : Page 51 ff -> Tx-configuration ( once )
3. : Page 151 ff -> Rx-configuration ( once )
4. : Page 251 ff -> data exchange: output and input ( cyclically )
( Page 251, 252, 253, ... xyz, 251, 252, ... xyz (depending on the number of pages required)
)
)
Network 9: page-mode-output and page-mode-input
-----------
CALL FB 2 , DB102
FREIGABE :=#BIT1 // muss zuerst NULL sein (s.o.)
WRITE_ADDRESS :=#WRITE_ADDRESS
WRITE_CONFIG_DB:=#WRITE_CONFIG_DB
WRITE_DB :=#WRITE_DB
READ_ADDRESS :=#READ_ADDRESS
READ_CONFIG_DB :=#READ_CONFIG_DB
READ_DB :=#READ_DB
RET_VALUE :=#t016
**************************************************************************
Calling FB 4: give commands via Communication Window
-----------------------------------------------------------------
(after setup via FB 1, because FB 1 operates via the Communication Window as well)
Network 5:
-----------
U M 95.0
SPB M401
L 0 // CAN-ID = 0
T MW 0
T MW 4
T MB 12
T MB 14 // subcommand
T MB 15 // command = 0:
SPA M499
M401: U M 95.1 // start-frame ready ?
SPB M402
L 0 // CAN-ID = 0 (for start-frame)
T MW 0
L W#16#100 // CAN-data = 0x01,0x00 (start-frame)
T MW 4
L 2