cancelar
Mostrando resultados para 
Pesquisar então 
Você quer dizer: 

how to program a conditional in LabVIEW

Resolvido!
Ir para a solução

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
Mensagem 1 de 12
3.833Exibições

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

0 Kudos
Mensagem 2 de 12
3.808Exibições

@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.



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
Mensagem 3 de 12
3.789Exibições

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
Mensagem 4 de 12
3.767Exibições

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
Mensagem 5 de 12
3.732Exibições
Solução
Aceita por 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
Mensagem 6 de 12
3.728Exibições

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
Mensagem 7 de 12
3.713Exibições

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

0 Kudos
Mensagem 8 de 12
3.708Exibições

@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
Mensagem 9 de 12
3.694Exibições

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
Mensagem 10 de 12
3.666Exibições