Hello, I'm new to the labview environment and I have some questions that I am hoping some of you may be able to answer. I think that this simplest thing would be for me to describe what i want to do so that everyone is clear on what's happening.
I need a program that controls and older GPIB piece of equipment as well as a brand new high speed digitizer scope (pxi-5114). Here is what I would like to do... Among other things, I would like the main VI to have two buttons on it that can be used to open and change settings on the two subVIs that correspond with the GPIB device and the scope. However, I need to be able to interact with both of these subVIs at the same time (meaning, I need both of them open) in order to find the right combination for data acquisition. this means that i need to be able to pass data back and forth between the subVIs and mainVI (and possibly between the subVIs, but I'm not sure about that part yet).
(1) For the GPIB device, I essentially set scan parameters which generate a 1D array of values that will be passed back to the main VI. So that the main VI can then execute a series of tasks for each index in the array. Up until now, I have been able to accomplish this task using globals, but after having read through ~ 15 different threads posted in this forum, I've decided I'll probably switch over to using queues because using globals can get pretty messy and they really disrupt the program flow. That being said, I want to be able to click the "GPIB device" button on mainVI and have another VI popup (i'm confused about how exactly to implement this still -- i feel like I could use a subVI, or use dynamically loaded VIs and i'm not sure about the pros/cons of each). I'd like to input some values, ... hit 'load values' on the GPIB device VI and have the array be passed back to the mainVI for further use.
(2) for the scopeVI, I feel like things are much more complicated, but perhaps I'm just not thinking about it clearly yet. For each member of the 1D array generated in (1), a 'scan' will be run that generates another 1D array as a function of time. Basically, in the experiment, I have a signal coming in that is time dependent. I have a master external trigger that is 10Hz and will dictate the collection rate. I will have parameters in the scopeVI (or whatever) that I will need to adjust (# of sweeps to collect/average per scan, horizontal,vertical, sample rate, record length, etc.) These parameters are set at the beginning of the experiment, but do not change over the coarse of the experiment (which leads to a question i will address later).
(3) mainVI. This is the most loosely defined section as of yet. I may incorporate some data analysis/signal processing, etc into this section, but I can add those features later. For now, I want to be able display the result of each 'scan' as it is collected (i.e. - pass the data from scopeVI to mainVI). Since this is a 10Hz laser, If I take 30 sweeps per scan, my mainVI display will update ~ 1 time every 3 seconds or so. At the end of the experiment, there will be a 2D array of data. somewhere in mainVI, I need to include write/save capabilities, but I think I can handle that part on my own as well.
My primary concerns are:
i. do people have suggestions for the way I should design this program? -- i.e. - using queues, notifiers, reference controls, VI server, etc. and the benefits/pitfalls of your choice?? as I said before, I have read enough to lead me away from using global vars...
ii. There were a lot of example VIs that came with the scope hardware. There's no need for me to rewrite a bunch of code, so I will just modify one of those VIs to use as scopeVI. However, the questions that arise with this VI are
a. I want it's values to exist for the duration of the lifetime of mainVI. I don't want to dynamically load it (and it's default values) every time I reopen it by pressing the 'scope' button on mainVI.
b. I want to pass the data that is collected by scopeVI back to mainVI for further processing... I essentially want to keep all of the processing of the signal in mainVI and keep scopeVI strictly as a way to define experimental parameters
I think that's about it. I'm more than willing to discuss things further if that would help in your analysis. Thanks for any information that you're willing to share with a new guy to this language!
-Z (wazgrp@yahoo.com)