The example is prepared to run on an Allen-Bradley CompactLogix 5370 controller communicating with an EtherNet/IP Adapter implementing a General Purpose Discrete I/O Device profile running on a Texas Instruments LP-AM243 LaunchPad™ development kit.
Both Explicit and Implicit messaging are demonstrated in the example.
Allen-Bradley CompactLogix 5370, model 1769-L16ER, controller is programmed using Studio 5000 development environment.
To add a different EDS file that is not listed in the known EDS files click on "Tools → EDS Hardware Installation Tool". You need to do that if you are using EVM board instead of Launchpad becasue the EDS of Launchpad is already in the structure of this example.
The project is created in Structured Text and divided into three routines that are run from the main routine and triggerred by a timer every 3 seconds.
The subroutines are:
This example checks the two bytes of the Configuration Assembly and sets the Output Assemblies represented as two instances of Discrete Output Object. The results can be read on Input Assemblies represented as two instances of Discrete Input Object.
If the first byte of Configuration Assembly is set to "0" Discrete Output Point Object's first instance will be disabled for the I/O messaging. If it is set to "1" I/O communication for that instance will be enabled and changes on Output Assembly can be seen both on Input Assembly and LED on the board.
The example below shows that Configuration Assemblies set to "1" and enabled for both of the Discrete Output Point Object's instances. Industrial LEDs (LD 15 & LD 14) controlled by the TPIC2810 8-bit I2C LED driver will be toggled.
Verify the the hardware swith on the PLC (RUN/REM/PROG) is set into REM position. To download the example to the PLC, from dropdown menu click "Download".
After downloading if you are not automatically prompted to move to "Rem Run", from the dropdown menu click "Run Mode".
When online, you can observe these Implicit messages changes from Controller Tags on the left menu bar. In this example we can specifically observe "DTK_Discrete:O.Data[0]" & "DTK_Discrete:O.Data[1]" and "DTK_Discrete:I.Data[0]" & "DTK_Discrete:I.Data[1]" changing.