Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

add PXI 6508 to existing Cont Acq to file (binary)

"I currently run LV Rt on a PXI chassis that has a PXI 6030E card installed. I have modified the example vi: "Cont acq to file (binary).vi" that NI provides as a DAQ example , to acquire 6 analog channels. I now want to append digital data to the binary stream and save to disk. I'll be reading in 50 digital lines using the PXI-6508 card.
I'd like to know how I might add the digital data acquisition inside my existing loop, make sure that the digital lines are appended to teh analog data, and if possible, I'd like to use a digital signal coming into te PXI 6508 to trigger data acquisition (rather than jhust running at the 240S/s that i currently run).

I have attached my existing code for the data acquisition.
Basically this code controls the release of a sled chair in which a human subject sits. the subject initiates release of the chair by a joystick, a laser fixation point is turned on and off at various times, and data from the joystick as well as various linear acclerometers is acquired. The data acquistion loop is in frame three of the main sequence. You'll notice that i am using some of the digital lines of the PXI-6030E but want to include many more digital lines by using the 6058
cheers


stu
0 Kudos
Message 1 of 2
(2,496 Views)
Your application sounds very interesting... with several different parts. I'll try to address your multiple questions independently.

1. Reading in digital lines using the PXI-6508

There is a LabVIEW shipping example which demonstrates performing digital input with the PXI-6508. Please note that the PXI-6508 only performs unstrobed (untimed) I/O. This means that it depends on software calls to perform reads/writes -- it cannot use a hardware clock the way that your analog input does. In the shipping example, one read (of all the lines in the port) is performed once each time the while loop executes.

You can modify and test the shipping example and then add it to your existing code. Simply keep in mind that the AI Read VI will read in as many analog input samples as you specify during one iteration of the while loop, and that the Port Read VI will read in only one sample of the port per iteration of the while loop.

In LabVIEW 7.0, this shipping example is located at:

Help >> Find Examples >> Hardware Input and Output >> Traditional NI-DAQ >> Digital Input and Output >> 8255 >> Read from Digital Port (8255).vi

The directory structure is similar for earlier versions of LabVIEW.

2. Writing both the analog input data and digital input data to file

There are many different possibilities for implementing this. One method is to use the Array tools within the Array subpalette of the Functions palette to add your digital data to your 2D array of analog data before sending it to the Write File VI.

3. Triggering data acquisition
You can set up a hardware trigger for your analog acquisition. There are several LabVIEW shipping examples, as well as Developer Zone examples which demonstrate how to do this. It is not possible to set up a hardware trigger to begin a digital acquisition with your PXI-6508; however, you could set up something similar using software (continuously polling a line to see if it changes state and allowing the program to continue once it does...) or using the handshaking capabilities of the PXI-6508 (there are several examples of how to set this up in the same example directory listed earlier).

I hope that this helps. If you have more detailed questions on your application, you may want to contact technical support directly. You can do this by generating a phone or email request at http://www.ni.com/ask

Sonya
0 Kudos
Message 2 of 2
(2,496 Views)