Jump to content

Component: MIAC Basic (MIAC: Addon Modules): Difference between revisions

From Flowcode Help
XML import
 
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{| style="width:50%"
 
{| width="50%"
|-
|-
| width="20%" style="color: gray;" | Author
| width="20%" style="color:gray;" | Author
| [http://www.matrixtsl.com Matrix TSL]
|  
|-
|-
| width="20%" style="color: gray;" | Version
| width="20%" style="color:gray;" | Version
| 1.0 (Release)
| 1.0
|-
|-
| width="20%" style="color: gray;" | Category
| width="20%" style="color:gray;" | Category
| MIAC: Addon Modules
| MIAC: Addon Modules
|}
|}




 
==MIAC Basic component==
==[[File:Component Icon 8c6ad2c7_f4a7_4584_a376_ec7fed05e5d3.png|Image]] MIAC Basic component==
Basic Addon expansion module for MIAC System
Basic Addon expansion module for MIAC System


==Examples==
==Component Source Code==
''<span style="color:red;">No additional examples</span>''


Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_ma_basic.fcfx FC_Comp_Source_ma_basic.fcfx]


==Downloadable macro reference==
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_ma_basic.fcfx FC_Comp_Source_ma_basic.fcfx]


===<span style="font-weight: normal;"><u><tt>PWM_Enable</tt></u></span>===
==Detailed description==
Enable the PWM on Channel 1 or 2


'''Parameters'''


:[[Variable Types|BYTE]] ''Channel''
::PWM Channel 1 or 2




'''Return value'''


:''This call does not return a value''




===<span style="font-weight: normal;"><u><tt>LED_Control</tt></u></span>===
Sets the indicator LED On (State=1) or Off (State=0)


'''Parameters'''


:[[Variable Types|BYTE]] ''State''




'''Return value'''


:''This call does not return a value''




===<span style="font-weight: normal;"><u><tt>PWM_Disable</tt></u></span>===
Disable the PWM on Channel 1 or 2


'''Parameters'''
''No detailed description exists yet for this component''


:[[Variable Types|BYTE]] ''Channel''
==Examples==
::PWM Channel 1 or 2




'''Return value'''


:''This call does not return a value''




===<span style="font-weight: normal;"><u><tt>DigitalOutput</tt></u></span>===
Set a Terminal Output to High (Value=1) or Low (Value=0)


'''Parameters'''


:[[Variable Types|BYTE]] ''Terminal''


:[[Variable Types|BYTE]] ''Value''




'''Return value'''


:[[Variable Types|BYTE]]




===<span style="font-weight: normal;"><u><tt>AnalogInput</tt></u></span>===
Read the ADC value of a Terminal


Returns 12 bit ADC reading


'''Parameters'''


:[[Variable Types|BYTE]] ''Terminal''
''<span style="color:red;">No additional examples</span>''
::Terminal number to be read




'''Return value'''


:[[Variable Types|UINT]]




===<span style="font-weight: normal;"><u><tt>Initialize</tt></u></span>===
Forces a software reset on the module


'''Parameters'''


:''This macro has no parameters''




'''Return value'''


:''This call does not return a value''




===<span style="font-weight: normal;"><u><tt>PWM_SetDuty</tt></u></span>===
==Macro reference==
Sets the PWM Duty cycle on Channel 1 or 2


'''Parameters'''
===AnalogInput===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''AnalogInput'''
|-
| colspan="2" | Read the ADC value of a Terminal Returns 12 bit ADC reading&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Terminal
|-
| colspan="2" | Terminal number to be read&nbsp;
|-
| 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''
|}


:[[Variable Types|BYTE]] ''Channel''
::PWM Channel 1 or 2


:[[Variable Types|BYTE]] ''Duty''
===DigitalInput===
::Duty cycle (8 bit value)
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''DigitalInput'''
|-
| colspan="2" | Read the value of a terminal &nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Terminal
|-
| colspan="2" | &nbsp;
|-
| 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''
|}




'''Return value'''
===DigitalOutput===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''DigitalOutput'''
|-
| colspan="2" | Set a Terminal Output to High (Value=1) or Low (Value=0)&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Terminal
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Value
|-
| colspan="2" | &nbsp;
|-
| 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''
|}


:''This call does not return a value''


===Initialize===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''Initialize'''
|-
| colspan="2" | Forces a software reset on the module&nbsp;
|-
|-
| 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''
|}


===<span style="font-weight: normal;"><u><tt>DigitalInput</tt></u></span>===
Read the value of a terminal


'''Parameters'''
===LED_Control===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''LED_Control'''
|-
| colspan="2" | Sets the indicator LED On (State=1) or Off (State=0)&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | State
|-
| colspan="2" | &nbsp;
|-
| 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''
|}


:[[Variable Types|BYTE]] ''Terminal''


===MIAC_Module_GetData===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''MIAC_Module_GetData'''
|-
| colspan="2" | &nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Index
|-
| colspan="2" | &nbsp;
|-
| 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''
|}


'''Return value'''


:[[Variable Types|BYTE]]
===MIAC_Module_Init===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''MIAC_Module_Init'''
|-
| colspan="2" | &nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | CAN_ID
|-
| colspan="2" | &nbsp;
|-
| 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''
|}




===MIAC_Module_Message===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''MIAC_Module_Message'''
|-
| colspan="2" | &nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | CAN_ID
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | CMD_ID
|-
| colspan="2" | &nbsp;
|-
| 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''
|}


