11-17-2006 12:16 PM
11-19-2006 11:41 PM
Which DAQ card are you using??
11-20-2006 07:50 AM
11-21-2006
12:04 PM
- last edited on
03-10-2025
10:36 AM
by
Content Cleaner
Hi Nspaulding,
I want to make sure I am clear on your application. Do you need to verify that the the closure occurs for at least 1/100 of a second? Or is it simply detect the digital high (that lasts for only 1/100s)?
Also, the line of data you wish to write, is this a series of bits on one digital line? Do you need a particular data rate? Does the data have to be written at a particular time or delay following the point at which the contact is sensed?
Since the USB-6008 does not have correlated (timed) digital I/O, the application could be designed as follows:
1) The 5V pulse could be detected by wiring it to the PFI line to use as a digital trigger. Since the the digital task cannot be triggered, you could trigger a single point read of an analog line and perform your digital task when the read completes. Alternatively you could wire the signal to an analog input line and acquire continuously and compare the readings to a threshold value to detect the pulse. This acquisition would be done in a while loop and the stop condition would be set when the threshold is met.
2) Assuming your message is digital, the data line could then be toggled high and low to send your message. This will be software timed. You can put a delay in a loop or use a timed loop to determine when to write the next piece of data to the line. The data maximum data rate will be system dependant and slow in comparison to working with a correlated Digital I/O device.
Assuming you require precise timing or faster data rates for the sending of the data message, you will want to look at using a multifunction DAQ board with correlated or timed digital I/O such as the M-Series DAQ boards or a digital board. This would simplify the programming. You could start with one of the LabVIEW examples (Help>>Find Examples) such as Write Dig Chan-Ext Clk.vi. You would be able to use a counter to generate a clock at your desired output frequency.
Hope this helps,
Jennifer O.
Applications Engineer
National Instruments
11-29-2006 08:33 AM
11-30-2006 10:52 AM
Hi nspaulding,
This would be a simple buffered event count task (see the LabVIEW Example Finder). A buffered event count can be set up to latch the count on a rising/falling digital edge. Unfortunately this is not supported on the USB-6008. This type of task requires two PFI lines, one for the counter and one to externally clock the signal. The USB-6008 only has one PFI line.
I recommend upgrading to a USB M-Series card for this type of application.
A work around for your application with your current hardware would be to sample the autosampler signal on an analog channel. You can use a waveform measurement function (Amplitude &Level, Basic Level Trigger Detect) to determine if the 5V has connected. At the same time, you can run an edge count task on the optical encoder to continuously count. When the analog signal is above a particular threshold (i.e 2.5V) then you can log the current value of the counter. This work around will not have precise timing; you may end up with extra counts by the time the "software trigger" occurs. For accurate timing with the counting, you will need a device which supports buffered edge counting.
Regards,
Jennifer O.