Difference between revisions of "Component: Injector (File) (Test Injectors)"
From Flowcode Help
Jump to navigationJump to search(12 intermediate revisions by the same user not shown) | |||
Line 14: | Line 14: | ||
==Injector (File) component== | ==Injector (File) component== | ||
Comms data injector to allow data to be streamed to and from a file during simulation. The component will read data from the incoming file and write data to the outgoing file. | Comms data injector to allow data to be streamed to and from a file during simulation. The component will read data from the incoming file and write data to the outgoing file. | ||
+ | |||
+ | ==Component Source Code== | ||
+ | |||
+ | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_InjectorFile.fcfx FC_Comp_Source_InjectorFile.fcfx] | ||
+ | |||
+ | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_InjectorFile.fcfx FC_Comp_Source_InjectorFile.fcfx] | ||
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
Line 26: | Line 50: | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
Line 40: | Line 82: | ||
[[File:FileWrite.jpg]] | [[File:FileWrite.jpg]] | ||
− | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==Macro reference== | ||
+ | |||
+ | ===SPIInitialise=== | ||
{| 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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SPIInitialise''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Initialsie the SPI module ready for communications |
|- | |- | ||
|- | |- | ||
Line 54: | Line 107: | ||
|- | |- | ||
| colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1 | | colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1 | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| 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 75: | Line 113: | ||
+ | ===SPIPrescaler=== | ||
{| 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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SPIPrescaler''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Modify the speed of the SPI bus |
|- | |- | ||
|- | |- | ||
Line 86: | Line 125: | ||
| width="90%" | Channel | | width="90%" | Channel | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1 |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Prescaler |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Range: 0-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 | ||
Line 98: | Line 137: | ||
+ | ===SPITransfer=== | ||
{| 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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SPITransfer''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Transfer a byte using the SPI bus |
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" | Channel | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | DataOut | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
Line 116: | Line 161: | ||
+ | ===SPITransferTrans=== | ||
{| 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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SPITransferTrans''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Transfer an array of bytes using the SPI bus |
|- | |- | ||
|- | |- | ||
Line 127: | Line 173: | ||
| width="90%" | Channel | | width="90%" | Channel | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1 |
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Count | ||
+ | |- | ||
+ | | colspan="2" | Number of bytes to send and receive | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | DataOut | ||
+ | |- | ||
+ | | colspan="2" | Outgoing data | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | DataIn | ||
+ | |- | ||
+ | | colspan="2" | Incoming data | ||
|- | |- | ||
| 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 134: | Line 195: | ||
+ | ===UARTBaud=== | ||
{| 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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTBaud''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | |
|- | |- | ||
|- | |- | ||
Line 145: | Line 207: | ||
| width="90%" | Channel | | width="90%" | Channel | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Rate |
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | 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'' | ||
|} | |} | ||
+ | ===UARTCheckRX=== | ||
{| 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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTCheckRX''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
|- | |- | ||
Line 181: | Line 231: | ||
| width="90%" | Channel | | width="90%" | Channel | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | |
|- | |- | ||
− | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | |
− | |||
− | |||
− | |||
− | |||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===UARTInitialise=== | ||
{| 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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTInitialise''' |
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
Line 206: | Line 252: | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | 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'' | ||
|} | |} | ||
+ | ===UARTReceive=== | ||
{| 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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTReceive''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | |
|- | |- | ||
|- | |- | ||
Line 222: | Line 269: | ||
| width="90%" | Channel | | width="90%" | Channel | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | |
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | 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'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===UARTSend=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 250: | Line 298: | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
− | |||
− | |||
Line 266: | Line 312: | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Incoming File Settings (Rx) | ||
+ | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-13-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-13-icon.png]] | ||
Line 291: | Line 341: | ||
|- | |- | ||
| colspan="2" | A file populated with data from an injector may have a timestamp built in which we may not want to receive. Yes: Skip first 22 characters of each line of data so we don't receive any of the timestamp info. No: Read data normally. | | colspan="2" | A file populated with data from an injector may have a timestamp built in which we may not want to receive. Yes: Skip first 22 characters of each line of data so we don't receive any of the timestamp info. No: Read data normally. | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Outgoing File Settings (Tx) | ||
+ | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-13-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-13-icon.png]] | ||
Line 316: | Line 370: | ||
|- | |- | ||
| colspan="2" | Appends a timestamp to the beginning of every line relating to the time the first byte in the line was received. Based on the PC system time. Timestamp in the format "YY/MM/DD - HH:MM:SS - " | | colspan="2" | Appends a timestamp to the beginning of every line relating to the time the first byte in the line was received. Based on the PC system time. Timestamp in the format "YY/MM/DD - HH:MM:SS - " | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} |
Latest revision as of 13:11, 7 February 2023
Author | Matrix Ltd |
Version | 1.0 |
Category | Test Injectors |
Contents
Injector (File) component
Comms data injector to allow data to be streamed to and from a file during simulation. The component will read data from the incoming file and write data to the outgoing file.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_InjectorFile.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_InjectorFile.fcfx
Detailed description
No detailed description exists yet for this component
Examples
Example to log the bytes sent via the UART RS232 component to a file as comma separated decimal numbers.
LogToFile
Contents of the file in the Flowcode project directory after running the simulation.
Macro reference
SPIInitialise
![]() |
SPIInitialise |
Initialsie the SPI module ready for communications | |
![]() |
Channel |
Channel Index: Range 0 - SPI Bus Count - 1 | |
![]() |
Return |
SPIPrescaler
![]() |
SPIPrescaler |
Modify the speed of the SPI bus | |
![]() |
Channel |
Channel Index: Range 0 - SPI Bus Count - 1 | |
![]() |
Prescaler |
Range: 0-2 | |
![]() |
Return |
SPITransfer
![]() |
SPITransfer |
Transfer a byte using the SPI bus | |
![]() |
Channel |
Channel Index: Range 0 - SPI Bus Count - 1 | |
![]() |
DataOut |
![]() |
Return |
SPITransferTrans
UARTBaud
![]() |
UARTBaud |
![]() |
Channel |
![]() |
Rate |
![]() |
Return |
UARTCheckRX
![]() |
UARTCheckRX |
![]() |
Channel |
![]() |
Return |
UARTInitialise
![]() |
UARTInitialise |
![]() |
Channel |
![]() |
Return |
UARTReceive
![]() |
UARTReceive |
![]() |
Channel |
![]() |
Return |
UARTSend
![]() |
UARTSend |
![]() |
Channel |
![]() |
Data |
![]() |
Return |