Difference between revisions of "Component Macro Icon Properties"

From Flowcode Help
Jump to navigationJump to search
Tags: Flowcode v8 Version
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<sidebar>Sidebar: Icon Properties</sidebar>
+
[[File:iconComponentMacro.png|border]]
{| style="margin:auto; text-align:center;"
 
|-
 
|[[File:Btn_Component_Macro.gif|border]]
 
| width="50px" |&rarr;
 
|[[File:Gen_Component_Macro_Flowchart_Icon_01.png]]
 
|width="50px" |&rarr;
 
|[[File:Gen_Component_Macro_Icon_Properties_01.png]]
 
|}
 
 
 
Macros are split into Macros and Component/Simulation macros.
 
 
 
  
 
Component macros are pre-defined macros supplied with the components. For example LCD macros are used to display numbers and characters on the LCD display.
 
Component macros are pre-defined macros supplied with the components. For example LCD macros are used to display numbers and characters on the LCD display.
  
Component macros are only available for use with that particular component.
 
  
Component macros have hatched outer bands on the icon.
+
==Old Versions==
 +
This page is current for Flowcode v9 and later. Earlier versions can be found below:
 +
{| class="wikitable"
 +
|+
 +
|-
 +
| [[Special:PermanentLink/41380|Flowcode v8]]
 +
|}
  
  
[[Simulation Macro Icon Properties|Simulation macros]] are simulation-only Component macros - they provide a similar purpose, although they can only be used in simulation and cannot be run on hardware.
+
==Details==
 
+
{| style="margin:0px; text-align:center;"
 
+
|-
[[Creating a New Macro|Macros]] are those designed and created by the user.
+
|[[File:iconComponentMacro.png|border]]
 
+
| width="50px" |&rarr;
Macros can be [[Exporting a Macro|exported]] and [[Importing a Macro|imported]] allowing users to build up macro libraries of common or important tasks.
+
|[[File:Gen_Component_Macro_Flowchart_Icon_01.png]]  
 
+
|width="50px" |&rarr;
On Macros the outer bands are clear and not hatched.
+
|[[File:Properties_CompMacro.png]]
 +
|}
  
  
 
'''Adding a component macro'''
 
'''Adding a component macro'''
  
Select the component and then [[Selecting Component Macros|select the Component Macro icon.]]
+
Components macros are listed in the properties window and are grouped by component.
  
Select the component from the list of attached components to expand the list group to reveal the available component macros to choose from.
+
Find the component from the list of attached components and click the "+" sign to its left to expand the list group to reveal the available component macros.
  
Select the macro and add in any parameters required, and select a return value if required.
+
Select the macro and add in any parameters required, then optionally select a return value if required.
  
  
Line 42: Line 37:
 
If the device macro requires any parameters then these can be entered in this field. They can be numeric values, strings or existing variables. Clicking on the down arrow [[File:Btn_Arrow.png]] brings up the variables dialog window allowing you to select an existing variable or to [[Creating Variables|create a new one]].
 
If the device macro requires any parameters then these can be entered in this field. They can be numeric values, strings or existing variables. Clicking on the down arrow [[File:Btn_Arrow.png]] brings up the variables dialog window allowing you to select an existing variable or to [[Creating Variables|create a new one]].
  
The parameter details will list the parameter type. Parameters must be of the required type to be accepted.
+
The parameter details will list the parameter type. Parameters must be a compatible type to be accepted, and a full set of parameters must be provided.
 
 
Note that a full set of parameters must be provided.
 
  
 
Expressions can be used as parameters for example (5 + a) where a is a numeric variable. Expressions cannot contain string functions or other functions requiring the use of arrays.
 
Expressions can be used as parameters for example (5 + a) where a is a numeric variable. Expressions cannot contain string functions or other functions requiring the use of arrays.
Line 53: Line 46:
 
If the device macro returns a value then you can assign that value to an existing variable for use later in the flowchart. If the function returns a value but you do not wish to retrieve it then leave this field empty.
 
