Explicit messaging preset example for the 1756-dnb – Rockwell Automation 842D-60131331BXA DeviceNet Encoder User Manual User Manual

Page 39

Advertising
background image

Using DeviceNet Explicit Messaging

6-5

Explicit Messaging Preset Example for the 1756-DNB

The following is a code segment that will preset the value of the 842D
encoder’s ‘Position Value’. This can be useful for automatic homing
or automated error recovery. The following tags are used for the
explicit messaging:

MSGY is a Message type tag

Lsource is a UDINT type tag the value is preset to

Ldest is a UDINT type tag that should always return with 0.

Figure 6.2

Position Value Preset

MSGY needs the service code (set) 10, the class code (encoder) 2F,
and the instance 01 (only instance) for the attribute 0A (Preset). The
preset data will be sent from the tag ‘Lsource.’ Since the ‘Preset’
attribute is a long integer (UDINT), the ‘Num. Of Elements’ is 4
bytes.

Other attributes maybe read (service code 0E) or set ( service code
10) in a similar way. Any response data would return in Ldest.

Advertising
This manual is related to the following products: