Jump to content

Component: Injector (Flowcode vNet) (Test Injectors): Difference between revisions

From Flowcode Help
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..."
 
No edit summary
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 149: Line 153:
|-
|-
| 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
| 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 247: Line 264:
|-
|-
| 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 (Flowcode vNet) component

Comms data injector to allow components to talk to each other between instances of Flowcode. The injector allows the data to be sent and received between multiple instances of Flowcode either running on a single machine, across a network or via the internet.

Detailed description

No detailed description exists yet for this component

Examples

Simple Single Instance

Sends out data and prints incoming data to an LCD. Uses the same port number for transmit and receive.

SingleInstanceVnet


Simple Multi Instance

The first program sends out data.

UartVnetDemoTx


The second program receives the data and prints to an LCD.

UartVnetDemoRx


Remote Lock

Here is an example of using the vNet injector to simulate a multi microcontroller system.

Microcontroller 1 is connected to a keypad and has a RS232 communications connection.

Microcontroller 2 is connected to a solenoid and has a RS232 communications connection.

Any key presses detected on microcontroller 1 will be sent via RS232 to microcontroller 2. If the correct byte sequence (1234) is received by microcontroller 2 then the solenoid is fired to unlock a door for 5 seconds.

vNet Example Node 1

vNet Example Node 2

Communications over the vNet injector can be monitored using the console.


Modbus Master and Slave example using vNet

Example of communicating using Modbus Master and Slave using two instances of Flowcode and the vNet injector component.

ModbusMasterDemo

ModBusSlaveDemo


Downloadable macro reference

UARTBaud
 
- BYTE Channel
 
- BYTE Rate
 
- VOID Return


IOGetInputPin
 
- BYTE Pin
 
[[File:]] - Return


UARTCheckRX
 
- BYTE Channel
 
- BYTE Return


UARTInitialise
 
- BYTE Channel
 
- VOID Return


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


UARTReceive
 
- BYTE Channel
 
- BYTE Return


IOSetOutputPin
 
- BYTE Pin
 
[[File:]] - State
 
- VOID Return


UARTSend
 
- BYTE Channel
 
- BYTE Data
 
- VOID Return


Initialise
Sets up the injector ready to receive commands or send data 
- VOID Return


UARTSend
 
- BYTE Channel
 
- BYTE Data
 
- VOID Return


Initialise
Sets up the GSM module. Returns 0 for OK, 255 for no reply and 254 for command fail. 
- BYTE Return


SampleAccel
Samples the accelerometer 0 = no new data, 1 = new data available 
- BYTE Return


Left
Rotates the robot left - waits for the angle to be traversed before returning 
- UINT Angle
Angle to turn in degrees 
- VOID Return


ReadIR
Reads an IR sensor 0=Left, 1=FrontLeft, 2=Front, 3=FrontRight, 4=Right, 5=RearRight, 6=Rear, 7=RearLeft 
- BYTE index
0=Left, 1=FrontLeft, 2=Front, 3=FrontRight, 4=Right, 5=RearRight, 6=Rear, 7=RearLeft 
- UINT Return


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


ServoSetPosition
Allows one of the servo positions to be assigned 
- BYTE Channel
Range 0-3 
- BYTE Position
Range 0-255 
- VOID Return


CardBitmap
Displays a monochrome bitmap read from the card on the LCD 
- BYTE X
Range 0-127 
- BYTE Y
Range 0-31 
- STRING Filename
 
- BYTE Return


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


CardOpen
Attempts to open an existing file on the SD card 255=Error, 1=File not found, 0=Open OK 
- STRING Filename
 
- BYTE Return


Forwards
Drives the robot forwards - waits for the distance to be traversed before returning 
- UINT Distance
Distance in mm 
- VOID Return


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


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


LCDDrawLine
Allows a single pixel width line to be drawn on the LCD 
- BYTE X1
X Pixel 0-127 
- BYTE Y1
Y Pixel 0-31 
- BYTE X2
X Pixel 0-127 
- BYTE Y2
Y Pixel 0-31 
- VOID Return


