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

Once you have created the array (which it sounds like you are able to do), just wire an array with the appropriate value to the "Value" property of the ArrayConstant class.

0 Kudos
Message 31 of 39
(1,007 Views)

Thank you. That turned out to be much simplier than I thought. 🙂

0 Kudos
Message 32 of 39
(1,000 Views)

How can I generate (using LabVIEW VI scripting) FPGA Math & Analysis (High Throughput Math) function?

For example, as mentioned previously in this topic, divide function. 

 

0 Kudos
Message 33 of 39
(986 Views)

The high throughput math function is not a normal node, so there is not a good way to generate it from scratch (the functions are private, for good reason). Your best bet is to create a template like I suggested above and move a base version of the code from a template into your final code, then use the functions Darren pointed out to configure it.  Good luck!

0 Kudos
Message 34 of 39
(964 Views)

I agree with Damien, you should be using templates to drop these things. But if you must drop one from scratch, you can wire the path to the source file to the New VI Object function:

 

div.png

 

If you search the vi.lib\rvi\FXPMathLib folder for *.xnode, you should find the source files for all the HTM nodes. I'd like to reiterate here that all of this scripting functionality is not officially supported by NI.

0 Kudos
Message 35 of 39
(956 Views)

Till now I have created VI script that generates High Throughput Math Divide function (added attachments). 

But is how can I add my x and y inputs (Controls) to this generated function in my VI script? 

0 Kudos
Message 36 of 39
(932 Views)

After you have finished scripting the node (your commit function), get a reference to new node, then use the Terminals[] property of the node to get references to all the terminals. Use the Is Source? property on each terminal to find out if it is an input or output. Then  use the Create Control or Create Indicator method to create controls and indicators. You can use the terminal Name property to filter whether or not you create a control/indicator.

Message 37 of 39
(922 Views)

That works for High Throughput Divide function generation, but is it possible to generate Memory Method Node and set it's data type to fixed-point?

I added photos of my VI script and the generated VI. 

 

Maybe one more time somebody can explain me that?

Download All
0 Kudos
Message 38 of 39
(905 Views)

You need to use the VIs in vi.lib\rvi\ClientSDK\Core\Script\Memory\ProjectItem to create the Memory item in the project. This includes setting properties like the data type. Once you've done this, you'll use the VIs in vi.lib\rvi\ClientSDK\Core\Script\Memory\XNode to drop a method node that references the memory node you've already created and configured in the project. I don't know what purpose it serves to try to configure the data type on the node itself, since that's defined by the project item.

 

Also, you'll want to wire a numeric constant configured to the FXP type you want to the "Data Type 2" instance of the Set VI. The enum that has an "FXP" entry doesn't let you configure the word length, integer word length, etc. of the FXP data type.

0 Kudos
Message 39 of 39
(884 Views)