Difference between revisions of "Component: Modbus TCP Master (Comms: System)"
(12 intermediate revisions by one other user not shown) | |||
Line 14: | Line 14: | ||
==Modbus TCP Master component== | ==Modbus TCP Master component== | ||
Modbus component for talking to Modbus compatible hardware via Ethernet or WIFI. Ensure TCP/IP or WIFI component is initialised and connected to a network before calling the ModbusMasterTCP component macros. | Modbus component for talking to Modbus compatible hardware via Ethernet or WIFI. Ensure TCP/IP or WIFI component is initialised and connected to a network before calling the ModbusMasterTCP component macros. | ||
+ | |||
+ | ==Component Source Code== | ||
+ | |||
+ | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_ModbusTCP.fcfx FC_Comp_Source_ModbusTCP.fcfx] | ||
+ | |||
+ | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_ModbusTCP.fcfx FC_Comp_Source_ModbusTCP.fcfx] | ||
==Detailed description== | ==Detailed description== | ||
Line 23: | Line 29: | ||
− | |||
− | |||
Line 34: | Line 38: | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ''No detailed description exists yet for this component'' | ||
+ | |||
+ | ==Examples== | ||
Example master program to control the slave. The example sets coil address 0, clears coil address 0, reads an input register and outputs to the LCD. Be sure to set the IP address of the slave device at the top of the program. If you are simulating then use the IP address of the PC running the Slave simulation. Both programs can be simulated on the same PC using two instances of Flowcode. | Example master program to control the slave. The example sets coil address 0, clears coil address 0, reads an input register and outputs to the LCD. Be sure to set the IP address of the slave device at the top of the program. If you are simulating then use the IP address of the PC running the Slave simulation. Both programs can be simulated on the same PC using two instances of Flowcode. | ||
Line 89: | Line 103: | ||
In Flowcode each section starts from 0 so the address range is as shown. | In Flowcode each section starts from 0 so the address range is as shown. | ||
+ | ==Macro reference== | ||
− | == | + | ===GetResponseByte=== |
− | |||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetResponseByte''' |
+ | |- | ||
+ | | colspan="2" | Reads a byte from the last received response. The Index parametes specifies which byte to read back. | ||
+ | |- | ||
|- | |- | ||
− | | | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
+ | | width="90%" | Index | ||
|- | |- | ||
+ | | colspan="2" | 0=SlaveAddress, 1=FunctionCode/ExceptionCode, 2=DataBytes, 3=data0, 4=data1, .. | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE |
− | | width="90%" | | + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |
+ | |} | ||
+ | |||
+ | |||
+ | ===GetResponseInt=== | ||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
− | | | + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetResponseInt''' | ||
|- | |- | ||
− | | | + | | colspan="2" | Reads a 16-bit value from the last received response. The Index parametes specifies the byte index of the value to read back. |
− | |||
|- | |- | ||
− | |||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
− | | width="90%" | | + | | width="90%" | Index |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | 3=data0, 5=data1, 7=data2, .. |
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===ReadAnalogInput=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadAnalogInput''' |
|- | |- | ||
− | | colspan="2" | This command | + | | colspan="2" | This command requests the analogue input register values starting from the start RegAddress and going through to RegAddress plus RegCount. Returns 0 for success, 1 for CRC fail and 255 for no reply. |
|- | |- | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT |
| width="90%" | SlaveID | | width="90%" | SlaveID | ||
|- | |- | ||
Line 134: | Line 158: | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
− | | width="90%" | | + | | width="90%" | RegAddress |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Input Address: 0=10001, 1=10002, 2=10003, ... |
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT |
− | | width="90%" | | + | | width="90%" | RegCount |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Number of consecutive inputs to read, starting from RegAddress |
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
Line 148: | Line 172: | ||
+ | ===ReadCoils=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadCoils''' |
|- | |- | ||
− | | colspan="2" | This command | + | | colspan="2" | This command requests the ON/OFF status of discrete coils starting from the start CoilAddress and going through to CoilAddress plus CoilCount. Returns 0 for success, 1 for CRC fail and 255 for no reply. |
|- | |- | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT |
| width="90%" | SlaveID | | width="90%" | SlaveID | ||
|- | |- | ||
− | | colspan="2" | The ID of the MODBUS slave | + | | colspan="2" | The ID of the MODBUS slave |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
Line 170: | Line 195: | ||
|- | |- | ||
| colspan="2" | Number of consecutive coils to try and read | | colspan="2" | Number of consecutive coils to try and read | ||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
Line 181: | Line 201: | ||
+ | ===ReadDigitalInputs=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadDigitalInputs''' |
+ | |- | ||
+ | | colspan="2" | This command requests the ON/OFF status of discrete inputs starting from the start DataAddress and going through to DataAddress plus DataCount. Returns 0 for success, 1 for CRC fail and 255 for no reply. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | SlaveID | ||
+ | |- | ||
+ | | colspan="2" | The ID of the MODBUS slave | ||
|- | |- | ||
− | | | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT |
+ | | width="90%" | DataAddress | ||
|- | |- | ||
+ | | colspan="2" | Input Address: 0=10001, 1=10002, 2=10003, ... | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT |
− | | width="90%" | | + | | width="90%" | DataCount |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Number of consecutive inputs to read, starting from RegAddress |
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
Line 199: | Line 230: | ||
+ | ===ReadHoldingRegister=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadHoldingRegister''' |
|- | |- | ||
− | | colspan="2" | This command requests the | + | | colspan="2" | This command requests the analogue holding register values starting from the start RegAddress and going through to RegAddress plus RegCount. Returns 0 for success, 1 for CRC fail and 255 for no reply. |
|- | |- | ||
|- | |- | ||
Line 213: | Line 245: | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
− | | width="90%" | | + | | width="90%" | RegAddress |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Address: 0=40001, 1=40002, ... |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
− | | width="90%" | | + | | width="90%" | RegCount |
|- | |- | ||
− | | colspan="2" | Number of consecutive | + | | colspan="2" | Number of consecutive registers to read, starting from RegAddress |
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
Line 227: | Line 259: | ||
+ | ===SetCoil=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetCoil''' |
+ | |- | ||
+ | | colspan="2" | This command writes the contents of a discrete coil at the location CoilAddress. Returns 0 for success, 1 for CRC fail and 255 for no reply. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | SlaveID | ||
+ | |- | ||
+ | | colspan="2" | The ID of the MODBUS slave | ||
|- | |- | ||
− | | | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT |
+ | | width="90%" | CoilAddress | ||
|- | |- | ||
+ | | colspan="2" | Coil Address: 0=Coil1, 1=Coil2, 2=Coil3, ... | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | CoilState |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | 0=Off, 1=On |
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===SetCoils=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetCoils''' |
|- | |- | ||
− | | colspan="2" | This command writes the contents of | + | | colspan="2" | This command writes the contents of a series of discrete coils at the location starting at CoilAddress through to CoilAddress + CoilCount. Returns 0 for success, 1 for CRC fail and 255 for no reply. |
|- | |- | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
| width="90%" | SlaveID | | width="90%" | SlaveID | ||
|- | |- | ||
− | | colspan="2" | The ID of the MODBUS slave | + | | colspan="2" | The ID of the MODBUS slave - Used for TCP to Serial forwarders |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
− | | width="90%" | | + | | width="90%" | CoilAddress |
|- | |- | ||
− | | colspan="2" | Address: 0= | + | | colspan="2" | Coil Address: 0=Coil1, 1=Coil2, 2=Coil3, ... |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
− | | width="90%" | | + | | width="90%" | CoilCount |
|- | |- | ||
− | | colspan="2" | Number of consecutive | + | | colspan="2" | Number of consecutive coils to try and read |
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
− | | width="90%" | | + | | width="90%" | CoilData |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | An array of bytes each containing 8 1-bit coil values |
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
Line 278: | Line 322: | ||
+ | ===SetHoldingRegister=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 306: | Line 351: | ||
+ | ===SetHoldingRegisters=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetHoldingRegisters''' |
|- | |- | ||
− | | colspan="2" | This command | + | | colspan="2" | This command writes the contents of several analogue output holding registers starting at the location RegAddress through to location RegAddress + RegCount . Returns 0 for success, 1 for CRC fail and 255 for no reply. |
|- | |- | ||
|- | |- | ||
Line 322: | Line 368: | ||
| width="90%" | RegAddress | | width="90%" | RegAddress | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Address: 0=40001, 1=40002, ... |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| width="90%" | RegCount | | width="90%" | RegCount | ||
|- | |- | ||
− | | colspan="2" | Number of consecutive | + | | colspan="2" | Number of consecutive registers to write, starting from RegAddress |
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | RegValue | ||
+ | |- | ||
+ | | colspan="2" | Array of values to send to the registers | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
Line 334: | Line 385: | ||
+ | ===SetTCPAddress=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 350: | Line 402: | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Line 390: | Line 412: | ||
|- | |- | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9-type- | + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] |
− | | width="90%" | | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Modbus TCP/IP Properties |
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | LinkTo | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-10-icon.png]] | ||
Line 414: | Line 440: | ||
|- | |- | ||
| colspan="2" | Maximum time to wait for network reply, in mS | | colspan="2" | Maximum time to wait for network reply, in mS | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation Properties | ||
+ | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-10-icon.png]] | ||
Line 419: | Line 449: | ||
|- | |- | ||
| colspan="2" | A text label to appear on the Modbus panel object. | | colspan="2" | A text label to appear on the Modbus panel object. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} |
Latest revision as of 15:13, 18 July 2023
Author | Matrix Ltd. |
Version | 2.1 |
Category | Comms: System |
Contents
Modbus TCP Master component
Modbus component for talking to Modbus compatible hardware via Ethernet or WIFI. Ensure TCP/IP or WIFI component is initialised and connected to a network before calling the ModbusMasterTCP component macros.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_ModbusTCP.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_ModbusTCP.fcfx
Detailed description
No detailed description exists yet for this component
Examples
Example master program to control the slave. The example sets coil address 0, clears coil address 0, reads an input register and outputs to the LCD. Be sure to set the IP address of the slave device at the top of the program. If you are simulating then use the IP address of the PC running the Slave simulation. Both programs can be simulated on the same PC using two instances of Flowcode.
Example slave program to react to the signals from the master. The example listens for Modbus commands from the master and outputs the current coils 0 state to an LED connected to PortA. The input register is loaded with a value which is incremented on each Modbus transaction.
Addressing
In Modbus the addressing protocol looks like this.
Data Type | Common name | Starting address | Ending Address | Flowcode Start Address | Flowcode End Address |
Modbus Coils | Bits, binary values, flags | 00001 | 10000 | 0 | 9999 |
Digital Inputs | Binary inputs | 10001 | 30000 | 0 | 19999 |
Analog Inputs | Binary inputs | 30001 | 40000 | 0 | 9999 |
Modbus Registers | Analog values, variables | 40001 | 60000 | 0 | 19999 |
In Flowcode each section starts from 0 so the address range is as shown.
Macro reference
GetResponseByte
GetResponseInt
GetResponseInt | |
Reads a 16-bit value from the last received response. The Index parametes specifies the byte index of the value to read back. | |
- BYTE | Index |
3=data0, 5=data1, 7=data2, .. | |
- UINT | Return |
ReadAnalogInput
ReadCoils
ReadDigitalInputs
ReadHoldingRegister
SetCoil
SetCoils
SetHoldingRegister
SetHoldingRegisters
SetTCPAddress
SetTCPAddress | |
Sets the address of the remote TCP Slave that we wish to control. | |
- STRING | Address |
e.g. "192.168.1.1" | |
- VOID | Return |