|
|
(5 intermediate revisions by one other user not shown) |
Line 22: |
Line 22: |
| | | |
| ==Detailed description== | | ==Detailed description== |
| + | |
| + | |
| | | |
| | | |
Line 46: |
Line 48: |
| | | |
| ==Examples== | | ==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 122: |
Line 102: |
| | | |
| 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== | | ==Macro reference== |
| | | |
− | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| + | ===GetResponseByte=== |
− | |-
| |
− | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadHoldingRegister'''
| |
− | |-
| |
− | | 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.
| |
− | |-
| |
− | |-
| |
− | | 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%" | RegAddress
| |
− | |-
| |
− | | colspan="2" | Address: 0=40001, 1=40002, ...
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | RegCount
| |
− | |-
| |
− | | 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="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− | | |
− | | |
− | {| 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;" | '''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="90%" | CoilState
| |
− | |-
| |
− | | colspan="2" | 0=Off, 1=On
| |
− | |-
| |
− | | 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''
| |
− | |}
| |
− | | |
− | | |
− | {| 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;" | '''SetCoils'''
| |
− | |-
| |
− | | 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-u8-icon.png]] - BYTE
| |
− | | width="90%" | SlaveID
| |
− | |-
| |
− | | 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="90%" | CoilAddress
| |
− | |-
| |
− | | colspan="2" | Coil Address: 0=Coil1, 1=Coil2, 2=Coil3, ...
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | CoilCount
| |
− | |-
| |
− | | colspan="2" | Number of consecutive coils to try and read
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
− | | width="90%" | CoilData
| |
− | |-
| |
− | | 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="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− | | |
− | | |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
Line 233: |
Line 124: |
| | | |
| | | |
− | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| + | ===GetResponseInt=== |
− | |-
| |
− | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadCoils'''
| |
− | |-
| |
− | | 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-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%" | CoilAddress
| |
− | |-
| |
− | | colspan="2" | Coil Address: 0=Coil1, 1=Coil2, 2=Coil3, ...
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | CoilCount
| |
− | |-
| |
− | | 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="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− | | |
− | | |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
Line 279: |
Line 143: |
| | | |
| | | |
− | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| + | ===ReadAnalogInput=== |
− | |-
| |
− | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetHoldingRegisters'''
| |
− | |-
| |
− | | 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.
| |
− | |-
| |
− | |-
| |
− | | 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%" | RegAddress
| |
− | |-
| |
− | | colspan="2" | Address: 0=40001, 1=40002, ...
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | RegCount
| |
− | |-
| |
− | | 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="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− | | |
− | | |
− | {| 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;" | '''SetHoldingRegister'''
| |
− | |-
| |
− | | colspan="2" | This command writes the contents of a analogue output holding register at the location RegAddress. 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%" | RegAddress
| |
− | |-
| |
− | | colspan="2" | Address: 0=40001, 1=40002, ...
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | RegValue
| |
− | |-
| |
− | | colspan="2" | Value to send to the selected register
| |
− | |-
| |
− | | 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''
| |
− | |}
| |
− | | |
− | | |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
Line 368: |
Line 172: |
| | | |
| | | |
− | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| + | ===ReadCoils=== |
− | |-
| |
− | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTCPAddress'''
| |
− | |-
| |
− | | colspan="2" | Sets the address of the remote TCP Slave that we wish to control.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| |
− | | width="90%" | Address
| |
− | |-
| |
− | | colspan="2" | e.g. "192.168.1.1"
| |
− | |-
| |
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| |
− | | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− | | |
− | | |
− | {| 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;" | '''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-u16-icon.png]] - UINT
| |
− | | width="90%" | DataCount
| |
− | |-
| |
− | | 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="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− | | |
− | | |
− | | |
− | | |
− | ==Property reference==
| |
− | | |
− | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
− | |-
| |
− | | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| |
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| |
− | | 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" |
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
| |
− | | width="90%" | Status
| |
− | |-
| |
− | | colspan="2" | Shows the state of the network comms component to verify everything is configured correctly.
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | TCP/IP Port
| |
− | |-
| |
− | | colspan="2" | Port used for network communications Range: 0-65535
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Receive Buffer Size
| |
− | |-
| |
− | | colspan="2" | Maximum number of bytes the receive buffer can hold
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Receive Timeout
| |
− | |-
| |
− | | 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="90%" | Label
| |
− | |-
| |
− | | colspan="2" | A text label to appear on the Modbus panel object.
| |
− | |}==Macro reference==
| |
− | | |
− | {| 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;" | '''ReadHoldingRegister'''
| |
− | |-
| |
− | | 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.
| |
− | |-
| |
− | |-
| |
− | | 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%" | RegAddress
| |
− | |-
| |
− | | colspan="2" | Address: 0=40001, 1=40002, ...
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | RegCount
| |
− | |-
| |
− | | 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="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− | | |
− | | |
− | {| 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;" | '''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="90%" | CoilState
| |
− | |-
| |
− | | colspan="2" | 0=Off, 1=On
| |
− | |-
| |
− | | 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''
| |
− | |}
| |
− | | |
− | | |
− | {| 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;" | '''SetCoils'''
| |
− | |-
| |
− | | 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-u8-icon.png]] - BYTE
| |
− | | width="90%" | SlaveID
| |
− | |-
| |
− | | 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="90%" | CoilAddress
| |
− | |-
| |
− | | colspan="2" | Coil Address: 0=Coil1, 1=Coil2, 2=Coil3, ...
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | CoilCount
| |
− | |-
| |
− | | colspan="2" | Number of consecutive coils to try and read
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
− | | width="90%" | CoilData
| |
− | |-
| |
− | | 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="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− | | |
− | | |
− | {| 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;" | '''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" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| |
− | | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− | | |
− | | |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
Line 598: |
Line 201: |
| | | |
| | | |
− | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| + | ===ReadDigitalInputs=== |
− | |-
| |
− | | 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-u8-icon.png]] - BYTE
| |
− | | width="90%" | Index
| |
− | |-
| |
− | | colspan="2" | 3=data0, 5=data1, 7=data2, ..
| |
− | |-
| |
− | | 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''
| |
− | |}
| |
− | | |
− | | |
− | {| 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;" | '''SetHoldingRegisters'''
| |
− | |-
| |
− | | 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.
| |
− | |-
| |
− | |-
| |
− | | 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%" | RegAddress
| |
− | |-
| |
− | | colspan="2" | Address: 0=40001, 1=40002, ...
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | RegCount
| |
− | |-
| |
− | | 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="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− | | |
− | | |
− | {| 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;" | '''SetHoldingRegister'''
| |
− | |-
| |
− | | colspan="2" | This command writes the contents of a analogue output holding register at the location RegAddress. 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%" | RegAddress
| |
− | |-
| |
− | | colspan="2" | Address: 0=40001, 1=40002, ...
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | RegValue
| |
− | |-
| |
− | | colspan="2" | Value to send to the selected register
| |
− | |-
| |
− | | 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''
| |
− | |}
| |
− | | |
− | | |
− | {| 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;" | '''ReadAnalogInput'''
| |
− | |-
| |
− | | 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-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%" | RegAddress
| |
− | |-
| |
− | | colspan="2" | Input Address: 0=10001, 1=10002, 2=10003, ...
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | RegCount
| |
− | |-
| |
− | | 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="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− | | |
− | | |
− | {| 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;" | '''SetTCPAddress'''
| |
− | |-
| |
− | | colspan="2" | Sets the address of the remote TCP Slave that we wish to control.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| |
− | | width="90%" | Address
| |
− | |-
| |
− | | colspan="2" | e.g. "192.168.1.1"
| |
− | |-
| |
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| |
− | | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− | | |
− | | |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
Line 751: |
Line 230: |
| | | |
| | | |
− | | + | ===ReadHoldingRegister=== |
− | | |
− | ==Property reference== | |
− | | |
− | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
− | |-
| |
− | | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| |
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| |
− | | 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" |
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
| |
− | | width="90%" | Status
| |
− | |-
| |
− | | colspan="2" | Shows the state of the network comms component to verify everything is configured correctly.
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | TCP/IP Port
| |
− | |-
| |
− | | colspan="2" | Port used for network communications Range: 0-65535
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Receive Buffer Size
| |
− | |-
| |
− | | colspan="2" | Maximum number of bytes the receive buffer can hold
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Receive Timeout
| |
− | |-
| |
− | | 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="90%" | Label
| |
− | |-
| |
− | | colspan="2" | A text label to appear on the Modbus panel object.
| |
− | |}==Macro reference==
| |
− | | |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
Line 828: |
Line 259: |
| | | |
| | | |
| + | ===SetCoil=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
Line 856: |
Line 288: |
| | | |
| | | |
| + | ===SetCoils=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
Line 889: |
Line 322: |
| | | |
| | | |
− | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| + | ===SetHoldingRegister=== |
− | |-
| |
− | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
− | | 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" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| |
− | | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− | | |
− | | |
− | {| 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;" | '''ReadCoils'''
| |
− | |-
| |
− | | 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-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%" | CoilAddress
| |
− | |-
| |
− | | colspan="2" | Coil Address: 0=Coil1, 1=Coil2, 2=Coil3, ...
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | CoilCount
| |
− | |-
| |
− | | 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="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− | | |
− | | |
− | {| 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-u8-icon.png]] - BYTE
| |
− | | width="90%" | Index
| |
− | |-
| |
− | | colspan="2" | 3=data0, 5=data1, 7=data2, ..
| |
− | |-
| |
− | | 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''
| |
− | |}
| |
− | | |
− | | |
− | {| 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;" | '''SetHoldingRegisters'''
| |
− | |-
| |
− | | 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.
| |
− | |-
| |
− | |-
| |
− | | 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%" | RegAddress
| |
− | |-
| |
− | | colspan="2" | Address: 0=40001, 1=40002, ...
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | RegCount
| |
− | |-
| |
− | | 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="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− | | |
− | | |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
Line 1,014: |
Line 351: |
| | | |
| | | |
− | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| + | ===SetHoldingRegisters=== |
− | |-
| |
− | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadAnalogInput'''
| |
− | |-
| |
− | | 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-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%" | RegAddress
| |
− | |-
| |
− | | colspan="2" | Input Address: 0=10001, 1=10002, 2=10003, ...
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | RegCount
| |
− | |-
| |
− | | 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="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− | | |
− | | |
− | {| 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;" | '''SetTCPAddress'''
| |
− | |-
| |
− | | colspan="2" | Sets the address of the remote TCP Slave that we wish to control.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| |
− | | width="90%" | Address
| |
− | |-
| |
− | | colspan="2" | e.g. "192.168.1.1"
| |
− | |-
| |
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| |
− | | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− | | |
− | | |
− | {| 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;" | '''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-u16-icon.png]] - UINT
| |
− | | width="90%" | DataCount
| |
− | |-
| |
− | | 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="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− | | |
− | | |
− | | |
− | | |
− | ==Property reference==
| |
− | | |
− | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
− | |-
| |
− | | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| |
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| |
− | | 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" |
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
| |
− | | width="90%" | Status
| |
− | |-
| |
− | | colspan="2" | Shows the state of the network comms component to verify everything is configured correctly.
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | TCP/IP Port
| |
− | |-
| |
− | | colspan="2" | Port used for network communications Range: 0-65535
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Receive Buffer Size
| |
− | |-
| |
− | | colspan="2" | Maximum number of bytes the receive buffer can hold
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Receive Timeout
| |
− | |-
| |
− | | 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="90%" | Label
| |
− | |-
| |
− | | colspan="2" | A text label to appear on the Modbus panel object.
| |
− | |}==Macro reference==
| |
− | | |
− | {| 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;" | '''ReadHoldingRegister'''
| |
− | |-
| |
− | | 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.
| |
− | |-
| |
− | |-
| |
− | | 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%" | RegAddress
| |
− | |-
| |
− | | colspan="2" | Address: 0=40001, 1=40002, ...
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | RegCount
| |
− | |-
| |
− | | 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="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− | | |
− | | |
− | {| 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;" | '''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="90%" | CoilState
| |
− | |-
| |
− | | colspan="2" | 0=Off, 1=On
| |
− | |-
| |
− | | 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''
| |
− | |}
| |
− | | |
− | | |
− | {| 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;" | '''SetCoils'''
| |
− | |-
| |
− | | 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-u8-icon.png]] - BYTE
| |
− | | width="90%" | SlaveID
| |
− | |-
| |
− | | 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="90%" | CoilAddress
| |
− | |-
| |
− | | colspan="2" | Coil Address: 0=Coil1, 1=Coil2, 2=Coil3, ...
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | CoilCount
| |
− | |-
| |
− | | colspan="2" | Number of consecutive coils to try and read
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
− | | width="90%" | CoilData
| |
− | |-
| |
− | | 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="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− | | |
− | | |
− | {| 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;" | '''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" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| |
− | | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− | | |
− | | |
− | {| 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;" | '''ReadCoils'''
| |
− | |-
| |
− | | 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-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%" | CoilAddress
| |
− | |-
| |
− | | colspan="2" | Coil Address: 0=Coil1, 1=Coil2, 2=Coil3, ...
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | CoilCount
| |
− | |-
| |
− | | 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="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− | | |
− | | |
− | {| 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-u8-icon.png]] - BYTE
| |
− | | width="90%" | Index
| |
− | |-
| |
− | | colspan="2" | 3=data0, 5=data1, 7=data2, ..
| |
− | |-
| |
− | | 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''
| |
− | |}
| |
− | | |
− | | |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
Line 1,323: |
Line 385: |
| | | |
| | | |
− | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| + | ===SetTCPAddress=== |
− | |-
| |
− | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetHoldingRegister'''
| |
− | |-
| |
− | | colspan="2" | This command writes the contents of a analogue output holding register at the location RegAddress. 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%" | RegAddress
| |
− | |-
| |
− | | colspan="2" | Address: 0=40001, 1=40002, ...
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | RegValue
| |
− | |-
| |
− | | colspan="2" | Value to send to the selected register
| |
− | |-
| |
− | | 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''
| |
− | |}
| |
− | | |
− | | |
− | {| 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;" | '''ReadAnalogInput'''
| |
− | |-
| |
− | | 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-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%" | RegAddress
| |
− | |-
| |
− | | colspan="2" | Input Address: 0=10001, 1=10002, 2=10003, ...
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | RegCount
| |
− | |-
| |
− | | 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="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− | | |
− | | |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
Line 1,395: |
Line 402: |
| | width="90%" style="border-top: 2px solid #000;" | ''Return'' | | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |
| |} | | |} |
− |
| |
− |
| |
− | {| 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;" | '''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-u16-icon.png]] - UINT
| |
− | | width="90%" | DataCount
| |
− | |-
| |
− | | 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="90%" style="border-top: 2px solid #000;" | ''Return''
| |
− | |}
| |
− |
| |
− |
| |
| | | |
| | | |