Difference between revisions of "Component: Injector (File) (Test Injectors)"

From Flowcode Help
Jump to navigationJump to search
(Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix Ltd |- | width="20%" style="color:gray;" | Version | 1.0 |- | width="20%" style="color:gray...")
 
Line 16: Line 16:
  
 
==Detailed description==
 
==Detailed description==
 +
 +
  
 
''No detailed description exists yet for this component''
 
''No detailed description exists yet for this component''
  
 
==Examples==
 
==Examples==
 +
 +
  
  
Line 141: Line 145:
 
|-
 
|-
 
| 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-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetConsoleHandle'''
 +
|-
 +
| colspan="2" | Gets the handle to the console allowing data displaying on the panel etc. 
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
Line 221: Line 238:
 
|-
 
|-
 
| colspan="2" |  
 
| colspan="2" |  
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 +
|-
 +
| colspan="2" | Sets up the GSM module. Returns 0 for OK, 255 for no reply and 254 for command fail. 
 +
|-
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SampleAccel'''
 +
|-
 +
| colspan="2" | Samples the accelerometer 0 = no new data, 1 = new data available 
 +
|-
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Left'''
 +
|-
 +
| colspan="2" | Rotates the robot left - waits for the angle to be traversed before returning 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Angle
 +
|-
 +
| colspan="2" | Angle to turn in degrees 
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadIR'''
 +
|-
 +
| colspan="2" | Reads an IR sensor 0=Left, 1=FrontLeft, 2=Front, 3=FrontRight, 4=Right, 5=RearRight,  6=Rear, 7=RearLeft 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | index
 +
|-
 +
| colspan="2" | 0=Left, 1=FrontLeft, 2=Front, 3=FrontRight, 4=Right, 5=RearRight, 6=Rear, 7=RearLeft 
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDDrawPixel'''
 +
|-
 +
| colspan="2" | Allows a single pixel on the LCD to be set or cleared 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | X
 +
|-
 +
| colspan="2" | X Pixel 0-127 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Y
 +
|-
 +
| colspan="2" | Y Pixel 0-31 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | State
 +
|-
 +
| colspan="2" | 0=White (Off), 1=Black (On) 
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ServoSetPosition'''
 +
|-
 +
| colspan="2" | Allows one of the servo positions to be assigned 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Range 0-3 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Position
 +
|-
 +
| colspan="2" | Range 0-255 
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardBitmap'''
 +
|-
 +
| colspan="2" | Displays a monochrome bitmap read from the card on the LCD 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | X
 +
|-
 +
| colspan="2" | Range 0-127 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Y
 +
|-
 +
| colspan="2" | Range 0-31 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | Filename
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardRecordMic'''
 +
|-
 +
| colspan="2" | Records an audio stream on the card from the microphone 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | BitDepth
 +
|-
 +
| colspan="2" | 0=8-bit, 1=16-bit 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | SampleRate
 +
|-
 +
| colspan="2" | Sample Rate 0=8KHz, 1=16KHz 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | RecordTime
 +
|-
 +
| colspan="2" | Time to record for in seconds, Range 0-65535 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | Filename
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardOpen'''
 +
|-
 +
| colspan="2" | Attempts to open an existing file on the SD card 255=Error, 1=File not found, 0=Open OK 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | Filename
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Forwards'''
 +
|-
 +
| colspan="2" | Drives the robot forwards - waits for the distance to be traversed before returning 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Distance
 +
|-
 +
| colspan="2" | Distance in mm 
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadBearing'''
 +
|-
 +
| colspan="2" | Reads the compass bearing based on the degrees clockwise from magnetic north. 
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetConsoleHandle'''
 +
|-
 +
| colspan="2" | Gets the handle to the console allowing data displaying on the panel etc. 
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDDrawLine'''
 +
|-
 +
| colspan="2" | Allows a single pixel width line to be drawn on the LCD 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | X1
 +
|-
 +
| colspan="2" | X Pixel 0-127 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Y1
 +
|-
 +
| colspan="2" | Y Pixel 0-31 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | X2
 +
|-
 +
| colspan="2" | X Pixel 0-127 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Y2
 +
|-
 +
| colspan="2" | Y Pixel 0-31 
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ServoAutoMoveToPosition'''
 +
|-
 +
| colspan="2" | Allows one of the servo positions to move gradually to a new position 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Range 0-3 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Position
 +
|-
 +
| colspan="2" | Range 0-255 
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadAllValue'''
 +
|-
 +
| colspan="2" | Reads a single value stored from the read all command Index dictates which sensor value to read 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Index
 +
|-
 +
| colspan="2" | 0=SW, 1-8=IR, 9-10=Line, 11=Light, 12=Mic, 13-15=Accel 
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDBacklight'''
 +
|-
 +
| colspan="2" | Allows the LCD backlight brighntess to be adjusted 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Intensity
 +
|-
 +
