LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

New LV2010 Feature: DBL Numeric Constant

Solved!
Go to solution

I like how there is a new item added to the numeric palette in LV 2010.  It is a numeric constant already set for double precision representation.  Previously, you only had a integer numeric constant.  If you wanted a double, you'd have to drop the blue integer numeric constant, then go through a right click to change the representation of the integer to double.

 

So this saves an annoying step.  This is great.

 

But one question I have when context help is show for that palette item, what does the "(4800)" in parentheses mean?

 

Message 1 of 13
(5,379 Views)
Solution
Accepted by topic author RavensFan

The four digit number after SubVIs refers to the connector pane pattern of the SubVI. I believe this number only appears when you have Scripting enabled. The valid connector pane ranges are from 4800 to 4835 (someone correct me here...), where 4800 is the single terminal connector pane.

0 Kudos
Message 2 of 13
(5,371 Views)

Except it's a constant and not a VI.

 

Went to the Boolean palette and I see the same thing for the True constant but not for the False.

0 Kudos
Message 3 of 13
(5,368 Views)

 


@Dennis Knutson wrote:

Except it's a constant and not a VI.


 

Or is it?? Smiley Wink

 

For those who don't know the Easter Egg (NI oversight?) for "when a constant is not a constant", go to the Strings palette and drop a Space Constant on your diagram. Now double-click the "constant" to reveal it's a SubVI.

 

Seriously, I don't know enough about how BD nodes define wiring terminals, but I would not be surprised if both SubVIs and constants used the same underlying notion of a connector pane. I'm all ears waiting for someone to jump in with some better insight.

 

 

0 Kudos
Message 4 of 13
(5,356 Views)

Jack,

 

You're right.  It's kind of a strange coincidence because right around the time I found the double constant on the palette, I had just enabled scripting in LV 2010.  I had never seen that notation before with respect to scripting before now.  Is scripting now inherently a part of 2010 that you just have to click an option in Tools/Option to access, as opposed to previously where you needed to install it and run license manager to activate?  Somewhere, I thought I read that NI was now embracing scripting a bit more, where in LV2009, they basically opened it up publically, but said use at your own risk.  Am I thinking correctly on this?

 

I was kind of confused with trying to get scripting installed in LV2010.  It came up as a package in VIPM, while previously, I remember it being a separate download from NI unrelated to VIPM.  So I went ahead and installed in LV2010 with VIPM.  Then I went into LV to find it, but couldn't.  Then I checked the more info in VIPM and it said, go to license manager LV, Toolkits to activate it with the special license number.  "Oh yeah, I remember having to activate it that way under 2009!"  But I went to the license manager, and scripting did not show up under 2010 (only 2009 which was activated because I did it a year ago.)  WTF?  Is it installed or not??  Searching NI.com about scripting lead me to a couple pages that looked relatively new, and one said go to Tools/Options and click on a checkbox to show scripting functions.  I did that, and it worked.

 

It looks like there is another option (already checked by default) to show additional scripting information in context help.  I didn't know what that meant at the time so I didn't change it.  But based on your information, if I uncheck that, the (4800) goes away.  I don't know why I'd care to see the (4800) .  (Is this piece of scripting informatoin new in LV2010?)  Is there any other additional scripting information that I might have cared about but will now be hidden because I unchecked that box?

 

Dennis,  as for the (4800) showing up on the true constant, I remembered a past message about the true constant being different from the false because it was actually a "merge VI".  I found the message at Darren's Weekly Nugget 11/23/2009.

0 Kudos
Message 5 of 13
(5,354 Views)

Missed that in the nugget. So instead of changing the engine to add new functions/constants, NI simply writes a VI. Cool.

0 Kudos
Message 6 of 13
(5,342 Views)

Scripting is now a click (or two) away in LV2010.  No more installs and activations, getting to be quite mainstream.  I have used scripting as much as the next guy, but even I have not found a lot of use for those numbers.  

 

As to the DBL constant, I still instinctively add a '.0' so it probably won't help me out much. 

 

The constant/VI distinction can now be blurred even further thanks to the ability to set up SubVIs to inline themselves automatically.  One of the first things I did was write a SubVI/constant which implements the imaginary number i.  A very nice way to implement constants and not have to worry about dropping them in tight loops or other places.

0 Kudos
Message 7 of 13
(5,330 Views)

The extra information you get by leaving the checkbox checked is the connector pane number and the indices of the terminals.  The former is useful to find the number of a pattern quickly.  The latter prevents the trial-and-error approach scripting required you to go through to get terminal indices for wiring.  If you do much scripting, you will enjoy having the info easily available.

0 Kudos
Message 8 of 13
(5,300 Views)

My guess is that to add this quickly to the palette they used a Merge VI (Place VI Contents) with just the constant on the block diagram. That could explain why the constant in the palette claims to have a connector pane.

 

But that is purely a guess, I had no idea either that this was added in 2010.

Jarrod S.
National Instruments
0 Kudos
Message 9 of 13
(5,277 Views)

To summarize this thread:

 

  1. I added the DBL Numeric Constant to the palettes in LabVIEW 2010.  It is a Place VI Contents VI, like the True Constant.  Even though it's very easy to change a regular Numeric Constant to DBL representation by including a "." in whatever you typed, there were times where I needed quick access to a DBL data type on the diagram...that's why I added it.
  2. Scripting is now a core LabVIEW feature, which is enabled by the afore-mentioned Tools > Options setting.  No more license or hidden keys required.  Expect to see a weekly nugget on this at some point.
  3. When you enable scripting, you can also enable scripting information in the context help window, which will give you VI connector pane pattern information, and VI/function terminal index information.  Since the DBL Numeric Constant is really a VI, that's why you see its connector pane information when you have this option enabled.
Message 10 of 13
(5,252 Views)