![Helmholz CAN 300 PRO Скачать руководство пользователя страница 25](http://html1.mh-extra.com/html/helmholz/can-300-pro/can-300-pro_startup-manual_2122264025.webp)
6
Programming in the PLC
If the slave is in “Operational” status, we can now turn to the PLC
program. All data handling blocks should now have been
imported into the PLC. However, you do not actually require all
of blocks FB 20 to FB 28.
Manual: Section 7.7
The project with the CANopen
®
data handling blocks also
contains an FC 1 that shows all block calls as examples.
The function blocks that are important in the first step are FB 20
“CANopen
®
IO Read” and FB 21 “CANopen
®
IO Write,” which are
responsible for data exchange of the IO memory area that
contains the PDO data.
The block FB 20 “CANopen
®
IO Read” is called at the start of the
PLC cycle to read the received data (TPDOs of the slave) from the
CAN 300 PRO into the PLC.
CALL FB 20 , DB20
Base :=256
Dest :=P#E 50.0 BYTE 60
STAT :=MW20
Err :=M22.6
RetVal :=MW24
NewData:=M22.0
After this call, you can process the current data of the slave in the
input image (IB50 – IB109).
To transmit values to the slave, you only need to change the
values in the output image (QB50 – QB109) and call FB 21
“CANopen
®
IO Write” at the end of the cycle.
The block FB 21 “CANopen
®
IO Write” is called at the end of the
PLC cycle to write the new output data (RPDOs of the slave) from
the PLC into the CAN 300 PRO.
CALL FB 21 , DB21
Base :=256
Source:=P#A 50.0 BYTE 60
STAT :=MW20
Err :=M22.7
RetVal:=MW24
All further block calls are not required for basic operation and are
initially ignored or commented out of the FC 1.
Start-up Guide CAN 300 PRO
25
Содержание CAN 300 PRO
Страница 2: ......
Страница 33: ...Start up Guide CAN 300 PRO 33 Notes...