|
|
(5 intermediate revisions by the same user not shown) |
Line 17: |
Line 17: |
| ==Component Source Code== | | ==Component Source Code== |
| | | |
− | Please click here to download the component source project: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_ModbusSlave.fcfx FC_Comp_Source_ModbusSlave.fcfx] | + | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_ModbusSlave.fcfx FC_Comp_Source_ModbusSlave.fcfx] |
| | | |
| Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_ModbusSlave.fcfx FC_Comp_Source_ModbusSlave.fcfx] | | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_ModbusSlave.fcfx FC_Comp_Source_ModbusSlave.fcfx] |
| | | |
| ==Detailed description== | | ==Detailed description== |
| + | |
| + | |
| + | |
| + | |
| | | |
| | | |
Line 44: |
Line 48: |
| | | |
| ==Examples== | | ==Examples== |
| + | |
| + | |
| + | |
| + | |
| | | |
| | | |
Line 128: |
Line 136: |
| 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==
| |
| | | |
− | {| 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" | Reads the value of a single holding register.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | Address
| |
− | |-
| |
− | | colspan="2" | Coil Address
| |
− | |-
| |
− | | 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;" | '''SetCoil'''
| |
− | |-
| |
− | | colspan="2" | Sets the state of a single digital coil.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | Address
| |
− | |-
| |
− | | colspan="2" | Coil Address
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
− | | width="90%" | State
| |
− | |-
| |
− | | colspan="2" | 0=off, 1=on
| |
− | |-
| |
− | | 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;" | '''SetDigitalInput'''
| |
− | |-
| |
− | | colspan="2" | Sets the state of a single digital input.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | Address
| |
− | |-
| |
− | | colspan="2" | Coil Address
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
− | | width="90%" | State
| |
− | |-
| |
− | | colspan="2" | 0=off, 1=on
| |
− | |-
| |
− | | 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''
| |
− | |}
| |
| | | |
| | | |
| + | |
| + | |
| + | |
| + | ==Macro reference== |
| + | |
| + | ===ChangeBaud=== |
| {| 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;" | '''SetSlaveAddress''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ChangeBaud''' |
| |- | | |- |
− | | colspan="2" | Allows the slave address to be overridden from the default slave address specified in the component property. The number of bytes used for the address is fixed by the Slave ID Bytes property to save on RAM usage. | + | | colspan="2" | Changes the UART Baud rate. 1 = 1200 / 2 = 2400 / 3 = 4800 / 4 = 9600 / 5 = 19200 / 6 = 31250 7 = 38400 / 8 = 57600 / 9 = 115200 |
| |- | | |- |
| |- | | |- |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
− | | width="90%" | SlaveAddress | + | | width="90%" | Baud |
| |- | | |- |
− | | colspan="2" | | + | | colspan="2" | The new baud rate (0=1200, 9=115200) |
| |- | | |- |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |
Line 212: |
Line 167: |
| | | |
| | | |
| + | ===ChangeFrameType=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
Line 230: |
Line 186: |
| | | |
| | | |
− | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| + | ===CheckForIncoming=== |
− | |-
| |
− | | 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" | Reads the state of up to eight digital coils. Can pack a max of 8-bits together in a single operation
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | StartAddress
| |
− | |-
| |
− | | colspan="2" | Coil Address Range 0 to (NumCoils - 1)
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
− | | width="90%" | AddressCount
| |
− | |-
| |
− | | colspan="2" | Range 1-8
| |
− | |-
| |
− | | 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;" | '''SetBaudRate'''
| |
− | |-
| |
− | | colspan="2" | Allows the Baud Rate to be controlled dynamically overriding the default rate specified by the Baud component property.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
− | | width="90%" | Rate
| |
− | |-
| |
− | | colspan="2" | 0=1200, 1=2400, 2=4800, 3=9600, 4=19200, 5=38400, 6=57600, 7=115200
| |
− | |-
| |
− | | 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;" | '''SetHoldingRegister'''
| |
− | |-
| |
− | | colspan="2" | Sets the state of a single holding register.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | Address
| |
− | |-
| |
− | | colspan="2" | Coil Address
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | Value
| |
− | |-
| |
− | | colspan="2" | Analogue Value range 0 - 65535
| |
− | |-
| |
− | | 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;" | '''ReadAnalogInput'''
| |
− | |-
| |
− | | colspan="2" | Reads the value of a single analogue input.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | Address
| |
− | |-
| |
− | | colspan="2" | Coil Address
| |
− | |-
| |
− | | 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 325: |
Line 200: |
| | | |
| | | |
− | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| + | ===GetLastIncoming=== |
− | |-
| |
− | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ChangeBaud'''
| |
− | |-
| |
− | | colspan="2" | Changes the UART Baud rate. 1 = 1200 / 2 = 2400 / 3 = 4800 / 4 = 9600 / 5 = 19200 / 6 = 31250 7 = 38400 / 8 = 57600 / 9 = 115200
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
− | | width="90%" | Baud
| |
− | |-
| |
− | | colspan="2" | The new baud rate (0=1200, 9=115200)
| |
− | |-
| |
− | | 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" | Reads the state of up to eight digital inputs. Can pack a max of 8-bits together in a single operation
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | StartAddress
| |
− | |-
| |
− | | colspan="2" | Coil Address Range 0 to (NumCoils - 1)
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
− | | width="90%" | AddressCount
| |
− | |-
| |
− | | colspan="2" | Range 1-8
| |
− | |-
| |
− | | 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 384: |
Line 219: |
| | | |
| | | |
− | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| + | ===Initialise=== |
− | |-
| |
− | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetAnalogInput'''
| |
− | |-
| |
− | | colspan="2" | Sets the state of a single analogue input.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | Address
| |
− | |-
| |
− | | colspan="2" | Coil Address
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | Value
| |
− | |-
| |
− | | colspan="2" | Analogue Value range 0 - 65535
| |
− | |-
| |
− | | 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 420: |
Line 233: |
| | | |
| | | |
− | | + | ===ReadAnalogInput=== |
− | | |
− | ==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;" | UART Properties
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
− | | width="90%" | Channel
| |
− | |-
| |
− | | colspan="2" | UART Channel selector Software channels are bit banged using generic I/O pins but are not as reliable as hardware channels. Hardware channels use the selected peripheral on-board the target microcontroller.
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| |
− | | width="90%" | TX
| |
− | |-
| |
− | | colspan="2" | Pin to be used for Transmit data
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| |
− | | width="90%" | RX
| |
− | |-
| |
− | | colspan="2" | Pin to be used for Receive data
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
− | | width="90%" | Baud Options
| |
− | |-
| |
− | | colspan="2" | Baud rate option selector
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| |
− | | width="90%" | Baud Rate
| |
− | |-
| |
− | | colspan="2" |
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
− | | width="90%" | Bus
| |
− | |-
| |
− | | colspan="2" | Specifies the bus mode being used, RS232 allows you to connect a single master node to a single slave node. RS485 allows you to connect a single master node to multiple slave nodes.
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Timeout
| |
− | |-
| |
− | | colspan="2" | Timeout in milliseconds used to dictate the maximum time to wait in milliseconds between bytes in a packet. Range: 1 - 255
| |
− | |-
| |
− | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| |
− | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Modbus Properties
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
− | | width="90%" | Frame Type
| |
− | |-
| |
− | | colspan="2" | Switches between RTU and ASCII forms of Modbus
| |
− | |-
| |
− | | 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%" | Slave ID Bytes
| |
− | |-
| |
− | | colspan="2" | Number of bytes used when passing a slave ID, usually 1 but sometimes 2
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Slave Address
| |
− | |-
| |
− | | colspan="2" |
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Reply Delay
| |
− | |-
| |
− | | colspan="2" | Delay in micro seconds to wait before transmitting a reply
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| |
− | | width="90%" | Maintain Stats
| |
− | |-
| |
− | | colspan="2" | Controls if the last command from the master is logged allowing for easier value updates. No - Do not log commands Yes - Commands are logged and available via the GetLastIncoming macro
| |
− | |-
| |
− | | 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.
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| |
− | | width="90%" | Scope Traces
| |
− | |-
| |
− | | colspan="2" | Selects if the scope traces are automatically added to the data recorder window or not. Simulation - draws an approximation of the UART data onto the scope trace. ICT - sets up the scope trace for incoming data and adds UART packet decoding at the correct BAUD.
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| |
− | | width="90%" | Console Data
| |
− | |-
| |
− | | colspan="2" | Selects if the console data is automatically generated or not
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Console Columns
| |
− | |-
| |
− | | colspan="2" | Number of characters that can be displayed on a single line of the console.
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
− | | width="90%" | Data Source
| |
− | |-
| |
− | | colspan="2" | Simulation data source used to allow the component to connect to various remote devices Nothing - Simulation data is ignored COM port - Routes the communication data to and from a physical or virtual COM port API - Routes the communication data via a data API component on the Panel.
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
− | | width="90%" | API
| |
− | |-
| |
− | | colspan="2" | Selects which API component to route the communication data via. Add API components to the panel before they will be available in this list. API components are available from the Comms component category.
| |
− | |-
| |
− | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| |
− | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Modbus Coils - Single bit values
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Starting Address
| |
− | |-
| |
− | | colspan="2" | Start address of the Modbus coils. Referenced from 0. For example Slave 1 might have 100 coils addressed 0-99 Start Address = 0 Slave 2 might have 100 coils addressed 100-199 Start Address = 100
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Number of Addresses
| |
− | |-
| |
− | | colspan="2" | Specifies how many Coils are available on the slave. Each address consumes a single bit of RAM, 8 Addresses are packed together into a single RAM Byte.
| |
− | |-
| |
− | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| |
− | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Digital Inputs - Single bit values
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Starting Address
| |
− | |-
| |
− | | colspan="2" | Start address of the Modbus digital inputs. Referenced from 0. For example Slave 1 might have 100 inputs addressed 0-99 Start Address = 0 Slave 2 might have 100 inputs addressed 100-199 Start Address = 100
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Number of Addresses
| |
− | |-
| |
− | | colspan="2" | Specifies how many Digital Inputs are available on the slave. Each address consumes a single bit of RAM, 8 Addresses are packed together into a single RAM Byte.
| |
− | |-
| |
− | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| |
− | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Analog Inputs - 16-bit values
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Starting Address
| |
− | |-
| |
− | | colspan="2" | Start address of the Modbus analogue inputs. Referenced from 0. For example Slave 1 might have 100 inputs addressed 0-99 Start Address = 0 Slave 2 might have 100 inputs addressed 100-199 Start Address = 100
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Number of Addresses
| |
− | |-
| |
− | | colspan="2" | Specifies how many 16-bit analogue inputs are available on the slave. Each address consumes two RAM Bytes.
| |
− | |-
| |
− | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| |
− | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Holding Registers - 16-bit values
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Starting Address
| |
− | |-
| |
− | | colspan="2" | Start address of the Modbus registers. Referenced from 0. For example Slave 1 might have 100 registers addressed 0-99 Start Address = 0 Slave 2 might have 100 registers addressed 100-199 Start Address = 100
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Number of Addresses
| |
− | |-
| |
− | | colspan="2" | Specifies how many 16-bit holding registers are available on the slave. Each address consumes two RAM Bytes.
| |
− | |}==Macro reference==
| |
− | | |
| {| 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;" | '''ReadHoldingRegister''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadAnalogInput''' |
| |- | | |- |
− | | colspan="2" | Reads the value of a single holding register. | + | | colspan="2" | Reads the value of a single analogue input. |
| |- | | |- |
| |- | | |- |
Line 612: |
Line 252: |
| | | |
| | | |
− | {| 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;" | '''SetCoil'''
| |
− | |-
| |
− | | colspan="2" | Sets the state of a single digital coil.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | Address
| |
− | |-
| |
− | | colspan="2" | Coil Address
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
− | | width="90%" | State
| |
− | |-
| |
− | | colspan="2" | 0=off, 1=on
| |
− | |-
| |
− | | 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;" | '''SetDigitalInput'''
| |
− | |-
| |
− | | colspan="2" | Sets the state of a single digital input.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | Address
| |
− | |-
| |
− | | colspan="2" | Coil Address
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
− | | width="90%" | State
| |
− | |-
| |
− | | colspan="2" | 0=off, 1=on
| |
− | |-
| |
− | | 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;" | '''SetSlaveAddress'''
| |
− | |-
| |
− | | colspan="2" | Allows the slave address to be overridden from the default slave address specified in the component property. The number of bytes used for the address is fixed by the Slave ID Bytes property to save on RAM usage.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | SlaveAddress
| |
− | |-
| |
− | | colspan="2" |
| |
− | |-
| |
− | | 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;" | '''ChangeFrameType'''
| |
− | |-
| |
− | | colspan="2" | Default frame type is the type set in the component properties.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
− | | width="90%" | Type
| |
− | |-
| |
− | | colspan="2" | 0 = Modbus RTU / 1 = Modbus ASCII
| |
− | |-
| |
− | | 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 717: |
Line 276: |
| | | |
| | | |
− | {| 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;" | '''SetBaudRate'''
| |
− | |-
| |
− | | colspan="2" | Allows the Baud Rate to be controlled dynamically overriding the default rate specified by the Baud component property.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
− | | width="90%" | Rate
| |
− | |-
| |
− | | colspan="2" | 0=1200, 1=2400, 2=4800, 3=9600, 4=19200, 5=38400, 6=57600, 7=115200
| |
− | |-
| |
− | | 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;" | '''SetHoldingRegister'''
| |
− | |-
| |
− | | colspan="2" | Sets the state of a single holding register.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | Address
| |
− | |-
| |
− | | colspan="2" | Coil Address
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | Value
| |
− | |-
| |
− | | colspan="2" | Analogue Value range 0 - 65535
| |
− | |-
| |
− | | 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;" | '''ReadAnalogInput'''
| |
− | |-
| |
− | | colspan="2" | Reads the value of a single analogue input.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | Address
| |
− | |-
| |
− | | colspan="2" | Coil Address
| |
− | |-
| |
− | | 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;" | '''CheckForIncoming'''
| |
− | |-
| |
− | | colspan="2" | Checks for an incoming message and if the data address is within range then also automatically replies with the correct reply. Returns 0 if no comms received, 1 for a succesful transaction, 255 for an error.
| |
− | |-
| |
− | |-
| |
− | | 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;" | '''ChangeBaud'''
| |
− | |-
| |
− | | colspan="2" | Changes the UART Baud rate. 1 = 1200 / 2 = 2400 / 3 = 4800 / 4 = 9600 / 5 = 19200 / 6 = 31250 7 = 38400 / 8 = 57600 / 9 = 115200
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
− | | width="90%" | Baud
| |
− | |-
| |
− | | colspan="2" | The new baud rate (0=1200, 9=115200)
| |
− | |-
| |
− | | 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 830: |
Line 300: |
| | | |
| | | |
| + | ===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;" | '''GetLastIncoming''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadHoldingRegister''' |
| |- | | |- |
− | | colspan="2" | Gets a value from the last incoming command. Index 0 = 0 Read / 1 Write Index 1 = 0 Coils / 1 DigInput / 2 AnInput / 3 Register Index 2 = Address Index 3 = Number | + | | colspan="2" | Reads the value of a single holding register. |
| |- | | |- |
| |- | | |- |
− | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT |
− | | width="90%" | Index | + | | width="90%" | Address |
| |- | | |- |
− | | colspan="2" | Range: 0-3 | + | | colspan="2" | Coil Address |
| |- | | |- |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT |
Line 848: |
Line 319: |
| | | |
| | | |
| + | ===SetAnalogInput=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
Line 871: |
Line 343: |
| | | |
| | | |
| + | ===SetBaudRate=== |
| {| 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;" | '''Initialise''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetBaudRate''' |
| |- | | |- |
− | | colspan="2" | Starts up the UART to allow communications and initialises the states of the various Modbus Coils, Inputs and Registers to 0. | + | | colspan="2" | Allows the Baud Rate to be controlled dynamically overriding the default rate specified by the Baud component property. |
| |- | | |- |
| |- | | |- |
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
− | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | + | | width="90%" | Rate |
− | |}
| |
− | | |
− | | |
− | | |
− | | |
− | ==Property reference==
| |
− | | |
− | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |- | | |- |
− | | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]] | + | | colspan="2" | 0=1200, 1=2400, 2=4800, 3=9600, 4=19200, 5=38400, 6=57600, 7=115200 |
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
| |
| |- | | |- |
− | |-
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |
− | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| |
− | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | UART Properties
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
− | | width="90%" | Channel
| |
− | |-
| |
− | | colspan="2" | UART Channel selector Software channels are bit banged using generic I/O pins but are not as reliable as hardware channels. Hardware channels use the selected peripheral on-board the target microcontroller.
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| |
− | | width="90%" | TX
| |
− | |-
| |
− | | colspan="2" | Pin to be used for Transmit data
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| |
− | | width="90%" | RX
| |
− | |-
| |
− | | colspan="2" | Pin to be used for Receive data
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
− | | width="90%" | Baud Options
| |
− | |-
| |
− | | colspan="2" | Baud rate option selector
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| |
− | | width="90%" | Baud Rate
| |
− | |-
| |
− | | colspan="2" |
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
− | | width="90%" | Bus
| |
− | |-
| |
− | | colspan="2" | Specifies the bus mode being used, RS232 allows you to connect a single master node to a single slave node. RS485 allows you to connect a single master node to multiple slave nodes.
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Timeout
| |
− | |-
| |
− | | colspan="2" | Timeout in milliseconds used to dictate the maximum time to wait in milliseconds between bytes in a packet. Range: 1 - 255
| |
− | |-
| |
− | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| |
− | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Modbus Properties
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
− | | width="90%" | Frame Type
| |
− | |-
| |
− | | colspan="2" | Switches between RTU and ASCII forms of Modbus
| |
− | |-
| |
− | | 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%" | Slave ID Bytes
| |
− | |-
| |
− | | colspan="2" | Number of bytes used when passing a slave ID, usually 1 but sometimes 2
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Slave Address
| |
− | |-
| |
− | | colspan="2" |
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Reply Delay
| |
− | |-
| |
− | | colspan="2" | Delay in micro seconds to wait before transmitting a reply
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| |
− | | width="90%" | Maintain Stats
| |
− | |-
| |
− | | colspan="2" | Controls if the last command from the master is logged allowing for easier value updates. No - Do not log commands Yes - Commands are logged and available via the GetLastIncoming macro
| |
− | |-
| |
− | | 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.
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| |
− | | width="90%" | Scope Traces
| |
− | |-
| |
− | | colspan="2" | Selects if the scope traces are automatically added to the data recorder window or not. Simulation - draws an approximation of the UART data onto the scope trace. ICT - sets up the scope trace for incoming data and adds UART packet decoding at the correct BAUD.
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| |
− | | width="90%" | Console Data
| |
− | |-
| |
− | | colspan="2" | Selects if the console data is automatically generated or not
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Console Columns
| |
− | |-
| |
− | | colspan="2" | Number of characters that can be displayed on a single line of the console.
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
− | | width="90%" | Data Source
| |
− | |-
| |
− | | colspan="2" | Simulation data source used to allow the component to connect to various remote devices Nothing - Simulation data is ignored COM port - Routes the communication data to and from a physical or virtual COM port API - Routes the communication data via a data API component on the Panel.
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
− | | width="90%" | API
| |
− | |-
| |
− | | colspan="2" | Selects which API component to route the communication data via. Add API components to the panel before they will be available in this list. API components are available from the Comms component category.
| |
− | |-
| |
− | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| |
− | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Modbus Coils - Single bit values
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Starting Address
| |
− | |-
| |
− | | colspan="2" | Start address of the Modbus coils. Referenced from 0. For example Slave 1 might have 100 coils addressed 0-99 Start Address = 0 Slave 2 might have 100 coils addressed 100-199 Start Address = 100
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Number of Addresses
| |
− | |-
| |
− | | colspan="2" | Specifies how many Coils are available on the slave. Each address consumes a single bit of RAM, 8 Addresses are packed together into a single RAM Byte.
| |
− | |-
| |
− | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| |
− | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Digital Inputs - Single bit values
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Starting Address
| |
− | |-
| |
− | | colspan="2" | Start address of the Modbus digital inputs. Referenced from 0. For example Slave 1 might have 100 inputs addressed 0-99 Start Address = 0 Slave 2 might have 100 inputs addressed 100-199 Start Address = 100
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Number of Addresses
| |
− | |-
| |
− | | colspan="2" | Specifies how many Digital Inputs are available on the slave. Each address consumes a single bit of RAM, 8 Addresses are packed together into a single RAM Byte.
| |
− | |-
| |
− | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| |
− | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Analog Inputs - 16-bit values
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Starting Address
| |
− | |-
| |
− | | colspan="2" | Start address of the Modbus analogue inputs. Referenced from 0. For example Slave 1 might have 100 inputs addressed 0-99 Start Address = 0 Slave 2 might have 100 inputs addressed 100-199 Start Address = 100
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Number of Addresses
| |
− | |-
| |
− | | colspan="2" | Specifies how many 16-bit analogue inputs are available on the slave. Each address consumes two RAM Bytes.
| |
− | |-
| |
− | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| |
− | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Holding Registers - 16-bit values
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Starting Address
| |
− | |-
| |
− | | colspan="2" | Start address of the Modbus registers. Referenced from 0. For example Slave 1 might have 100 registers addressed 0-99 Start Address = 0 Slave 2 might have 100 registers addressed 100-199 Start Address = 100
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Number of Addresses
| |
− | |-
| |
− | | colspan="2" | Specifies how many 16-bit holding registers are available on the slave. Each address consumes two RAM Bytes.
| |
− | |}==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" | Reads the value of a single holding register.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | Address
| |
− | |-
| |
− | | colspan="2" | Coil Address
| |
− | |-
| |
− | | 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'' |
| |} | | |} |
| | | |
| | | |
| + | ===SetCoil=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
Line 1,099: |
Line 386: |
| | | |
| | | |
| + | ===SetDigitalInput=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
Line 1,122: |
Line 410: |
| | | |
| | | |
− | {| 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;" | '''SetSlaveAddress'''
| |
− | |-
| |
− | | colspan="2" | Allows the slave address to be overridden from the default slave address specified in the component property. The number of bytes used for the address is fixed by the Slave ID Bytes property to save on RAM usage.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | SlaveAddress
| |
− | |-
| |
− | | colspan="2" |
| |
− | |-
| |
− | | 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;" | '''ChangeFrameType'''
| |
− | |-
| |
− | | colspan="2" | Default frame type is the type set in the component properties.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
− | | width="90%" | Type
| |
− | |-
| |
− | | colspan="2" | 0 = Modbus RTU / 1 = Modbus ASCII
| |
− | |-
| |
− | | 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;" | '''ReadCoils'''
| |
− | |-
| |
− | | colspan="2" | Reads the state of up to eight digital coils. Can pack a max of 8-bits together in a single operation
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | StartAddress
| |
− | |-
| |
− | | colspan="2" | Coil Address Range 0 to (NumCoils - 1)
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
− | | width="90%" | AddressCount
| |
− | |-
| |
− | | colspan="2" | Range 1-8
| |
− | |-
| |
− | | 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;" | '''SetBaudRate'''
| |
− | |-
| |
− | | colspan="2" | Allows the Baud Rate to be controlled dynamically overriding the default rate specified by the Baud component property.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
− | | width="90%" | Rate
| |
− | |-
| |
− | | colspan="2" | 0=1200, 1=2400, 2=4800, 3=9600, 4=19200, 5=38400, 6=57600, 7=115200
| |
− | |-
| |
− | | 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 1,222: |
Line 434: |
| | | |
| | | |
| + | ===SetSlaveAddress=== |
| {| 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;" | '''ReadAnalogInput''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetSlaveAddress''' |
| |- | | |- |
− | | colspan="2" | Reads the value of a single analogue input. | + | | colspan="2" | Allows the slave address to be overridden from the default slave address specified in the component property. The number of bytes used for the address is fixed by the Slave ID Bytes property to save on RAM usage. |
| |- | | |- |
| |- | | |- |
| | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT |
− | | width="90%" | Address | + | | width="90%" | SlaveAddress |
− | |-
| |
− | | colspan="2" | Coil Address
| |
− | |-
| |
− | | 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;" | '''CheckForIncoming'''
| |
− | |-
| |
− | | colspan="2" | Checks for an incoming message and if the data address is within range then also automatically replies with the correct reply. Returns 0 if no comms received, 1 for a succesful transaction, 255 for an error.
| |
− | |-
| |
− | |-
| |
− | | 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;" | '''ChangeBaud'''
| |
− | |-
| |
− | | colspan="2" | Changes the UART Baud rate. 1 = 1200 / 2 = 2400 / 3 = 4800 / 4 = 9600 / 5 = 19200 / 6 = 31250 7 = 38400 / 8 = 57600 / 9 = 115200
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
− | | width="90%" | Baud
| |
− | |-
| |
− | | colspan="2" | The new baud rate (0=1200, 9=115200)
| |
− | |-
| |
− | | 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" | Reads the state of up to eight digital inputs. Can pack a max of 8-bits together in a single operation
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | StartAddress
| |
− | |-
| |
− | | colspan="2" | Coil Address Range 0 to (NumCoils - 1)
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
− | | width="90%" | AddressCount
| |
− | |-
| |
− | | colspan="2" | Range 1-8
| |
− | |-
| |
− | | 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;" | '''GetLastIncoming'''
| |
− | |-
| |
− | | colspan="2" | Gets a value from the last incoming command. Index 0 = 0 Read / 1 Write Index 1 = 0 Coils / 1 DigInput / 2 AnInput / 3 Register Index 2 = Address Index 3 = Number
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
− | | width="90%" | Index
| |
− | |-
| |
− | | colspan="2" | Range: 0-3
| |
− | |-
| |
− | | 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;" | '''SetAnalogInput'''
| |
− | |-
| |
− | | colspan="2" | Sets the state of a single analogue input.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | Address
| |
− | |-
| |
− | | colspan="2" | Coil Address
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | Value
| |
− | |-
| |
− | | colspan="2" | Analogue Value range 0 - 65535
| |
− | |-
| |
− | | 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;" | '''Initialise'''
| |
− | |-
| |
− | | colspan="2" | Starts up the UART to allow communications and initialises the states of the various Modbus Coils, Inputs and Registers to 0.
| |
| |- | | |- |
| + | | colspan="2" | |
| |- | | |- |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | | 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'' | | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |
| |} | | |} |
− |
| |
− |
| |
| | | |
| | | |