LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tricky Switch case

Hi experts,

 

I understand that it is we can't use double/float values as inputs for a case structure. I am relatively new to LabVIEW. I am depicting my situation which I am trying to develop using LabVIEW.

 

For example, there is a option named 'A' and it has range between 25.00dB to 55.00dB with the step size of 0.25dB.

And we have a predefined 'X' value which can be altered according to the user need.

For example, say X=29(the value of X may change in future) .

 

When the user sets the value of 'A' as 40dB then I want to send the value 0 and the value of 'X' respectively.( I am aware that both these values can be bundled).

 

When the user sets a value anything between 41dB to 55dB then I want to send the value 0 and (X-(user-entered-value)+40).

 

When the user sets a value anything between 25dB to 39dB then I want to send the value (40-(user-entered-value))

and the value of 'X' respectively.

 

I kindly request you to help me implement the same using LabVIEW. Your support will be greatly appreciated. Thank you in advance.

0 Kudos
Message 1 of 2
(1,887 Views)

Based on what I understood from your description, you can use Threshold 1D Array and an appropriate Round towards (probably -Infinity, i.e. round down) with the array that you're thresholding being the points at which you change behaviour.

 

Then you can get an integer (by rounding) and so determine which "bracket" you're in, and use that for your Case Structure.


GCentral
0 Kudos
Message 2 of 2
(1,847 Views)