Sdo access example – Rockwell Automation 20-COMM-K CANopen Adapter User Manual

Page 104

Advertising
background image

F-4

Logic Controller Program Example

20-COMM-K CANopen Adapter User Manual
Publication 20COMM-UM012B-EN-P

3. If the program has changed, the program must be downloaded first.

Click Ja (Yes).

Figure F.4

Login Menu

4. To set the PLC in Run mode, select Online > Run or click the Run icon

in the toolbar.

NOTE: When the program is running, the current values of the
variables are visible in the opened POUs (Program Organization Units)
and the Global Variables files.

NOTE: After power cycling, the PLC must be set in RUN mode every
time. However, if the program has been downloaded with the CANopen
Configuration Studio (CANopen Network Access - Download to
Device
), the program starts automatically after a power cycle.

SDO Access Example

To read or write an adapter parameter, the data structure for CANopen
object 0x2228 (DPI Parameter Send) has to be filled in and then, the
response can be read in CANopen object 0x2229 (DPI Parameter Receive).
The following figures show how to read and write to these data structures.
The CIA405 functions CIA405_SDO_READ4 and
CIA405_SDO_WRITE4, which are already defined in CoDeSys, are used
to access the CANopen objects.

Figure F.5

Function Block SDO_READ - Declarations

Advertising