Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

conditional stopping the loop while

i am trying to control the loop whilei am collecting dat afrom pci6025E. i am reading voltages.voltage will incraese in one cycle and will decreasing in the other cycle on the same channelhwo can i made an intelligent setup that decide itself that the voltage is increasing or decreasingand when the voltage while increasing reach 4 volt it should stop and should atuomatically start again when the voltage starts decreasingand while decrasing it should stop at 3 volts and automatically start again when voltage start incresingplz help me in this

0 Kudos
Message 1 of 2
(2,591 Views)

Hello,

 

basically you don't need to stop the while loop - you can collect data from PCI all the time, but you put data into your output (chart, graph, array indicator, file etc.) only for those conditions you have mentioned. This can be done with  placing the output terminal/output block into the case structure, which is conditioned by two conditions:

 

The voltage is below 4V and it's increasing

OR

The voltage is above 3V and it's decreasing

 

You decide the slope with placing shift register in which you store the previous voltage level; and then you compare corrent voltage level to a voltage level saved in the shift register.

 

I also attached the image of the block diagram with solution with comments for easier understandment.

 

Please let me know if it is working,

Gregor Cerne

 

 

0 Kudos
Message 2 of 2
(2,561 Views)