07-25-2012 09:06 AM
@rolfk wrote:
Which in this particular case is just a wire wired straight through, so very little chance of uncompilable code.
Of course there is little chance of uncompilable code, but still it has to be checked on case structures and is not checked on "conditional compiling" - wouldn't you agree?
I've not accounted for how much effort is needed, but for the fact that in 'case structures' all the code is required to be runnable and, therefore, is checked, as opposed to 'conditional compiling' which allows the code in diabled frames to be broken because/therefore that code is not checked.
Or have I got this wrong?
07-25-2012 09:12 AM
@Gyc wrote:
Kudos to the idea.
In the mean time, you can, of course, enclose everything in a subVI an call it "Get default value.vi".
![]()
But that would only work for one data type.
James, that would be a good idea for the exchange. I think Darren should post it but if he doesn't then you should do it.
07-25-2012 09:20 AM
@Steve Chandler wrote:
@Gyc wrote:
Kudos to the idea.
In the mean time, you can, of course, enclose everything in a subVI an call it "Get default value.vi".
![]()
But that would only work for one data type.
Unfortunate, but true! Precisely why I wrote "in the mean time".
N.I. still does not share with us mortals those of their primitives that would allow us to do that (and some precious other things).
07-25-2012 09:29 AM
Given the enthusiasm around this thread I am surprised this idea has fared so poorly.
http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Default-Data-Function/idi-p/1082080
Personally I am having a hard time seeing when I would use this (both the functionality and this implementation). I would like to hear some real-world use cases not handled well by say type-def constants or for the FPGA example the =0? or !=0? functions.
07-25-2012 09:40 AM
Sometimes reality is overtaking dreams!
07-25-2012 09:50 AM
@rolfk wrote:
Sometimes reality is overtaking dreams!
That's not the default value of the data type. That's the defualt value of the referenced control. Plus you need scripting enabled, meaning, it will not work in the RTE or on FPGA.
07-25-2012 10:02 AM
Even though it is a "blue node", Default Value is available for read in the run time engine. When in doubt, look in the LabVIEW help for the property name (Default Value Property in this case). The help topic includes a table which lists such things as whether or not it will run in the run time engine, it needs a front panel, etc.
07-25-2012 10:29 AM - edited 07-25-2012 10:29 AM
@DFGray wrote:
Even though it is a "blue node", Default Value is available for read in the run time engine. When in doubt, look in the LabVIEW help for the property name (Default Value Property in this case). The help topic includes a table which lists such things as whether or not it will run in the run time engine, it needs a front panel, etc.
Ok, this one make since. It is read only while in the RTE.
07-25-2012
10:36 AM
- last edited on
04-29-2025
01:39 PM
by
Content Cleaner
@Darin.K wrote:
Given the enthusiasm around this thread I am surprised this idea has fared so poorly.
https://forums.ni.com/t5/LabVIEW-Idea-Exchange/Default-Data-Function/idi-p/1082080
Personally I am having a hard time seeing when I would use this (both the functionality and this implementation). I would like to hear some real-world use cases not handled well by say type-def constants or for the FPGA example the =0? or !=0? functions.
I hadn't seen that idea. I just voted for it (and everybody upthread who thought it was a good idea should go vote for it too).
Since most of my experience with this approach is in FPGA, I just went back through some FPGA code to get examples. I found that we use this trick to define the contents of a Fixed Size Array with all default values as its elements. I also found that we used it for getting a 'zero' value for other things besides comparison functions, like inputs to Select, In Range and Coerce, and FPGA counters. Many of these diagrams are rather complex and heavily nested, so not having to worry about affected constants when changing upstream data types becomes a huge benefit.
07-26-2012 09:24 PM
Also you now need to put controls down for any default values you want. This could result in hidden controls on front panels that could get to be confusing for additional developers picking up the project.
@crossrulz wrote:
@rolfk wrote:
Sometimes reality is overtaking dreams!
That's not the default value of the data type. That's the defualt value of the referenced control. Plus you need scripting enabled, meaning, it will not work in the RTE or on FPGA.