Component: Injector (File) (Test Injectors)

From Flowcode Help
Jump to navigationJump to search
Author Matrix Ltd
Version 1.0
Category Test Injectors


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. FC6 Icon.png LogToFile Contents of the file in the Flowcode project directory after running the simulation.

FileWrite.jpg






Macro reference

SPIInitialise

Fc9-comp-macro.png SPIInitialise
Initialsie the SPI module ready for communications 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - SPI Bus Count - 1 
Fc9-void-icon.png - VOID Return


SPIPrescaler

Fc9-comp-macro.png SPIPrescaler
Modify the speed of the SPI bus 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - SPI Bus Count - 1 
Fc9-u8-icon.png - BYTE Prescaler
Range: 0-2 
Fc9-void-icon.png - VOID Return


SPITransfer

Fc9-comp-macro.png SPITransfer
Transfer a byte using the SPI bus 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - SPI Bus Count - 1 
Fc9-u8-icon.png - BYTE DataOut
 
Fc9-u8-icon.png - BYTE Return


SPITransferTrans

Fc9-comp-macro.png SPITransferTrans
Transfer an array of bytes using the SPI bus 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - SPI Bus Count - 1 
Fc9-u16-icon.png - UINT Count
Number of bytes to send and receive 
Fc9-u8-icon.png - BYTE DataOut
Outgoing data 
Fc9-u8-icon.png - BYTE DataIn
Incoming data 
Fc9-void-icon.png - VOID Return


UARTBaud

Fc9-comp-macro.png UARTBaud
 
Fc9-u8-icon.png - BYTE Channel
 
Fc9-u8-icon.png - BYTE Rate
 
Fc9-void-icon.png - VOID Return


UARTCheckRX

Fc9-comp-macro.png UARTCheckRX
 
Fc9-u8-icon.png - BYTE Channel
 
Fc9-u8-icon.png - BYTE Return


UARTInitialise

Fc9-comp-macro.png UARTInitialise
 
Fc9-u8-icon.png - BYTE Channel
 
Fc9-void-icon.png - VOID Return


UARTReceive

Fc9-comp-macro.png UARTReceive
 
Fc9-u8-icon.png - BYTE Channel
 
Fc9-u8-icon.png - BYTE Return


UARTSend

Fc9-comp-macro.png UARTSend
 
Fc9-u8-icon.png - BYTE Channel
 
Fc9-u8-icon.png - BYTE Data
 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-type-7-icon.png Show Console
 
Fc9-conn-icon.png Incoming File Settings (Rx)
Fc9-type-13-icon.png Incoming File
File to stream incoming data from. File -> Communications component. 
Fc9-type-16-icon.png Parse Mode
Specifies the way we read in the data from the file. Detailed Byte : "z - 122 - 0x7a" Raw : "z" CSV Decimal : "122, " CSV Hex : "0x7a, " 
Fc9-type-16-icon.png Display Mode
Specifies the way we show the data on the console. Detailed Byte : "z - 122 - 0x7a" Raw : "z" CSV Decimal : "122, " CSV Hex : "0x7a, " 
Fc9-type-21-icon.png Values Per Line
Number of values to display on a single line of the data console. 0 = Infinite number of characters 
Fc9-type-7-icon.png Skip Timestamp
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. 
Fc9-conn-icon.png Outgoing File Settings (Tx)
Fc9-type-13-icon.png Outgoing File
File to store outgoing data. Communications component -> File 
Fc9-type-7-icon.png Clear On Init
No - Append to the end of the file. Yes - Empty file on initialise and start from the beginning of the file. 
Fc9-type-16-icon.png Data Mode
Specifies how the data is represented in the outgoing file. Detailed Byte : "z - 122 - 0x7a" Raw : "z" CSV Decimal : "122, " CSV Hex : "0x7a, " 
Fc9-type-21-icon.png Values Per Line
Number of values to display on a single line, applies to the file and data console. 0 = Infinite number of characters 
Fc9-type-7-icon.png Append Timestamp
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 - "