| colspan="2" | Range 0-100, 0=Off, 1=Min Brightness, 100=Max Brightness 
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDDrawRect'''
 +
|-
 +
| colspan="2" | Allows a rectangle to be drawn on the LCD 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | X1
 +
|-
 +
| colspan="2" | X Pixel 0-127 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Y1
 +
|-
 +
| colspan="2" | Y Pixel 0-31 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | X2
 +
|-
 +
| colspan="2" | X Pixel 0-127 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Y2
 +
|-
 +
| colspan="2" | Y Pixel 0-31 
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadLine'''
 +
|-
 +
| colspan="2" | Reads one of the IR line sensors 0-1 0=Left, 1=Right 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | index
 +
|-
 +
| colspan="2" | 0=Left, 1=Right 
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ServoDisable'''
 +
|-
 +
| colspan="2" | Allows one of the servo outputs 0-3 to be disabled 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Range 0-3 
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ServoEnable'''
 +
|-
 +
| colspan="2" | Allows one of the servo outputs 0-3 to be enabled 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Range 0-3 
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardReadByte'''
 +
|-
 +
| colspan="2" | Reads a byte from the currently open file. Starts at the beginning of the file and auto increments to the end 
 +
|-
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardErase'''
 +
|-
 +
| colspan="2" | Attempts to delete an existing file on the SD card 255=Error, 1=File not found, 0=Delete OK 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | Filename
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardWriteByte'''
 +
|-
 +
| colspan="2" | Appends a byte to the end of the currently open file  
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EncoderRead'''
 +
|-
 +
| colspan="2" | Reads one of the motor encoder counters. Approx 0.328296mm of travel per encoder unit. 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | index
 +
|-
 +
| colspan="2" | 0=Left, 1=Right 
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetMotors'''
 +
|-
 +
| colspan="2" | Sets the motor speeds without feedback Range -100 to 100 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:]] -
 +
| width="90%" | Left
 +
|-
 +
| colspan="2" | Range -100 to 100 
 +
|-
 +
| width="10%" align="center" | [[File:]] -
 +
| width="90%" | Right
 +
|-
 +
| colspan="2" | Range -100 to 100 
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Backwards'''
 +
|-
 +
| colspan="2" | Drives the robot backwards - waits for the distance to be traversed before returning 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Distance
 +
|-
 +
| colspan="2" | Distance in mm 
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EncoderReset'''
 +
|-
 +
| colspan="2" | Resets the motor encoder counters 
 +
|-
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDVerbose'''
 +
|-
 +
| colspan="2" | Allows the LCD to automatically report the API commands as they get processed. Default - verbose on 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | State
 +
|-
 +
| colspan="2" | 0=Off 1=On 
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetProp'''
 +
|-
 +
| colspan="2" | Allows the COM port property to be set from a parent component. 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | PropName
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
 +
| width="90%" | PropVal
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardInit'''
 +
|-
 +
| colspan="2" | Attempts to startup the SD card  255=No Card, 254=Init Fail, 0=Init OK 
 +
|-
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetProp'''
 +
|-
 +
| colspan="2" | Allows the property filter for the COM port list to be copied to a parent component. 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | PropName
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDClear'''
 +
|-
 +
| colspan="2" | Clears the LCD 
 +
|-
 
|-
 
|-
 
| 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

Revision as of 10:36, 17 November 2021

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.

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

Downloadable macro reference

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


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


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


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


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


Fc9-comp-macro.png GetConsoleHandle
Gets the handle to the console allowing data displaying on the panel etc. 
[[File:]] - Return


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


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


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


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


Fc9-comp-macro.png Initialise
Sets up the GSM module. Returns 0 for OK, 255 for no reply and 254 for command fail. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SampleAccel
Samples the accelerometer 0 = no new data, 1 = new data available 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Left
Rotates the robot left - waits for the angle to be traversed before returning 
Fc9-u16-icon.png - UINT Angle
Angle to turn in degrees 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ReadIR
Reads an IR sensor 0=Left, 1=FrontLeft, 2=Front, 3=FrontRight, 4=Right, 5=RearRight, 6=Rear, 7=RearLeft 
Fc9-u8-icon.png - BYTE index
0=Left, 1=FrontLeft, 2=Front, 3=FrontRight, 4=Right, 5=RearRight, 6=Rear, 7=RearLeft 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png LCDDrawPixel
Allows a single pixel on the LCD to be set or cleared 
Fc9-u8-icon.png - BYTE X
X Pixel 0-127 
Fc9-u8-icon.png - BYTE Y
Y Pixel 0-31 
Fc9-u8-icon.png - BYTE State
0=White (Off), 1=Black (On) 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ServoSetPosition
Allows one of the servo positions to be assigned 
Fc9-u8-icon.png - BYTE Channel
Range 0-3 
Fc9-u8-icon.png - BYTE Position
Range 0-255 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png CardBitmap
Displays a monochrome bitmap read from the card on the LCD 
Fc9-u8-icon.png - BYTE X
Range 0-127 
Fc9-u8-icon.png - BYTE Y
Range 0-31 
Fc9-string-icon.png - STRING Filename
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png CardRecordMic
Records an audio stream on the card from the microphone 
Fc9-u8-icon.png - BYTE BitDepth
0=8-bit, 1=16-bit 
Fc9-u8-icon.png - BYTE SampleRate
Sample Rate 0=8KHz, 1=16KHz 
Fc9-u16-icon.png - UINT RecordTime
Time to record for in seconds, Range 0-65535 
Fc9-string-icon.png - STRING Filename
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png CardOpen
Attempts to open an existing file on the SD card 255=Error, 1=File not found, 0=Open OK 
Fc9-string-icon.png - STRING Filename
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Forwards
Drives the robot forwards - waits for the distance to be traversed before returning 
Fc9-u16-icon.png - UINT Distance
Distance in mm 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ReadBearing
Reads the compass bearing based on the degrees clockwise from magnetic north. 
[[File:]] - Return


