Reading cr30 status – Rockwell Automation 440C Guardmaster 440C-CR30 Configurable Safety Relay User Manual User Manual

Page 99

Advertising
background image

Rockwell Automation Publication 440C-UM001C-EN-P - November 2014

99

Modbus Communication

Chapter 14

Reading CR30 Status

In the Micro800 family, the Msg_Modbus block must be used.

In the example ladder diagram below, a Micro830 reads the status of the first five
input wiring terminals of the CR30.

Rung 1: When a push button, which is connected to terminal 03 of the
Micro830, is pressed, the Micro830 sends a Modbus message to the CR30

Rung 2: The format of the data in LocalAddr is a 'WORD'. The first block
ANY_TO_DINT converts the 'WORD' to a 'DINT'. The second block
compares the DINT to the value of 1 with an AND_MASK. The third
block checks to see if the value is 1. If the value is 1, then the output
terminal _IO_EM_DO_00 goes HI.

Figure 117 - Read Ladder Diagram

You should configure local variables. In this example, they are labeled LocalCfg,
TargetCfg, and LocalAddr.

LocalCfg must be configured as a MODBUSLOCPARA data type.
TargetCfg must be configured as a MODBUSTARPARA data type.
LocalAddr must be configured as a MODBUSLOCADDR data type.

TargetCfg.Addr - Select the first value from the Modbus Mapping table
for the CR30. In this case, the initial value is set to 000273 (leading zeros
must be included), which is mapped to terminal 00 of the CR30.

TargetCfg.Node - Enter a value of 1. The CR30 is fixed at Node 1.

LocalCfg.Channel - Select the serial port location. Enter a 2 if the
embedded serial port is used. Enter a 5 to use the serial port in the fist plug-
in slot.

LocatCfg.TriggerType - Enter a 0 to have the block execute only once. Each
time the push button that is connected to terminal _IO_EM-DI-00 is
pressed, message is sent once.

LocalCfg.Cmd - Enter a 1 to instruct the block to read a 'coil' (which is
mapped to the CR30).

LocalCfg.ElementCnt - Enter a 5 read the status if 5 inputs (starting at
000273 and ending at 000277).

Advertising