Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Advance Digital Edge for analog generation

Hello,

I was wondering if anyone could show me how to properly use the Advance Digital Edge vi in LabVIEW.  Currently, I have a program that writes to both one PCI 6220 and two PCI 6711 M Series DAQ boards.  The digital is written by creating a row of 8 columns, representing the on off state for the 8 available correlated digital channels.  This array is expanded by another 1D array that designates the dimension size for each row. Because I am using a sample clock from the analog board at a rate of 1 MHz, these rows are divided into one microsecond apiece, and then output.  This aspect of the program is working fine, however when trying to perform a similar operation for the analog board, the program returns an error stating there is not enough memory to execute (picture attached below).  I believe I can get around this problem if I can properly setup the Advance Digital Edge vi.  By using the last line of the digital channels, attaching it externally to one of the Analog PFI lines, is it possible to simply tell the analog board when to change voltage, as opposed to writing the analog voltage value of each channel for each microsecond. 

When attempting to set this up, I was met with the following error:

 

Error -200452 occurred at Property Node DAQmx Trigger (arg 1) in DAQmx Advance Trigger (Digital Edge)

Possible reason(s):

Specified property is not supported by the device or is not applicable to the task.

 

I am hoping this error is not applicable to the task as opposed to not supported by the hardware.

Download All
0 Kudos
Message 1 of 4
(3,945 Views)

Hi EESteve1992,

 

First, the Advance Digital Edge trigger VI is meant for tasks using switch modules. The reason you are receiving this error is that this function is not supported for an Analog Output task.

 

Also, the memory error is due to rebuilding arrays within a loop. Every time you build a new array in a loop, LabVIEW allocates new memory, instead of rewriting the memory of the current array. This is causing you to run out of memory in your program. 

 

Could you go into more detail about exactly what you are trying to do with your Analog Output tasks? Are you trying to output a signal at 1 MHz?

 

Because you are trying to write a large array of sweeping voltage values all at once, you might also run into buffer overflow. My recommendation would be to write some initial value at your DAQmx Write.vi, but then have an additional DAQmx Write.vi in your loop, in place of the DAQmx Is Task Done.vi. In the loop, you could update the Analog Output based on the DO, instead of having to write the entire array of AO values at once before the loop.

 

Hope this helps!

 

 

Robert R. | Applications Engineer | National Instruments
0 Kudos
Message 2 of 4
(3,915 Views)

Hi BobRodge,

Thanks for the reply, to get into a bit more detail, the end goal for the program is to have a front panel where the user can define the voltages of the eight available channels throughout roughly 30 seconds of experiment time.  The PCI 6711 board will latch the last value it received and hold there, so realistically the user only needs to tell the analog values when to change, not precisely how many microseconds it needs to last for.  I've attached a picture of a program that I am trying to emulate on a smaller scale, this program uses one of the digital lines to trigger analog values to change, but I'm not sure if that is 100% necessary.  

I was thinking this change event could be triggered off of one of the digital lines, or if there is a way around this that would be nice as it would save one of the digital lines. 

I definitely need to avoid placing the entire array on my board at one time, i think the idea of placing another write in the while loop may be a good idea.

Thanks for the suggestions, and thanks in advance for any others! 

 

0 Kudos
Message 3 of 4
(3,912 Views)

Hi EESteve1992,

 

I do believe adding a DAQmx Write.vi in your loop would be the best solution. You could also have an enum control in the loop as the selector for a Case Structure in order to choose between the 8 voltage levels. Here is my idea:

 

Have an enum with 8 items, representing the 8 different voltage values you will want to output. Create a Case Structure with the 8 cases from the enum. Output the corresponding voltage value for each case. Send that output to the DAQmx Write.vi. All of this would be in the While Loop.

 

This would prevent using a digital line and just tell the AO to change in software. 

 

I hope this helps!

Robert R. | Applications Engineer | National Instruments
0 Kudos
Message 4 of 4
(3,898 Views)