Fc9-comp-macro.png GetConsoleHandle
Gets the handle to the console allowing data displaying on the panel etc. 
[[File:]] - Return


Fc9-comp-macro.png LCDDrawLine
Allows a single pixel width line to be drawn on the LCD 
Fc9-u8-icon.png - BYTE X1
X Pixel 0-127 
Fc9-u8-icon.png - BYTE Y1
Y Pixel 0-31 
Fc9-u8-icon.png - BYTE X2
X Pixel 0-127 
Fc9-u8-icon.png - BYTE Y2
Y Pixel 0-31 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ServoAutoMoveToPosition
Allows one of the servo positions to move gradually to a new position 
Fc9-u8-icon.png - BYTE Channel
Range 0-3 
Fc9-u8-icon.png - BYTE Position
Range 0-255 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ReadAllValue
Reads a single value stored from the read all command Index dictates which sensor value to read 
Fc9-u8-icon.png - BYTE Index
0=SW, 1-8=IR, 9-10=Line, 11=Light, 12=Mic, 13-15=Accel 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png LCDBacklight
Allows the LCD backlight brighntess to be adjusted 
Fc9-u8-icon.png - BYTE Intensity
Range 0-100, 0=Off, 1=Min Brightness, 100=Max Brightness 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png LCDDrawRect
Allows a rectangle to be drawn on the LCD 
Fc9-u8-icon.png - BYTE X1
X Pixel 0-127 
Fc9-u8-icon.png - BYTE Y1
Y Pixel 0-31 
Fc9-u8-icon.png - BYTE X2
X Pixel 0-127 
Fc9-u8-icon.png - BYTE Y2
Y Pixel 0-31 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ReadLine
Reads one of the IR line sensors 0-1 0=Left, 1=Right 
Fc9-u8-icon.png - BYTE index
0=Left, 1=Right 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png ServoDisable
Allows one of the servo outputs 0-3 to be disabled 
Fc9-u8-icon.png - BYTE Channel
Range 0-3 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ServoEnable
Allows one of the servo outputs 0-3 to be enabled 
Fc9-u8-icon.png - BYTE Channel
Range 0-3 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png CardReadByte
Reads a byte from the currently open file. Starts at the beginning of the file and auto increments to the end 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png CardErase
Attempts to delete an existing file on the SD card 255=Error, 1=File not found, 0=Delete OK 
Fc9-string-icon.png - STRING Filename
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png CardWriteByte
Appends a byte to the end of the currently open file  
Fc9-u8-icon.png - BYTE Data
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png EncoderRead
Reads one of the motor encoder counters. Approx 0.328296mm of travel per encoder unit. 
Fc9-u8-icon.png - BYTE index
0=Left, 1=Right 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png SetMotors
Sets the motor speeds without feedback Range -100 to 100 
[[File:]] - Left
Range -100 to 100 
[[File:]] - Right
Range -100 to 100 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Backwards
Drives the robot backwards - waits for the distance to be traversed before returning 
Fc9-u16-icon.png - UINT Distance
Distance in mm 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png EncoderReset
Resets the motor encoder counters 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png LCDVerbose
Allows the LCD to automatically report the API commands as they get processed. Default - verbose on 
Fc9-u8-icon.png - BYTE State
0=Off 1=On 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetProp
Allows the COM port property to be set from a parent component. 
Fc9-string-icon.png - STRING PropName
 
Fc9-u32-icon.png - ULONG PropVal
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png CardInit
Attempts to startup the SD card 255=No Card, 254=Init Fail, 0=Init OK 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png GetProp
Allows the property filter for the COM port list to be copied to a parent component. 
Fc9-string-icon.png - STRING PropName
 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png LCDClear
Clears the LCD 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-7-icon.png Show Console
 
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-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 - " 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png Simulations