From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to find out if a digiatal control is an integer or a double value?

Solved!
Go to solution

When I have the Reference to a Digital Control, how can I find out the Representation of it's value(e.g. Double, Integer32,...)?

ctrref.png

0 Kudos
Message 1 of 10
(4,098 Views)

Activate VI Scripting (LV Options) and you will have access to a property called "Representation"....

 

Please note that you should only read this property for running VIs!

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 10
(4,089 Views)

Does it matter? You can convert value from int control to double, it has enough precision, you will not loose data.

0 Kudos
Message 3 of 10
(4,066 Views)

@Alexander: That is not true for I64/U64. Also I want to save the data to file and save memory.

 

@Norbert: I will try this out. Is there a reason it is not possible to get the representation without VI Scripting?

0 Kudos
Message 4 of 10
(4,020 Views)

@romankoch wrote:

[...]

 

@Norbert:[...] Is there a reason it is not possible to get the representation without VI Scripting?


Honestly, i don't know. I assume some legacy decisions of the LV R&D team.....

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 10
(4,016 Views)
Solution
Accepted by topic author romankoch

C:\Program Files (x86)\National Instruments\LabVIEW 2015\vi.lib\Utility\Data Type\Get Type Information.vi

"If you weren't supposed to push it, it wouldn't be a button."
Message 6 of 10
(3,972 Views)

Yep. The location and the VI paul_cardinale suggest works. Kudos paul!!!

 

Though there is no Data Type Folder in my PC (Running Win7 and LabVIEW 2014)

C:\Program Files (x86)\National Instruments\LabVIEW 2014\vi.lib\Utility\GetType.llb---->Get Type of Control.vi will help you to determine the Representation of the reference.

-John Theodore
Certified LabVIEW Architect, Certified TestStand Architect
Message 7 of 10
(3,962 Views)

I'd like to know why you would need to know.  This is for my own education, since I have no idea why it would be useful.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 10
(3,926 Views)

@billko: I write the value of the control to an config file. So I need to know if I write a double or an integer. Until now I always used a double, but it doesn't look nice, when integer values get displayed with fractional digits.

0 Kudos
Message 9 of 10
(3,867 Views)

You can format the value yourself and use Write String key instead. With Format Value and format specifier "%#g" you'll cut trailing zeroes, which should make it general enough.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 10 of 10
(3,859 Views)