From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-17-2014 01:02 AM
Hello,
how can I create fixed-point number using LabVIEW VI scripting? And set the word length and integer word length?
Solved! Go to Solution.
04-17-2014 07:24 AM
Creating the number is fairly easy using the standard scripting methods. Create a numeric control using the New VI Object primitive, then change its Representation using a property node. Unfortunately, the properties to set the word and integer word length are private. This usually means they are unsafe for general use, but could be a simple mistake. I will make inquiries and see what is up. Hopefully, I will be able to post a VI with the functionality for you.
04-17-2014 08:59 AM
Thank you. That would be great!
04-17-2014 01:23 PM
I posted a snippet in a post here that edited the representation using this property:
04-17-2014 02:02 PM - edited 04-17-2014 02:31 PM
Edit. Removed code snippet as it used private property members.
04-17-2014 02:14 PM - edited 04-17-2014 02:16 PM
When I connect Property Node with New VI Object it does not provide such an option as FXPRepBits.
04-17-2014 02:26 PM - edited 04-17-2014 02:32 PM
This may be related to what dfgray mentioned in an earlier post. Do you not have an option for "Fixed-Point Representation" in your property list?
Edit:
Yeah, unfortunately the code that I had posted was using the private members that DFGray mentioned in an earlier post. That was my mistake. I'm not sure on another way to accomplish this task otherwise.
Sorry for the confusion
04-17-2014 02:31 PM
I have only these options.
04-17-2014 02:34 PM
Note the dark yellow background on the property node. This means it is using a private function, something not recommended unless you know it is safe. Private functions do not normally show up in the function lists. I should know withing 24 hours whether or not these functions are safe. If they are, I will post a VI containing them and write a CAR to make them public.
For those of you curious as to what "safe" means, I have crashed LabVIEW in many cases and permanently corrupted 1000 VIs with a single private call in another. Most will not do that to you, but a very innocent sounding one did it to me. Caveat coder.
04-17-2014 02:37 PM
The code I posted in July 2013, and the snippet you removed, have a brown property node. In LabVIEW 2013 it is blue. Is it still private? What version was your snippet?
Yeah, unfortunately the code that I had posted was using the private members that DFGray mentioned in an earlier post. That was my mistake. I'm not sure on another way to accomplish this task otherwise.
Sorry for the confusion
I don't know the significance of the colors. If it's still private, you might remove my snippet earlier in this thread.