Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I do continuous digital input and/or output with my PCIe-6259?

I'm trying to do continuous digital I/O with my PCIe-6259. Is this possible?

I want to read one line at 1MHz continuous, and write the other port of lines at 1MHz.

How can I do this without dropping samples between the reads?

I'm using DAQmx for Visual Studio (C# but a C++ answer might be helpful if no one uses C#).
0 Kudos
Message 1 of 23
(5,669 Views)
It seems my problem was in trying to use the 10MHzRefClock as my timing source.

I'll have more questions later regarding continuous I/O but this is getting me started.
0 Kudos
Message 2 of 23
(5,650 Views)
It looks like you are off to a good start.  I thought I would just add a few notes about this particular application.

1.  You can only used Port 0 for timed digital operations on the PCIe-6259.  (ie P0.<0..31> )
2.  The sources that you can use to time the digital acquisition or generations are Any PFI, RTSI, AI Sample or Convert Clock, AO Sample Clock, and the Ctr n Internal Output. (Listed in the Specifications for the NI 6259)
3.  There is are C# examples for timed digital operations that install with the DAQmx Driver.  Both examples are configured to use an external clock but can be modified to use an internal counter out or other available internal source.  They can be found at:

C:\Program Files\National Instruments\MeasurementStudioVS2003\DotNET\Examples\DAQmx\Digital\Read Values\ContReadDigChan_ExtClk\Cs
and
C:\Program Files\National Instruments\MeasurementStudioVS2003\DotNET\Examples\DAQmx\Digital\Generate Values\WriteDigChan_ExtClk\Cs

Let me know if you have any specific questions about the examples or the specifications for the NI PCIe-6259.

Regards,

Neil S.
Applications Engineer
National Instruments

Message Edited by Neil S. on 07-31-2006 02:06 PM

0 Kudos
Message 3 of 23
(5,639 Views)
Hello 280Z28,

It sounds like you are trying to do correlated digital I/O on your PCIe-6259 M Series board.  One thing to keep in mind is that you can only run one hardware-timed (correlated) digital task at a time on the same board.  This means that you will not be able to simultaneously perform hardware-timed reads and writes.  For some good examples of how to program a correlated DIO task, please refer to the following example programs:

M Series Correlated Digital Input with Counter Clock Generation in ANSI C

M Series Correlated Digital Input with Analog Input Sample Clock in ANSI C

I hope that this information helps!

Best regards,
0 Kudos
Message 4 of 23
(5,636 Views)
I hope this explains it. Smiley Indifferent

http://www.280z28.org/downloads/IORequirements.pdf

Message Edited by 280Z28 on 08-01-2006 07:23 AM

0 Kudos
Message 5 of 23
(5,628 Views)
Hello 280Z28,

If you want to do hardware-timed digital output (signals generated according to a clock) with an M Series board, then correlated digital outpt, as Neil and I have described is still your only option.  Just to reiterate, there are a couple of hardware constraints to consider:

1.  Correlated DIO works only on Port 0 (8 lines)
2.  You can only have one correlated DIO task running at any given time.  If you need to do both reads and writes according to a clock, you will have to stop one task and then start another. 

If these constraints are showstoppers, I would encourage you to look at the 6533/6534 boards.  These boards have two timing engines, allowing you to perform two hardware-timed digital tasks simultaneously.  Again, take a look at the examples that we posted, and then if you have any specific questions, let us know.

Best regards,
0 Kudos
Message 6 of 23
(5,620 Views)
I think I found a solution. It's gross! it took 4 attempts with completely different methods! but it just...might... work!

(it better work, i can't afford any more than this haha)

I'll be sure to let y'all know once I get it tested more. Right now I know for sure that p is measured correctly, and the updates perfectly spaced relative to each other (c and d are correct), but I have to make sure that the beginning of d is lining up with the pulse start (actually, that's not even very important; the width of d which I have right already is the important part) and the ap0/90 gap is correct (which is important).

Jarrod or Neil: can you send me an email if you get the chance? I have a question for you. The address is part of my profile which I figure you insiders have access to.

Side note: I have a very lazy non-engineer friend named Jarrod B. It's quite humorous to me to see you posting with that name as an engineer because my first thought is him. Smiley Surprised Smiley Happy

Message Edited by 280Z28 on 08-02-2006 05:50 PM

0 Kudos
Message 7 of 23
(5,599 Views)
Hello 280Z28,

If you want to correspond through e-mail with an applications engineer, you should go to ni.com/support and create an e-mail service request.  If you have anymore questions for me, please feel free to post to this forum. 

Thanks,
0 Kudos
Message 8 of 23
(5,580 Views)
OK so here's where I got:

This is what I came up with:

Ctr0 - measures period.
Ctr1 - retriggerable pulse output so each pulse is 1/90 of the measured period. Finite 80 sample output.
DOTask - outputs a sample to port0 on rising pulse from Ctr1InternalOutput. Continuous output, wrote 80 samples per "section" and it loops internally.

This is the problem: If the period ever changes fast enough so Ctr1 doesn't get a start trigger because it's already going, then my DOTask is going to miss 80 samples of output and everything goes bad.

This is how I wanted to improve it:

Ctr0 - Measure period
Ctr1 - Measure two edge separation between known DOTask event and a reference pulse
Adjust DOTask to correct the skew.

If there was a way to do either of the following, then it would work:

a) Adjust the output rate of an AO task without stopping and starting it again.
b) Tell a DO task with a buffer 200 long to wrap back to the beginning after 176 samples (making the effective buffer a subset of the full thing)
0 Kudos
Message 9 of 23
(5,580 Views)
Hello 280Z28,

I didn't completely follow your proposed solution.  I know that you can use a counter to generate a pulse train, and then use the internal output of the counter as the sample clock source for your correlated DIO task.  What I didn't understand is how you expect to use the two signal edge separation for the same purpose.

Regardless, to anwer your questions, you can definitely adjust the update rate of an AO task on the fly.  Basically, you just use a DAQmx Timing Property Node in your loop to write to the Sample Clock >> Rate property.  For an example of how to do this, refer to the LabVIEW example Cont Gen Voltage Wfm-Int Clk-Variable Rate.vi.  I don't think that the second option is possible. 

Let me know if this helps!

Best regards,
0 Kudos
Message 10 of 23
(5,565 Views)