Hi Team.
I am struggling with the scope visibility of Constants I will appreciate any hints or help.
On the ADS1118 ADC there is a complex setting /configuration possible and to make a component that supports all these configurations it is necessary to define them and allow the user of the component to select these various settings , ,
At the moment I have these settings as CONST in globals and then pass them into the macro call as shown below.
The question is there a more elegant way for example include them with in the macro and then when the macro is called the user can select them with the .XXX syntax.I tried but was not successful (maybe I miss something) .
Also if the CONST are in Global s will they get exported with the Component, when exported ?
Any ideas help hints appreciated
Constants Visibility
- p.erasmus
- Posts: 434
- http://meble-kuchenne.info.pl
- Joined: Thu Dec 03, 2020 12:01 pm
- Location: Russia / Россия
- Has thanked: 104 times
- Been thanked: 88 times
-
- Matrix Staff
- Posts: 1492
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 536 times
- Been thanked: 485 times
Re: Constants Visibility
Hi,
What about adding it in properties? You just select Fixed list of ints for the properties type. As soon as a property selected, the Property in the EV part is automatically accessed. So you will just need to enalbe it.
Of course that will only work if only one gain is needed?
Another way is a number selection.
0 for 512mV, 1 for 614mV etc.
The number values is added to the decription so the user knows which one to select.
Like this:
What about adding it in properties? You just select Fixed list of ints for the properties type. As soon as a property selected, the Property in the EV part is automatically accessed. So you will just need to enalbe it.
Of course that will only work if only one gain is needed?
Another way is a number selection.
0 for 512mV, 1 for 614mV etc.
The number values is added to the decription so the user knows which one to select.
Like this:
Martin
- p.erasmus
- Posts: 434
- Joined: Thu Dec 03, 2020 12:01 pm
- Location: Russia / Россия
- Has thanked: 104 times
- Been thanked: 88 times
Re: Constants Visibility
Hi Martin,
Thank you for your help.
I like the property way as it use names and a person can clearly see what you select.however it seems
that selecting a byte type is not possible in the list of variable types. What I actually need is a byte type(because it is a mask of size byte ) to mask out the corrects settings.
the closes I can see a Bit mask which allows me to tick on the value I would like for the mask but my concern is that it seems it is a integer variable type showing a Z next too it
What would have been ideal for me if there was a list of bytes just a fool can wish such things
learning flowcode now a bit deeper sorry for all the amateur questions ,I appreciate every bodies help
Thank you for your help.
I like the property way as it use names and a person can clearly see what you select.however it seems
that selecting a byte type is not possible in the list of variable types. What I actually need is a byte type(because it is a mask of size byte ) to mask out the corrects settings.
the closes I can see a Bit mask which allows me to tick on the value I would like for the mask but my concern is that it seems it is a integer variable type showing a Z next too it
What would have been ideal for me if there was a list of bytes just a fool can wish such things
learning flowcode now a bit deeper sorry for all the amateur questions ,I appreciate every bodies help
- Attachments
-
- Pmask.jpg (25.97 KiB) Viewed 4835 times
Regards Peter - QME Electronics
- p.erasmus
- Posts: 434
- Joined: Thu Dec 03, 2020 12:01 pm
- Location: Russia / Россия
- Has thanked: 104 times
- Been thanked: 88 times
Re: Constants Visibility
Hi All.
As Martin suggested I created properties and the properties contain the Mask for the Configuration register ,this works nice I am just not sure if this is an elegant way any comments on it is appreciated.
Calling the Macro and the Setting the properties as parameters result in the correct configuration for the Channel and the call is readable you can see what channel , Mode ,Sample Rate and if it is a single Conversion or Continuous Sampling
Thanks Martin for your pointers !! appreciated
As Martin suggested I created properties and the properties contain the Mask for the Configuration register ,this works nice I am just not sure if this is an elegant way any comments on it is appreciated.
Calling the Macro and the Setting the properties as parameters result in the correct configuration for the Channel and the call is readable you can see what channel , Mode ,Sample Rate and if it is a single Conversion or Continuous Sampling
Thanks Martin for your pointers !! appreciated
Regards Peter - QME Electronics
-
- Matrix Staff
- Posts: 1492
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 536 times
- Been thanked: 485 times
Re: Constants Visibility
Even though Bytes is not there, I belive you can still use bytes in your flowchart but just use intergers within properties.
Would a drop down list be better option?
Would a drop down list be better option?
Martin
- p.erasmus
- Posts: 434
- Joined: Thu Dec 03, 2020 12:01 pm
- Location: Russia / Россия
- Has thanked: 104 times
- Been thanked: 88 times
Re: Constants Visibility
Martin
yes a drop down list would be great if it shows in the component call (macro) to select because different channels can have different selections in Run time,so it is necessary to be able to select different config settings for each channels as they are called
I never created such a drop down list have to look how to do it
yes a drop down list would be great if it shows in the component call (macro) to select because different channels can have different selections in Run time,so it is necessary to be able to select different config settings for each channels as they are called
I never created such a drop down list have to look how to do it
Regards Peter - QME Electronics
-
- Matrix Staff
- Posts: 1790
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 455 times
- Been thanked: 621 times
Re: Constants Visibility
Hello,
It is also possible to make constant values available to the user by going into the Interface -> Globals tabs of the Component Management window.
Just set the Global constants / variables to public and they will appear as options in the parameter fields for component macros.
It is also possible to make constant values available to the user by going into the Interface -> Globals tabs of the Component Management window.
Just set the Global constants / variables to public and they will appear as options in the parameter fields for component macros.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Matrix Staff
- Posts: 1310
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 175 times
- Been thanked: 299 times
Re: Constants Visibility
You could create a "fixed list of ints" property and then change the numbers on the left of the list. The property variable ("var_name") would equal the value, not the text.