Unable to Export Component

A forum where Flowcode v6 user created components can be shared, discussed and reviewed.

Moderator: Benj

Post Reply
User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times
Contact:

Unable to Export Component

Post by JohnCrow »

Hi
I must be missing something but I've tried following the Create LED tutorial in the Wiki

I get to the Export Component section and hit a problem.
In the "Interface" section of "Component Management" where it says select component macro for LEDon and LEDoff, that one is not in the dropdown box
I just get
Hidden
Downloadable
Simulation
Hidden embedded
Embedded

I had it working in the beta release, but it seems to be a slightly different method now.

Attached the file I've created so far.
oneLED.fcfx
(5.48 KiB) Downloaded 412 times
1 in 10 people understand binary, the other one doesn't !

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: Unable to Export Component

Post by JonnyW »

Hi John.

The 'component macro' was the older name for 'downloadable macro' - we felt it described the type of macro better that way. Same thing though and I will update the Wiki, thanks for the spot.

Jonny

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times
Contact:

Re: Unable to Export Component

Post by JohnCrow »

Thanks Jonny
Got it working now :)
1 in 10 people understand binary, the other one doesn't !

Kenrix2
Flowcode v5 User
Posts: 211
Joined: Tue Feb 19, 2013 9:51 pm
Has thanked: 72 times
Been thanked: 177 times
Contact:

Re: Unable to Export Component

Post by Kenrix2 »

The tutorial on creating the led component is very well done. It is step by step with clear instructions on how to create it which made it easy for me to learn. Thank you very much for for making that tutorial. I would like to learn more so I can create components that use some of the other functions. Using the function "SetColor" is all I understand how to do right now. Perhaps when you have time, another tutorial using other functions, like "GetValue" and "SetValue" would be very helpful. Another thought would be to request a program that has some examples using the other functions and properties so I can see how they are setup and also step through them to understand how they react. An example program wouldn't have to actually "do anything" I am just looking for something to take the mystery out of using the other functions and properties. Having an example program would be nice since I could have that program open to refer to while creating my own program.

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: Unable to Export Component

Post by JonnyW »

Hello.

I have done a Flowcode introduction tutorial recently, and we have step-by-step guides on various activities, such as creating and LED component and a sim-only analogue clock. These are good for getting in to components and simulations.

I will Email my manager and if it is OK with them will post some of these tutorials here, hopefully let you know Monday.

In the meantime, here is a Simon game that I wrote as an activity - this gives hints on what to do but is not a step-by-step tutorial. This is a downloadable (I assume) and simulatable Simon game. I hope it helps.
simon.png
(6.69 KiB) Downloaded 6046 times
simon_game.fcfx
Game source
(28.84 KiB) Downloaded 388 times
simon_activity.pdf
Activity sheet
(61.83 KiB) Downloaded 474 times
PS: If this does not open in your version of Flowcode, I have had a play with the file format, trying to streamline things. Let me know if this is the case and I will try to ensure compatibility with 6.0.4.

Jonny

Kenrix2
Flowcode v5 User
Posts: 211
Joined: Tue Feb 19, 2013 9:51 pm
Has thanked: 72 times
Been thanked: 177 times
Contact:

Re: Unable to Export Component

Post by Kenrix2 »

Thank you for the example, nicely done. I will experiment with the SetValue portion. I wish I understood the basic concept of of the other functions and properties and the variables (which don't even seem to act like variables) so I could at least ask a simple question on how to do something in particular, but i don't. If I add a list of integers to the property and then select a function for a Sim icon, just about anything I try to put in the fields is rejected or does not work as I would expect. Another problem, or maybe it really isn't a problem, I always get incompatible macro!. For some reason I am just not getting it. I am a patient person and I am sure, eventually, something will get posted about creating components that will make me understand and I can say, "Oh, that's what is going on, now I get it". Thanks again for your help.

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: Unable to Export Component

Post by JonnyW »

Morning.

Events
There are various subtleties to Events and matching macros. One thing to remember is every event returns a ULONG type - this is the usual thing to miss when creating macros by hand.

Easiest thing to do is let Flowcode create the macros and it will get everything right for that event. Double click on the bold Macro and the macro will be created, as it is for the interrupt icon.
000040_Add event.png
(16.91 KiB) Downloaded 6028 times
This wiki entry may help clear things up.
http://www.matrixmultimedia.com/wiki/in ... ion_Events

Properties
A property is a funny thing. When it is downloaded it becomes a define, but in simulation we have the ability to 're-define' its value using SetValue(). They behave more like mini-macros than variables.

So if you have a property called 'Number' and it has a value of '5', you can not do 'Number = 10', because Flowcode sees this as '5 =10', which does not make sense. To get round this during simulation we use SetValue() to redefine the value of the property.

Here is a demo program of 'SetValue' and 'GetValue' - it uses a general expression you can modify during simulation to change the results of the property.
property_eg.fcfx
Properties in simulation
(16.48 KiB) Downloaded 403 times
I hope all this is useful (and works) - let me know of any problems.

Jonny

Post Reply