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

isolate event strucutre

Resolvido!
Ir para a solução

I am controlling a valve using my serial port which sends a signal to turh clockwise or counterclockwise. To cut down on CPU usage I put this in an event structure so that the signal is sent only once as opposed to every iteration, that now works. However this seems to have paused everything. The only time my program advances is when I function the switch for the valve to turn.

 

How do isolate the action of the event structure so the switch will work, but everything else will work as well. E.g. My elapsed time will display once I activate the switch, but then it wont change until I press the switch again. It's exactly like pressing the lap button on a stopwatch instead of watching the elapsed time progress forward. See attached file to see what I am talking about.

 

I have tried putting the two parts in their own while loops, but that was met with little success. I am new to labview, so whatever help you can give is welcome, any ideas?

 

Thanks for your help in advance.

 

-adam

0 Kudos
Mensagem 1 de 6
3.967Exibições
Solução
Aceita por AVMaine

Try this. I just put your code inside the timeout event. You had it set to never timeout.

 

 

Mensagem 2 de 6
3.958Exibições

Adam,

 

To simply get your program working properly, you will need to add a timeout to the event structure (the Event Timeout terminal in the top left corner of the event structure). The way your code is currently, the timeout is set to its default value of -1, so the code will only execute when an event is registered (the behavior you were describing).

 

Hope this helps.

 

-RW

0 Kudos
Mensagem 3 de 6
3.951Exibições
Sorry for the duplicate reply, Dennis beat me to the punch.
0 Kudos
Mensagem 4 de 6
3.948Exibições

Or just make an other parallel loop.

The problem is, if you mix event-structure with e.g. data  acquisition, than e.g. a dialog opens from the event-structure - it will block your other code.

0 Kudos
Mensagem 5 de 6
3.943Exibições

Awesome! Thats just what I was trying to do.

 

Thank you.

0 Kudos
Mensagem 6 de 6
3.925Exibições