LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

case structure multiple inputs

I do not think you can format the case selector to show leading zeros.  Since only the programmer will see this, he or she will have to adapt to the display of  011 as 11.  You can of course have case 0 as numeric. 

 

Lynn

0 Kudos
Message 11 of 22
(3,357 Views)

@captain_harlock wrote:

Although I wonder, isn't there a a much more elegant way of indexing a case struct with mutually exclusive booleans?


This thread is NOT about mutually exclusive booleans, so you should probably have started a new thread. You have a very different problem!

 

Unfortunately, you don't show the inputs to your "in range & Coerce" functions, so we cannot tell what you are doing and we cannot really help.

 

Where do the mutually exclusive booleans come from? Is this from an instrument or from a user control?


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 12 of 22
(3,345 Views)

@pcardinale wrote:

I suggest using radio buttons.


Unfortunately my booleans are not a manual input (i.e. front panel), they come from a computation about intervals, ranges and max/min outputs.

0 Kudos
Message 13 of 22
(3,323 Views)

So why don't you tell us a little bit more? Maybe there is a much simpler solution!


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 14 of 22
(3,318 Views)

@altenbach wrote:

So why don't you tell us a little bit more? Maybe there is a much simpler solution!


It's not a very big deal.

I'm writing a little program to build the spurious emissions mask limits for a point-to-point RF system.

So on the front panel I have two inputs, the Channel Spacing (CS) value, and the frequency carrier f_0 value, plus a parameter that in the final realease will not be an input but will be taken directly from the Spectrum Analyzer (the Max range of the SA).

 

ScreenShot002.jpg

 

There's a fourth param, the breakpoint (BP) frequency, which is the value on which the mask limits jump from -50 to -30 dBm.

So according to the ETSI spec I have 4 cases, mutually excluding:

 

  1. f_BP is in interval 1<f<(f_0 - 2.5*CS)
  2. f_BP is in interval (f0 + 2.5*CS)<f<(Max SA freq)
  3. f_BP is in interval |f - f_0|<2.5*CS
  4. f_BP is beyonf Max SA freq

Hence my issue with that "boolan driven" case struct.

 

0 Kudos
Message 15 of 22
(3,311 Views)

Build your threshold numbers into an array and use something like what's described here or here. Much less code! Smiley Very Happy


LabVIEW Champion Do more with less code and in less time
Message 16 of 22
(3,330 Views)

Or here...

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 17 of 22
(3,328 Views)

Justto put my 2 cents in... regarding to the original subject with multiple Case inputs, I prefer the solution shown in the attached pictures. It uses the type cast function to cast the U32 values to an Enum (which MUST be of U32). This makes it more readible to the programmer.

 

 

 

 

 

Enum- Items in Order:

Greets, Dave
Message 18 of 22
(3,307 Views)

everybody, thanks for the hints Smiley Happy

0 Kudos
Message 19 of 22
(3,291 Views)

C  B  A     Yellow     Red      Pink     Blue

0  0   1      1

0  1   0                     1

0  1   1                                   1

1  0   0                                             1

 

----------------------------------------------------------

0 Kudos
Message 20 of 22
(3,153 Views)