Difference between revisions of "Component: MIAC NXT AllCode API (AllCode)"

From Flowcode Help
Jump to navigationJump to search
 
(5 intermediate revisions by the same user not shown)
Line 17: Line 17:
 
==Component Source Code==
 
==Component Source Code==
  
Please click here to download the component source project: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_MIAC_NXT_AllCode_Component_Source.fcsx FC_Comp_Source_MIAC_NXT_AllCode_Component_Source.fcsx]
+
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_MIAC_NXT_AllCode_Component_Source.fcsx FC_Comp_Source_MIAC_NXT_AllCode_Component_Source.fcsx]
  
 
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_MIAC_NXT_AllCode_Component_Source.fcsx FC_Comp_Source_MIAC_NXT_AllCode_Component_Source.fcsx]
 
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_MIAC_NXT_AllCode_Component_Source.fcsx FC_Comp_Source_MIAC_NXT_AllCode_Component_Source.fcsx]
Line 31: Line 31:
  
  
''No detailed description exists yet for this component''
 
  
==Examples==
 
  
  
  
 +
''No detailed description exists yet for this component''
  
 +
==Examples==
  
  
Line 43: Line 43:
  
  
''<span style="color:red;">No additional examples</span>''
 
  
==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;" | '''WriteTranPWMEnable'''
 
|-
 
| colspan="2" | Allows pulse width modulated transistor outputs to be switched on or off.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Range: 1-4 Where 1=A / 2=B / 3=C / 4=D&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | EnableOrState
 
|-
 
| colspan="2" | PWM on Enable Pin or State Pin - 1 = Enable / 0 = State&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | OnOrOff
 
|-
 
| colspan="2" | 1 = Enabled / 0 = Disabled&nbsp;
 
|-
 
| 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;" | '''WriteTrans'''
 
|-
 
| colspan="2" | Allows all transistor outputs to be switched on or off in a single command.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Value
 
|-
 
| colspan="2" | Range: 0-63 or 0b000000 to 0b111111&nbsp;
 
|-
 
| 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;" | '''DisplayPrint'''
 
|-
 
| colspan="2" | Prints a string to the MIAC display starting from the current cursor position.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" | data
 
|-
 
| colspan="2" | Range: 0-21&nbsp;
 
|-
 
| 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;"
+
''<span style="color:red;">No additional examples</span>''
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetAPIVersion'''
 
|-
 
| colspan="2" | Gets the API version of the MIAC NXT AllCode Firmware. Useful to see if the MIAC NXT is responding to commands.&nbsp;
 
|-
 
|-
 
| 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;" | '''DisplayNumber'''
 
|-
 
| colspan="2" | Prints a number to the MIAC display starting from the current cursor position.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-s32-icon.png]] - LONG
 
| width="90%" | Value
 
|-
 
| colspan="2" | Range: Signed Long&nbsp;
 
|-
 
| 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;" | '''WriteTranPWMDuty'''
 
|-
 
| colspan="2" | Sets the PWM duty on the selected channel.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Range: 1-4 Where 1=A / 2=B / 3=C / 4=D&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | EnableOrState
 
|-
 
| colspan="2" | 1 = Enable / 0 = State&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Duty
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| 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;" | '''DisplayClear'''
 
|-
 
| colspan="2" | Clears the MIAC display&nbsp;
 
|-
 
|-
 
| 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;" | '''ReadKey'''
 
|-
 
| colspan="2" | Reads a keypress from the keypad. Returns 0 for no keypress or 1-9 for a valid keypress. 1 = TopLeft, 2=TopMiddle, 3=TopRight, 4=CenterLeft etc&nbsp;
 
|-
 
|-
 
| 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;" | '''DisplayPixel'''
 
|-
 
| colspan="2" | Controls a single pixel on the MIAC display&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | X
 
|-
 
| colspan="2" | Range: 0-119&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Y
 
|-
 
| colspan="2" | Range: 0-31&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | State
 
|-
 
| colspan="2" | Range: 0-1&nbsp;
 
|-
 
| 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;" | '''WriteRelay'''
 
|-
 
| colspan="2" | Allows a single relay to be switched on or off.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Range 1-2&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | Value
 
|-
 
| colspan="2" | 0 = Off, 1 = On&nbsp;
 
|-
 
| 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''
 
|}
 
  
 +
==Macro reference==
  
 +
===DisplayClear===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteRelays'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DisplayClear'''
 
