Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

NI PXI 6221 DIGITAL I/O Generation of 10 digital signals and a clock signal on board

Solved!
Go to solution

Hello Sir/Madam,

 

I am using NI-PXI 6221 DAQ to my research and I have to test a 10 bit Digital to analog convertor using this DAQ. I have generated a counter signal that acts as a clock and 8 digital signals using PORT 0 but I am not able to generate 2 more signals on the other PORT1 . The error I get is that the DAQ

doesnot support buffered operation. What does that mean?

 The port1 is a dual function port for PFI function and digital I/O. As per the specification the DAQ supports 24 digital I/O.

 

 

0 Kudos
Message 1 of 23
(4,937 Views)

Ravi,

 

I have an idea about why you're getting that error.  It is most likely an issue with one or more of your timing VI's.  I would like to take a look at your code to confirm.  If possible, please attach your VI and I will see where the problem lies.

Regards,

Chris L
Applications Engineer
National Instruments

Certified LabVIEW Associate Developer
0 Kudos
Message 2 of 23
(4,920 Views)

Hello Mr.Chris,

Thanks for your reply. I am attaching the file along with the post please do find the DIGITAL8bitandcounter.vi file.

I tried writing on to two ports but it says thebuffer operation is not supported.The DAQ is used to generate the counter output on PFI12.The port 0 is configured for digital data output.

 

I am able to contorl the frequency using the couter frequency as it determines the sampling rate but I am not able to control the frequency of content writing unless i use a huge number for the for loop. I meant that I cant see the waveform continously on the logic analyzer If I dont use a big number for the for loop.

 

Thanks.

0 Kudos
Message 3 of 23
(4,916 Views)

Only port 0 supports buffered digital I/O as per the specifications.  On the 6221 that means you only have 8 lines for generating digital waveforms.  The counters can be used to generate pulse trains and can be synchronized with the generation, so perhaps these can fill in depending on what you want to generate exactly (it looks like you want to generate every possible bit combination in sequence?  If so, this would be possible using the 2 counters + the 8 DO lines).

 

The 6229 is similar to the 6221 but has 32 lines on port 0 (and double the AI and AO channels).  The 6224 is similar to the 6229 but it doesn't have Analog Outputs.

 

To address your other question, you should change your code to write all of your data before-hand, then use DAQmx Start to begin the generation (something more like this).  Right now you are auto-starting and writing a single sample per loop iteration.

 

 

Best Regards,

John Passiak
0 Kudos
Message 4 of 23
(4,911 Views)
Solution
Accepted by ravi shankar

The counter workaround to get 10 lines is probably a bit confusing if you don't have much experience with NI DAQ hardware.  Attached is a VI that should step through every possible 10 bit combination using the 8 clocked DO lines and the 2 available counters:

 

bits 0:7 are on port0 line 0:7

bit 8 is on PFI 12 (default ctr0 output)

bit 9 is on PFI 13 (default ctr1 output)

CLK is on PFI 14 (default Frequency Output)

 

 

Note that the available frequencies are limited to what is supported by the frequency generator--{10 MHz, 100 kHz} / {1:16}.  If you want more resolution in your sample clock (but a lower max rate) you can configure a dummy analog input or analog output task and use its sample clock in place of the frequency generator.

 

 

Best Regards,

John Passiak
0 Kudos
Message 5 of 23
(4,903 Views)

Thanks Mr.John,

 I checked the two counter outputs and found they are not synchronized there is a delay of 250ns between each output and I cannot view the attached file as it says the version available is 10.0 I have labview 8.0 installed on the machine.

 

Synchronization of all signals is very important in my testing.Can you provide me further if possible.

0 Kudos
Message 6 of 23
(4,894 Views)

Hi Ravi,

 

If you weren't able to run my VI how did you check the synchronization of the counters?  If you aren't configuring them properly then they wouldn't start at the same time and thus wouldn't be synchronized.  By default the counters share a free-running timebase so unless you are triggering them together there is no guarantee they would start at the same time.  My VI has the counters use another signal as a timebase--this signal is started after both counters are armed so you can guarantee they are started together.

 

Anyway, here's the same VI saved in LV 8.0.

 

 

Best Regards,

 

 

John Passiak
Message 7 of 23
(4,882 Views)

Thanks a lot Mr.John. I recently found the counter output on the DAQ and started using it for my program. Previously I was using an external clock for the sample clock and writing on the port. I tested the counters using DAQ assistants  so there was a delay between them. Now I can use this Vi to generate all the signals perfect for testing my 10 bit DAC.

 

Where can I find the tutorials to understand in depth regarding the programming of DAQ. I still have to develop Vi's to read analog input for processing my DAC output.? I am still in learning process ..

 

Regards,

Ravi shankar gaddam,

Research assistant,

analog and mixed signal IC design,

The university of Akron.

 

0 Kudos
Message 8 of 23
(4,877 Views)

Hi Ravi,

 

I find the following article to be a good starting point for using the API--you'll want to use the lower level DAQmx functions instead of the DAQ Assistant since your application requires more precise control over the synchronization between tasks:

 

https://www.ni.com/en/support/documentation/supplemental/06/learn-10-functions-in-ni-daqmx-and-handl...

 

 

Property nodes are barely mentioned in that article, so you might want to read over this one as well:

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YH72CAG&l=en-US

 

 

 

If you're using the 6221's ADC to measure the output of your DAC, I'd suggest replacing the Frequency Output task with an Analog Input one, then use the AI Sample Clock as your clock for the other tasks.  You should set the "Delay from Sample Clock" DAQmx Timing property on the Analog Input task to allow for your DAC to settle. 

 

You'll probably also want to average multiple analog input samples per DAC update to reduce the impact of noise--doing this would add some complexity to your code but it would be possible by repeating multiple copies of each DO update (and adjusting the counter output high ticks/low ticks/initial delay parameters accordingly).

 

 

Best Regards,

John Passiak
0 Kudos
Message 9 of 23
(4,861 Views)

Thanks a lot Mr.John. I will go through the articles. 

 

It will definitely be a great help in developing my testing setup.

 

Thank you very much for your support. I appreciate your work.

0 Kudos
Message 10 of 23
(4,854 Views)