Jump to content

Customising A Component

From Flowcode Help
Revision as of 11:47, 29 June 2026 by SteveT (talk | contribs) (Exporting the component)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Introduction

Sometimes components may need to be customised, for example with specific default pin connections that are meaningful for your hardware.


Adding the component

Begin by starting a new project and select the microcontroller you are going to be using.

Next add the component you wish to customise to the apropreate panel e.g 2D for 2D components. I am using the generic customable LCD which I want to assign with custom pre-set pins on PortD.


Presetting Property Values

Select the component on the panel and open the Properties window. Then adjust the properties to be as you want them to be. For example I'm going to change the pins from the default PortB 0-5 to PortD 2 - 7.

Tip: You can change the top pin then Right or left click and select Auto connect digital


Exposing Properties

While we are in the properties window there may be properties that you will still need to be available to the user when using your new customised component. Simply right click these properties and choose Expose from the menu to expose these properties to the user of the component.

You can see which properties will be available to the user by clicking on a blank area of the component panel, or by choosing Panel from the drop down menu at the top of the Properties window.


Exposing Macros

As well as properties you will also need to expose the macros for the component that can be called. This could be all the components macros or could simply be a sub set if you only ever use a few macro calls from a component. Open the Project Explorer window and select the components tab, then right click any macros you want available and select Expose from the menu.

You can see which macros will be available to the user by clicking on a blank area of the component panel, or by choosing Panel from the drop down menu at the top of the Properties window and then selecting the Macros tab.


Finishing Up

Before we export the component we need to do a number of small finishing steps to get the new component ready. First save your project in a meaningful location with a meaningful name so you can go back and re-export the modified component in future if needed.


Next click on the File -> Export -> Edit the export settings for your component


Setup Tab - Standard

Give the component a Name, a Cosmetic Name, Assign pannel type, Assign a Category from the drop down menu.


Setup Tab - Advanced

If you have already created one component from your project file and want to create a new but different component then click Edit next to GUID and click New next to the GUID, this ensures you do not overwrite your previously exported component.


When you're done click OK.


Exporting the component

Next simply click the File -> Export -> Export this project as a component to save the component as a .fcpx file. This file can be saved into the standard Flowcode components folder or you can create your own custom folder.

You might be prompted to save the project fcfx file first if there have been any changes.


Flowcode 7

Components location : "C:\Program Files (x86)\Flowcode 7\Components"

Export somewhere with write access e.g. your desktop and then manually copy the file into the components folder using Windows explorer, you will need administrator permissions to write inside the Program Files (x86) folder.


Flowcode 8 and later

It is recommended that user-generated components are saved into a custom location and not saved to Flowcode's component folder. This is because Flowcode may modify its component folder following an update and any components saved there may be deleted.

Since v11.0.2, Flowcode will warn you if you attempt to export a component into this area of %PROGRAMFILES%.

However, it is still possibly to save your own components there. But make sure you have a back-up.

Flowcode's components folder for versions v8 and older can be found in the following location : "%PROGRAMDATA%\MatrixTSL\FlowcodeVxx\Components", where "xx" is the version of Flowcode.

%PROGRAMDATA% is a reference to a common location used by Windows-based apps. Typically this will be "C:\ProgramData\" but may be elsewhere if the OS is installed on a different drive or is in a non-English language.

So for v11, the components location is typically: "C:\ProgramData\MatrixTSL\FlowcodeV11\Components".


Custom Location

Export directly to your own custom components folder.

To use your own folder simply click on File -> Global Settings -> Locations Tab menu and add your custom folder location to the Look for components in... text field.

Using the component

The new component should now appear in Flowcode in the category you selected. Simply use the component as you would any other component.


Advanced - Dynamic Properties

Note: Some component properties such as CAL type component channels and pins are dynamic and based on the selected target microcontroller and will not work with the method explained above, for these you will have to use something like the Initialise event and the Simulation API to force your custom property values in as the component is loaded.