|-
 
|-
| colspan="2" | Allows all relays to be switched on or off in a single command.&nbsp;
+
| colspan="2" | Clears the MIAC display&nbsp;
 
|-
 
|-
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Value
 
|-
 
| colspan="2" | Range: 0-3 or 0b00 to 0b11&nbsp;
 
|-
 
| 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;" | '''ReadAnalogInput'''
 
|-
 
| colspan="2" | Reads a single analog input with range 0 to 4095 corresponding to input voltage 0V to +V.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Range: 1 - 8&nbsp;
 
|-
 
| 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;" | '''SetAPIVerbose'''
 
|-
 
| 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.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | Mode
 
|-
 
| colspan="2" | Range: 0-1 : 0=Off or User Mode / 1=API Verbose Mode&nbsp;
 
 
|-
 
|-
 
| 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 301: Line 79:
  
  
 +
===DisplayCursor===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 324: Line 103:
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
===DisplayFloat===
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadDigitalInput'''
 
|-
 
| colspan="2" | Reads a single digital input.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Range: 1 - 8&nbsp;
 
|-
 
| 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;" | '''ReadDigitalInputs'''
 
|-
 
| colspan="2" | Reads all digital inputs at once and returns as a binary value. Input 1 = Bit 0 Input 8 = Bit 7&nbsp;
 
|-
 
|-
 
| 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;" | '''WriteTran'''
 
|-
 
| colspan="2" | Allows a single transistor output to be switched on or off.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Range 1-6 where 1=A / 2=B / 3=C / 4=D / 5=E / 6=F&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | Value
 
|-
 
| colspan="2" | 0 = Off, 1 = On&nbsp;
 
|-
 
| 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;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 401: Line 127:
  
  
 
+
===DisplayNumber===
 
 
==Property reference==
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | API Connection Type
 
|-
 
| colspan="2" | API connection mode. COM - Bluetooth / RS232 / RS485 WIFI - Network&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Warnings On Error
 
|-
 
| colspan="2" | Generates a warning dialogue if the communication to the device fails allowing the program to be ended.&nbsp;
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connection Properties
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Auto Detect
 
|-
 
| colspan="2" | &nbsp;
 
|}==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;" | '''WriteTranPWMEnable'''
 
|-
 
| colspan="2" | Allows pulse width modulated transistor outputs to be switched on or off.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Range: 1-4 Where 1=A / 2=B / 3=C / 4=D&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | EnableOrState
 
|-
 
| colspan="2" | PWM on Enable Pin or State Pin - 1 = Enable / 0 = State&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | OnOrOff
 
|-
 
| colspan="2" | 1 = Enabled / 0 = Disabled&nbsp;
 
|-
 
| 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;" | '''WriteTrans'''
 
|-
 
| colspan="2" | Allows all transistor outputs to be switched on or off in a single command.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Value
 
|-
 
| colspan="2" | Range: 0-63 or 0b000000 to 0b111111&nbsp;
 
|-
 
| 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;" | '''DisplayPrint'''
 
|-
 
| colspan="2" | Prints a string to the MIAC display starting from the current cursor position.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" | data
 
|-
 
| colspan="2" | Range: 0-21&nbsp;
 
|-
 
| 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;" | '''GetAPIVersion'''
 
|-
 
| colspan="2" | Gets the API version of the MIAC NXT AllCode Firmware. Useful to see if the MIAC NXT is responding to commands.&nbsp;
 
|-
 
|-
 
| 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;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 530: Line 146:
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
===DisplayPixel===
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteTranPWMDuty'''
 
|-
 
| colspan="2" | Sets the PWM duty on the selected channel.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Range: 1-4 Where 1=A / 2=B / 3=C / 4=D&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | EnableOrState
 
|-
 
| colspan="2" | 1 = Enable / 0 = State&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Duty
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| 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;" | '''DisplayClear'''
 
|-
 
| colspan="2" | Clears the MIAC display&nbsp;
 
|-
 
|-
 
| 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;" | '''ReadKey'''
 
|-
 
| colspan="2" | Reads a keypress from the keypad. Returns 0 for no keypress or 1-9 for a valid keypress. 1 = TopLeft, 2=TopMiddle, 3=TopRight, 4=CenterLeft etc&nbsp;
 
|-
 
|-
 
