IEC 104 Component
IEC 104 Communication Protocol
IEC 104 configuration in Shunya
Config | Description |
---|---|
Protocol Type | Modbus is available in 2 variants RTU and TCP. Select the mode that you want to communicate |
IP address | Modbus server IP address (only for Modbus TCP type) |
Port | Modbus server Port (only for Modbus TCP type) |
Device | Modbus server Device node (only for Modbus RTU type) |
Baud Rate | Modbus server Baud rate (only for Modbus RTU type) |
The configurations need to be set manually by the user before using the API's
For example:
A sample JSON snippet should contain
Commonly configured parameters
For example:
A typical IEC 104 configuration without security will look like this
IEC 104 API's
To get the data from the device over modbus you can use these API's present in the Shunya Interfaces
API | Description | Details |
---|---|---|
newIec104Client() | Creates a new IEC 104 client Instance | Read More |
iec104Connect() | Connect to device over IEC 104 | Read More |
iec104Read() | Read IEC 104 address and get data | Read More |
iec104Write() | Write data to IEC 104 address | Read More |
iec104Disconnect() | Close connection with the IEC 104 device | Read More |
newIec104Client()
Description : Creates a new IEC 104 client Instance.
Parameters
name (char *)
- Name of the JSON object.
Return-type : iec104ClientObj
Returns : iec104ClientObj Instance for IEC 104
Usage :
For example: Lets say your JSON file looks like
So the usage of the API's will be
modbusRtuConnect()
Description : Connect to the device Connected via Serial
Parameters
*obj
(modbusObj) - Pointer to the Modbus Instance.
Return-type : int
Usage :
modbusRtuRead()
Description : Read from PLC address connected via Serial
Parameters
*obj
(modbusObj) - Pointer to the Modbus Instance.addr
(uint16_t) - coil address to read the value from
Return-type : int
Usage :
modbusRtuWrite()
Description : Write to PLC address connected via Serial
Parameters
*obj
(modbusObj) - Pointer to the Modbus Instance.addr
(uint16_t) - coil address to write the valueval
(uint16_t) - value to write
Return-type : int
Usage :
modbusRtuDisconnect()
Description : Disconnect to the device Connected via Serial
Parameters
*obj
(modbusObj) - Pointer to the Modbus Instance.
Return-type : int
Usage :
modbusTcpConnect()
Description : Connect to the device Connected via Ethernet
Parameters
*obj
(modbusObj) - Pointer to the Modbus Instance.
Return-type : int
Usage :
modbusTcpRead()
Description : Read from PLC address connected via TCP(Eth/wifi)
Parameters
*obj
(modbusObj) - Pointer to the Modbus Instance.addr
(uint16_t) - coil address to read the value from
Return-type : int
Usage :
modbusTcpWrite()
Description : Read from PLC address connected via TCP(Eth/wifi)
Parameters
*obj
(modbusObj) - Pointer to the Modbus Instance.addr
(uint16_t) - coil address to read the value fromval
(uint16_t) - value to write
Return-type : int
Usage :
modbusTcpDisconnect()
Description : Disconnect to the device Connected via Ehternet
Parameters
*obj
(modbusObj) - Pointer to the Modbus Instance.
Return-type : int
Usage :