Difference between revisions of "Component: Injector (File) (Test Injectors)"
From Flowcode Help
Jump to navigationJump to search| Line 15: | Line 15: | ||
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 | + | ==Component Source Code== |
| − | + | Please click here for the component source code: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_InjectorFile.fcfx FC_Comp_Source_InjectorFile.fcfx] | |
==Detailed description== | ==Detailed description== | ||
| + | |||
| + | |||
| Line 34: | Line 36: | ||
==Examples== | ==Examples== | ||
| + | |||
| + | |||
| Line 278: | Line 282: | ||
|- | |- | ||
| 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 303: | Line 311: | ||
|- | |- | ||
| 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 328: | Line 340: | ||
|- | |- | ||
| 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 - " | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
|} | |} | ||
Revision as of 17:47, 9 November 2022
| 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 for the component source code: 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.
Downloadable macro reference
| UARTBaud | |
| Channel | |
| Rate | |
| Return | |
| UARTCheckRX | |
| Channel | |
| Return | |
| UARTInitialise | |
| Channel | |
| Return | |
| SPITransfer | |
| Transfer a byte using the SPI bus | |
| Channel | |
| Channel Index: Range 0 - SPI Bus Count - 1 | |
| DataOut | |
| Return | |
| GetConsoleHandle | |
| Gets the handle to the console allowing data displaying on the panel etc. | |
| Return | |
| SPIPrescaler | |
| Modify the speed of the SPI bus | |
| Channel | |
| Channel Index: Range 0 - SPI Bus Count - 1 | |
| Prescaler | |
| Range: 0-2 | |
| Return | |
| UARTReceive | |
| Channel | |
| Return | |
| SPIInitialise | |
| Initialsie the SPI module ready for communications | |
| Channel | |
| Channel Index: Range 0 - SPI Bus Count - 1 | |
| Return | |
| UARTSend | |
| Channel | |
| Data | |
| Return | |
