Component: MIAC AllCode (MIAC: PC Peripheral)
Author | Matrix TSL |
Version | 1.0 (Release) |
Category | MIAC: PC Peripheral |
Contents
- 1 MIAC AllCode component
- 2 Examples
- 3 Downloadable macro reference
- 4 Simulation macro reference
- 4.1 CommsWrite
- 4.2 WriteTrans
- 4.3 LCDPixel
- 4.4 CardCreate
- 4.5 CardDelete
- 4.6 LCDBitmap
- 4.7 GetAPIVersion
- 4.8 LCDNumber
- 4.9 CardInserted
- 4.10 ReadRTC
- 4.11 CardOpen
- 4.12 CommsRead
- 4.13 ReadKey
- 4.14 WriteRTC
- 4.15 LCDBacklight
- 4.16 WriteRelay
- 4.17 LCDLine
- 4.18 LCDPrint
- 4.19 ReadInputs
- 4.20 CardReadByte
- 4.21 WriteRelays
- 4.22 CardWriteByte
- 4.23 LCDRect
- 4.24 ReadAnalogInput
- 4.25 CommsBaud
- 4.26 LCDOptions
- 4.27 LCDVerbose
- 4.28 ReadDigitalInput
- 4.29 PWMConfig
- 4.30 PWMEnable
- 4.31 PWMDuty
- 4.32 LCDCursor
- 4.33 WriteTran
- 4.34 LCDClear
- 5 Property reference
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
Examples
No additional examples
Downloadable macro reference
This component does not contain any downloadable macros
Simulation macro reference
CommsWrite
Writes a byte to the alt communications channel
Parameters
- BYTE Data
- Range: 0-255
Return value
- This call does not return a value
WriteTrans
Allows all transistor outputs to be switched on or off in a single command.
Parameters
- BYTE Value
- Range: 0-15 or 0b0000 to 0b1111
Return value
- This call does not return a value
LCDPixel
Controls a single pixel on the MIAC display
Parameters
- BYTE X
- Range: 0-119
- BYTE Y
- Range: 0-49
- BYTE State
- Range: 0-1
Return value
- This call does not return a value
CardCreate
Attempts to create a specific file on the card.
Returns 0 for success, 255 for no card or error.
Parameters
- <- STRING Filename
- This parameter may be returned back to the caller
Return value
CardDelete
Attempts to delete a specific file on the card.
Returns 0 for success, 255 for no card or error.
Parameters
- <- STRING Filename
- This parameter may be returned back to the caller
Return value
LCDBitmap
Draws a bitmap file from the SD card onto the MIAC display
Parameters
- BYTE X
- Range: 0-119
- BYTE Y
- Range: 0-49
- <- STRING Filename
- Range: 0-1
- This parameter may be returned back to the caller
Return value
- This call does not return a value
GetAPIVersion
Gets the API version of the Robot ARM Firmware
Parameters
- This macro has no parameters
Return value
LCDNumber
Prints a number to the MIAC display starting from the current cursor position.
Parameters
- INT Value
- Range: -32678 - 32767
Return value
- This call does not return a value
CardInserted
Checks to see if a card is present.
Returns 0 for no card or 1 for card detected
Parameters
- This macro has no parameters
Return value
ReadRTC
Reads a value from the real time clock module.
Used for getting the time or date.
Parameters
- BYTE Unit
- 0=Second 1=Minute 2=Hour 3=Day 4=Month 5=Year
Return value
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.
Parameters
- <- STRING Filename
- This parameter may be returned back to the caller
Return value
CommsRead
Reads a byte from the alt communications channel
Parameters
- BYTE Timeout
- Range: 0-255 : 0 = Don't wait / 1-255 = ms
Return value
ReadKey
Reads a keypress from the keypad.
Parameters
- This macro has no parameters
Return value
WriteRTC
Writes a value to the real time clock module.
Used for setting the time or date.
Parameters
- BYTE Unit
- 0=Second 1=Minute 2=Hour 3=Day 4=Month 5=Year
- BYTE Value
Return value
- This call does not return a value
LCDBacklight
Controls the brightness of the LCD backlight.
Parameters
- BYTE Brightness
- Range: 0-100
Return value
- This call does not return a value
WriteRelay
Allows a single relay to be switched on or off.
Parameters
- BYTE Channel
- Range 1-4
- BYTE Value
- 0 = Off, 1 = On
Return value
- This call does not return a value
LCDLine
Draws a single pixel width line on the MIAC display
Parameters
- BYTE X1
- Range: 0-119
- BYTE Y1
- Range: 0-49
- BYTE X2
- Range: 0-119
- BYTE Y2
- Range: 0-49
Return value
- This call does not return a value
LCDPrint
Prints a string to the MIAC display starting from the current cursor position.
Parameters
- <- STRING data
- Range: 0-21
- This parameter may be returned back to the caller
Return value
- This call does not return a value
ReadInputs
Reads all digital inputs at once and returns as a binary value.
Input 1 = Bit 0
Input 8 = Bit 7
Parameters
- This macro has no parameters
Return value
CardReadByte
Reads a byte from the open file.
Parameters
- This macro has no parameters
Return value
WriteRelays
Allows all relays to be switched on or off in a single command.
Parameters
- BYTE Value
- Range: 0-15 or 0b0000 to 0b1111
Return value
- This call does not return a value
CardWriteByte
Appends a byte to the end of the open file.
Returns 0 for success.
Parameters
- BYTE data
Return value
LCDRect
Draws a single pixel rectangle on the MIAC display
Parameters
- BYTE X1
- Range: 0-119
- BYTE Y1
- Range: 0-49
- BYTE X2
- Range: 0-119
- BYTE Y2
- Range: 0-49
Return value
- This call does not return a value
ReadAnalogInput
Reads a single digital input.
Parameters
- BYTE Channel
Return value
CommsBaud
Sets the Baud rate of the alt communications channel
Parameters
- BYTE Baud
- Range: 0-7 : 0=1200 / 7=115200
Return value
- This call does not return a value
LCDOptions
Controls some of the LCD options
Parameters
- BYTE Foreground
- Range: 0-1
- BYTE Background
- Range: 0-1
- BYTE Transparent
- Range: 0-1
Return value
- This call does not return a value
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.
Parameters
- BYTE Mode
- Range: 0-1 : 0=Off or User Mode / 1=API Verbose Mode
Return value
- This call does not return a value
ReadDigitalInput
Reads a single digital input.
Parameters
- BYTE Channel
Return value
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
Parameters
- BYTE Channel
- Range 0-1
- UINT Period
- Range: 0-65535
- BYTE Scaler
- Range: 0-3
Return value
- This call does not return a value
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
Parameters
- BYTE EnableMask
- Range 0-63 or 0b00000 to 0b111111
Return value
- This call does not return a value
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
Parameters
- BYTE Channel
- Range 0-5
- UINT Duty
Return value
- This call does not return a value
LCDCursor
Sets the cursor position for the MIAC display
Parameters
- BYTE X
- Range: 0-21
- BYTE Y
- Range: 0-4
Return value
- This call does not return a value
WriteTran
Allows a single transistor output to be switched on or off.
Parameters
- BYTE Channel
- Range 1-4
- BYTE Value
- 0 = Off, 1 = On
Return value
- This call does not return a value
LCDClear
Clears the MIAC display
Parameters
- This macro has no parameters
Return value
- This call does not return a value
Property reference
Mode
This property is of type Fixed list of ints and can be referenced with the variable name SimMode.
Configures how the simulation component functions, does it simply simulate or does it control real hardware.
API Connection Type
This property is of type Fixed list of ints and can be referenced with the variable name APIType.
API connection mode.
COM - Bluetooth / RS232 / RS485
WIFI - Network
Network Interface
This property is of type Fixed list of ints and can be referenced with the variable name TCP_Base1::interface.
List of network interfaces connected to the PC.
Sets which interface we are communicating via.
My IP
This property is of type Line of text and can be referenced with the variable name MyIP.
My Local IP Address on the selected network interface
MIAC IP
This property is of type Line of text and can be referenced with the variable name IPAddress.
The IP address of the MIAC we want to connect to