Difference between revisions of "Component: Modbus Master (SCADA) (Comms: System)"

From Flowcode Help
Jump to navigationJump to search
(XML import)
 
Line 1: Line 1:
 
+
{| style="width:50%"
 
 
{| width="50%"
 
 
|-
 
|-
| width="20%" style="color: gray;" | Author
+
| width="20%" style="color:gray;" | Author
 
| Matrix TSL
 
| Matrix TSL
 
|-
 
|-
| width="20%" style="color: gray;" | Version
+
| width="20%" style="color:gray;" | Version
| 2.1 (Release)
+
| 2.1
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color:gray;" | Category
 
| Comms: System
 
| Comms: System
 
|}
 
|}
  
  
 
+
==Modbus Master (SCADA) component==
==[[File:Component Icon 97647329_1e06_46dc_ba11_9d721038294d.png|Image]] Modbus Master (SCADA) component==
 
 
Modbus component for talking to Modbus compatible hardware via RS232 or RS485.  
 
Modbus component for talking to Modbus compatible hardware via RS232 or RS485.  
  
==Examples==
+
==Detailed description==
''<span style="color:red;">No additional examples</span>''
 
  
 +
''No detailed description exists yet for this component''
  
==Downloadable macro reference==
+
==Examples==
  
===<span style="font-weight: normal;"><u><tt>ReadHoldingRegister</tt></u></span>===
 
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.
+
''<span style="color:red;">No additional examples</span>''
  
'''Parameters'''
 
  
:[[Variable Types|UINT]] ''SlaveID''
+
==Downloadable macro reference==
::The ID of the MODBUS slave
 
  
:[[Variable Types|UINT]] ''RegAddress''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
::Address: 0=40001, 1=40002, ...
+
|-
 +
| 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.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | SlaveID
 +
|-
 +
| colspan="2" | The ID of the MODBUS slave&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | RegAddress
 +
|-
 +
| colspan="2" | Address: 0=40001, 1=40002, ...&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | RegCount
 +
|-
 +
| colspan="2" | Number of consecutive registers to read, starting from RegAddress&nbsp;
 +
|-
 +
| 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''
 +
|}
  
:[[Variable Types|UINT]] ''RegCount''
 
::Number of consecutive registers to read, starting from RegAddress
 
  
 +
{| 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;" | '''ReadCoil'''
 +
|-
 +
| 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.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | SlaveID
 +
|-
 +
| colspan="2" | The ID of the MODBUS slave&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | CoilAddress
 +
|-
 +
| colspan="2" | Coil Address: 0=Coil1, 1=Coil2, 2=Coil3, ...&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | CoilCount
 +
|-
 +
| colspan="2" | Number of consecutive coils to try and read&nbsp;
 +
|-
 +
| 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''
 +
|}
  
