Jump to content

Component: UART SCADA (CAL) (Misc): Difference between revisions

From Flowcode Help
m Text replacement - "width="10%" align="center" style="background-color:#D8C9D8;"" to "width="10%" align="center" class="mtx-class-macrohead""
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead""
Line 95: Line 95:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetConsoleHandle'''
| width="90%" class="mtx-class-macrohead" | '''GetConsoleHandle'''
|-
|-
| colspan="2" |  
| colspan="2" |  
Line 109: Line 109:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Init'''
| width="90%" class="mtx-class-macrohead" | '''Init'''
|-
|-
| colspan="2" | Initialize the component with the specified properties 
| colspan="2" | Initialize the component with the specified properties 
Line 123: Line 123:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Receive'''
| width="90%" class="mtx-class-macrohead" | '''Receive'''
|-
|-
| colspan="2" | Receive a Character 
| colspan="2" | Receive a Character 
Line 142: Line 142:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveByteArray'''
| width="90%" class="mtx-class-macrohead" | '''ReceiveByteArray'''
|-
|-
| colspan="2" | Receives an array of bytes and returns the number of bytes received. 
| colspan="2" | Receives an array of bytes and returns the number of bytes received. 
Line 171: Line 171:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveString'''
| width="90%" class="mtx-class-macrohead" | '''ReceiveString'''
|-
|-
| colspan="2" | Receives a string of bytes and returns the number of bytes received. 
| colspan="2" | Receives a string of bytes and returns the number of bytes received. 
Line 200: Line 200:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ScanForDeviceID'''
| width="90%" class="mtx-class-macrohead" | '''ScanForDeviceID'''
|-
|-
| colspan="2" | Checks to see if a device VID/PID string is present and returns the COM port number. Returns 0 if device not found. 
| colspan="2" | Checks to see if a device VID/PID string is present and returns the COM port number. Returns 0 if device not found. 
Line 219: Line 219:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Send'''
| width="90%" class="mtx-class-macrohead" | '''Send'''
|-
|-
| colspan="2" | Send the Character  
| colspan="2" | Send the Character  
Line 238: Line 238:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendByteArray'''
| width="90%" class="mtx-class-macrohead" | '''SendByteArray'''
|-
|-
| colspan="2" | Transmits an array of bytes via the UART peripheral 
| colspan="2" | Transmits an array of bytes via the UART peripheral 
Line 262: Line 262:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendString'''
| width="90%" class="mtx-class-macrohead" | '''SendString'''
|-
|-
| colspan="2" | Transmits a string of bytes via the UART peripheral 
| colspan="2" | Transmits a string of bytes via the UART peripheral 
Line 281: Line 281:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Uninit'''
| width="90%" class="mtx-class-macrohead" | '''Uninit'''
|-
|-
| colspan="2" | Un-initialize the UART and release the resources 
| colspan="2" | Un-initialize the UART and release the resources 
Line 296: Line 296:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-

Revision as of 14:23, 13 July 2026

Author Matrix TSL
Version 2.1
Category Misc


UART SCADA component

CAL = Code Abstraction Layer - Allows one code base to run on a wide range of chips. A low level implementation giving direct access to the UART peripheral. Includes simulation functionality to commmunicate via a COM port or an Injector component. Also includes timestamped logging via the console and Data Recorder trace monitoring support.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_UART_SCADA.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_UART_SCADA.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples









Macro reference

GetConsoleHandle

GetConsoleHandle
 
- HANDLE Return


Init

Init
Initialize the component with the specified properties 
- VOID Return


Receive

Receive
Receive a Character 
- UINT Timeout
Period to wait for the character to be received 
- INT Return


ReceiveByteArray

ReceiveByteArray
Receives an array of bytes and returns the number of bytes received. 
- BYTE Data
A byte array variable to hold the received data 
- UINT NumBytes
Maximum number of bytes to try and receive 
- UINT Timeout
Max amount of time in ms to wait between bytes 
- UINT Return


ReceiveString

ReceiveString
Receives a string of bytes and returns the number of bytes received. 
- STRING StringData
 
- UINT NumBytes
Maximum number of bytes to try and receive 
- UINT Timeout
Max amount of time in ms to wait between bytes 
- BYTE Return


ScanForDeviceID

ScanForDeviceID
Checks to see if a device VID/PID string is present and returns the COM port number. Returns 0 if device not found. 
- STRING HWID
Example: "VID_12BF&PID_0101" 
- BYTE Return


Send

Send
Send the Character  
- UINT Char
The Character to send 
- VOID Return


SendByteArray

SendByteArray
Transmits an array of bytes via the UART peripheral 
- BYTE Data
Data to transmit 
- UINT NumBytes
Number of bytes to send from the array 
- VOID Return


SendString

SendString
Transmits a string of bytes via the UART peripheral 
- STRING Data
Data String to transmit 
- VOID Return


Uninit

Uninit
Un-initialize the UART and release the resources 
- VOID Return


Property reference

Properties
Component Enable
A global flag to enable or disable the UART component from producing code. Useful for generating components with multiple communications options. 
Runtime
Console Data
Selects if the console data is automatically generated or not 
Console Columns
Number of characters that can be displayed on a single line of the console. 
Auto Close
Auto close the port on Sim stop event 
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. 
COM Port
Lists all the current available COM port hardware on your PC. 
Refresh Ports
 
Baud Rate
COM port data rate in bits per second