Jump to content

Component: MIAC USB Slave API (PIC) (AllCode): Difference between revisions

From Flowcode Help
No edit summary
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead""
 
(18 intermediate revisions by 2 users not shown)
Line 14: Line 14:
==MIAC USB Slave API (PIC) component==
==MIAC USB Slave API (PIC) component==
Allows Matrix's MIAC PLC  to be used as a PC peripheral controlled by Flowcode via a USB connection. Requires that the MIAC (PIC) has the USB Slave firmware downloaded to it.
Allows Matrix's MIAC PLC  to be used as a PC peripheral controlled by Flowcode via a USB connection. Requires that the MIAC (PIC) has the USB Slave firmware downloaded to it.
==Component Source Code==
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_MIAC_Slave.fcsx FC_Comp_Source_MIAC_Slave.fcsx]
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_MIAC_Slave.fcsx FC_Comp_Source_MIAC_Slave.fcsx]


==Detailed description==
==Detailed description==




Line 22: Line 48:


==Examples==
==Examples==




Line 242: Line 288:




==Downloadable macro reference==


{| 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;" | '''LCDPrintString'''
|-
| colspan="2" | Prints a string to the LCD on the MIAC. 
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Str
|-
| 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;" | '''GetRegisterValue'''
|-
| colspan="2" | Gets the value of the register specified on the MIAC 
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | RegAddress
|-
| 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;" | '''GetAnalogueInput'''
|-
| colspan="2" | Returns the value for a specific analogue input on the MIAC slave. 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Input
|-
| 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;" | '''LCDPrintNumber'''
|-
| colspan="2" | Prints out a number to the display on the MIAC. 
|-
|-
| width="10%" align="center" | [[File:]] -
| width="90%" | Number
|-
| 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;" | '''CANTx'''
|-
| colspan="2" | Sends the Tx data with the ID specified in the form of a CAN message 
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | CANID
|-
| 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;" | '''GetKeypadBuffer'''
|-
| colspan="2" | Returns a keypress from the keypress buffer, returns 255 if no keypress is 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;" | '''SetRegisterValue'''
|-
| colspan="2" | Sets the value of the register specified on the MIAC 
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | RegAddress
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Value
|-
| 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;" | '''PWMSetPeriod'''
|-
| colspan="2" | Sets the PWM period for the channel specified 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Prescaler
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Period
|-
| 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;" | '''PWMOvercurrentCheck'''
|-
| colspan="2" | Checks the PWM outputs  to see if they are overcurrent 
|-
|-
| 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''
|}


