LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Darren's Occasional Nugget 07/24/2012


@rolfk wrote:

Which in this particular case is just a wire wired straight through, so very little chance of uncompilable code. Smiley Very Happy


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?

 

 

 

0 Kudos
Message 11 of 23
(2,012 Views)

@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". Smiley Happy 


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.

=====================
LabVIEW 2012


0 Kudos
Message 12 of 23
(2,008 Views)

@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". Smiley Happy 


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). 

0 Kudos
Message 13 of 23
(2,002 Views)

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.

Message 14 of 23
(1,995 Views)

Sometimes reality is overtaking dreams!

 

default value.png

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 15 of 23
(1,988 Views)

@rolfk wrote:

Sometimes reality is overtaking dreams!

 

default value.png


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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 16 of 23
(1,976 Views)

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.

0 Kudos
Message 17 of 23
(1,967 Views)

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 18 of 23
(1,950 Views)

@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.

Message 19 of 23
(1,944 Views)

@crossrulz wrote:

@rolfk wrote:

Sometimes reality is overtaking dreams!

 

default value.png


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.


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.
0 Kudos
Message 20 of 23
(1,872 Views)