05-24-2016 09:16 AM - edited 05-24-2016 09:18 AM
When I have the Reference to a Digital Control, how can I find out the Representation of it's value(e.g. Double, Integer32,...)?
Solved! Go to Solution.
05-24-2016 09:22 AM
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
05-24-2016 11:23 AM
Does it matter? You can convert value from int control to double, it has enough precision, you will not loose data.
05-25-2016 03:20 AM
@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?
05-25-2016 03:23 AM
@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
05-26-2016 05:17 PM
C:\Program Files (x86)\National Instruments\LabVIEW 2015\vi.lib\Utility\Data Type\Get Type Information.vi
05-26-2016 06:06 PM
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.
05-27-2016 01:51 PM
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.
05-30-2016 03:43 AM
@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.
05-30-2016 06:51 AM
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