==Simulation macro reference==


''This component does not contain any simulation macros''
===MIAC_Module_PushData===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''MIAC_Module_PushData'''
|-
| colspan="2" | &nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Data
|-
| colspan="2" | &nbsp;
|-
| 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''
|}




==Property reference==
===MIAC_Module_SetData===
<span style="font-weight: normal;"><u>Module Type</u></span>
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''MIAC_Module_SetData'''
|-
| colspan="2" | &nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Count
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | D0
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | D1
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | D2
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | D3
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | D4
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | D5
|-
| colspan="2" | &nbsp;
|-
| 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''
|}


This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''MODULE_TYPE''.


''<span style="color:red;">No additional information</span>''
===PWM_Disable===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''PWM_Disable'''
|-
| colspan="2" | Disable the PWM on Channel 1 or 2&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | PWM Channel 1 or 2&nbsp;
|-
| 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''
|}




===PWM_Enable===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''PWM_Enable'''
|-
| colspan="2" | Enable the PWM on Channel 1 or 2&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | PWM Channel 1 or 2&nbsp;
|-
| 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''
|}


<span style="font-weight: normal;"><u>Module Address</u></span>


This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''ORDINAL''.
===PWM_SetDuty===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''PWM_SetDuty'''
|-
| colspan="2" | Sets the PWM Duty cycle on Channel 1 or 2&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | PWM Channel 1 or 2&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Duty
|-
| colspan="2" | Duty cycle (8 bit value)&nbsp;
|-
| 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''
|}


''<span style="color:red;">No additional information</span>''


==Property reference==


 
{| class="mtx-class-macrotable wikitable"
<span style="font-weight: normal;"><u>Period Overflow</u></span>
|-
 
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''PERIOD''.
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
 
|-
''<span style="color:red;">No additional information</span>''
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Module Type
 
|-
<span style="font-weight: normal;"><u>Prescaler</u></span>
| colspan="2" | &nbsp;
 
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''PRESCALER''.
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Module Address
''<span style="color:red;">No additional information</span>''
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
<span style="font-weight: normal;"><u>Frequency (KHz)</u></span>
| width="90%" class="mtx-class-propfolder" | PWM
 
|-
This property is of type ''Floating point'' and can be referenced with the variable name ''PWM_FREQ''.
|-
 
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
''<span style="color:red;">No additional information</span>''
| width="90%" | Period Overflow
 
|-
 
| colspan="2" | &nbsp;
 
|-
<span style="font-weight: normal;"><u>Period (uS)</u></span>
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Prescaler
This property is of type ''Floating point'' and can be referenced with the variable name ''PWM_PERIOD''.
|-
 
| colspan="2" | &nbsp;
''<span style="color:red;">No additional information</span>''
|-
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
| width="90%" | Frequency (KHz)
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
| width="90%" | Period (uS)
|-
| colspan="2" | &nbsp;
|}

Latest revision as of 14:37, 13 July 2026

Author
Version 1.0
Category MIAC: Addon Modules


MIAC Basic component

Basic Addon expansion module for MIAC System

Component Source Code

Please click here to download the component source project: FC_Comp_Source_ma_basic.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_ma_basic.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples







Macro reference

AnalogInput

AnalogInput
Read the ADC value of a Terminal Returns 12 bit ADC reading 
- BYTE Terminal
Terminal number to be read 
- UINT Return


DigitalInput

DigitalInput
Read the value of a terminal  
- BYTE Terminal
 
- BYTE Return


DigitalOutput

DigitalOutput
Set a Terminal Output to High (Value=1) or Low (Value=0) 
- BYTE Terminal
 
- BYTE Value
 
- BYTE Return


Initialize

Initialize
Forces a software reset on the module 
- VOID Return


LED_Control

LED_Control
Sets the indicator LED On (State=1) or Off (State=0) 
- BYTE State
 
- VOID Return


MIAC_Module_GetData

MIAC_Module_GetData
 
- BYTE Index
 
- BYTE Return


MIAC_Module_Init

MIAC_Module_Init
 
- UINT CAN_ID
 
- VOID Return


MIAC_Module_Message

MIAC_Module_Message
 
- UINT CAN_ID
 
- UINT CMD_ID
 
- BYTE Return


MIAC_Module_PushData

MIAC_Module_PushData
 
- BYTE Data
 
- VOID Return


MIAC_Module_SetData

MIAC_Module_SetData
 
- BYTE Count
 
- BYTE D0
 
- BYTE D1
 
- BYTE D2
 
- BYTE D3
 
- BYTE D4
 
- BYTE D5
 
- VOID Return


PWM_Disable

PWM_Disable
Disable the PWM on Channel 1 or 2 
- BYTE Channel
PWM Channel 1 or 2 
- VOID Return


PWM_Enable

PWM_Enable
Enable the PWM on Channel 1 or 2 
- BYTE Channel
PWM Channel 1 or 2 
- VOID Return


PWM_SetDuty

PWM_SetDuty
Sets the PWM Duty cycle on Channel 1 or 2 
- BYTE Channel
PWM Channel 1 or 2 
- BYTE Duty
Duty cycle (8 bit value) 
- VOID Return


Property reference

Properties
Module Type
 
Module Address
 
PWM
Period Overflow
 
Prescaler
 
Frequency (KHz)
 
Period (uS)