06-09-2010 04:57 PM
I have a laser based measurement system that has two shutters with sync output. I want to monitor the sync output to verify my shutters are opening. I have a PCI-6602 that does the timing for the system and was trying to use 2 of its DIO lines. The shutters are open for 300ms at a time and then I have about 500ms of closed time before the shutter opens again. When I start a measurement I also start the attached vi to look at the DIO port. When the array from the port matches my expected shutter states I conclude the shutters opened. 80% of the reads the shutter is detected open in 1-10ms. The other 20% of the time I exceed my timeout without detecting the shutters even though I can see the sync signal on an oscilloscope. I do not see any reason why my simple vi fails to detect the opening of the shutter. Is there a way I can get this to work with the 6602 or do I have to use a card that supports change detection?
I am working with Labview 7.1 and Traditional NI-DAQ 7.4.4.
The DIO port is configured when I start the main program and the task is passed to the attached vi.
06-10-2010 12:25 PM - edited 06-10-2010 12:26 PM
Hello,
Can you clarify what you mean by sync output? Are the shutters outputting high voltage when on and low voltage when off, or vice versa? Do these shutters open simultaneously, or do they open individually at different times? Is your timeout 300 ms or is it greater?
One thing to note is you are using software timing for the DIO task, and you are controlling the timing on your while loop. You might want to verify that you are reading the port many times in the duration that the shutters are open (300ms) to make sure you are polling fast enough. It seems like it does detect the open state most of the time, so there must be some timing/signal quality issue that prevents it from detecting everytime. You mentioned this is running in parallel with another program, so make sure your other program is not adversely affecting the timing on this vi.
Another possible troubleshooting step is make an array of your port reads so that you can see what exactly is coming out of the Port Read vi during each iteration of your while loop. You can even timestamp the array with your Tick Count that you already use in the loop. This may give some clue as to why the detection fails.