ServoAutoMoveToPosition
Allows one of the servo positions to move gradually to a new position 
- BYTE Channel
Range 0-3 
- BYTE Position
Range 0-255 
- VOID Return


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


LCDBacklight
Allows the LCD backlight brighntess to be adjusted 
- BYTE Intensity
Range 0-100, 0=Off, 1=Min Brightness, 100=Max Brightness 
- VOID Return


LCDDrawRect
Allows a rectangle to be drawn on the LCD 
- BYTE X1
X Pixel 0-127 
- BYTE Y1
Y Pixel 0-31 
- BYTE X2
X Pixel 0-127 
- BYTE Y2
Y Pixel 0-31 
- VOID Return


ReadLine
Reads one of the IR line sensors 0-1 0=Left, 1=Right 
- BYTE index
0=Left, 1=Right 
- UINT Return


ServoDisable
Allows one of the servo outputs 0-3 to be disabled 
- BYTE Channel
Range 0-3 
- VOID Return


ServoEnable
Allows one of the servo outputs 0-3 to be enabled 
- BYTE Channel
Range 0-3 
- VOID Return


CardReadByte
Reads a byte from the currently open file. Starts at the beginning of the file and auto increments to the end 
- BYTE Return


CardErase
Attempts to delete an existing file on the SD card 255=Error, 1=File not found, 0=Delete OK 
- STRING Filename
 
- BYTE Return


CardWriteByte
Appends a byte to the end of the currently open file  
- BYTE Data
 
- VOID Return


EncoderRead
Reads one of the motor encoder counters. Approx 0.328296mm of travel per encoder unit. 
- BYTE index
0=Left, 1=Right 
- UINT Return


SetMotors
Sets the motor speeds without feedback Range -100 to 100 
[[File:]] - Left
Range -100 to 100 
[[File:]] - Right
Range -100 to 100 
- VOID Return


Backwards
Drives the robot backwards - waits for the distance to be traversed before returning 
- UINT Distance
Distance in mm 
- VOID Return


EncoderReset
Resets the motor encoder counters 
- VOID Return


LCDVerbose
Allows the LCD to automatically report the API commands as they get processed. Default - verbose on 
- BYTE State
0=Off 1=On 
- VOID Return


SetProp
Allows the COM port property to be set from a parent component. 
- STRING PropName
 
- ULONG PropVal
 
- VOID Return


CardInit
Attempts to startup the SD card 255=No Card, 254=Init Fail, 0=Init OK 
- BYTE Return


GetProp
Allows the property filter for the COM port list to be copied to a parent component. 
- STRING PropName
 
- STRING Return


LCDClear
Clears the LCD 
- VOID Return



Property reference

Properties
Network Interface
Allows different network interfaces to be selected. The current network interface can be determined by looking at the My IP properties. 
Incoming Channel
TCP Channel Instance, allows multiple servers and clients to run on the same machine or inside the same simulation. 
Incoming Port
Port used for incoming communications. 80=HTTP Ports have to match up to allow communications to be sent and received. 
Outgoing Channel
TCP Channel Instance, allows multiple servers and clients to run on the same machine or inside the same simulation. 
Outgoing Port
Port used for outgoing communications. 80=HTTP Ports have to match up to allow communications to be sent and received. 
Connection Mode
Specified if this Vnet node is going to connect to another instance of Flowcode running on this PC or a networked PC.  
Circular Buffer Size
Size of the circular buffers used to temporarily store the incoming and outgoing data. 
Remote IP0
Remotel IP address to connect to byte 0 
Remote IP1
Remotel IP address to connect to byte 1 
Remote IP2
Remotel IP address to connect to byte 2 
Remote IP3
Remotel IP address to connect to byte 3 
My IP0
Local IP address byte 0 
My IP1
Local IP address byte 1 
My IP2
Local IP address byte 2 
My IP3
Local IP address byte 3 
Connections
Simulations
Show Console