Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI6509 - Reading output port data

Hi,
 
I am interested to know if it is possible to read the data that an output port or line is programmed with ? I'm using a PCI6509 card, and I'm using most of it's 96 I/O lines as outputs, and I want to make a graphic tool that will show all I/O lines states. Using the DAQmx driver, I didn't find any CVI functions that will read the content of the output buffer.
Any advice on this issue will be highly appreciated,
 
Regards
 
0 Kudos
Message 1 of 4
(3,708 Views)
Hello miniMe,

Thank you for posting to the discussion forum. I see that you are using a PCI-6509 card to output to your digitial I/O lines in CVI. You'd like to create some sort of graphical indicator to display the information that you are sending to the output. How are you sending the data to your DAQmx Write? If the data that you are generating comes from some sort of waveform generator, you can also have that data displayed on a waveform chart or other form of indicator.

Regards,
  Sandra T.

Applications Engineer | National Instruments
0 Kudos
Message 2 of 4
(3,690 Views)

Hi Sandra,

I use PCI6509 card to control actuators and relays inside a test station. Test application is developed in Teststand and CVI, using parallel model, running 6 UUT's. The output port lines are controlled by functions called by Teststand. The write function inside the DIO DLL is DAQmxWriteDigitalLines.

 What I'd like to do, is to write a CVI application that will read the content of all the output buffers in the PCI6509, and  display it on some graphical form. I tried an application that reads all 12 ports from time to time, using DAQmxReadDigitalU8, but this was not OK because it  messes the configuration of all the ports, setting them as inputs.

At this point I'm stuck because I don't know how to read the output buffers of the PCI6509 using the NI-DAQmx driver functions.

Regards

 

0 Kudos
Message 3 of 4
(3,685 Views)
Hello miniMe,

With regards to your question about reading from the output buffer, there is no function to read directly from your output buffer.

There is a a way to specifiy where in the buffer data is  written. By default, NI-DAQmx writes samples sequentially beginning with the first sample in the buffer, and each write begins where the previous one left off. The sample where a write begins is called the Current Write Position. Each time data is written, the Current Write Position is computed based on the settings of the Relative To and Offset attributes/properties. The default write behavior results from the default settings of these two attributes/properties. The default for Relative To is Current Write Position and the default for Offset is 0. Changing the settings of these two attributes/properties controls where in the buffer data is written.

For an application like this, instead of reading the output buffer for those values, you can do a channel read of the port. You can do a read on an output task, that is use the taskhandler of your output task in your read function. This operation will be static, meaning it will not be hardware timed. Since it will be depending on your system, you may run into issues where a signal might be missed.

Another recommendation is keeping track of what you are writing to the buffer with your write function.

Regards,
  Sandra T.

Applications Engineer | National Instruments
0 Kudos
Message 4 of 4
(3,655 Views)