Macro Parameters

Please add any feature requests for Flowcode version 7 here

Moderator: Benj

Post Reply
User avatar
Alan_37
Posts: 179
Joined: Sun May 01, 2016 8:36 pm
Has thanked: 51 times
Been thanked: 54 times
Contact:

Macro Parameters

Post by Alan_37 »

Hi
I have this feature request that should not be to complicated to implement
but will make Programming with flowcode much easier .

It has to do with Macro Parameters , now I try to explain .

A Macro that can do different Tasks, say if input parameter (Byte)
Is set to 0 will read the external device , if set to 1 it will write , if 2 will configure the device
and so on , now in a macro you can have more then one of these task selectors and it is very
likely that after a few days you forget what the values where doing exactly .
So one have to go through the macro again every time which is very time consuming .

Can we have an option for the parameters that if enabled , will
make it possible to assign a name to a specific value

Something like Html drop down menu . where you have the value and the name to be displayed .

Below is an Example from Labview .

Thanks in Advance

Alan
Attachments
Drop down.png
(1.96 KiB) Downloaded 3150 times
Drop 2.png
(8.4 KiB) Downloaded 3150 times

User avatar
Steve
Matrix Staff
Posts: 3422
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: Macro Parameters

Post by Steve »

Hi Alan,

One way to implement this now is to use global constants. The attached image and program should help.
Attachments
constants as parameters.fcfx
(5.23 KiB) Downloaded 256 times
constants as parameters.png
(39.5 KiB) Downloaded 3136 times

User avatar
Alan_37
Posts: 179
Joined: Sun May 01, 2016 8:36 pm
Has thanked: 51 times
Been thanked: 54 times
Contact:

Re: Macro Parameters

Post by Alan_37 »

hi Steve

yes that is a great idea , although now i realize
that using a variable for every value will increase the
ram usage of the micro controller .

do you think there is a solution to that ?

thanks for your support

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Macro Parameters

Post by kersing »

Constants do not use additional controller resources (ram/flash)
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

User avatar
Alan_37
Posts: 179
Joined: Sun May 01, 2016 8:36 pm
Has thanked: 51 times
Been thanked: 54 times
Contact:

Re: Macro Parameters

Post by Alan_37 »

Hi kersing

Did't know that, so that is a very good work around .

Will implement that for sure .

Thanks

User avatar
petesmart
Valued Contributor
Valued Contributor
Posts: 395
Joined: Thu May 06, 2010 11:42 am
Location: Sydney, Australia
Has thanked: 187 times
Been thanked: 140 times
Contact:

Re: Macro Parameters

Post by petesmart »

You can also add constants inside of macros as well...
sorry about that Chief!

Post Reply