'''Return value'''
 
  
:[[Variable Types|BYTE]]
+
{| 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.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | SlaveID
 +
|-
 +
| colspan="2" | The ID of the MODBUS slave&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | CoilAddress
 +
|-
 +
| colspan="2" | Coil Address: 0=Coil1, 1=Coil2, 2=Coil3, ...&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | CoilState
 +
|-
 +
| colspan="2" | 0=Off, 1=On&nbsp;
 +
|-
 +
| 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''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>ForceMultipleCoils</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
This command writes the contents of a series of discrete coils at the location starting at CoilAddress through to CoilAddress + CoilCount.
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetResponse'''
 +
|-
 +
| colspan="2" | Collects as much incoming data as possible and stored into the response buffer. The number of bytes received will be stored into location 0 of the response buffer. Return value indicates validity of incoming CRC. 0 = OK, 1 = CRC fail, 255 = No Data&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
Returns 0 for success, 1 for CRC fail and 255 for no reply.
 
  
'''Parameters'''
+
{| 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.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | SlaveID
 +
|-
 +
| colspan="2" | The ID of the MODBUS slave&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | CoilAddress
 +
|-
 +
| colspan="2" | Coil Address: 0=Coil1, 1=Coil2, 2=Coil3, ...&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | CoilCount
 +
|-
 +
| colspan="2" | Number of consecutive coils to try and read&nbsp;
 +
|-
 +
| 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&nbsp;
 +
|-
 +
| 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''
 +
|}
  
:[[Variable Types|UINT]] ''SlaveID''
 
::The ID of the MODBUS slave
 
  
:[[Variable Types|UINT]] ''CoilAddress''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
::Coil Address: 0=Coil1, 1=Coil2, 2=Coil3, ...
+
|-
 +
| 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. &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Index
 +
|-
 +
| colspan="2" | 0=NumBytes, 1=SlaveAddress, 2=FunctionCode/ExceptionCode, 3=DataBytes, 4=data0, 5=data1, ..&nbsp;
 +
|-
 +
| 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''
 +
|}
  
:[[Variable Types|UINT]] ''CoilCount''
 
::Number of consecutive coils to try and read
 
  
:[[Variable Types|BYTE]] ''CoilData''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
::An array of bytes each containing 8 1-bit coil values
+
|-
 +
| 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.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Type
 +
|-
 +
| colspan="2" | 0 = Modbus RTU / 1 = Modbus ASCII&nbsp;
 +
|-
 +
| 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''
 +
|}
  
  
'''Return value'''
+
{| 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. &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Index
 +
|-
 +
| colspan="2" | 4=data0, 6=data1, 8=data2, ..&nbsp;
 +
|-
 +
| 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''
 +
|}
  
:[[Variable Types|BYTE]]
 
  
 +
{| 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 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.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | SlaveID
 +
|-
 +
| colspan="2" | The ID of the MODBUS slave&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | RegAddress
 +
|-
 +
| colspan="2" | Address: 0=40001, 1=40002, ...&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | RegCount
 +
|-
 +
| colspan="2" | Number of consecutive registers to write, starting from RegAddress&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | RegValue
 +
|-
 +
| colspan="2" | Array of values to send to the registers&nbsp;
 +
|-
 +
| 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''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>ForceSingleCoil</tt></u></span>===
 
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.
+
{| 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.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | SlaveID
 +
|-
 +
| colspan="2" | The ID of the MODBUS slave&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | RegAddress
 +
|-
 +
| colspan="2" | Input Address: 0=10001, 1=10002, 2=10003, ...&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | RegCount
 +
|-
 +
| colspan="2" | Number of consecutive inputs to read, starting from RegAddress&nbsp;
 +
|-
 +
| 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''
 +
|}
  
'''Parameters'''
 
  
:[[Variable Types|UINT]] ''SlaveID''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
::The ID of the MODBUS slave
+
|-
 +
| 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 holding register at the location RegAddress. Returns 0 for success, 1 for CRC fail and 255 for no reply.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | SlaveID
 +
|-
 +
| colspan="2" | The ID of the MODBUS slave&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | RegAddress
 +
|-
 +
| colspan="2" | Address: 0=40001, 1=40002, ...&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | RegValue
 +
|-
 +
| colspan="2" | Value to send to the selected register&nbsp;
 +
|-
 +
| 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''
 +
|}
  
:[[Variable Types|UINT]] ''CoilAddress''
 
::Coil Address: 0=Coil1, 1=Coil2, 2=Coil3, ...
 
  
:[[Variable Types|BYTE]] ''CoilState''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
::0=Off, 1=On
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadDigitalInput'''
 +
|-
 +
| 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.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | SlaveID
 +
|-
 +
| colspan="2" | The ID of the MODBUS slave&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | DataAddress
 +
|-
 +
| colspan="2" | Input Address: 0=10001, 1=10002, 2=10003, ...&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | DataCount
 +
|-
 +
| colspan="2" | Number of consecutive inputs to read, starting from RegAddress&nbsp;
 +
|-
 +
| 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''
 +
|}
  
  
'''Return value'''
+
{| 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&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
:[[Variable Types|BYTE]]
 
  
 +
{| 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;" | '''ReadByteFromBuffer'''
 +
|-
 +
| colspan="2" | Reads a byte of data from the local sector buffer. Return = Data byte read from the local sector buffer. &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Address
 +
|-
 +
| colspan="2" | 0 - 511 - Contains the position of the byte to be read&nbsp;
 +
|-
 +
| 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''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>GetResponse</tt></u></span>===
 
Collects as much incoming data as possible and stored into the response buffer. The number of bytes received will be stored into location 0 of the response buffer.
 
  
Return value indicates validity of incoming CRC. 0 = OK, 1 = CRC fail, 255 = No Data
+
{| 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;" | '''ReadFileLength'''
 +
|-
 +
| colspan="2" | Returns the number of bytes in the current sector that are used by the current open file. Return = 512 - Sector is filled with file data Return < 512 - Last sector of the file, Retval specifies how many bytes of data are remaining in the sector&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Parameters'''
 
  
:''This macro has no parameters''
+
{| 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;" | '''OpenFile'''
 +
|-
 +
| colspan="2" | Searches for and opens a file for reading or writing from within the current directory on the disk. Returns 0 for success.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | Filename
 +
|-
 +
| colspan="2" | 8.3 filename of the file we are trying to open e.g. "file.txt"&nbsp;
 +
|-
 +
| 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''
 +
|}
  
  
'''Return value'''
+
{| 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;" | '''WriteFileSector'''
 +
|-
 +
| colspan="2" | Overwrites the current sector on the memory card with the contents of the local sector buffer. See write_byte_to_buffer function. Return = 0 - File sector written successfully. Return > 0 - File sector write error&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
:[[Variable Types|BYTE]]
 
  
 +
{| 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;" | '''SetFileIndex'''
 +
|-
 +
| colspan="2" | Sets the current file index and used to switch between several open file streams.  Default = 0. &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | File_Index
 +
|-
 +
| colspan="2" | File index ranges from 0 to (Max Concurrent Files - 1)&nbsp;
 +
|-
 +
| 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''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>ReadCoilStatus</tt></u></span>===
 
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.
+
{| 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;" | '''AppendStringToFile'''
 +
|-
 +
| colspan="2" | Adds the contents of the data string parameter to the end of the currently open file. Returns 0 for success.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | Data_String
 +
|-
 +
| colspan="2" | Data to append to the end of the file&nbsp;
 +
|-
 +
| 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''
 +
|}
  
'''Parameters'''
 
  
:[[Variable Types|UINT]] ''SlaveID''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
::The ID of the MODBUS slave
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadFileSize'''
 +
|-
 +
| colspan="2" | Reads the entire size of the current file in bytes.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u32-icon.png]] - ULONG
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|UINT]] ''CoilAddress''
 
