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

From Flowcode Help
Jump to navigationJump to search
(XML import)
 
 
Line 23: Line 23:
  
 
==Examples==
 
==Examples==
''<span style="color:red;">No additional examples</span>''
 
  
 +
Bluetooth based examples.
 +
 +
{{Zip|MA_FC_Bluetooth.zip|MIAC AllCode Bluetooth}}
 +
 +
 +
WIFI based examples.
 +
 +
{{Zip|MA_FC_WIFI.zip|MIAC AllCode WIFI}}
  
 
==Downloadable macro reference==
 
==Downloadable macro reference==

Latest revision as of 15:45, 27 August 2019


Author Matrix TSL
Version 1.0 (Release)
Category MIAC: PC Peripheral


Image 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

Bluetooth based examples.

ZIP Icon.png MIAC AllCode Bluetooth


WIFI based examples.

ZIP Icon.png MIAC AllCode WIFI

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

BYTE


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

BYTE


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

BYTE


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

BYTE


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

BYTE


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

BYTE


CommsRead

Reads a byte from the alt communications channel

Parameters

BYTE Timeout
Range: 0-255 : 0 = Don't wait / 1-255 = ms


Return value

BYTE


ReadKey

Reads a keypress from the keypad.

Parameters

This macro has no parameters


Return value

BYTE


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

BYTE


CardReadByte

Reads a byte from the open file.

Parameters

This macro has no parameters


Return value

BYTE


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

BYTE


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

UINT


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

BYTE


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