Difference between revisions of "Component: MIAC (PIC) (MIAC Module)"
(XML import BR) |
|||
Line 21: | Line 21: | ||
==Examples== | ==Examples== | ||
− | |||
===Analogue Input=== | ===Analogue Input=== | ||
Basic example of how to read an analogue input on the MIAC and display it on the LCD. | Basic example of how to read an analogue input on the MIAC and display it on the LCD. | ||
− | |||
{{Fcfile|MIAC_ADC_t01.fcfx|MIAC ADC LCD}} | {{Fcfile|MIAC_ADC_t01.fcfx|MIAC ADC LCD}} | ||
− | |||
− | |||
===Keypad Input=== | ===Keypad Input=== | ||
Basic example of how to read the keypad and display the value on the LCD. | Basic example of how to read the keypad and display the value on the LCD. | ||
− | |||
{{Fcfile|MIAC_Keypad.fcfx|MIAC Keypad}} | {{Fcfile|MIAC_Keypad.fcfx|MIAC Keypad}} | ||
− | |||
− | |||
For reference the numbering of the MIAC keypad looks like this. | For reference the numbering of the MIAC keypad looks like this. | ||
Line 48: | Line 41: | ||
If you are driving high current outputs then you can instead supply separate DC power to the M terminal. | If you are driving high current outputs then you can instead supply separate DC power to the M terminal. | ||
− | |||
{{Fcfile|MIAC_Outputs.fcfx|MIAC Outputs}} | {{Fcfile|MIAC_Outputs.fcfx|MIAC Outputs}} | ||
− | |||
− | |||
[[File:MIACOuts.jpg]] | [[File:MIACOuts.jpg]] | ||
Line 58: | Line 48: | ||
Basic example of how to create a timer interrupt based clock. | Basic example of how to create a timer interrupt based clock. | ||
− | |||
{{Fcfile|MIAC_Clock.fcfx|MIAC Clock}} | {{Fcfile|MIAC_Clock.fcfx|MIAC Clock}} | ||
− | |||
− | |||
[[File:MIACclock.jpg]] | [[File:MIACclock.jpg]] | ||
− | |||
==Downloadable macro reference== | ==Downloadable macro reference== |
Revision as of 15:46, 16 February 2017
Author | Matrix Ltd |
Version | 1.6 (Release) |
Category | MIAC Module |
Contents
MIAC (PIC) component
MIAC - Matrix Industrial Automotive Controller PLC type module based on a PIC18F4455 device, produced by Matrix Component includes functions to drive the functionality of the MIAC and MIAC system.
Examples
Analogue Input
Basic example of how to read an analogue input on the MIAC and display it on the LCD.
MIAC ADC LCD
Keypad Input
Basic example of how to read the keypad and display the value on the LCD.
MIAC Keypad
For reference the numbering of the MIAC keypad looks like this.
Output Control
Basic example of how to control all of the individual outputs on the MIAC using the keypad.
Note that for the transistor outputs to come on you must wire a connection from the +V terminal to the M terminal.
If you are driving high current outputs then you can instead supply separate DC power to the M terminal.
MIAC Outputs
MIAC Interrupt Controlled Clock
Basic example of how to create a timer interrupt based clock.
MIAC Clock
Downloadable macro reference
InputANALOG_10Bit
Returns the 10 bit value for the analogue input requested by parameter InputID
(Inputs 1 to 8)
Parameters
- BYTE InputID
- The input to read from 1 to 8.
Return value
RelayOFF
Turns off the requested relay given by parameter RelayID, values 1 to 4
Parameters
- BYTE RelayID
- The relay to turn off. From 1 to 4.
Return value
- This call does not return a value
PrintString
Prints the given character string to the display at the current cursor position and moves the cursor position.
Parameters
- <- STRING Str
- The string to send to the display.
- This parameter may be returned back to the caller
Return value
- This call does not return a value
GetKeypad
Returns the key code of the key that is pressed, otherwise if nothing is pressed then returns 255
Parameters
- This macro has no parameters
Return value
DisplayStart
Initialise the display ready for use
Parameters
- This macro has no parameters
Return value
- This call does not return a value
DisplayCommand
Sends the given command to the display
Parameters
- BYTE Cmd
Return value
- This call does not return a value
PrintASCII
Prints the given character to the display at the current cursor position and increments the cursor position.
Parameters
- BYTE Char
- ASCII code of the character to print.
Return value
- This call does not return a value
PrintNumber
Prints the given number to the display starting at the current cursor position and moves the cursor position.
Parameters
- INT n
Return value
- This call does not return a value
PrintFormattedNumber
Will allow you to print a number up to 32-bits with signed or unsigned formatting.
Signed = -2147483648 to 2147483647
Unsigned = 0 to 4294967295
Parameters
- ULONG Number
- Enter the number or variable to print to the LCD
- BOOL Format
- 0=Signed, 1=Unsigned
Return value
- This call does not return a value
DisplayClear
Clears the display to white space
Parameters
- This macro has no parameters
Return value
- This call does not return a value
RelayON
Turns on the requested relay given by parameter RelayID, values 1 to 4
Parameters
- BYTE RelayID
- The relay to turn on from 1 to 4.
Return value
- This call does not return a value
OutputOFF
Outputs a digital low state on the output requested by parameter TransID
(Outputs 1 to 4)
Parameters
- BYTE TransID
- 1 to 4 (Outputs A to D)
Return value
- This call does not return a value
DisplayCursor
Moves the display cursor to the given position.
If the cursor is set to the origin at x=0, y=0, then the next character sent to the display will appear in the top left corner.
Parameters
- BYTE x
- Position of the cursor in characters from left to right.
- BYTE y
- The line to move the cursor to.
Return value
- This call does not return a value
OutputON
Outputs a digital high state on the output requested by parameter TransID
(Outputs 1 to 4)
Parameters
- BYTE TransID
- 1 to 4 (Outputs A to D)
Return value
- This call does not return a value
InputDIGITAL
Returns the digital state of the input requested by parameter InputID
(Inputs 1 to 8)
Parameters
- BYTE InputID
- The input number from 1 to 8.
Return value
InputANALOG
Returns the 8 bit value for the analogue input requested by parameter InputID
(Inputs 1 to 8)
Parameters
- BYTE InputID
- The input to read from 1 to 8.
Return value
Simulation macro reference
EvClick
No additional information
Parameters
- This macro has no parameters
Return value
- This call does not return a value
Property reference
This component does not contain any properties