Component: MIAC AllCode API (dsPIC) (AllCode): Difference between revisions
Appearance
No edit summary |
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder"" |
||
| (9 intermediate revisions by 2 users not shown) | |||
| Line 47: | Line 47: | ||
{| class="wikitable | |||
==Macro reference== | |||
===CardCreate=== | |||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''CardCreate''' | ||
|- | |- | ||
| colspan="2" | Attempts to create a specific file on the card. Returns 0 for success, 255 for no card or error. | | colspan="2" | Attempts to create a specific file on the card. Returns 0 for success, 255 for no card or error. | ||
| Line 131: | Line 76: | ||
{| class="wikitable | ===CardDelete=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''CardDelete''' | ||
|- | |- | ||
| colspan="2" | Attempts to delete a specific file on the card. Returns 0 for success, 255 for no card or error. | | colspan="2" | Attempts to delete a specific file on the card. Returns 0 for success, 255 for no card or error. | ||
| Line 149: | Line 95: | ||
{| class="wikitable | ===CardInserted=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''CardInserted''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Checks to see if a card is present. Returns 0 for no card or 1 for card detected | ||
|- | |- | ||
|- | |- | ||
| 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%" | | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |||
===CardOpen=== | |||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" class="mtx-class-macrohead" | '''CardOpen''' | |||
|- | |- | ||
| | | colspan="2" | Attempts to open a specific file from the card. Returns 0 for file found and opened, 239 for file not found and 255 for no card. | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| width="90%" | Filename | | width="90%" | Filename | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | | 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 | ===CardReadByte=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''CardReadByte''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Reads a byte from the open file. | ||
|- | |- | ||
|- | |- | ||
| Line 190: | Line 142: | ||
{| class="wikitable | ===CardWriteByte=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''CardWriteByte''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Appends a byte to the end of the open file. Returns 0 for success. | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9- | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" | | | width="90%" | data | ||
|- | |- | ||
| colspan="2" | | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| Line 221: | Line 161: | ||
{| class="wikitable | ===CommsBaud=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''CommsBaud''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Sets the Baud rate of the alt communications channel | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" | | | width="90%" | Baud | ||
|- | |- | ||
| colspan="2" | 0= | | colspan="2" | Range: 0-7 : 0=1200 / 7=115200 | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | | 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 | ===CommsRead=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''CommsRead''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Reads a byte from the alt communications channel | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9- | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" | | | width="90%" | Timeout | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Range: 0-255 : 0 = Don't wait / 1-255 = ms | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| Line 257: | Line 199: | ||
{| class="wikitable | ===CommsWrite=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''CommsWrite''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Writes a byte to the alt communications channel | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" | | | width="90%" | Data | ||
|- | |- | ||
| colspan="2" | Range: 0-255 | | colspan="2" | Range: 0-255 | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | | 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 | ===GetAPIVersion=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetAPIVersion''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Gets the API version of the Robot ARM Firmware | ||
|- | |- | ||
|- | |- | ||
| Line 288: | Line 232: | ||
{| class="wikitable | ===LCDBacklight=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''LCDBacklight''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Controls the brightness of the LCD backlight. | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" | | | width="90%" | Brightness | ||
|- | |- | ||
| colspan="2" | 0 | | colspan="2" | Range: 0-100 | ||
|- | |- | ||
| 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 311: | Line 251: | ||
{| class="wikitable | ===LCDBitmap=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''LCDBitmap''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Draws a bitmap file from the SD card onto the MIAC display | ||
|- | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | |||
| width="90%" | X | |||
|- | |- | ||
| colspan="2" | Range: 0-119 | |||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" | | | width="90%" | Y | ||
|- | |||
| colspan="2" | Range: 0-49 | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | |||
| width="90%" | Filename | |||
|- | |- | ||
| colspan="2" | Range: 0- | | 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 329: | Line 280: | ||
{| class="wikitable | ===LCDClear=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''LCDClear''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Clears the MIAC display | ||
|- | |- | ||
|- | |- | ||
| 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 352: | Line 294: | ||
{| class="wikitable | ===LCDCursor=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''LCDCursor''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Sets the cursor position for the MIAC display | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9- | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" | | | width="90%" | X | ||
|- | |- | ||
| colspan="2" | Range: 0-21 | | colspan="2" | Range: 0-21 | ||
|- | |||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | |||
| width="90%" | Y | |||
|- | |||
| colspan="2" | Range: 0-4 | |||
|- | |- | ||
| 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 370: | Line 318: | ||
{| class="wikitable | ===LCDLine=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''LCDLine''' | ||
|- | |- | ||
| colspan="2" | Draws a single pixel width line on the MIAC display | | colspan="2" | Draws a single pixel width line on the MIAC display | ||
| Line 403: | Line 352: | ||
{| class="wikitable" | ===LCDNumber=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" class="mtx-class-macrohead" | '''LCDNumber''' | |||
|- | |||
| colspan="2" | Prints a number to the MIAC display starting from the current cursor position. | |||
|- | |- | ||
|- | |- | ||
| | | width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT | ||
| width="90%" | Value | |||
|- | |- | ||
| colspan="2" | Range: -32678 - 32767 | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | | 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" | ===LCDOptions=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" class="mtx-class-macrohead" | '''LCDOptions''' | |||
|- | |||
| colspan="2" | Controls some of the LCD options | |||
|- | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | |||
| width="90%" | Foreground | |||
|- | |||
| colspan="2" | Range: 0-1 | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | |||
| width="90%" | Background | |||
|- | |- | ||
| | | colspan="2" | Range: 0-1 | ||
|- | |- | ||
| | | 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- | | 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" | ===LCDPixel=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" class="mtx-class-macrohead" | '''LCDPixel''' | |||
|- | |||
| colspan="2" | Controls a single pixel on the MIAC display | |||
|- | |||
|- | |- | ||
| width="10% | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90% | | width="90%" | X | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Range: 0-119 | ||
|- | |||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | |||
| width="90%" | Y | |||
|- | |- | ||
| colspan="2" | Range: 0-49 | |||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" | | | width="90%" | State | ||
|- | |- | ||
| colspan="2" | Range: 0- | | 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 447: | Line 429: | ||
{| class="wikitable | ===LCDPrint=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''LCDPrint''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Prints a string to the MIAC display starting from the current cursor position. | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9- | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| width="90%" | data | | width="90%" | data | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Range: 0-21 | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | | 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 | ===LCDRect=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''LCDRect''' | ||
|- | |- | ||
| colspan="2" | Draws a single pixel rectangle on the MIAC display | | colspan="2" | Draws a single pixel rectangle on the MIAC display | ||
| Line 498: | Line 482: | ||
{| class="wikitable | ===LCDVerbose=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''LCDVerbose''' | ||
|- | |- | ||
| colspan="2" | | | 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. | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" | | | width="90%" | Mode | ||
|- | |- | ||
| colspan="2" | | | 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- | | 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" | ===PWMConfig=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" class="mtx-class-macrohead" | '''PWMConfig''' | |||
|- | |||
| colspan="2" | Channel = 0 - 5 : 0=EN_AB, 1=A, 2=B, 3=C, 4=D, 5=EN_CD Period = 0 - 65535 Scaler = 0 - 3 : 0=1:1 1=1:8 2=1:64 3=1:256 | |||
|- | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | |||
| width="90%" | Channel | |||
|- | |- | ||
| | | colspan="2" | Range 0-1 | ||
|- | |- | ||
| | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| width="90%" | Period | |||
|- | |- | ||
| colspan="2" | Range: 0-65535 | |||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" | | | width="90%" | Scaler | ||
|- | |- | ||
| colspan="2" | Range: 0- | | 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 534: | Line 530: | ||
{| class="wikitable | ===PWMDuty=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''PWMDuty''' | ||
|- | |- | ||
| colspan="2" | | | 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 | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" | | | width="90%" | Channel | ||
|- | |||
| colspan="2" | Range 0-5 | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | |||
| 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'' | |||
|} | |||
===PWMEnable=== | |||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" class="mtx-class-macrohead" | '''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="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" | | | width="90%" | EnableMask | ||
|- | |- | ||
| colspan="2" | Range | | colspan="2" | Range 0-63 or 0b00000 to 0b111111 | ||
|- | |- | ||
| 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 562: | Line 573: | ||
{| class="wikitable | ===ReadAnalogInput=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadAnalogInput''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Reads a single digital input. | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" | | | width="90%" | Channel | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | | 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'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
{| class="wikitable | ===ReadDigitalInput=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadDigitalInput''' | ||
|- | |- | ||
| colspan="2" | Reads a single digital input. | | colspan="2" | Reads a single digital input. | ||
| Line 598: | Line 611: | ||
{| class="wikitable" style="width | ===ReadInputs=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" class="mtx-class-macrohead" | '''ReadInputs''' | |||
|- | |||
| colspan="2" | Reads all digital inputs at once and returns as a binary value. Input 1 = Bit 0 Input 8 = Bit 7 | |||
|- | |||
|- | |||
| 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'' | |||
|} | |||
===ReadKey=== | |||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadKey''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Reads a keypress from the keypad. | ||
|- | |- | ||
|- | |- | ||
| 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%" | | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |||
===ReadRTC=== | |||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" class="mtx-class-macrohead" | '''ReadRTC''' | |||
|- | |- | ||
| | | colspan="2" | Reads a value from the real time clock module. Used for getting the time or date. | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" | | | width="90%" | Unit | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | 0=Second 1=Minute 2=Hour 3=Day 4=Month 5=Year | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | | 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" | ===WriteRTC=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" class="mtx-class-macrohead" | '''WriteRTC''' | |||
|- | |||
| colspan="2" | Writes a value to the real time clock module. Used for setting the time or date. | |||
|- | |- | ||
|- | |- | ||
| | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" | Unit | |||
|- | |- | ||
| colspan="2" | 0=Second 1=Minute 2=Hour 3=Day 4=Month 5=Year | |||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" | | | width="90%" | Value | ||
|- | |- | ||
| colspan="2" | | | 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 644: | Line 682: | ||
{| class="wikitable | ===WriteRelay=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''WriteRelay''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Allows a single relay to be switched on or off. | ||
|- | |- | ||
|- | |- | ||
| Line 655: | Line 694: | ||
| width="90%" | Channel | | width="90%" | Channel | ||
|- | |- | ||
| colspan="2" | Range | | colspan="2" | Range 1-4 | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9- | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" | | | width="90%" | Value | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | 0 = Off, 1 = On | ||
|- | |- | ||
| 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 667: | Line 706: | ||
{| class="wikitable | ===WriteRelays=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''WriteRelays''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Allows all relays to be switched on or off in a single command. | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" | | | width="90%" | Value | ||
|- | |- | ||
| colspan="2" | Range: 0- | | colspan="2" | Range: 0-15 or 0b0000 to 0b1111 | ||
|- | |- | ||
| 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 690: | Line 725: | ||
{| class="wikitable | ===WriteTran=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''WriteTran''' | ||
|- | |- | ||
| colspan="2" | Allows a single transistor output to be switched on or off. | | colspan="2" | Allows a single transistor output to be switched on or off. | ||
| Line 713: | Line 749: | ||
{| class="wikitable | ===WriteTrans=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''WriteTrans''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Allows all transistor outputs to be switched on or off in a single command. | ||
|- | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | |||
| width="90%" | Value | |||
|- | |- | ||
| colspan="2" | Range: 0-15 or 0b0000 to 0b1111 | |||
|- | |- | ||
| 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 | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Properties''' | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Connections | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Operating Mode | ||
|- | |- | ||
|- | |- | ||
Latest revision as of 14:37, 13 July 2026
| Author | Matrix TSL |
| Version | 1.1 |
| Category | AllCode |
MIAC AllCode API (dsPIC) component
MIAC AllCode. dsPIC version of the MIAC loaded with the AllCode firmware. Usefull for SCADA, Control or Test applications. Allows you to control the MIAC using the programming language of choice. Compatible with simulation / Bluetooth / Wifi / RS232 and RS485
Component Source Code
Please click here to download the component source project: FC_Comp_Source_MIAC_AllCode_Component_Source.fcsx
Please click here to view the component source code (Beta): FC_Comp_Source_MIAC_AllCode_Component_Source.fcsx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
CardCreate
| CardCreate | |
| Attempts to create a specific file on the card. Returns 0 for success, 255 for no card or error. | |
| Filename | |
| Return | |
CardDelete
| CardDelete | |
| Attempts to delete a specific file on the card. Returns 0 for success, 255 for no card or error. | |
| Filename | |
| Return | |
CardInserted
| CardInserted | |
| Checks to see if a card is present. Returns 0 for no card or 1 for card detected | |
| Return | |
CardOpen
| CardOpen | |
| Attempts to open a specific file from the card. Returns 0 for file found and opened, 239 for file not found and 255 for no card. | |
| Filename | |
| Return | |
CardReadByte
| CardReadByte | |
| Reads a byte from the open file. | |
| Return | |
CardWriteByte
| CardWriteByte | |
| Appends a byte to the end of the open file. Returns 0 for success. | |
| data | |
| Return | |
CommsBaud
| CommsBaud | |
| Sets the Baud rate of the alt communications channel | |
| Baud | |
| Range: 0-7 : 0=1200 / 7=115200 | |
| Return | |
CommsRead
| CommsRead | |
| Reads a byte from the alt communications channel | |
| Timeout | |
| Range: 0-255 : 0 = Don't wait / 1-255 = ms | |
| Return | |
CommsWrite
| CommsWrite | |
| Writes a byte to the alt communications channel | |
| Data | |
| Range: 0-255 | |
| Return | |
GetAPIVersion
| GetAPIVersion | |
| Gets the API version of the Robot ARM Firmware | |
| Return | |
LCDBacklight
| LCDBacklight | |
| Controls the brightness of the LCD backlight. | |
| Brightness | |
| Range: 0-100 | |
| Return | |
LCDBitmap
| LCDBitmap | |
| Draws a bitmap file from the SD card onto the MIAC display | |
| X | |
| Range: 0-119 | |
| Y | |
| Range: 0-49 | |
| Filename | |
| Range: 0-1 | |
| Return | |
LCDClear
| LCDClear | |
| Clears the MIAC display | |
| Return | |
LCDCursor
| LCDCursor | |
| Sets the cursor position for the MIAC display | |
| X | |
| Range: 0-21 | |
| Y | |
| Range: 0-4 | |
| Return | |
LCDLine
| LCDLine | |
| Draws a single pixel width line on the MIAC display | |
| X1 | |
| Range: 0-119 | |
| Y1 | |
| Range: 0-49 | |
| X2 | |
| Range: 0-119 | |
| Y2 | |
| Range: 0-49 | |
| Return | |
LCDNumber
| LCDNumber | |
| Prints a number to the MIAC display starting from the current cursor position. | |
| Value | |
| Range: -32678 - 32767 | |
| Return | |
LCDOptions
| LCDOptions | |
| Controls some of the LCD options | |
| Foreground | |
| Range: 0-1 | |
| Background | |
| Range: 0-1 | |
| Transparent | |
| Range: 0-1 | |
| Return | |
LCDPixel
| LCDPixel | |
| Controls a single pixel on the MIAC display | |
| X | |
| Range: 0-119 | |
| Y | |
| Range: 0-49 | |
| State | |
| Range: 0-1 | |
| Return | |
LCDPrint
| LCDPrint | |
| Prints a string to the MIAC display starting from the current cursor position. | |
| data | |
| Range: 0-21 | |
| Return | |
LCDRect
| LCDRect | |
| Draws a single pixel rectangle on the MIAC display | |
| X1 | |
| Range: 0-119 | |
| Y1 | |
| Range: 0-49 | |
| X2 | |
| Range: 0-119 | |
| Y2 | |
| Range: 0-49 | |
| Return | |
LCDVerbose
PWMConfig
PWMDuty
| PWMDuty | |
| 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 | |
| Channel | |
| Range 0-5 | |
| Duty | |
| Return | |
PWMEnable
ReadAnalogInput
| ReadAnalogInput | |
| Reads a single digital input. | |
| Channel | |
| Return | |
ReadDigitalInput
| ReadDigitalInput | |
| Reads a single digital input. | |
| Channel | |
| Return | |
ReadInputs
| ReadInputs | |
| Reads all digital inputs at once and returns as a binary value. Input 1 = Bit 0 Input 8 = Bit 7 | |
| Return | |
ReadKey
| ReadKey | |
| Reads a keypress from the keypad. | |
| Return | |
ReadRTC
| ReadRTC | |
| Reads a value from the real time clock module. Used for getting the time or date. | |
| Unit | |
| 0=Second 1=Minute 2=Hour 3=Day 4=Month 5=Year | |
| Return | |
WriteRTC
| WriteRTC | |
| Writes a value to the real time clock module. Used for setting the time or date. | |
| Unit | |
| 0=Second 1=Minute 2=Hour 3=Day 4=Month 5=Year | |
| Value | |
| Return | |
WriteRelay
| WriteRelay | |
| Allows a single relay to be switched on or off. | |
| Channel | |
| Range 1-4 | |
| Value | |
| 0 = Off, 1 = On | |
| Return | |
WriteRelays
| WriteRelays | |
| Allows all relays to be switched on or off in a single command. | |
| Value | |
| Range: 0-15 or 0b0000 to 0b1111 | |
| Return | |
WriteTran
| WriteTran | |
| Allows a single transistor output to be switched on or off. | |
| Channel | |
| Range 1-4 | |
| Value | |
| 0 = Off, 1 = On | |
| Return | |
WriteTrans
| WriteTrans | |
| Allows all transistor outputs to be switched on or off in a single command. | |
| Value | |
| Range: 0-15 or 0b0000 to 0b1111 | |
| Return | |
Property reference
| Properties | |
| Connections | |
| Operating Mode | |
| API Connection Type | |
| API connection mode. COM - Bluetooth / RS232 / RS485 WIFI - Network | |
| Auto Detect | |
| Baud | |