Home Labs Stories Using CoDeSys on Raspberry Pi to poll ModbusTCP slave data, and uplink by using LoRaWAN ATIM ACW-XB

USING CODESYS ON RASPBERRY PI TO POLL MODBUSTCP SLAVE DATA, AND UPLINK BY USING LORAWAN ATIM ACW-XB

image story

ABOUT THIS STORY


Posted on Jan. 1, 2019



Expert
2 Days

Introduction

Required equipments

Register ATIM ACW-XB on TTN

Raspberry Pi installation

CoDeSys installation

Create a CoDeSys project and check connection

Configure ModbusTCP polling

Cayenne LPP payload

Send payload to TTN

Cayenne myDevices

Introduction


In this story, a Raspberry Pi is used as a PLC (Programmable Logic Controller).
Program inside Raspberry Pi is developped in ST language (Structured Text) with CoDeSys IDE.
ModbusTCP polling is used by Raspberry Pi (master) to read values (temperature, power consumption) from an IRIO (slave).
In IRIO, temperature is stored in IEEE format (2 Modbus registers) and power consumption is stored in one integer word (1 Modbus register).
Raspberry Pi uses a small ATIM LoRaWAN device (ACW-XB) to uplink data.
Payloads are uplinked to Cayenne myDevice server (via TTN) to be viewed.
For this purpose, payloads use Cayenne LPP format.