Jump to content

Component: MIAC AllCode (MIAC: PC Peripheral): Difference between revisions

From Flowcode Help
No edit summary
No edit summary
Line 20: Line 20:


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




Line 38: Line 40:


==Examples==
==Examples==




Line 70: Line 74:




==Downloadable macro reference==
==Macro reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"

Revision as of 14:12, 20 January 2023

Author Matrix TSL
Version 1.0
Category MIAC: PC Peripheral


MIAC AllCode 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 for the component source code: FC_Comp_Source_MIAC_AllCode_Firmware.fcfx

Detailed description

No detailed description exists yet for this component

Examples

Bluetooth based examples.

MIAC AllCode Bluetooth


WIFI based examples.

MIAC AllCode WIFI


USB Driver

USB Serial Driver


Macro reference

CommsWrite
Writes a byte to the alt communications channel 
- BYTE Data
Range: 0-255 
- VOID Return


WriteTrans
Allows all transistor outputs to be switched on or off in a single command. 
- BYTE Value
Range: 0-15 or 0b0000 to 0b1111 
- VOID Return


LCDPixel
Controls a single pixel on the MIAC display 
- BYTE X
Range: 0-119 
- BYTE Y
Range: 0-49 
- BYTE State
Range: 0-1 
- VOID Return


CardCreate
Attempts to create a specific file on the card. Returns 0 for success, 255 for no card or error. 
- STRING Filename
 
- BYTE Return


CardDelete
Attempts to delete a specific file on the card. Returns 0 for success, 255 for no card or error. 
- STRING Filename
 
- BYTE Return


LCDBitmap
Draws a bitmap file from the SD card onto the MIAC display 
- BYTE X
Range: 0-119 
- BYTE Y
Range: 0-49 
- STRING Filename
Range: 0-1 
- VOID Return


GetAPIVersion
Gets the API version of the Robot ARM Firmware 
- BYTE Return


LCDNumber
Prints a number to the MIAC display starting from the current cursor position. 
- INT Value
Range: -32678 - 32767 
- VOID Return


CardInserted
Checks to see if a card is present. Returns 0 for no card or 1 for card detected 
- BYTE Return


ReadRTC
Reads a value from the real time clock module. Used for getting the time or date. 
- BYTE Unit
0=Second 1=Minute 2=Hour 3=Day 4=Month 5=Year 
- BYTE Return


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. 
- STRING Filename
 
- BYTE Return


CommsRead
Reads a byte from the alt communications channel 
- BYTE Timeout
Range: 0-255 : 0 = Don't wait / 1-255 = ms 
- BYTE Return


ReadKey
Reads a keypress from the keypad. 
- BYTE Return


WriteRTC
Writes a value to the real time clock module. Used for setting the time or date. 
- BYTE Unit
0=Second 1=Minute 2=Hour 3=Day 4=Month 5=Year 
- BYTE Value
 
- VOID Return


LCDBacklight
Controls the brightness of the LCD backlight. 
- BYTE Brightness
Range: 0-100 
- VOID Return


WriteRelay
Allows a single relay to be switched on or off. 
- BYTE Channel
Range 1-4 
- BYTE Value
0 = Off, 1 = On 
- VOID Return


LCDPrint
Prints a string to the MIAC display starting from the current cursor position. 
- STRING data
Range: 0-21 
- VOID Return


LCDLine
Draws a single pixel width line on the MIAC display 
- BYTE X1
Range: 0-119 
- BYTE Y1
Range: 0-49 
- BYTE X2
Range: 0-119 
- BYTE Y2
Range: 0-49 
- VOID Return


ReadInputs
Reads all digital inputs at once and returns as a binary value. Input 1 = Bit 0 Input 8 = Bit 7 
- BYTE Return


CardReadByte
Reads a byte from the open file. 
- BYTE Return


WriteRelays
Allows all relays to be switched on or off in a single command. 
- BYTE Value
Range: 0-15 or 0b0000 to 0b1111 
- VOID Return


CardWriteByte
Appends a byte to the end of the open file. Returns 0 for success. 
- BYTE data
 
- BYTE Return


LCDRect
Draws a single pixel rectangle on the MIAC display 
- BYTE X1
Range: 0-119 
- BYTE Y1
Range: 0-49 
- BYTE X2
Range: 0-119 
- BYTE Y2
Range: 0-49 
- VOID Return


ReadAnalogInput
Reads a single digital input. 
- BYTE Channel
 
- UINT Return


CommsBaud
Sets the Baud rate of the alt communications channel 
- BYTE Baud
Range: 0-7 : 0=1200 / 7=115200 
- VOID Return


LCDOptions
Controls some of the LCD options 
- BYTE Foreground
Range: 0-1 
- BYTE Background
Range: 0-1 
- BYTE Transparent
Range: 0-1 
- VOID Return


LCDVerbose
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. 
- BYTE Mode
Range: 0-1 : 0=Off or User Mode / 1=API Verbose Mode 
- VOID Return


ReadDigitalInput
Reads a single digital input. 
- BYTE Channel
 
- BYTE Return


PWMConfig
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 
- BYTE Channel
Range 0-1 
- UINT Period
Range: 0-65535 
- BYTE Scaler
Range: 0-3 
- VOID Return


PWMEnable
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 
- BYTE EnableMask
Range 0-63 or 0b00000 to 0b111111 
- VOID Return


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 
- BYTE Channel
Range 0-5 
- UINT Duty
 
- VOID Return


LCDCursor
Sets the cursor position for the MIAC display 
- BYTE X
Range: 0-21 
- BYTE Y
Range: 0-4 
- VOID Return


WriteTran
Allows a single transistor output to be switched on or off. 
- BYTE Channel
Range 1-4 
- BYTE Value
0 = Off, 1 = On 
- VOID Return


LCDClear
Clears the MIAC display 
- VOID Return



Property reference

Properties
Connections
Operating Mode
Mode
Configures how the simulation component functions, does it simply simulate or does it control real hardware. 
API Connection Type
API connection mode. COM - Bluetooth / RS232 / RS485 WIFI - Network 
AutoDetect Port
 
Baud