Suggestion for new Flowcode version

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Suggestion for new Flowcode version

Post by Jan Lichtenbelt »

Improvements go on. I have a suggestion for a new Flowcode version.

A good working Flowcode needs a lot of testing and a lot of loading the program into a microchip.

For me , there is always a need of knowing which version is used actual used. My suggestion to solve this problem is the following:

Make it possible to use a pre-defined variable (or constant), something like "Version_ID" which can be introduced in a Flowcode.
As soon as the Flowcode will be transferred into the C-code file this variable (or constant) gets an unique value. There are three possibilities:
1) The Version_ID value will increase each time it is used. A UInt fulfills in this case with values from 1 - 65,535, enough for a lifetime.
2) The Version-ID value will be equal to the C-file date and time, which is an unique parameter. My proposal is to give the date and time in seconds starting at January, 1st 2000. Using Ulong variable this is enough for 136 years (up to the year 2136, see Note1).
3) In MS Excel date and time are given in seconds starting at 1900 in a real format with the date before and the seconds after the point. But I would not prefer to use floating point variables in Flowcode if it can be done with bytes or integers.

After further conversion into the microchip, this Version_ID can e.g. be shown on a LCD screen, showing you are working with the correct version.

Kind regards

Jan Lichtenbelt


Note 1) each day has 3600x24= 86,400 seconds. Each year has 86400x365= 31,536,000 seconds. 136 years has 136 x 3,1536,000= 4,288,896,000 seconds, just within the maximum number of ULong 4,294,967,295

Mathy
Posts: 333
Joined: Mon Oct 05, 2009 2:39 pm
Has thanked: 30 times
Been thanked: 33 times
Contact:

Re: Suggestion for new Flowcode version

Post by Mathy »

Hi,

Very good idea :)

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Suggestion for new Flowcode version

Post by Benj »

Hi Jan,

We could easily make a component to do this and this way the component would have macros to allow you to get the RAW long count val, the compile date and time should you so wish. The count value would be populated with the correct number at compile time using the compile start event macro.

Would this fulfil the brief?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Suggestion for new Flowcode version

Post by Benj »

Here's a go at what you requested.

Here is the component file it should be placed into the "C:\Program Files (x86)\Flowcode 6\components" folder. Currently the time and date will update every time you run the sim or compile. The build version only changes when you compile but I left the property writable if you want to manually update it to something meaningful.
AutoVersionID.fcpx
(2.16 KiB) Downloaded 247 times
Restarting Flowcode the component should appear in the "Tools/Matrix Tools" component category as an "Auto Version Identifier".

Here is a simple test file.
ID_Test.fcfx
(5.85 KiB) Downloaded 250 times
I ended up using strings to hold the time and date as the long number method would need a fair amount of code to work out issues such as leap years and gets a bit messy. e.g. working out the number of days since Jan 1st 2000. This also gets around having to convert the long number to something meaningful during runtime which should hopefully save a bit of RAM and ROM usage.

Here is the source if anyone is interested in how I put it together. It relies on an external 24 x 24 pixel image file to set the texture on the panel object which I have not included as mine was pretty poor. I'm sure it'll get reworked by someone who knows graphics before it goes in the build.
AutoVersionID.fcfx
(14.04 KiB) Downloaded 240 times
Let me know how you get on and if you want to tweak the functionality at all.

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: Suggestion for new Flowcode version

Post by Jan Lichtenbelt »

Hi Ben,

Fantastisch!!! (you will understand my Dutch)



Jan Lichtenbelt

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: Suggestion for new Flowcode version

Post by Jan Lichtenbelt »

It works!
P1060068_t.jpg
P1060068_t.jpg (221.38 KiB) Viewed 4012 times

Post Reply