Discussion:
PCI6509 - Reading output port data
(too old to reply)
miniMe
2007-03-05 10:10:12 UTC
Permalink
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
 
miniMe
2007-03-06 19:40:14 UTC
Permalink
This post might be inappropriate. Click to display it.
Sandra T
2007-03-11 17:10:12 UTC
Permalink
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

Continue reading on narkive:
Loading...