LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to program a conditional in LabVIEW

Solved!
Go to solution

Hello. I want to program a relay using cRIO and i made a manual control but i need a program that, if my input is <0 turn on the button automatically and if the input is >0 turn off the button  automatically in order to send my input with possitive and negatives numbers to my power supply. 

0 Kudos
Message 1 of 12
(3,325 Views)

If yo show us what you have so far, we might be able to give you some tips.

0 Kudos
Message 2 of 12
(3,300 Views)

@GokuJubilao wrote:

Hello. I want to program a relay using cRIO and i made a manual control but i need a program that, if my input is <0 turn on the button automatically and if the input is >0 turn off the button  automatically in order to send my input with possitive and negatives numbers to my power supply. 


And what if the input is 0?  Assuming 0 should be on, then just use a Less Than Or Equal To Zero.  If 0 should be ff, then use Less Than Zero.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 12
(3,281 Views)

My input is an excel with a measurement and it never will be 0, so I need a program that if the valiu is under 0 run my program with the cRIO digital output in order to activate a relay and if the value is above 0 stop the relay automatically

0 Kudos
Message 4 of 12
(3,259 Views)

hello, I've uploaded two screenshots of my program.  I need something that, if the input is less than 0 change the case to True and the relay goes on and if the input is greather than 0 change the case to false and the relay goes off.

true.PNG

false.PNG

  

0 Kudos
Message 5 of 12
(3,224 Views)
Solution
Accepted by topic author GokuJubilao

Just do a comparison with 'less than 0' and send the result to the relay. No Case, number to bool array or index array needed!

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

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

In case you missed it, "the results after the add..." is an array. How do you want to check if it is greater or less than zero?

 

Frozen_1-1608569363973.png

 

 

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
0 Kudos
Message 7 of 12
(3,205 Views)

All the elemens of the array must turn on/off the relay, i don´t know if that is a problem

0 Kudos
Message 8 of 12
(3,200 Views)

@GokuJubilao wrote:

All the elemens of the array must turn on/off the relay, i don´t know if that is a problem


That makes no sense unless you have as many relays as you have elements. If the array only has one element, it should not be an array.

 

Otherwise you need to decide based the suggestions above, e.g.

 

  • Should it turn on if all elements are less than zero?
  • Should it turn on it at least one element is less than zero?
  • Should it turn on of more that 50% of all elements are less than zero?
  • etc.

 

0 Kudos
Message 9 of 12
(3,186 Views)

I have to program a power supply but and i want that, if my input is less than 0 the relay reverse the polarity of the current and if is greather than 0 turn off the relay. There is no possibility to do that? Can´t convert my array in numbers one by one?

0 Kudos
Message 10 of 12
(3,158 Views)