| 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;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 612: Line 175:
  
  
 +
===DisplayPrint===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteRelay'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DisplayPrint'''
 
|-
 
|-
| colspan="2" | Allows a single relay to be switched on or off.&nbsp;
+
| colspan="2" | Prints a string to the MIAC display starting from the current cursor position.&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Channel
+
| width="90%" | data
 
|-
 
|-
| colspan="2" | Range 1-2&nbsp;
+
| colspan="2" | Range: 0-21&nbsp;
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | Value
 
|-
 
| colspan="2" | 0 = Off, 1 = On&nbsp;
 
 
|-
 
|-
 
| 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 635: Line 194:
  
  
 +
===GetAPIVersion===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteRelays'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetAPIVersion'''
 
|-
 
|-
| colspan="2" | Allows all relays to be switched on or off in a single command.&nbsp;
+
| colspan="2" | Gets the API version of the MIAC NXT AllCode Firmware. Useful to see if the MIAC NXT is responding to commands.&nbsp;
 
|-
 
|-
 
|-
 
|-
| 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%" | Value
 
|-
 
| colspan="2" | Range: 0-3 or 0b00 to 0b11&nbsp;
 
|-
 
| 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''
 
|}
 
|}
  
  
 +
===ReadAnalogInput===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 671: Line 227:
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
===ReadDigitalInput===
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetAPIVerbose'''
 
|-
 
| 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.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | Mode
 
|-
 
| colspan="2" | Range: 0-1 : 0=Off or User Mode / 1=API Verbose Mode&nbsp;
 
|-
 
| 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;" | '''DisplayCursor'''
 
|-
 
| colspan="2" | Sets the cursor position for the MIAC display&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | X
 
|-
 
| colspan="2" | Range: 0-21&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Y
 
|-
 
| colspan="2" | Range: 0-3&nbsp;
 
|-
 
| 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;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 730: Line 246:
  
  
 +
===ReadDigitalInputs===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 743: Line 260:
  
  
 +
===ReadKey===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteTran'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadKey'''
 
|-
 
|-
| colspan="2" | Allows a single transistor output to be switched on or off.&nbsp;
+
| colspan="2" | Reads a keypress from the keypad. Returns 0 for no keypress or 1-9 for a valid keypress. 1 = TopLeft, 2=TopMiddle, 3=TopRight, 4=CenterLeft etc&nbsp;
 
|-
 
|-
 
|-
 
|-
| 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%" | Channel
 
|-
 
| colspan="2" | Range 1-6 where 1=A / 2=B / 3=C / 4=D / 5=E / 6=F&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | Value
 
|-
 
| colspan="2" | 0 = Off, 1 = On&nbsp;
 
|-
 
| 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''
 
|}
 
|}
  
  
 +
===SetAPIVerbose===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DisplayFloat'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetAPIVerbose'''
 
|-
 
|-
| colspan="2" | Prints a floating point number to the MIAC display starting from the current cursor position.&nbsp;
+
| 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.&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
+
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" | Value
+
| width="90%" | Mode
 
|-
 
|-
| colspan="2" | Range: Float&nbsp;
+
| colspan="2" | Range: 0-1 : 0=Off or User Mode / 1=API Verbose Mode&nbsp;
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | NumDP
 
|-
 
| colspan="2" | Number of decimal places to display&nbsp;
 
 
|-
 
|-
 
| 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 789: Line 293:
  
  
 
+
===WriteRelay===
 
 
==Property reference==
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | API Connection Type
 
|-
 
| colspan="2" | API connection mode. COM - Bluetooth / RS232 / RS485 WIFI - Network&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Warnings On Error
 
|-
 
| colspan="2" | Generates a warning dialogue if the communication to the device fails allowing the program to be ended.&nbsp;
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connection Properties
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Auto Detect
 
|-
 
| colspan="2" | &nbsp;
 
|}==Macro reference==
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteTranPWMEnable'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteRelay'''
 
|-
 
|-
| colspan="2" | Allows pulse width modulated transistor outputs to be switched on or off.&nbsp;
+
| colspan="2" | Allows a single relay to be switched on or off.&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 834: Line 305:
 
| width="90%" | Channel
 
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | Range: 1-4 Where 1=A / 2=B / 3=C / 4=D&nbsp;
+
| colspan="2" | Range 1-2&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" | EnableOrState
+
| width="90%" | Value
 
