LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting the fixed-point type on the to fixed-point function

How does one configure the output of the "to-fixed point" using the fixed-point type input to the block?

 

For example, let us say the following configuration is the desired output mode - Rouding: truncate, Overflow: saturate, Encoding: signed, Word length: 16-bits, Integer word length: 1-bit. How would this get passed into the "to-fixed point" function using the fixed-point type input?

0 Kudos
Message 1 of 11
(4,548 Views)

Hi john,

 

you need to connect a FXP constant of correct type. This has been told to you before...

 

You set the properties of the FXP constant in their properties dialog. I'm sure you have noticed that one too...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 11
(4,548 Views)

I understand that if I connect an input of a ceratin data type to the 'fixed-point type' terminal that this sets the data type of the ouput terminal. However, this is quite inconvienient and makes analyzing system performance under thaousands of differet bit configurations virtually impossible since you must manually set the 'Output Configuration' of the input to 'fixed-point type' every time you want to change the data type.

  

This block should offer an alternative way to set the configuration parameters in addition to simply taking on the data type of that which is connected to 'fixed-point type'. Perhaps a string input to define each parameter in the 'Output Configuration' or possibly an integer value input to set each parameter.

 

Any thoughts or suggestions to get around this dilemma are welcome.

0 Kudos
Message 3 of 11
(4,539 Views)

... never mind.

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 11
(4,527 Views)

@jcarmody wrote:

... never mind.


I'm back.

 

This will find all Fixed-Point constants and let you edit the representation:bits.

 

Fixed Point Tool.png

Set it to run when opened and put it in your <LabVIEW>/Projects folder and it'll be available from the Tools menu. This can be modified to fit a scheme as you described in your last post.

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 5 of 11
(4,513 Views)

You can use a typedef to define the constant that is configuring the "to fixed point" function.

0 Kudos
Message 6 of 11
(4,500 Views)

What you're asking for is very useful, but changing at run-time would involve a whole new data type, which might be called "Dynamic FXP". It would behave a lot like floating-point, but would have a way to pass type parameters to each node to do quantization and overflow handling at run-time. 

 

Although this is a well-known feature request, I don't see anything on the Idea Exchange about it with a quick search. I would love to get a feel for the level of interest in such a feature. I'll post something if it's not already there (or you're welcome to!).

 

Jim

0 Kudos
Message 7 of 11
(4,492 Views)

Thank you Jim,

 

I'm not quite sure what the functionality of each block is in the figure. Are these from a special design palette? Is this something you developed?

0 Kudos
Message 8 of 11
(4,484 Views)

JLewis mentioned changing them at run-time; my solution changes them at design-time.  What are you trying to do?

 

I developed that with functions mostly from the Application Control palette.  What version of LabVIEW are you using.  If you're using 2009 or later, you should be able to drag the png image from the post to an empty block diagram.  It's a snippet.

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 9 of 11
(4,480 Views)

Thank you Jim, I did'nt realize I could just drop the png into the block diagram.

 

I am also trying to define the changes at design time. Let me see what I can do with this.

 

 

0 Kudos
Message 10 of 11
(4,474 Views)