LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simultaneous Control Using GPIB / DAQ

I am working on a project that is a continuation of a previous project. It involves controlling the temperature and pressure in two vacuum chambers. The original project controlled only one chamber and the original code contained a number of global variables. In order to control the temperature and pressure, the LabVIEW code reads in values from a data logger thru the GPIB interface. To regulate the temperature/pressure, a DAQ card is used to control a heater and a series of pressure valves. The client wishes to keep the original code and is asking me to incorporate code to accomodate the second chamber. One computer will be running identical LabVIEW programs(with different global variables and sub-VIs), one to control each chamber.

I am fairly new to LabVIEW and looking for a starting place or sample code that I can look at. I have duplicated the current code, renaming sub-VIs and global variables. The solution I have come up with so far is to have a VI that does all of the reading and writing, but I am unsure as to how the chamber LabVIEW programs will access it whenever a reading is needed or the temperature/pressure needs to be adjusted.

If further explanation or the original code is needed let me know, and thanks in advance for any advice that can be offered
0 Kudos
Message 1 of 2
(2,706 Views)
Hi lrsantos,

It's unfortunate that you have to maintain the original architecture of the code, because this type of application would most likely be better implemented in a single top-level VI with subVIs. However, if that is not an option, I understand.

So, using notifiers you are able to easily transfer information between "independently-running" VIs. There is a very good example program on this (Wait on Multiple Notifiers.vi) that ships with LabVIEW. You can access this by going to Help->Find Examples->Search "notifiers". This actually does almost exactly what you are thinking about doing. You can make a 3rd VI that reads the information off of the USB port and then sends that information (via Notifier1 or Notifier2, depending on the chamber) to its respective VI. For example, one VI would be waiting for a notification (and data) from Notifier1 and the other VI from Notifier2. You could then process this information accordingly. Like I mentioned, this shipping example should show you exactly how to do this with the exception of 1 thing. If you are passing notifiers between top-level VIs, you will need to write the "notifier out" to a global from your 3rd VI and read it back into your 1st and 2nd VIs (to be passed to Wait on Notification functions).

As far as priority goes, you won't need to do anything. The way that I described the "3rd" VI as operating is more like a Producer of data and the "1st" and "2nd" VIs act like Consumers. Therefore, the Consumer VIs don't ever really "access" the 3rd VI, they are actually sent data from the 3rd VI.

Hope this helps!
Travis H.
LabVIEW R&D
National Instruments
0 Kudos
Message 2 of 2
(2,688 Views)