|-
 
|-
| colspan="2" | PWM on Enable Pin or State Pin - 1 = Enable / 0 = State&nbsp;
+
| colspan="2" | 0 = Off, 1 = On&nbsp;
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | OnOrOff
 
|-
 
| colspan="2" | 1 = Enabled / 0 = Disabled&nbsp;
 
 
|-
 
|-
 
| 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 851: Line 317:
  
  
 +
===WriteRelays===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteTrans'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteRelays'''
 
|-
 
|-
| colspan="2" | Allows all transistor outputs to be switched on or off in a single command.&nbsp;
+
| colspan="2" | Allows all relays to be switched on or off in a single command.&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 862: Line 329:
 
| width="90%" | Value
 
| width="90%" | Value
 
|-
 
|-
| colspan="2" | Range: 0-63 or 0b000000 to 0b111111&nbsp;
+
| colspan="2" | Range: 0-3 or 0b00 to 0b11&nbsp;
 
|-
 
|-
 
| 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 869: Line 336:
  
  
 +
===WriteTran===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DisplayPrint'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteTran'''
 
|-
 
|-
| colspan="2" | Prints a string to the MIAC display starting from the current cursor position.&nbsp;
+
| colspan="2" | Allows a single transistor output to be switched on or off.&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | data
+
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | Range: 0-21&nbsp;
+
| colspan="2" | Range 1-6 where 1=A / 2=B / 3=C / 4=D / 5=E / 6=F&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
+
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
| 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;" | '''GetAPIVersion'''
 
|-
 
| colspan="2" | Gets the API version of the MIAC NXT AllCode Firmware. Useful to see if the MIAC NXT is responding to commands.&nbsp;
 
|-
 
|-
 
| 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;" | '''DisplayNumber'''
 
|-
 
| colspan="2" | Prints a number to the MIAC display starting from the current cursor position.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-s32-icon.png]] - LONG
 
 
| width="90%" | Value
 
| width="90%" | Value
 
|-
 
|-
| colspan="2" | Range: Signed Long&nbsp;
+
| colspan="2" | 0 = Off, 1 = On&nbsp;
 
|-
 
|-
 
| 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 918: Line 360:
  
  
 +
===WriteTranPWMDuty===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 946: Line 389:
  
  
 +
===WriteTranPWMEnable===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DisplayClear'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteTranPWMEnable'''
 
|-
 
|-
| colspan="2" | Clears the MIAC display&nbsp;
+
| colspan="2" | Allows pulse width modulated transistor outputs to be switched on or off.&nbsp;
|-
 
|-
 
| 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;" | '''ReadKey'''
 
|-
 
| colspan="2" | Reads a keypress from the keypad. Returns 0 for no keypress or 1-9 for a valid keypress. 1 = TopLeft, 2=TopMiddle, 3=TopRight, 4=CenterLeft etc&nbsp;
 
|-
 
|-
 
| 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;" | '''DisplayPixel'''
 
|-
 
| colspan="2" | Controls a single pixel on the MIAC display&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | X
 
|-
 
| colspan="2" | Range: 0-119&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Y
 
|-
 
| colspan="2" | Range: 0-31&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | State
 
|-
 
| colspan="2" | Range: 0-1&nbsp;
 
|-
 
| 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;" | '''WriteRelay'''
 
|-
 
| colspan="2" | Allows a single relay to be switched on or off.&nbsp;
 
 
|-
 
|-
 
|-
 
|-
Line 1,011: Line 401:
 
| width="90%" | Channel
 
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | Range 1-2&nbsp;
+
| colspan="2" | Range: 1-4 Where 1=A / 2=B / 3=C / 4=D&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" | Value
+
| width="90%" | EnableOrState
|-
 
| colspan="2" | 0 = Off, 1 = On&nbsp;
 
|-
 
| 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;" | '''WriteRelays'''
 
|-
 
| colspan="2" | Allows all relays to be switched on or off in a single command.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Value
 
|-
 
| colspan="2" | Range: 0-3 or 0b00 to 0b11&nbsp;
 
|-
 
| 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;" | '''ReadAnalogInput'''
 
|-
 
| colspan="2" | Reads a single analog input with range 0 to 4095 corresponding to input voltage 0V to +V.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Range: 1 - 8&nbsp;
 
|-
 
| 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;" | '''SetAPIVerbose'''
 
|-
 