If the device macro returns a value then you can assign that value to an existing variable for use later in the flowchart. If the function returns a value but you do not wish to retrieve it then leave this field empty.
  
The [[Variable Types|variable type]] of the return value will be listed. A variable of the specified type must be used to accept the return value.
+
The [[Variable Types|variable type]] of the return value will be listed. A variable of compatible type must be used to accept the return value.
 +
 
 +
 
 +
==Macro types==
 +
Macros are 3 types of macro that can be called using this command icon:
 +
 
 +
{| class="wikitable"
 +
|+
 +
|-
 +
| [[Macro_Icon_Properties|Macros]]
 +
| Macros designed and created by the user that are created as part of this project.
 +
|-
 +
| [[Component_Macro_Icon_Properties|Components]]
 +
| Pre-defined macros supplied with the components. Only components that have been added to this project are available.
 +
|-
 +
| [[Simulation_Macro_Icon_Properties|Built-in Functions]]
 +
| Simulation-only macros for advanced Flowcode use such as component creation.
 +
|}
 +
 
  
====Video instructions====
+
==Video==
  
 
See the [http://www.youtube.com/watch?v=Xh68YXcTdoU&list=PLQDWBb7bxuCgg6aJgPJcfXBMzZdLILceQ Component Macro] video to learn how to call component macros, this video features both the [[Component: ID 7aad74d6 b24e 4dab 91eb 5d72a973f12d|ADC]] Dial and [[Component: ID 0953aac0 9c23 4c2f 9843 88954a4191ea|LCD]] EB005 components and their associated Component Macros.
 
See the [http://www.youtube.com/watch?v=Xh68YXcTdoU&list=PLQDWBb7bxuCgg6aJgPJcfXBMzZdLILceQ Component Macro] video to learn how to call component macros, this video features both the [[Component: ID 7aad74d6 b24e 4dab 91eb 5d72a973f12d|ADC]] Dial and [[Component: ID 0953aac0 9c23 4c2f 9843 88954a4191ea|LCD]] EB005 components and their associated Component Macros.

Latest revision as of 11:02, 12 June 2026

IconComponentMacro.png

Component macros are pre-defined macros supplied with the components. For example LCD macros are used to display numbers and characters on the LCD display.


Old Versions

This page is current for Flowcode v9 and later. Earlier versions can be found below:

Flowcode v8


Details

IconComponentMacro.png Gen Component Macro Flowchart Icon 01.png Properties CompMacro.png


Adding a component macro

Components macros are listed in the properties window and are grouped by component.

Find the component from the list of attached components and click the "+" sign to its left to expand the list group to reveal the available component macros.

Select the macro and add in any parameters required, then optionally select a return value if required.


Parameters

If the device macro requires any parameters then these can be entered in this field. They can be numeric values, strings or existing variables. Clicking on the down arrow Btn Arrow.png brings up the variables dialog window allowing you to select an existing variable or to create a new one.

The parameter details will list the parameter type. Parameters must be a compatible type to be accepted, and a full set of parameters must be provided.

Expressions can be used as parameters for example (5 + a) where a is a numeric variable. Expressions cannot contain string functions or other functions requiring the use of arrays.


Return value

If the device macro returns a value then you can assign that value to an existing variable for use later in the flowchart. If the function returns a value but you do not wish to retrieve it then leave this field empty.

The variable type of the return value will be listed. A variable of compatible type must be used to accept the return value.


Macro types

Macros are 3 types of macro that can be called using this command icon:

Macros Macros designed and created by the user that are created as part of this project.
Components Pre-defined macros supplied with the components. Only components that have been added to this project are available.
Built-in Functions Simulation-only macros for advanced Flowcode use such as component creation.


Video

See the Component Macro video to learn how to call component macros, this video features both the ADC Dial and LCD EB005 components and their associated Component Macros.

{{#ev:youtube|Xh68YXcTdoU|640}}