Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

M-series PCI-6221 digital output code is BROKEN on X-series PCIe-6321

Solved!
Go to solution

I have an application written in C++Builder and NIDAQmx 9.1 that either runs:
  1) Two simultaneous continuous tasks (acquisition/stimulation(AnalogOut+DigitialOut) sweeps task) and a continuous acquisition (tape recorder task)
  2) A single acquisition/stimulation(AnalogOut+DigitialOut) sweep

 

On many M-series PCI-6221 (and PCI-6229, PCI-6251, PCI-6259 and PCIe-6259) boards, both the Two Tasks and the Single Sweep work fine (AnalogInput, AnalogOutput and DigitalOutput are all correct).

 

In contrast, on the one X-series board I have, a PCIe-6321, the Two Tasks works FINE (AnalogInput, AnalogOutput and DigitalOutput are all correct).  However, the Single Sweep does not run correctly - AnalogInput and AnalogOutput work FINE, BUT THERE IS NO DigitalOutput!!!

 

The code for the board setup and start are the SAME for both (see below).

 

I had assumed that code that ran on M-series boards would also run on X-series boards.  Apparently not.

 

In the Multifunction DAQ forum, Dan_K mentions that there is now a dedicated DigitalInput and DigitalOutput clock.  Could this  new digital output clock be part of the problem?  Could the fact that I am using an AnalogOutput clock for digitial output be the problem for the X-series board?

 

In the attachment (PCIe-6321_DigitalOutput_BUG.txt) are my M and X series Setup and Start acquisition/output functions to see X-series experts can find any obvious problems.

 

Thanks,

 

Bill Anderson

 

0 Kudos
Message 1 of 5
(3,166 Views)

Hi Bill,

 

Code that works on an M-Series *should* work on your X-Series device as well.  Though DI and DO do have dedicated timing engines, they should not precluded you from using an external clock.  From you post, I gather that you are not receiving an error from the driver, but you are not seeing the expected patterns on your digital port.  Is this correct?  I didn't notice anything in your configuration that looked wrong, however it did not show the code where you write you data.  This needs to happen before you call start, otherwise DAQmx will not allocate a buffer and you may not get the behavior you expect (ie... you'd be doing HW Timed non-buffered rather than buffered generation).

 

If you are doing all of this correctly, then I think the next step to troubleshoot would be to figure out what is happening.  If you're not seeing output, I'd want to check to see that the DO task is getting it's clock as expected.  To check this, you should be able to create an edge counting task with one of the devices counters, and have it count /Dev1/do/SampleClock.  In you case I would expect these edges to arrive at 40 kHz.  If they are not, then it would indicate there was some issue with clock routing.  If you are counting clock edges, then there is some issue with the data being written.  One other question I have is whether you're checking for errors regularly  after starting your tasks?

 

What you're doing looks to me like it should work, so hopefully we can troubleshoot the issue you're seeing.  If you can get back to me with answers for my questions, we can go from there.

 

Hope that helps,
Dan

 

 

0 Kudos
Message 2 of 5
(3,147 Views)

Hi Dan,

 

Many thanks for your reply.  At least I know I'm not doing something obviously stupid - which I did not know before.  First I am going to make sure that the correct data is being sent to the board (ie some 1's rather than just all 0's).  Next I am going to try to use /Dev1/do/SampleClock (rather than /Dev1/ao/SampleClock) to drive all AnalogInput, AnalogOutput and DigitalOutput.  Then if still no success, I will do the edge counting task with one of the device counters and have it count /Dev1/do/SampleClock - I have never written an edge counting task which could present a bit of a problem - and therefore will leave until last.  Again, many thanks for your help.

 

Sincerely,

Bill Anderson

0 Kudos
Message 3 of 5
(3,110 Views)
Solution
Accepted by topic author Bill_Anderson

I have FIXED the inability of PCIe-6321 X-series boards to produce DigitialOutput during SingleSweeps.  Before I had a dual-buffer AO/DO buffer.  I changed this to a circular 3 buffer AO/DO  buffer.

 

Therefore the problem was NOT in the inability of the /Dev1/ao/SampleClock to trigger DigitialOutput in X-series boards, but a much more suble difference in timing between M-series and X-series boards that allowed M-series boards to use a dual-buffer output system, but X-series boards required a circular 3 buffer output system.

 

I consider this an acceptable solution.

0 Kudos
Message 4 of 5
(3,086 Views)

Bill,

 

I'm glad to hear that you were able to get your issue solved.  Thanks for sharing your solution!

 

Best of luck with your application,

Dan

0 Kudos
Message 5 of 5
(3,077 Views)