| 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.&nbsp;
 
 
|-
 
|-
 +
| colspan="2" | PWM on Enable Pin or State Pin - 1 = Enable / 0 = State&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" | Mode
+
| width="90%" | OnOrOff
 
|-
 
|-
| colspan="2" | Range: 0-1 : 0=Off or User Mode / 1=API Verbose Mode&nbsp;
+
| colspan="2" | 1 = Enabled / 0 = Disabled&nbsp;
 
|-
 
|-
 
| 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 1,077: Line 418:
  
  
 +
===WriteTrans===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DisplayCursor'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteTrans'''
 
|-
 
|-
| colspan="2" | Sets the cursor position for the MIAC display&nbsp;
+
| colspan="2" | Allows all transistor outputs to be switched on or off in a single command.&nbsp;
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | X
 
|-
 
| colspan="2" | Range: 0-21&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Y
 
|-
 
| colspan="2" | Range: 0-3&nbsp;
 
|-
 
| 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;" | '''ReadDigitalInput'''
 
|-
 
| colspan="2" | Reads a single digital input.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Range: 1 - 8&nbsp;
 
|-
 
| 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;" | '''ReadDigitalInputs'''
 
|-
 
| colspan="2" | Reads all digital inputs at once and returns as a binary value. Input 1 = Bit 0 Input 8 = Bit 7&nbsp;
 
|-
 
|-
 
| 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;" | '''WriteTran'''
 
|-
 
| colspan="2" | Allows a single transistor output to be switched on or off.&nbsp;
 
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
 
|-
 
| colspan="2" | Range 1-6 where 1=A / 2=B / 3=C / 4=D / 5=E / 6=F&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
 
| width="90%" | Value
 
| width="90%" | Value
 
|-
 
|-
| colspan="2" | 0 = Off, 1 = On&nbsp;
+
| colspan="2" | Range: 0-63 or 0b000000 to 0b111111&nbsp;
 
|-
 
|-
 
| 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''
 
|}
 
|}
 
 
{| 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;" | '''DisplayFloat'''
 
|-
 
| colspan="2" | Prints a floating point number to the MIAC display starting from the current cursor position.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 
| width="90%" | Value
 
|-
 
| colspan="2" | Range: Float&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | NumDP
 
|-
 
| colspan="2" | Number of decimal places to display&nbsp;
 
|-
 
| 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''
 
|}
 
 
 
  
  

Latest revision as of 13:11, 7 February 2023

Author Matrix TSL
Version 1.1
Category AllCode


MIAC NXT AllCode API component

Controls the MIAC NXT hardware loaded with the MIAC NXT AllCode firmware. Usefull for SCADA, Control or Test applications. Compatible with USB / Bluetooth / Wifi / Ethernet

Component Source Code

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

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

Detailed description

No detailed description exists yet for this component

Examples

No additional examples






Macro reference

DisplayClear

Fc9-comp-macro.png DisplayClear
Clears the MIAC display 
Fc9-void-icon.png - VOID Return


DisplayCursor

Fc9-comp-macro.png DisplayCursor
Sets the cursor position for the MIAC display 
Fc9-u8-icon.png - BYTE X
Range: 0-21 
Fc9-u8-icon.png - BYTE Y
Range: 0-3 
Fc9-void-icon.png - VOID Return


DisplayFloat

Fc9-comp-macro.png DisplayFloat
Prints a floating point number to the MIAC display starting from the current cursor position. 
Fc9-f32-icon.png - FLOAT Value
Range: Float 
Fc9-u8-icon.png - BYTE NumDP
Number of decimal places to display 
Fc9-void-icon.png - VOID Return


DisplayNumber

Fc9-comp-macro.png DisplayNumber
Prints a number to the MIAC display starting from the current cursor position. 
Fc9-s32-icon.png - LONG Value
Range: Signed Long 
Fc9-void-icon.png - VOID Return


DisplayPixel

Fc9-comp-macro.png DisplayPixel
Controls a single pixel on the MIAC display 
Fc9-u8-icon.png - BYTE X
Range: 0-119 
Fc9-u8-icon.png - BYTE Y
Range: 0-31 
Fc9-bool-icon.png - BOOL State
Range: 0-1 
Fc9-void-icon.png - VOID Return


DisplayPrint

