Difference between revisions of "Exercise - Exporting the LED Component"

From Flowcode Help
Jump to navigationJump to search
 
(31 intermediate revisions by 3 users not shown)
Line 1: Line 1:
* Create a LED component as shown in the [[Exercise - Create a LED component]].
+
<sidebar>Sidebar: Flowcode Exercises:Ex3</sidebar>
 +
Now that we have created an LED in the previous [[Exercise - Create an LED Component]] article we can now export the component for use elsewhere.
 +
 
 +
__NOTOC__
 +
==Preliminaries==
 +
[[File:gen_exerciseLEDexport_compmansetup_01.png|280px|right]]
 +
* Create a LED component as shown in the [[Exercise - Create an LED Component]].
 +
 
 +
 
 +
 
 +
 
 +
==Declaring the interface==
 +
 
 +
Before you export a component, you need to 'declare the interface'. The interface is the collection of macros and files publically available to the user. Declaring the interface means deciding which of the component routines to make available to the user, and to decide whether these are suitable for simulation or for download.
 +
 
  
 
* Move the mouse cursor over the [[System Panel]], and right-click.
 
* Move the mouse cursor over the [[System Panel]], and right-click.
  
* Select the option 'Export component'. The [[Component Management]] dialogue box opens. This replicates the settings, [[Settings Manager]], [[Interface Manager]] and [[Resources Manager]] available on the [[Panel Properties]].
+
* Select the option 'Export component'. The 'Component Management' dialogue box opens. This replicates the settings, [[Settings Manager]], [[Interface Manager]] and [[Resource Manager]] available on the [[Properties Panel]].
 
+
[[File:gen_exerciseLEDexport_componentman01.png|280px|right]]
* Configure this for the LED component. In particular, click on the 'Interface' tab, and set the 'LEDoff' and 'LEDon' macros as 'Simulation' macros. The 'PinChange' macro is a 'Hidden' macro.
+
* Configure this for the LED component as follow:
 +
:* Click on the 'Setup' tab.
 +
::* Assign the component to a category, by clicking on the down-arrow next to the label 'Category'. In this case, the component will go into the 'Outputs' toolbox.
 +
::* Click on the check-box next to the 'Use an image of the panel' label.
 +
:* Click on the 'Interface' tab.
 +
::* Set the 'LEDoff' and 'LEDon' macros as 'Downloadable' macros, by selecting each in turn, and clicking on 'Component macro' in the 'Type of macro' drop-down menu.  
 +
::* Set the 'PinChange' macro as a 'Hidden' macro, in the same way.
 +
:* In this case, there is no need to use the 'Resources' tab, as there are no additional files to save with the component.
  
 
* Click on 'OK'.
 
* Click on 'OK'.
  
 +
==Saving the component==
 
* You may be asked if you want to save the current flowchart. Do so if you wish.
 
* You may be asked if you want to save the current flowchart. Do so if you wish.
  
* The 'Save As' dialogue box opens. Choose a destination and a suitable name for the component.  
+
* The 'Save As' dialogue box opens. This will automatically point to a destination Flowcode will search for components. Select a suitable name for the component.  
  
 
* Click 'Save'. The component file is saved with a '*.fcpx' extension.
 
* Click 'Save'. The component file is saved with a '*.fcpx' extension.
 +
 +
 +
==What next?==
 +
Now you need to [[Exercise - Importing the LED Component|import the component]] into a new flowchart for testing.

Latest revision as of 14:43, 13 March 2014

<sidebar>Sidebar: Flowcode Exercises:Ex3</sidebar> Now that we have created an LED in the previous Exercise - Create an LED Component article we can now export the component for use elsewhere.


Preliminaries

Gen exerciseLEDexport compmansetup 01.png



Declaring the interface

Before you export a component, you need to 'declare the interface'. The interface is the collection of macros and files publically available to the user. Declaring the interface means deciding which of the component routines to make available to the user, and to decide whether these are suitable for simulation or for download.


  • Move the mouse cursor over the System Panel, and right-click.
Gen exerciseLEDexport componentman01.png
  • Configure this for the LED component as follow:
  • Click on the 'Setup' tab.
  • Assign the component to a category, by clicking on the down-arrow next to the label 'Category'. In this case, the component will go into the 'Outputs' toolbox.
  • Click on the check-box next to the 'Use an image of the panel' label.
  • Click on the 'Interface' tab.
  • Set the 'LEDoff' and 'LEDon' macros as 'Downloadable' macros, by selecting each in turn, and clicking on 'Component macro' in the 'Type of macro' drop-down menu.
  • Set the 'PinChange' macro as a 'Hidden' macro, in the same way.
  • In this case, there is no need to use the 'Resources' tab, as there are no additional files to save with the component.
  • Click on 'OK'.

Saving the component

  • You may be asked if you want to save the current flowchart. Do so if you wish.
  • The 'Save As' dialogue box opens. This will automatically point to a destination Flowcode will search for components. Select a suitable name for the component.
  • Click 'Save'. The component file is saved with a '*.fcpx' extension.


What next?

Now you need to import the component into a new flowchart for testing.