::Coil Address: 0=Coil1, 1=Coil2, 2=Coil3, ...
 
  
:[[Variable Types|UINT]] ''CoilCount''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
::Number of consecutive coils to try and read
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTimeAndDate'''
 +
|-
 +
| colspan="2" | Sets the current time and date.  Time = (Hour << 11) + (Min << 5) + (Sec >> 1) Date = (YearFrom1980 << 9) + (Month << 5) + (Day) Additional details can be found here: http://www.maverick-os.dk/FileSystemFormats/FAT16_FileSystem.html#TimeFormat&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Time
 +
|-
 +
| colspan="2" | Sets the current Time in FAT Time format hhhhhmmmmmmsssss - S=Secs/2&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Date
 +
|-
 +
| colspan="2" | Sets the current Date in FAT Date format yyyyyyymmmmddddd - Y=Years since 1980&nbsp;
 +
|-
 +
| 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''
 +
|}
  
  
'''Return value'''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
:[[Variable Types|BYTE]]
+
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
+
|-
===<span style="font-weight: normal;"><u><tt>GetResponseByte</tt></u></span>===
+
| colspan="2" | Attempts to communicate with the SD card and if successful sets up the file system. Returns 0 for success. &nbsp;
Reads a byte from the last received response. The Index parametes specifies which byte to read back.
+
|-
 
+
|-
'''Parameters'''
+
| 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''
:[[Variable Types|BYTE]] ''Index''
+
|}
::0=NumBytes, 1=SlaveAddress, 2=FunctionCode/ExceptionCode, .....
 
 
 
 
 
'''Return value'''
 
 
 
:[[Variable Types|BYTE]]
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>ReadInputStatus</tt></u></span>===
 
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.
 
 
 
'''Parameters'''
 
 
 
:[[Variable Types|UINT]] ''SlaveID''
 
::The ID of the MODBUS slave
 
 
 
:[[Variable Types|UINT]] ''DataAddress''
 
::Input Address: 0=10001, 1=10002, 2=10003, ...
 
 
 
:[[Variable Types|UINT]] ''DataCount''
 
::Number of consecutive inputs to read, starting from RegAddress
 
 
 
 
 
'''Return value'''
 
 
 
:[[Variable Types|BYTE]]
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>ChangeFrameType</tt></u></span>===
 
Default frame type is the type set in the component properties.
 
 
 
'''Parameters'''
 
 
 
:[[Variable Types|BYTE]] ''Type''
 
::0 = Modbus RTU / 1 = Modbus ASCII
 
 
 
 
 
'''Return value'''
 
 
 
:''This call does not return a value''
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>PresetSingleRegister</tt></u></span>===
 
This command writes the contents of a analogue output holding registerl at the location RegAddress.
 
 
 
Returns 0 for success, 1 for CRC fail and 255 for no reply.
 
 
 
'''Parameters'''
 
 
 
:[[Variable Types|UINT]] ''SlaveID''
 
::The ID of the MODBUS slave
 
 
 
:[[Variable Types|UINT]] ''RegAddress''
 
::Address: 0=40001, 1=40002, ...
 
 
 
:[[Variable Types|UINT]] ''RegValue''
 
::Value to send to the selected register
 
 
 
 
 
'''Return value'''
 
 
 
:[[Variable Types|BYTE]]
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>GetResponseInt</tt></u></span>===
 
Reads a 16-bit value from the last received response.
 
 
 
The Index parametes specifies the byte index of the value to read back.
 
 
 
'''Parameters'''
 
 
 
:[[Variable Types|BYTE]] ''Index''
 
::0=NumBytes, 1=SlaveAddress, 2=FunctionCode/ExceptionCode, .....
 
 
 
 
 
'''Return value'''
 
 
 
:[[Variable Types|UINT]]
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>ReadInputRegister</tt></u></span>===
 
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.
 
 
 
'''Parameters'''
 
 
 
:[[Variable Types|UINT]] ''SlaveID''
 
::The ID of the MODBUS slave
 
 
 
:[[Variable Types|UINT]] ''RegAddress''
 
::Input Address: 0=10001, 1=10002, 2=10003, ...
 
 
 
:[[Variable Types|UINT]] ''RegCount''
 
::Number of consecutive inputs to read, starting from RegAddress
 
 
 
 
 
'''Return value'''
 
 
 
:[[Variable Types|BYTE]]
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>PresetMultipleRegisters</tt></u></span>===
 
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.
 
 
 
'''Parameters'''
 
 
 
:[[Variable Types|UINT]] ''SlaveID''
 
::The ID of the MODBUS slave
 
 
 
:[[Variable Types|UINT]] ''RegAddress''
 
::Address: 0=40001, 1=40002, ...
 
 
 
:[[Variable Types|UINT]] ''RegCount''
 
::Number of consecutive registers to write, starting from RegAddress
 
 
 
:[[Variable Types|UINT]] ''RegValue''
 
::Array of values to send to the registers
 
 
 
 
 
'''Return value'''
 
 
 
:[[Variable Types|BYTE]]
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>===
 
Starts up the UART to allow communications
 
 
 
'''Parameters'''
 
 
 
:''This macro has no parameters''
 
 
 
 
 
'''Return value'''
 
 
 
:''This call does not return a value''
 
  
  
 +
{| 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" | Initialise the comms to the Arduino board ready for commands to be sent.&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
==Simulation macro reference==
 
  
''This component does not contain any simulation macros''
 
  
  
 
==Property reference==
 
==Property reference==
<span style="font-weight: normal;"><u>Frame Type</u></span>
 
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''FrameType''.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
Switches between RTU and ASCII forms of Modbus
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
<span style="font-weight: normal;"><u>Receive Buffer Size</u></span>
+
|-
 
+
|-
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''ReceiveBufferSize''.
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Frame Type
Maximum number of bytes the receive buffer can hold
+
|-
 
+
| colspan="2" | Switches between RTU and ASCII forms of Modbus&nbsp;
<span style="font-weight: normal;"><u>Slave ID Bytes</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''AddressBytes''.
+
| width="90%" | Receive Buffer Size
 
+
|-
Number of bytes used when passing a slave ID, usually 1 but sometimes 2
+
| colspan="2" | Maximum number of bytes the receive buffer can hold&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Silent Interval</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
+
| width="90%" | Slave ID Bytes
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''SilentInterval''.
+
|-
 
+
| colspan="2" | Number of bytes used when passing a slave ID, usually 1 but sometimes 2&nbsp;
Configures how much time to wait after each master modbus command before another command can be sent.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
A silent interval of 60ms minimum is required in order to guarentee successful reception of the next transmission.
+
| width="90%" | Silent Interval
 
+
|-
0=No Delay  
+
| colspan="2" | Configures how much time to wait after each master modbus command before another command can be sent. A silent interval of 60ms minimum is required in order to guarentee successful reception of the next transmission. 0=No Delay 60 = 60mS - Default Range : 0 - 65535&nbsp;
 
+
|-
60 = 60mS - Default
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
+
| width="90%" | UART Receive Timeout
Range : 0 - 65535
+
|-
 
+
| colspan="2" | Amount of time to wait before timing out when listening for a slave's response. Range: 0 - 255. 0 = Don't Wait 1 - 254 = X ms 255 = Wait Forever&nbsp;
<span style="font-weight: normal;"><u>UART Receive Timeout</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''RXTOUT''.
+
| width="90%" | Receive Timeout Count
 
+
|-
Amount of time to wait before timing out when listening for a slave's response.
+
| colspan="2" | Number of timeouts in a row to wait for until we decide the slave is not responding or finished responding to a message. Range: 0 - 255 0 = First Timeout Only 1 = First Timeout + 1 2 = First Timeout + 2&nbsp;
 
+
|-
Range: 0 - 255.
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 
+
| width="90%" | Label
0 = Don't Wait
+
|-
 
+
| colspan="2" | A text label to appear on the Modbus panel object.&nbsp;
1 - 254 = X ms
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
255 = Wait Forever
+
| width="90%" | Console Data
 
+
|-
<span style="font-weight: normal;"><u>Receive Timeout Count</u></span>
+
| colspan="2" | Selects if the console data is automatically generated or not&nbsp;
 
+
|-
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''TOUTCNT''.
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
+
| width="90%" | Console Columns
Number of timeouts in a row to wait for until we decide the slave is not responding or finished responding
+
|-
 
+
| colspan="2" | Number of characters that can be displayed on a single line of the console.&nbsp;
to a message.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
Range: 0 - 255
+
| width="90%" | Data Source
 
+
|-
0 = First Timeout Only
+
| 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     Injector - Routes the communication data via a data injector component on the Panel.&nbsp;
 
+
|-
1 = First Timeout + 1
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | COM Port
2 = First Timeout + 2
+
|-
 
+
| colspan="2" | Lists all the current available COM port hardware on your PC.&nbsp;
<span style="font-weight: normal;"><u>Label</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
This property is of type ''Line of text'' and can be referenced with the variable name ''label''.
+
| width="90%" | Refresh Ports
 
+
|-
A text label to appear on the Modbus panel object.
+
| colspan="2" | &nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Console Data</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
+
| width="90%" | Baud Rate
This property is of type ''True or false'' and can be referenced with the variable name ''scada_uart1::ConsoleData''.
+
|-
 
+
| colspan="2" | COM port data rate in bits per second&nbsp;
Selects if the console data is automatically generated or not
+
|-
 
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
<span style="font-weight: normal;"><u>Console Columns</u></span>
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''  
 
+
|-
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''scada_uart1::ConsoleColumns''.
+
|-
 
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
Number of characters that can be displayed on a single line of the console.
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''  
 
+
|-
<span style="font-weight: normal;"><u>Data Source</u></span>
+
|}
 
 
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''scada_uart1::DataSource''.
 
 
 
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  
 
 
 
    Injector - Routes the communication data via a data injector component on the Panel.
 
 
 
<span style="font-weight: normal;"><u>COM Port</u></span>
 
 
 
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''scada_uart1::com_port''.
 
 
 
Lists all the current available COM port hardware on your PC.
 
 
 
<span style="font-weight: normal;"><u>Baud Rate</u></span>
 
 
 
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''scada_uart1::baud''.
 
 
 
COM port data rate in bits per second
 

Revision as of 20:43, 16 November 2021

Author Matrix TSL
Version 2.1
Category Comms: System


Modbus Master (SCADA) component

Modbus component for talking to Modbus compatible hardware via RS232 or RS485.

Detailed description

No detailed description exists yet for this component

Examples

No additional examples


Downloadable macro reference

Fc9-comp-macro.png ReadHoldingRegister
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. 
Fc9-u16-icon.png - UINT SlaveID
The ID of the MODBUS slave 
Fc9-u16-icon.png - UINT RegAddress
Address: 0=40001, 1=40002, ... 
Fc9-u16-icon.png - UINT RegCount
Number of consecutive registers to read, starting from RegAddress 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png ReadCoil
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. 
Fc9-u16-icon.png - UINT SlaveID
The ID of the MODBUS slave 
Fc9-u16-icon.png - UINT CoilAddress
Coil Address: 0=Coil1, 1=Coil2, 2=Coil3, ... 
Fc9-u16-icon.png - UINT CoilCount
Number of consecutive coils to try and read 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetCoil
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. 
Fc9-u16-icon.png - UINT SlaveID
The ID of the MODBUS slave 
Fc9-u16-icon.png - UINT CoilAddress
Coil Address: 0=Coil1, 1=Coil2, 2=Coil3, ... 
Fc9-u8-icon.png - BYTE CoilState
0=Off, 1=On 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png GetResponse
Collects as much incoming data as possible and stored into the response buffer. The number of bytes received will be stored into location 0 of the response buffer. Return value indicates validity of incoming CRC. 0 = OK, 1 = CRC fail, 255 = No Data 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetCoils
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. 
Fc9-u16-icon.png - UINT SlaveID
The ID of the MODBUS slave 
Fc9-u16-icon.png - UINT CoilAddress
Coil Address: 0=Coil1, 1=Coil2, 2=Coil3, ... 
Fc9-u16-icon.png - UINT CoilCount
Number of consecutive coils to try and read 
Fc9-u8-icon.png - BYTE CoilData
An array of bytes each containing 8 1-bit coil values 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png GetResponseByte
Reads a byte from the last received response. The Index parametes specifies which byte to read back.  
Fc9-u8-icon.png - BYTE Index
0=NumBytes, 1=SlaveAddress, 2=FunctionCode/ExceptionCode, 3=DataBytes, 4=data0, 5=data1, .. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png ChangeFrameType
Default frame type is the type set in the component properties. 
Fc9-u8-icon.png - BYTE Type
0 = Modbus RTU / 1 = Modbus ASCII 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetResponseInt
Reads a 16-bit value from the last received response. The Index parametes specifies the byte index of the value to read back.  
Fc9-u8-icon.png - BYTE Index
4=data0, 6=data1, 8=data2, .. 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png SetHoldingRegisters
This command writes the contents of several 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. 
Fc9-u16-icon.png - UINT SlaveID
The ID of the MODBUS slave 
Fc9-u16-icon.png - UINT RegAddress
Address: 0=40001, 1=40002, ... 
Fc9-u16-icon.png - UINT RegCount
Number of consecutive registers to write, starting from RegAddress 
Fc9-u16-icon.png - UINT RegValue
Array of values to send to the registers 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png ReadAnalogInput
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. 
Fc9-u16-icon.png - UINT SlaveID
The ID of the MODBUS slave 
Fc9-u16-icon.png - UINT RegAddress
Input Address: 0=10001, 1=10002, 2=10003, ... 
Fc9-u16-icon.png - UINT RegCount
Number of consecutive inputs to read, starting from RegAddress 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetHoldingRegister
This command writes the contents of a holding register at the location RegAddress. Returns 0 for success, 1 for CRC fail and 255 for no reply. 
Fc9-u16-icon.png - UINT SlaveID
The ID of the MODBUS slave 
Fc9-u16-icon.png - UINT RegAddress
Address: 0=40001, 1=40002, ... 
Fc9-u16-icon.png - UINT RegValue
Value to send to the selected register 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png ReadDigitalInput
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. 
Fc9-u16-icon.png - UINT SlaveID
The ID of the MODBUS slave 
Fc9-u16-icon.png - UINT DataAddress
Input Address: 0=10001, 1=10002, 2=10003, ... 
Fc9-u16-icon.png - UINT DataCount
Number of consecutive inputs to read, starting from RegAddress 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Initialise
Starts up the UART to allow communications 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ReadByteFromBuffer
Reads a byte of data from the local sector buffer. Return = Data byte read from the local sector buffer.  
Fc9-u16-icon.png - UINT Address
0 - 511 - Contains the position of the byte to be read 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png ReadFileLength
Returns the number of bytes in the current sector that are used by the current open file. Return = 512 - Sector is filled with file data Return < 512 - Last sector of the file, Retval specifies how many bytes of data are remaining in the sector 
[[File:]] - Return


Fc9-comp-macro.png OpenFile
Searches for and opens a file for reading or writing from within the current directory on the disk. Returns 0 for success. 
Fc9-string-icon.png - STRING Filename
8.3 filename of the file we are trying to open e.g. "file.txt" 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png WriteFileSector
Overwrites the current sector on the memory card with the contents of the local sector buffer. See write_byte_to_buffer function. Return = 0 - File sector written successfully. Return > 0 - File sector write error 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetFileIndex
Sets the current file index and used to switch between several open file streams. Default = 0.  
Fc9-u8-icon.png - BYTE File_Index
File index ranges from 0 to (Max Concurrent Files - 1) 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png AppendStringToFile
Adds the contents of the data string parameter to the end of the currently open file. Returns 0 for success. 
Fc9-string-icon.png - STRING Data_String
Data to append to the end of the file 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png ReadFileSize
Reads the entire size of the current file in bytes. 
Fc9-u32-icon.png - ULONG Return


Fc9-comp-macro.png SetTimeAndDate
Sets the current time and date. Time = (Hour << 11) + (Min << 5) + (Sec >> 1) Date = (YearFrom1980 << 9) + (Month << 5) + (Day) Additional details can be found here: http://www.maverick-os.dk/FileSystemFormats/FAT16_FileSystem.html#TimeFormat 
Fc9-u16-icon.png - UINT Time
Sets the current Time in FAT Time format hhhhhmmmmmmsssss - S=Secs/2 
Fc9-u16-icon.png - UINT Date
Sets the current Date in FAT Date format yyyyyyymmmmddddd - Y=Years since 1980 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
Attempts to communicate with the SD card and if successful sets up the file system. Returns 0 for success.  
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Initialise
Initialise the comms to the Arduino board ready for commands to be sent. 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Frame Type
Switches between RTU and ASCII forms of Modbus 
Fc9-type-21-icon.png Receive Buffer Size
Maximum number of bytes the receive buffer can hold 
Fc9-type-21-icon.png Slave ID Bytes
Number of bytes used when passing a slave ID, usually 1 but sometimes 2 
Fc9-type-21-icon.png Silent Interval
Configures how much time to wait after each master modbus command before another command can be sent. A silent interval of 60ms minimum is required in order to guarentee successful reception of the next transmission. 0=No Delay 60 = 60mS - Default Range : 0 - 65535 
Fc9-type-21-icon.png UART Receive Timeout
Amount of time to wait before timing out when listening for a slave's response. Range: 0 - 255. 0 = Don't Wait 1 - 254 = X ms 255 = Wait Forever 
Fc9-type-21-icon.png Receive Timeout Count
Number of timeouts in a row to wait for until we decide the slave is not responding or finished responding to a message. Range: 0 - 255 0 = First Timeout Only 1 = First Timeout + 1 2 = First Timeout + 2 
Fc9-type-10-icon.png Label
A text label to appear on the Modbus panel object. 
Fc9-type-7-icon.png Console Data
Selects if the console data is automatically generated or not 
Fc9-type-21-icon.png Console Columns
Number of characters that can be displayed on a single line of the console. 
Fc9-type-16-icon.png Data Source
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 Injector - Routes the communication data via a data injector component on the Panel. 
Fc9-type-16-icon.png COM Port
Lists all the current available COM port hardware on your PC. 
Fc9-type-7-icon.png Refresh Ports
 
Fc9-type-21-icon.png Baud Rate
COM port data rate in bits per second 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png Simulations