Fc9-comp-macro.png DisplayPrint
Prints a string to the MIAC display starting from the current cursor position. 
Fc9-string-icon.png - STRING data
Range: 0-21 
Fc9-void-icon.png - VOID Return


GetAPIVersion

Fc9-comp-macro.png GetAPIVersion
Gets the API version of the MIAC NXT AllCode Firmware. Useful to see if the MIAC NXT is responding to commands. 
Fc9-u8-icon.png - BYTE Return


ReadAnalogInput

Fc9-comp-macro.png ReadAnalogInput
Reads a single analog input with range 0 to 4095 corresponding to input voltage 0V to +V. 
Fc9-u8-icon.png - BYTE Channel
Range: 1 - 8 
Fc9-u16-icon.png - UINT Return


ReadDigitalInput

Fc9-comp-macro.png ReadDigitalInput
Reads a single digital input. 
Fc9-u8-icon.png - BYTE Channel
Range: 1 - 8 
Fc9-u8-icon.png - BYTE Return


ReadDigitalInputs

Fc9-comp-macro.png ReadDigitalInputs
Reads all digital inputs at once and returns as a binary value. Input 1 = Bit 0 Input 8 = Bit 7 
Fc9-u8-icon.png - BYTE Return


ReadKey

Fc9-comp-macro.png ReadKey
Reads a keypress from the keypad. Returns 0 for no keypress or 1-9 for a valid keypress. 1 = TopLeft, 2=TopMiddle, 3=TopRight, 4=CenterLeft etc 
Fc9-u8-icon.png - BYTE Return


SetAPIVerbose

Fc9-comp-macro.png SetAPIVerbose
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. 
Fc9-bool-icon.png - BOOL Mode
Range: 0-1 : 0=Off or User Mode / 1=API Verbose Mode 
Fc9-void-icon.png - VOID Return


WriteRelay

Fc9-comp-macro.png WriteRelay
Allows a single relay to be switched on or off. 
Fc9-u8-icon.png - BYTE Channel
Range 1-2 
Fc9-bool-icon.png - BOOL Value
0 = Off, 1 = On 
Fc9-void-icon.png - VOID Return


WriteRelays

Fc9-comp-macro.png WriteRelays
Allows all relays to be switched on or off in a single command. 
Fc9-u8-icon.png - BYTE Value
Range: 0-3 or 0b00 to 0b11 
Fc9-void-icon.png - VOID Return


WriteTran

Fc9-comp-macro.png WriteTran
Allows a single transistor output to be switched on or off. 
Fc9-u8-icon.png - BYTE Channel
Range 1-6 where 1=A / 2=B / 3=C / 4=D / 5=E / 6=F 
Fc9-bool-icon.png - BOOL Value
0 = Off, 1 = On 
Fc9-void-icon.png - VOID Return


WriteTranPWMDuty

Fc9-comp-macro.png WriteTranPWMDuty
Sets the PWM duty on the selected channel. 
Fc9-u8-icon.png - BYTE Channel
Range: 1-4 Where 1=A / 2=B / 3=C / 4=D 
Fc9-bool-icon.png - BOOL EnableOrState
1 = Enable / 0 = State 
Fc9-u16-icon.png - UINT Duty
 
Fc9-void-icon.png - VOID Return


WriteTranPWMEnable

Fc9-comp-macro.png WriteTranPWMEnable
Allows pulse width modulated transistor outputs to be switched on or off. 
Fc9-u8-icon.png - BYTE Channel
Range: 1-4 Where 1=A / 2=B / 3=C / 4=D 
Fc9-bool-icon.png - BOOL EnableOrState
PWM on Enable Pin or State Pin - 1 = Enable / 0 = State 
Fc9-bool-icon.png - BOOL OnOrOff
1 = Enabled / 0 = Disabled 
Fc9-void-icon.png - VOID Return


WriteTrans

Fc9-comp-macro.png WriteTrans
Allows all transistor outputs to be switched on or off in a single command. 
Fc9-u8-icon.png - BYTE Value
Range: 0-63 or 0b000000 to 0b111111 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Connections
Fc9-type-16-icon.png API Connection Type
API connection mode. COM - Bluetooth / RS232 / RS485 WIFI - Network 
Fc9-type-7-icon.png Warnings On Error
Generates a warning dialogue if the communication to the device fails allowing the program to be ended. 
Fc9-conn-icon.png Connection Properties
Fc9-type-7-icon.png Auto Detect