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

From Flowcode Help
Jump to navigationJump to search
Line 2: Line 2:
 
* Create a new flowchart.
 
* Create a new flowchart.
  
* The following assumes that you have built, and exported a LED component, as described in [[Exercise - Create a LED component]] and [[Exercise - Open the 'Outputs' toolbox, where we stored the exported 'newLED' component. (If no destination was specified for the exported component, it would appear in the 'Misc' toolbox.)
+
* The following assumes that you have built, and exported a LED component, as described in [[Exercise - Create a LED component]] and [[Exercise - Exporting the LED component]].
 +
 
 +
* Open the 'Outputs' toolbox, where you stored the exported 'newLED' component. (If no destination was specified for the exported component, it would appear in the 'Misc' toolbox.)
  
 
* Locate the 'newLED' component, and use the down-arrow next to it to add it to the [[System Panel]]. It can now be used in the same way as any other electronic device.  
 
* Locate the 'newLED' component, and use the down-arrow next to it to add it to the [[System Panel]]. It can now be used in the same way as any other electronic device.  
Line 10: Line 12:
 
* Add a component macro to the flowchart, and double-click on it. Click on the 'Simulation' tab. The simulation macros, 'LEDoff' and 'LEDon',appear in the tree. Click on the one you want, and then click on 'OK'.  
 
* Add a component macro to the flowchart, and double-click on it. Click on the 'Simulation' tab. The simulation macros, 'LEDoff' and 'LEDon',appear in the tree. Click on the one you want, and then click on 'OK'.  
  
 
+
* Simulate the flowchart, (see [[Exercise - Simulate a simple flowchart]], to test whether the import has worked.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Create a LED component as shown in the [[Exercise - Create a LED component]].
 
 
 
[[File:Gen exerciseLEDcreate macropropsLEDoff 01.png|300px|right]]
 
==Setting the category==
 
'''Select category'''
 
'''Description and other details'''
 
 
 
==Declaring the interface==
 
* 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]].
 
 
 
* Configure this for the LED component. In particular, click on the 'Interface' tab, and set the 'LEDoff' and 'LEDon' macros as 'Component' macros. The 'PinChange' macro is a 'Hidden' macro.
 
 
 
* 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. If you did not select a category you will find the component in'''Misc'''.
 
 
 
Drag your component onto a panel, or double click on it.
 
 
 
'''Create a test flowchart'''
 

Revision as of 11:30, 24 May 2013

  • Create a new flowchart.
  • Open the 'Outputs' toolbox, where you stored the exported 'newLED' component. (If no destination was specified for the exported component, it would appear in the 'Misc' toolbox.)
  • Locate the 'newLED' component, and use the down-arrow next to it to add it to the System Panel. It can now be used in the same way as any other electronic device.
  • Create a flowchart which uses the imported component.
  • Add a component macro to the flowchart, and double-click on it. Click on the 'Simulation' tab. The simulation macros, 'LEDoff' and 'LEDon',appear in the tree. Click on the one you want, and then click on 'OK'.