3 changing the pdo properties at runtime, Changing the pdo properties at runtime – Lenze PLC Designer PLC Designer (R2-x) CANopen for Runtime Systems User Manual

Page 42

Advertising
background image

L-force | PLC Designer - CANopen for Runtime Systems

CanDevice

DMS 2.0 EN 05/2009 TD29

41

3.6.2 Access on the object dictionary entries by the application program

Naturally there are object dictionary entries which are mapped on variables (Parameter Manager).

But there are also the implicitly generated entries of the CanDevice, which cannot be mapped via the
Parameter Manager in a variable. These entries only appear in array ODentries at runtime. In the
monitoring mode (online mode) of »PLC Designer« all object dictionary entries can be viewed in the
global variables list of 3S_CanOpenDevice.lib.

The access on the content of these objects must, exactly as the accesses on the parameter lists of the
Parameter Manager, be done application-controlled:

Uniquely the index of the entry must be evaluated. For this purpose write (in the following example for
the first CanDevice in the configuration):

Index := FindBinary(16#iiiiss00, CanOpenDev[0].wODStart, CanOpenDev[0].wODEnd);

After that the content of the object can be read via GetODEntryValue(Index).

With SetODEntryValue the content of an object can be manipulated. Alternatively a direct access on
the content is possible, if it is known – like it is always the case for implicit objects – that the basis data
type is a numeric type:

ODEntries[Index].dwContent := xxxxx;

3.6.3 Changing the PDO properties at runtime

If the properties of a PDO should be changed during runtime, this can be done by another node via
SDO write accesses, like described by CANopen. Alternatively a new property can be written directly,
like e.g. the event time of a send-SDO, and subsequently a StartNode-NMT-command can be sent to
a node although this node is started already. This effects that the device will re-interpret the object
dictionary values.

But of course also a local application can change the properties of a PDO.

For this purpose the application just must modify, as described above, the contents of the respective
object(s) and subsequently must call method SetupPDOTable of the CanDevice:

CanOpenDev[0].SetupPDOTable();

Advertising