Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Sequential Buffered AI and Single Point AI in One Loop

Hi:

I am using a 6052E and a 6713. I have programmed a LabVIEW VI such that I can perform hardware-triggered continuous buffered AO and AI, with both the "AO Write" VI and the "AI Read" VI inside a while loop.
I use the AO channels on the 6713 and the AI channels on the 6052E. Additionally, I use the first counter of the 6052E to provide the above hardware trigger. This works like a charm.

Now I want to add the "Single Update" VI and the "Single Scan" VI to the while loop. Hence, I assigned the channels for the above hardware-triggered continuous buffered AO and AI to group 1 per the respective "AO Config" and "AI Config" VIs. Similarly I assigned the new channels that are to communicate with the single upda
te/scan VIs to group 0.

When I try to run this, however, I get the error code 10609 from AI SingleScan. (A transfer is already in progress ...). When I take the "Single Scan" VI out of the loop, it works fine again, i.e. the "Single Update" VI by itself does what it is supposed to do.

Can the 6713 support sequential buffered AO and single point AO, but the 6052E cannot support sequential buffered AI and single point AI? Or what else might I be doing wrong?

Thanks for your advice in advance.

Sincerely,

Matt Koch
0 Kudos
Message 1 of 4
(2,964 Views)
Groups can be confusing. In general, on a given DAQ card, though you can simultaneously do AI, AO, DIO etc, you can only do one of each. In other words, you can only have one AI acquisition going on at a time, but it can include as many channels as you want.

After programming the card for the first acquisition, you received error 10609 because you did not clear the first acquisition before starting the second. There are 4 parts to every acquisition: Config, Start, Read, Clear. The driver can hold multiple "Configurations" so that they are handy later if you wanted to stop one and then begin another. These "configurations" are things such as the channel list, input limits, and reference modes.

You can see from the attached example how this
works. Wire a sine wave into channel 1 and run the VI. You'll see that group 0 is programmed for a -5V - 5V range, while group 1 is programmed for a 0V - 5V range. You'll notice that in the second graph the sine wave gets clipped. If you change the AI Config VI's to both use "group 0," you'll see that the second AI Config overwrites the first.

The only catch is that once you clear a task ID, the task ID is no longer valid. (You also must clear the current acquisition before moving to the second)so it would be hard to revert back to a previously used configuration, but you do get to move from acquisition to acquisition faster.

However,the workaround in your situation is to include the channels you would be reading single updates from into your original scan list. You'll actually be scanning the channels just as often as the other ones, but you still have the option of whether or not you want to look at it, right?

Best Regards,

Russell
0 Kudos
Message 2 of 4
(2,964 Views)
Russell:

Thanks for your answer. I am not sure I completely understood, so here are some thoughts on your example VI from which you might be able to judge whether I understood.

I noticed that in the first Sequence, you have different groups and different ranges, but you have the the same channel 1. Can I actually assign channels 0 ... 3 in the first frame of that sequence and channels 4 ... 7 in the second frame of that sequence?

Furthermore I noticed that in the second Sequence, both frames have the same Start/Read/Clear VIs. Can I leave them like that in the first frame (corresponding to channels 0 ... 3), but replace the three of them with a Single Scan VI in the second frame (corresponding to channels 4 ... 7)?

I have not programmed it e
xactly like that in my VI, but I am reasonably certain that this would work for AO VIs (writing to PCI-6713), but so far, it has not worked for AI VIs (reading from PCI-6052E).

Thanks and Regards,

Matt Koch
0 Kudos
Message 3 of 4
(2,964 Views)
You are correct on both accounts. The channels don't have to be the same between the groups. (I guess I just thought it was less clear that you could do the same set of channels twice.) Also, you can use the Single Scan VI as well, just remember that you will eventually have to close out that task ID with an AI Clear.

You don't have to do it exactly the way I did, but you just need to make sure that the first acquisition has finished before you start the second one.

Remember, you could always put all the channels in one group. Even though you would continuously sample channels 4 - 7, you could just ignore all the samples that occur previous to when you would have done the Single Scan. That way, you don't have to worry about setting u
p separate groups.

Good luck with your application!

Regards,
Russell
0 Kudos
Message 4 of 4
(2,964 Views)