LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't keep my program running, trigger not fast enough

So I have a program that starts a NIM current integrator and shuts off when the charge limit has been reached.  I can tell when the current has reached the limit because a digital output goes from high to low.  The problem is that when I push the start button, the current integrator has a slight delay in setting the digital input to high.  So the program sees a low signal and shuts off....  I can not not figure out how to get around this delay, other than to put a switch in that I manually turn on/off which isn't practical for testing (working on a proton accelerator).
0 Kudos
Message 1 of 6
(2,820 Views)
You could put a slight delay into your program.  When you press the start button (I am assuming in your code) do not look at the shutoff signal for a short period while the device starts up.  Then just monitor as usual.  You could use a timer or count iterations of the vi to determine your delay.
0 Kudos
Message 2 of 6
(2,798 Views)
Yeah thats what I was trying to do. I've been having a bit of a hard time implementing it though just because I'm not familiar with the delay blocks.  I was thinking I would try putting the 1ms delay block in line with the start button, and see if that is long enough of a delay. 
0 Kudos
Message 3 of 6
(2,788 Views)
You need an initialization routine that waits for the NIM module to send the high signal. Once it is received, start your main loop.
Richard






0 Kudos
Message 4 of 6
(2,774 Views)
Be careful with delay blocks and waits, they can cause your entire program to see that delay and bad things can happen.  Depending on how sensitive your equipment is you could replace the device's output for that short period of time to get the program to get past that point, then return to look at the original signal.  Basically a case structure that would have a case with a fake signal for as long as you need then a case looking at the actual signal.
0 Kudos
Message 5 of 6
(2,769 Views)

Here is a state machine that will wait for the NIM to init (digital output goes from low to hi), then it waits for the charge to complete (digital output goes from hi to lo).  Add any processing code where you wish.  It is LV2009.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 6 of 6
(2,752 Views)