Component: SCADA (Interface Board) (SCADA Slaves)
Author | Matrix TSL |
Version | 1.0 (Release) |
Category | SCADA Slaves |
Contents
- 1 SCADA (Interface Board) component
- 2 Examples
- 3 Downloadable macro reference
- 4 Simulation macro reference
- 4.1 I2CInitialise
- 4.2 IOGetInputPin
- 4.3 UARTBaud
- 4.4 ADCSample8
- 4.5 UARTInitialise
- 4.6 UARTTX
- 4.7 I2CRestart
- 4.8 WIFIIsConnected
- 4.9 PWMDisable
- 4.10 I2CReceive
- 4.11 I2CStart
- 4.12 SPITransfer
- 4.13 I2CStop
- 4.14 WIFISetSSID
- 4.15 ServoDisable
- 4.16 SPIPrescaler
- 4.17 ServoEnable
- 4.18 UARTRXCount
- 4.19 ADCSample10
- 4.20 IOSetOutputPin
- 4.21 ServoSetPosition8
- 4.22 SPIInitialise
- 4.23 WIFIGetIP
- 4.24 I2CSend
- 4.25 PWMSetPrescaler
- 4.26 PWMSetDuty8
- 4.27 PWMEnable
- 4.28 UARTRX
- 4.29 Initialise
- 5 Property reference
SCADA (Interface Board) component
Connects to a Embeddded Interface Board running the SCADA Firmware allowing the board to become a slave to the flowcode simulation runtime. Supports: Digital IO / ADC / I2C / SPI / PWM / UART / DAC / Servo See Instructables for open source project files.
Examples
Direct Slave Access
Here is a simple demo to switch on and off digital pin 5.
Rapid Development - Virtualised SPI
A feature of the SCADA Slave interface is to use the component for rapid development.
The SCADA Slave hardware can be used to take communications from the Flowcode simulation and transfer them to a real world device allowing for easy code generation and test without having to download to a target microcontroller device.
The CS pin and SPI Prescaler are set via the properties of the Injector component.
The SPI Master component is linked to the Injector component via the Injector property.
The Injector component is linked to the SCADA Slave component via the SCADA Slave property.
Interface Board SCADA Slave SPI Demo
Rapid Development - Virtualised I2C
A feature of the SCADA Slave interface is to use the component for rapid development.
The SCADA Slave hardware can be used to take communications from the Flowcode simulation and transfer them to a real world device allowing for easy code generation and test without having to download to a target microcontroller device.
The I2C Master component is linked to the Injector component via the Injector property.
The Injector component is linked to the SCADA Slave component via the SCADA Slave property.
Interface Board SCADA Slave I2C Demo
Rapid Development - Virtualised UART
A feature of the SCADA Slave interface is to use the component for rapid development.
The SCADA Slave hardware can be used to take communications from the Flowcode simulation and transfer them to a real world device allowing for easy code generation and test without having to download to a target microcontroller device.
The Baud rate and optional RS485 Properties are set via the properties of the Injector component.
The UART component is linked to the Injector component via the Injector property.
The Injector component is linked to the SCADA Slave component via the SCADA Slave property.
Interface Board SCADA Slave UART Demo
Downloadable macro reference
This component does not contain any downloadable macros
Simulation macro reference
I2CInitialise
Initialsie the I2C module ready for communications
Parameters
- This macro has no parameters
Return value
- This call does not return a value
IOGetInputPin
Sets the selected digital pin to an input and reads the input state.
Parameters
- BYTE Pin
- Range: 0-17
Return value
- BOOL : Returns true if the operation is a success, else false
UARTBaud
Change the Baud rate of the UART
Parameters
- BYTE Rate
- 0=1200, 1=2400, 2=4800, 3=9600, 4=19200, 5=38400, 6=57600, 7=115200
Return value
- This call does not return a value
ADCSample8
Reads the voltage present on an Alanog pin as an 8-bit value range 0-255
Parameters
- BYTE ADCChannel
- Range: 0-5
Return value
UARTInitialise
Initialsie the UART module ready for communications
Parameters
- This macro has no parameters
Return value
- This call does not return a value
UARTTX
Transmit a byte via the UART
Parameters
- BYTE Data
Return value
- This call does not return a value
I2CRestart
Put the I2C Module into Restart mode
Parameters
- This macro has no parameters
Return value
- This call does not return a value
WIFIIsConnected
Checks to see if the WIFI is active and connected
Parameters
- This macro has no parameters
Return value
- BOOL : Returns true if the operation is a success, else false
PWMDisable
Disable a PWM output
Parameters
- BYTE Channel
- Range: 0-1
Return value
- This call does not return a value
I2CReceive
Receive a byte using the I2C bus
Parameters
- BOOL Last
- Last byte to receive: Range 0-1
Return value
I2CStart
Put the I2C Module into Start mode
Parameters
- This macro has no parameters
Return value
- This call does not return a value
SPITransfer
Transfer a byte using the SPI bus
Parameters
- BYTE DataOut
Return value
I2CStop
Put the I2C Module into Stop mode
Parameters
- This macro has no parameters
Return value
- This call does not return a value
WIFISetSSID
Assign the SSID and password for the network you wish to connect the board to.
Stores the parameters into ROM for later USB free setup.
Parameters
- <- STRING SSID
- Name of the network you wish to connect to
- This parameter may be returned back to the caller
- <- STRING Password
- This parameter may be returned back to the caller
Return value
- This call does not return a value
ServoDisable
Disable a Servo output
Parameters
- BYTE Channel
- Range: 0-5
Return value
- This call does not return a value
SPIPrescaler
Modify the speed of the SPI bus
Parameters
- BYTE Prescaler
- Range: 0-2
Return value
- This call does not return a value
ServoEnable
Enable a Servo output
Parameters
- BYTE Channel
- Range: 0-5
Return value
- This call does not return a value
UARTRXCount
Checks to see how many bytes have been received by the UART
Parameters
- This macro has no parameters
Return value
ADCSample10
Reads the voltage present on an Alanog pin as an 10-bit value range 0-1023
Parameters
- BYTE ADCChannel
- Range: 0-5
Return value
IOSetOutputPin
Sets the selected digital pin to an output and assigns the output state.
Parameters
- BYTE Pin
- Range: 0-17
- BOOL State
- Range: 0-1
Return value
- This call does not return a value
ServoSetPosition8
Sets the position as an 8-bit value
Parameters
- BYTE Channel
- Range: 0-1
- BYTE Position
- Range: 0-255
Return value
- This call does not return a value
SPIInitialise
Initialsie the SPI module ready for communications
Parameters
- This macro has no parameters
Return value
- This call does not return a value
WIFIGetIP
Gets the IP address of the board. Allows you to setup and get the assigned address via USB before using over WIFI,
Use the WIFIIsConnected first to check the WIFI is active.
Parameters
- This macro has no parameters
Return value
I2CSend
Transmit a byte using the I2C bus
Parameters
- BYTE DataOut
Return value
- BOOL : Returns true if the operation is a success, else false
PWMSetPrescaler
Sets the prescaler for the PWM output
Parameters
- BYTE Prescaler
Return value
- This call does not return a value
PWMSetDuty8
Sets the duty for the PWM output
Parameters
- BYTE Channel
- Range: 0-1
- BYTE Duty
- Range: 0-255
Return value
- This call does not return a value
PWMEnable
Enable a PWM output
Parameters
- BYTE Channel
- Range: 0-1
Return value
- This call does not return a value
UARTRX
Receive a byte from the RX buffer.
Recommend callinng UARTRXCount first to check fo available data.
Parameters
- This macro has no parameters
Return value
Initialise
Initialise the comms to the Arduino board ready for commands to be sent.
Parameters
- This macro has no parameters
Return value
- This call does not return a value
Property reference
Connection Type
This property is of type Fixed list of ints and can be referenced with the variable name ConnType.
No additional information
Refresh Ports
This property is of type True or false and can be referenced with the variable name scada_uart1::RefreshPorts.
No additional information
COM Port
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.
Network Interface
This property is of type Fixed list of ints and can be referenced with the variable name NetworkComms1::NetworkInterface.
Some computers may have several network interfaces such as ethernet ports and wifi access.
Select the correct network interface for the network you wish to connect to.
Use the IP address to confirm you are connected to the right network.
IP Address
This property is of type Line of text and can be referenced with the variable name NetworkComms1::IPAddress.
IP Address of the selected network interface.
WIFI IP
This property is of type Line of text and can be referenced with the variable name WIFIIP.
IP Address of the device we want to control
Console Log
This property is of type True or false and can be referenced with the variable name ConsoleLog.
Create an automatic console log of the commands sent to the device
Log Mode
This property is of type Fixed list of ints and can be referenced with the variable name LogMode.
Controls how the console data is formatted.
Fixed statistics gives an easy to read overview of the IO, Analog and PWM functionality
Command Log gives a more in depth analysis of the outgoing commands and incoming returns
Show Raw
This property is of type True or false and can be referenced with the variable name ShowRaw.
Shows the raw data stream via a console window