LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I select the condition one by one

I attaching a VI in which I have two condition less than or equal and greater than or equal. With respect to the input value 0f 125 the condition should be greater than or equal and if it is 175 then it should be less than or equal. So how can I exchange the conditions. Please reply

0 Kudos
Message 1 of 9
(3,105 Views)

Hi perumpadapu,

 

Maybe you can use case structures to do that exchange conditions. Create a case structure with integer input (data type represented in blue) connected to the selector terminal. You can create 3 cases: 1 default value whereby if you don't receive 125 or 175 from your input value, case "125" to execute the should be greater than or equal and case "175" to execute the less than or equal. 

 

You'll need an integer therefore if your input value is in double precision float, you'll need to convert it to unsigned integer.

 

Refer to the below link for your info:

Case Structure
http://zone.ni.com/reference/en-XX/help/371361K-01/glang/case_structure/

 

Hope it helps

 

Warmest regards,

Lennard.C

Learning new things everyday...
0 Kudos
Message 2 of 9
(3,092 Views)

Hi

 

Besides your issues with condition checking its worth pointing out that you have two instances of VISA Configure Serial Port, one appears to be completely unused, the other has its output connected to the while loop but not to the shift register that contains the visa resource name for the VISA Write inside the while loop ?

 

0 Kudos
Message 3 of 9
(3,081 Views)

i don't need to add case structure. I need to relpace the greater than equal to to lesser than equal sign as the 175 becomes 125.So there should be a flip in conditions to be considered. Becaus if i use case structure as you said, for the true as well as false case I have to include all these commands to execute in each case. I can't wire the both cases to the same case structure after that. So please reply

0 Kudos
Message 4 of 9
(3,062 Views)

Hi perumpadapu,

 

Can you show me in your code where is this "175" and "125" is coming from? Where do you want to implement your flip logic?

 

" I need to relpace the greater than equal to to lesser than equal sign as the 175 becomes 125.So there should be a flip in conditions to be considered. "

 

If you want to do some sort of flip conditions based on the integer value received, you can use case structure as below:

10.JPG11.JPG

Unless you are very certain that you will not receive any values other than 175 and 125, you can use Select. 

 

 

"Becaus if i use case structure as you said, for the true as well as false case I have to include all these commands to execute in each case. I can't wire the both cases to the same case structure after that."

 

Can you provide a screenshot to this issue?

 

It would be great if you can explain what you want to do and what your code does.

 

Warmest regards,

Lennard.C

 

Learning new things everyday...
0 Kudos
Message 5 of 9
(3,054 Views)
If the value should be in the 125..175 range you can either use that exact string as a case selector, or set thos limit on a In range and coerce-block.
If it's two different signals you need to check each individually and use a And-block.
/Y
G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 9
(3,029 Views)

It's not a range only these two values . So if I put case loop with true case having greater than or equal and and flase case having lesser than or equal. will the program takes in the expected manner ie for if 125 it will take the matching condition as greater than or equal and in false case(175) it will consider the less than or equal condition. Please reply

0 Kudos
Message 7 of 9
(2,997 Views)

@perumpadapu wrote:

So if I put case loop with true case having greater than or equal and and flase case having lesser than or equal.


A case structure has nothing to do with a loop.

You cannot have overlapping conditions. The "equal" can only apply to one of the two cases. 

0 Kudos
Message 8 of 9
(2,991 Views)

@perumpadapu wrote:

It's not a range only these two values . So if I put case loop with true case having greater than or equal and and flase case having lesser than or equal. will the program takes in the expected manner ie for if 125 it will take the matching condition as greater than or equal and in false case(175) it will consider the less than or equal condition. Please reply


You do know you can wire the integer directly to the case? You can then set 3 cases ..124, 125..175 and 176.. e.g.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 9 of 9
(2,963 Views)