==Macro reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===CANCheckRx===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetEEPROMData'''
| width="90%" class="mtx-class-macrohead" | '''CANCheckRx'''
|-
|-
| colspan="2" | Reads a byte from the EEPROM data memory 
| colspan="2" | Checks to see if a CAN message has been received, if so the ID is returned 
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Address
|-
| 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''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===CANGetRxData===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMControl'''
| width="90%" class="mtx-class-macrohead" | '''CANGetRxData'''
|-
|-
| colspan="2" | Sets the PWM channel specified to be enabled or disabled 
| colspan="2" | Collects the data from the last received CAN message 
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Channel
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Enable
|-
| 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''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===CANSetTxData===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CANSetTxData'''
| width="90%" class="mtx-class-macrohead" | '''CANSetTxData'''
|-
|-
| colspan="2" | Sets the LCD cursor position on the MIAC 
| colspan="2" | Sets the LCD cursor position on the MIAC 
Line 505: Line 389:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===CANTx===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetDigitalInputs'''
| width="90%" class="mtx-class-macrohead" | '''CANTx'''
|-
|-
| colspan="2" | Returns the value for a all 8 digital inputs on the MIAC slave. 
| colspan="2" | Sends the Tx data with the ID specified in the form of a CAN message 
|-
|-
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" | CANID
|}
 
 
{| 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;" | '''SetEEPROMData'''
|-
| colspan="2" | Writes a byte to the EEPROM data memory 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Address
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Data
|-
|-
| colspan="2" |  
| colspan="2" |  
Line 541: Line 408:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===ClearKeypadBuffer===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CANGetRxData'''
| width="90%" class="mtx-class-macrohead" | '''ClearKeypadBuffer'''
|-
|-
| colspan="2" | Collects the data from the last received CAN message 
| colspan="2" | Destroys the contents of the keypad buffer. 
|-
|-
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| 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''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===GetAnalogueInput===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMSetDuty'''
| width="90%" class="mtx-class-macrohead" | '''GetAnalogueInput'''
|-
|-
| colspan="2" | Sets the duty cycle for the PWM channel specified 
| colspan="2" | Returns the value for a specific analogue input on the MIAC slave. 
|-
|-
|-
|-
| 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%" | Input
|-
|-
| colspan="2" |  
| colspan="2" |  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Duty
|-
| 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''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===GetDigitalInput===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetOutputBank'''
| width="90%" class="mtx-class-macrohead" | '''GetDigitalInput'''
|-
|-
| colspan="2" | Controls the state of one of the transistor outputs on the MIAC slave. 
| colspan="2" | Returns the value for a specific digital input on the MIAC slave. 
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Mask
| width="90%" | Input
|-
|-
| colspan="2" |  
| colspan="2" |  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Output_States
|-
| 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''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===GetDigitalInputs===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTransistorOutput'''
| width="90%" class="mtx-class-macrohead" | '''GetDigitalInputs'''
|-
|-
| colspan="2" | Controls the state of one of the transistor outputs on the MIAC slave. 
| colspan="2" | Returns the value for a all 8 digital inputs on the MIAC slave. 
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Transistor
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | State
|-
| 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''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===GetEEPROMData===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetDigitalInput'''
| width="90%" class="mtx-class-macrohead" | '''GetEEPROMData'''
|-
|-
| colspan="2" | Returns the value for a specific digital input on the MIAC slave. 
| colspan="2" | Reads a byte from the EEPROM data memory 
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Input
| width="90%" | Address
|-
|-
| colspan="2" |  
| colspan="2" |  
Line 641: Line 493:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===GetKeypadBuffer===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ClearKeypadBuffer'''
| width="90%" class="mtx-class-macrohead" | '''GetKeypadBuffer'''
|-
|-
| colspan="2" | Destroys the contents of the keypad buffer. 
| colspan="2" | Returns a keypress from the keypress buffer, returns 255 if no keypress is available. 
|-
|-
|-
|-
| 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-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===GetRegisterValue===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDSetCursor'''
| width="90%" class="mtx-class-macrohead" | '''GetRegisterValue'''
|-
|-
| colspan="2" | Sets the LCD cursor position on the MIAC 
| colspan="2" | Gets the value of the register specified on the MIAC 
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | x
| width="90%" | RegAddress
|-
|-
| colspan="2" |  
| colspan="2" |  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | y
|-
| 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''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===LCDClear===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CANCheckRx'''
| width="90%" class="mtx-class-macrohead" | '''LCDClear'''
|-
|-
| colspan="2" | Checks to see if a CAN message has been received, if so the ID is returned 
| colspan="2" | Clears the LCD display on the MIAC.  
|-
|-
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| 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''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===LCDPrintNumber===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDClear'''
| width="90%" class="mtx-class-macrohead" | '''LCDPrintNumber'''
|-
|-
| colspan="2" | Clears the LCD display on the MIAC.  
| colspan="2" | Prints out a number to the display on the MIAC. 
|-
|-
| width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT
| width="90%" | Number
|-
|-
| colspan="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 703: Line 559:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===LCDPrintString===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetRelayOutput'''
| width="90%" class="mtx-class-macrohead" | '''LCDPrintString'''
|-
|-
| colspan="2" | Controls the state of one of the Relay outputs on the MIAC slave. 
| colspan="2" | Prints a string to the LCD on the MIAC. 
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Relay
| width="90%" | Str
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | State
|-
|-
| colspan="2" |  
| colspan="2" |  
Line 726: Line 578:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===LCDSetCursor===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''LCDSetCursor'''
|-
| colspan="2" | Sets the LCD cursor position on the MIAC 
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CommsBaud'''
|-
|-
| colspan="2" | Sets the Baud rate of the alt communications channel 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | x
|-
|-
| colspan="2" |  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Baud
| width="90%" | y
|-
|-
| colspan="2" | Range: 0-7 : 0=1200 / 7=115200 
| colspan="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 744: Line 602:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===PWMControl===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDOptions'''
| width="90%" class="mtx-class-macrohead" | '''PWMControl'''
|-
|-
| colspan="2" | Controls some of the LCD options 
| colspan="2" | Sets the PWM channel specified to be enabled or disabled 
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Foreground
| width="90%" | Channel
|-
|-
| colspan="2" | Range: 0-1 
| colspan="2" |  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Background
| width="90%" | Enable
|-
|-
| colspan="2" | Range: 0-1 
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Transparent
|-
| colspan="2" | Range: 0-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 772: Line 626:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===PWMOvercurrentCheck===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDVerbose'''
| width="90%" class="mtx-class-macrohead" | '''PWMOvercurrentCheck'''
|-
|-
| colspan="2" | Controls the Verbose mode. When enabled the LCD automatically displays an account of the incoming API commands and parameters. When switched off the LCD is free for the user to control as required. 
| colspan="2" | Checks the PWM outputs to see if they are overcurrent 
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Mode
|-
| colspan="2" | Range: 0-1 : 0=Off or User Mode / 1=API Verbose Mode 
|-
| 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''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===PWMSetDuty===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadDigitalInput'''
| width="90%" class="mtx-class-macrohead" | '''PWMSetDuty'''
|-
|-
| colspan="2" | Reads a single digital input. 
| colspan="2" | Sets the duty cycle for the PWM channel specified 
|-
|-
|-
|-
Line 803: Line 654:
| colspan="2" |  
| colspan="2" |  
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Duty
|-
| 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''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===PWMSetPeriod===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMConfig'''
| width="90%" class="mtx-class-macrohead" | '''PWMSetPeriod'''
|-
|-
| colspan="2" | Sets the PWM configuration. Channel = 0 - 1 : 0 = EN_AB, A, B / 1 = EN_CD, C, D Period = 0 - 65535 Scaler = 0 - 3 :  0=1:1 1=1:8 2=1:64 3=1:256 
| colspan="2" | Sets the PWM period for the channel specified 
|-
|-
|-
|-
| 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%" | Prescaler
|-
|-
| colspan="2" | Range 0-1 
| colspan="2" |  
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Period
| width="90%" | Period
|-
|-
| colspan="2" | Range: 0-65535 
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Scaler
|-
| colspan="2" | Range: 0-3 
|-
|-
| 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 836: Line 688:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SetEEPROMData===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''SetEEPROMData'''
|-
| colspan="2" | Writes a byte to the EEPROM data memory 
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMEnable'''
|-
|-
| colspan="2" | Allows pulse width modulated transistor outputs to be switched on or off. Bit 0 = Enable AB Bit 1 = A / Bit 2 = B Bit 3 = C / Bit 4 = D Bit 5 = Enable CD 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Address
|-
|-
| colspan="2" |  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | EnableMask
| width="90%" | Data
|-
|-
| colspan="2" | Range 0-63 or 0b00000 to 0b111111 
| colspan="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 854: Line 712:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SetOutputBank===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMDuty'''
| width="90%" class="mtx-class-macrohead" | '''SetOutputBank'''
|-
|-
| colspan="2" | Sets a single PWM channel duty. Channel = 0 - 5 : 0=EN_AB, 1=A, 2=B, 3=C, 4=D, 5=EN_CD Duty = 0 - 65535 
| colspan="2" | Controls the state of one of the transistor outputs on the MIAC slave. 
|-
|-
|-
|-
| 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%" | Mask
|-
|-
| colspan="2" | Range 0-5 
| colspan="2" |  
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Duty
| width="90%" | Output_States
|-
|-
| colspan="2" |  
| colspan="2" |  
Line 877: Line 736:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SetRegisterValue===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDCursor'''
| width="90%" class="mtx-class-macrohead" | '''SetRegisterValue'''
|-
|-
| colspan="2" | Sets the cursor position for the MIAC display 
| colspan="2" | Sets the value of the register specified on the MIAC 
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | X
| width="90%" | RegAddress
|-
|-
| colspan="2" | Range: 0-21 
| colspan="2" |  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Y
| width="90%" | Value
|-
|-
| colspan="2" | Range: 0-4 
| colspan="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 900: Line 760:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SetRelayOutput===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteTran'''
| width="90%" class="mtx-class-macrohead" | '''SetRelayOutput'''
|-
|-
| colspan="2" | Allows a single transistor output to be switched on or off. 
| colspan="2" | Controls the state of one of the Relay outputs on the MIAC slave. 
|-
|-
|-
|-
| 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%" | Relay
|-
|-
| colspan="2" | Range 1-4 
| colspan="2" |  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Value
| width="90%" | State
|-
|-
| colspan="2" | 0 = Off, 1 = On 
| colspan="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 923: Line 784:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SetTransistorOutput===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDClear'''
| width="90%" class="mtx-class-macrohead" | '''SetTransistorOutput'''
|-
|-
| colspan="2" | Clears the MIAC display 
| colspan="2" | Controls the state of one of the transistor outputs on the MIAC slave. 
|-
|-
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" | Transistor
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| colspan="2" |  
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDClear'''
|-
|-
| colspan="2" | Clears the LCD 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | State
|-
|-
| colspan="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
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




==Property reference==
==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-
Line 963: Line 820:
|-
|-
| colspan="2" | USB Slave Instance, if empty then is the MIAC slave firmware loaded, Is the MIAC slave driver installed, Is the MIAC connected and powered. 
| colspan="2" | USB Slave Instance, if empty then is the MIAC slave firmware loaded, Is the MIAC slave driver installed, Is the MIAC connected and powered. 
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
|-
|}
|}

Latest revision as of 14:23, 13 July 2026

Author Matrix Ltd
Version 1.1
Category AllCode


MIAC USB Slave API (PIC) component

Allows Matrix's MIAC PLC to be used as a PC peripheral controlled by Flowcode via a USB connection. Requires that the MIAC (PIC) has the USB Slave firmware downloaded to it.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_MIAC_Slave.fcsx

Please click here to view the component source code (Beta): FC_Comp_Source_MIAC_Slave.fcsx

Detailed description

No detailed description exists yet for this component

Examples

Firmware & USB Driver

The MIAC needs programming with the USB Slave firmware to function correctly with the MIAC USB Slave component.

Use the MIACprog tool to download the firmware .hex file to the MIAC.

File:MIAC USB Slave Firmware.zip


The MIAC USB Slave USB driver will need to be installed before Windows will correctly recognise the device and allow Flowcode to communicate correctly.


Controlled Using Flowcode

Here is a simple Flowcode program to toggle one of the transistor outputs on the MIAC USB Slave device. Remember to connect a linking wire between the (M) screw terminal to the (V+) screw terminal to allow the Transistor LEDs to light. MIAC USB Slave Here is an example of the high level MIAC USB Slave console.


Here is an example of the low level MIAC USB Slave console.


If the MIAC USB Slave component can see the MIAC USB Slave then you will able to select the instance via the Instance property.


Multiple MIAC USB slaves can be connected to a single PC and controlled by adding multiple MIAC USB Slave components each referring to their own instance of the hardware.


Controlled Using VB6 / VB2008

Files taken from the Locktronics Industrial sensor, actuator and control applications solution

File:VB Examples.zip


Controlled Using Labview

Files taken from the Locktronics Industrial sensor, actuator and control applications solution

File:Labview Examples.zip


Command Table

Command Number Description Parameters Returns
1 Digital Input Channel (1-8) Input State (0-1)
2 Digital Multi Input N/A Input State 8-bit (0-255)
3 Analogue Input Channel (1-8) Input ADC Reading (0-255)
4 Read Keypad Buffer N/A Key Press (0-8 or 255)
5 Clear Keypad Buffer N/A N/A
6 Relay Control Channel (1-4)

Relay State (0-1)

N/A
7 Transistor Control Channel (1-4)

Transistor State (0-1)

N/A
8 Multi Output Control Output Value (0-255)

Output Mask (0-255)

N/A
9 Display Clear N/A N/A
10 Display Cursor Position X Coord (0-15)

Y Coord (0-3)

N/A
11 Display Number Number Low Byte (0-255)

Number High Byte (0-255)

N/A
12 Display String String Data N/A
13 PWM Enable Control PWM Channel (1-2)

Enabled (0-1)

N/A
14 PWM Duty Control PWM Channel (1-2)

Duty (0-255)

N/A
15 PWM Period Control Prescaler (0-2) N/A
16 PWM Overcurrent Check N/A Overcurrent State (0-1)
17 EEPROM Write Address (0-255)

Data (0-255)

N/A
18 EEPROM Read Address (0-255) Data (0-255)
19 CAN Set Data Num Bytes (0-8)

Data0 (0-255) Data1 (0-255) Data2 (0-255) Data3 (0-255)

Data4 (0-255) Data5 (0-255) Data6 (0-255) Data7 (0-255)

N/A
20 CAN Send Message ID Low Byte (0-255)

ID High Byte (0-7)

N/A
21 CAN Check Incoming N/A ID High

ID Low

22 CAN Get RX Data N/A Num Bytes (0-8)

Data0 (0-255) Data1 (0-255) Data2 (0-255) Data3 (0-255)

Data4 (0-255) Data5 (0-255) Data6 (0-255) Data7 (0-255)

23 Register Read Address Low Byte (0-255)

Address High Byte (0-255)

Register Data Byte (0-255)
24 Register Write Address Low Byte (0-255)

Address High Byte (0-255) Register Data Byte (0-255)

N/A

Component Source

The component source code is available here.

MIAC PIC Slave Component








Macro reference

CANCheckRx

CANCheckRx
Checks to see if a CAN message has been received, if so the ID is returned 
- UINT Return


CANGetRxData

CANGetRxData
Collects the data from the last received CAN message 
- STRING Return


CANSetTxData

CANSetTxData
Sets the LCD cursor position on the MIAC 
- BYTE DataCount
 
- BYTE d0
 
- BYTE d1
 
- BYTE d2
 
- BYTE d3
 
- BYTE d4
 
- BYTE d5
 
- BYTE d6
 
- BYTE d7
 
- VOID Return


CANTx

CANTx
Sends the Tx data with the ID specified in the form of a CAN message 
- UINT CANID
 
- VOID Return


ClearKeypadBuffer

ClearKeypadBuffer
Destroys the contents of the keypad buffer. 
- VOID Return


GetAnalogueInput

GetAnalogueInput
Returns the value for a specific analogue input on the MIAC slave. 
- BYTE Input
 
- BYTE Return


GetDigitalInput

GetDigitalInput
Returns the value for a specific digital input on the MIAC slave. 
- BYTE Input
 
- BYTE Return


GetDigitalInputs

GetDigitalInputs
Returns the value for a all 8 digital inputs on the MIAC slave. 
- BYTE Return


GetEEPROMData

GetEEPROMData
Reads a byte from the EEPROM data memory 
- BYTE Address
 
- BYTE Return


GetKeypadBuffer

GetKeypadBuffer
Returns a keypress from the keypress buffer, returns 255 if no keypress is available. 
- BYTE Return


GetRegisterValue

GetRegisterValue
Gets the value of the register specified on the MIAC 
- UINT RegAddress
 
- BYTE Return


LCDClear

LCDClear
Clears the LCD display on the MIAC.  
- VOID Return


LCDPrintNumber

LCDPrintNumber
Prints out a number to the display on the MIAC. 
- INT Number
 
- VOID Return


LCDPrintString

LCDPrintString
Prints a string to the LCD on the MIAC. 
- STRING Str
 
- VOID Return


LCDSetCursor

LCDSetCursor
Sets the LCD cursor position on the MIAC 
- BYTE x
 
- BYTE y
 
- VOID Return


PWMControl

PWMControl
Sets the PWM channel specified to be enabled or disabled 
- BYTE Channel
 
- BYTE Enable
 
- VOID Return


PWMOvercurrentCheck

PWMOvercurrentCheck
Checks the PWM outputs to see if they are overcurrent 
- BYTE Return


PWMSetDuty

PWMSetDuty
Sets the duty cycle for the PWM channel specified 
- BYTE Channel
 
- BYTE Duty
 
- VOID Return


PWMSetPeriod

PWMSetPeriod
Sets the PWM period for the channel specified 
- BYTE Prescaler
 
- BYTE Period
 
- VOID Return


SetEEPROMData

SetEEPROMData
Writes a byte to the EEPROM data memory 
- BYTE Address
 
- BYTE Data
 
- VOID Return


SetOutputBank

SetOutputBank
Controls the state of one of the transistor outputs on the MIAC slave. 
- BYTE Mask
 
- BYTE Output_States
 
- VOID Return


SetRegisterValue

SetRegisterValue
Sets the value of the register specified on the MIAC 
- UINT RegAddress
 
- BYTE Value
 
- VOID Return


SetRelayOutput

SetRelayOutput
Controls the state of one of the Relay outputs on the MIAC slave. 
- BYTE Relay
 
- BYTE State
 
- VOID Return


SetTransistorOutput

SetTransistorOutput
Controls the state of one of the transistor outputs on the MIAC slave. 
- BYTE Transistor
 
- BYTE State
 
- VOID Return


Property reference

Properties
Instance
USB Slave Instance, if empty then is the MIAC slave firmware loaded, Is the MIAC slave driver installed, Is the MIAC connected and powered.