LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to control two different processes with one DAQ output board

Hi! I posted this in the Signal Generators forum, but I'm reposting here in case someone on this board has suggestions for a way to get around my problem programmatically (ie. within LabVIEW). Thank you for any help you can provide.
 
Patrick
 
------------------------------------------------------------------------------
I have a PXI-6722 8-channel, 13-bit analog output board, and with this I want to independently control both the temperature (thermometer excitation/heater control) and magnetic field in my experiment. Unfortunately, it appears that I cannot do both simultaneously, which is totally unacceptable for my application.
 
Currently I'm using separate VI's for field and temperature control. This is the start of the problem, because in DAQmx you can't have 2 output tasks on the same card at the same time. In order to remedy this situation, I used MAX to create a global task containing all 8 13-bit analog outputs. However, it now appears that each time I do a write operation on this task (from whichever VI) I must write to all of the task channels, rather than just the channels I want to change. This would be fine for the temperature controls as they are of the type "set an output voltage value and hold it until told differently," so I could re-write the currently held values for channels that are not being changed. Magnetic field control will not work in this way, because we need to do very smooth field sweeps which require an analog waveform to be sent and sampled at a high rate (so that the steps are as small as possible). So if, for example, a thermometer's excitation voltage or a heater's power need to be changed during a field sweep (as is often necessary to maintain a constant temperature, via PID), then the sweep will be disrupted, potentially causing a dangerous magnet quench.
 
Does anyone have any ideas on how I could make this work? It seems very wasteful to buy a second output board when I still have lots of free channels on the first.
 
Thanks,
 
Patrick
0 Kudos
Message 1 of 3
(2,689 Views)

I'd probably create a third process that just updates all output values on the card whenever necessary.

One way is to send messages via queues from the temperature and magnetic field control routines to the third process. The third process doesn't do anything unless it gets a message from one of the two other processes. The message should contain the channel task ID to change along with the new value. Use the LabVIEW queue VI's, using a type definition to specify the message type either when you create the queue or use the variant VI's. Once it gets a message, it updates the changed channels, not modifying the others (use a shift register to store an array with the current set of output values).

Hope this helps.

Jason

0 Kudos
Message 2 of 3
(2,680 Views)
Hi Patrick,

I replied just after you made this new post.

For those of you following the thread, you can go here:
How to control two different processes with one DAQ output board

I created the code initially in LabVIEW 8, so if you bear with me for just a bit longer (later today) and I'll post the code for LabVIEW 7 on that forum.

Regards,
0 Kudos
Message 3 of 3
(2,656 Views)