Difference between revisions of "Exercise - Exporting the Traffic Cone Component"

From Flowcode Help
Jump to navigationJump to search
Line 15: Line 15:
 
* Configure this for the traffic cone component as follow:
 
* Configure this for the traffic cone component as follow:
 
:* Click on the 'Setup' tab.
 
:* Click on the 'Setup' tab.
::* Assign the component to the 'Misc'toolbox, by clicking on the down-arrow next to the label 'Category'.  
+
::* Don't assign a category. As a result, the traffic cone will appear in the 'Misc'toolbox.
 +
::* Give the component a 'Cosmetic name' of "traffic cone". This name will appear in the list of components in the 'Misc' toolbox.
 
::* Click on the check-box next to the 'Use an image of the panel' label.
 
::* Click on the check-box next to the 'Use an image of the panel' label.
 
:* Click on the 'Interface' tab.  
 
:* Click on the 'Interface' tab.  
::* Set the 'LEDoff' and 'LEDon' macros as 'Component' macros, by selecting each in turn, and clicking on 'Component macro' in the 'Type of macro' drop-down menu.  
+
::* Set the 'flash' macro as a 'Simulation' macro, by clicking on 'Simulation macro' in the 'Type of macro' drop-down menu.  
 
::* Set the 'PinChange' macro as a 'Hidden' macro, in the same way.
 
::* 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.
 
:* In this case, there is no need to use the 'Resources' tab, as there are no additional files to save with the component.

Revision as of 19:36, 27 May 2013

Preliminaries

Gen exerciseLEDexport compmansetup 01.png



Declaring the interface

Before you export a component, you need to 'declare the interface'.

  • Move the mouse cursor over the System Panel, and right-click.
Gen exerciseLEDexport componentman01.png
  • Configure this for the traffic cone component as follow:
  • Click on the 'Setup' tab.
  • Don't assign a category. As a result, the traffic cone will appear in the 'Misc'toolbox.
  • Give the component a 'Cosmetic name' of "traffic cone". This name will appear in the list of components in the 'Misc' toolbox.
  • Click on the check-box next to the 'Use an image of the panel' label.
  • Click on the 'Interface' tab.
  • Set the 'flash' macro as a 'Simulation' macro, by clicking on 'Simulation 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.



Testing the component

Select to create a new flowchart from the main menu.

Go to the category your component was assigned to be in, ('Outputs' in this case). If you did not select a category you will find the component inMisc.

Click on the down arrow next to the component, and select 'Add to system panel, or double click on the name of the component.

Create a Flowcode flowchart to test the component, such as the one given in the Exercise - Testing an imported LED component