LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Real-time PID control and continuous buffered acquisition. Does it work together?

I use the "real-time PID control.vi" that acquires single AI point and generate single AO point in every "while loop" iteration to control a piezo actuator motion. Simultaneously I need to do (in another loop) a continuous buffered acquisition of another two AI channels (in the same rate as first AI channel).
It does not work together.
Does anybody know how to fix it?

Platform: LabVIEW 6.1
Board: PCI-6024E
0 Kudos
Message 1 of 4
(3,237 Views)
Yes, you cannot perform two DAQ processes with the same DAQ card at the same time. However...

If you acquire all of the data in your control loop, you can place the two channels into a buffer that the second loop can access at it's leisure. You can do this through local or global variables, but you will have to deal with the possibility of one loop accessing the variable while the other is in the middle of using (adding to or deleting from) the buffer. A "storage" VI with a while loop-shift register to store the buffered array would be better as only one occurance of the VI will execute at any one time.
Message 2 of 4
(3,237 Views)
Hi,
I would try to avoid the idea of using a separate loop since the PID
loop is a continuous acquisition and will require un-interrupted access
to the Analog DAQ system of the board. The last thing it needs is for
you to attempt to start other AI functions at the same time.

Configure your AI in the PID loop to read in multiple channels (Just add
some more channels to the Input Channels Control. Separate the data as
it comes out of the AI single Scan function using Index Array or other
Array functions into that needed for the PID and that needed for your
other data (the example is already doing this to make sure it only gets
1 channel of data into the PID). If you don't need to sample all your
channels of data all the time you can throw some data away as
required.
Obviously your other channels are now arriving one sample at a time so
if you might need to build an array, insert into an array or use Auto
Index on the loop if you are data logging.

Regards,

Dave R.




varmih wrote:
> I use the "real-time PID control.vi" that acquires single AI point and
> generate single AO point in every "while loop" iteration to control a
> piezo actuator motion. Simultaneously I need to do (in another loop) a
> continuous buffered acquisition of another two AI channels (in the
> same rate as first AI channel).
> It does not work together.
> Does anybody know how to fix it?
>
> Platform: LabVIEW 6.1
> Board: PCI-6024E
0 Kudos
Message 3 of 4
(3,237 Views)
Thank you for the idea. It works fine with "Recent History Buffer (DBL).vi" (see "Recent History Buffer Example.vi").
0 Kudos
Message 4 of 4
(3,237 Views)