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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create fixed-point number using LabVIEW VI scripting

Solved!
Go to solution

Hello,

 

how can I create fixed-point number using LabVIEW VI scripting? And set the word length and integer word length?

0 Kudos
Message 1 of 39
(3,571 Views)

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.

0 Kudos
Message 2 of 39
(3,490 Views)

Thank you. That would be great! 

0 Kudos
Message 3 of 39
(3,476 Views)

I posted a snippet in a post here that edited the representation using this property:

 

Example_VI_BD.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 4 of 39
(3,457 Views)

Edit. Removed code snippet as it used private property members.

Tim A.
0 Kudos
Message 5 of 39
(3,441 Views)

When I connect Property Node with New VI Object it does not provide such an option as FXPRepBits. 

0 Kudos
Message 6 of 39
(3,429 Views)

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 Cat Sad

Tim A.
0 Kudos
Message 7 of 39
(3,416 Views)

I have only these options.

0 Kudos
Message 8 of 39
(3,408 Views)

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.

0 Kudos
Message 9 of 39
(3,401 Views)

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 Cat Sad


I don't know the significance of the colors.  If it's still private, you might remove my snippet earlier in this thread.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 10 of 39
(3,404 Views)