05-25-2007 02:33 AM
Hi,
I would need to control a galvomirror(via inputting voltage) and acquire the photodetector voltage reading.
The process is as such
1) The photodetector voltage level is to be read
2) It is to be then fourier transform to obtain the spectrum
3)
4) Galvomirror is to be moved to new position by setting the voltage
5) Above process repeated for n readings
I have the following question
A) Programming via Labview
The NI cards I have are PCI-6133(only analog input reading) and USB 6008 (for analog output). I am using Labview 7.1 and DAQ mx8.3. I have written a program using parallel acquisition and output but I have some doubts.
i) Is it advisable to program both task in a parallel loop format? One loop for reading in the photodetector voltage and processing spectrum continuously while the other loop will be responsible for recording and moving the galvomirror
ii) I have used the local variables for passing the values between the two loops. Is there other ways to handle it as I read about the high memory consumption by using local variables
iii) Is there any examples that is similar?
I have trimmed down my program and attached it. Most of the sub-vi handles the more minor task such as to set the DAQ and to extract frequency value
B) Programming style
i) I have found that programming large vi usually have large amount of criss-crossed wires especially if u have multiple nested loops. Would some folks here advice me on how to keep a vi program looking neat? Do most of you hide the wires behind nested loops and sequences? How do you improve readability of the program?
ii) Is there any method for us to switch the connection points of vi around, somewhat like Mathlab simulink where you can switch the node point of a simulink block(ie allowing for program flow from right to left)? Or switch the location of the sequence local, without causing the wires to run crisscrossed in the previous frame
Thanks for your help!
05-25-2007
04:15 AM
- last edited on
04-18-2025
12:45 PM
by
Content Cleaner
Message Edited by devchander on 05-25-2007 04:16 AM
06-03-2007 10:02 PM
Hi,
Have studied the suggestion but I have some query over here
1) If we are using producer/consumer architecture, how do we handle the information that we might not want in the queue. For my case, not all the information that the detector has produced would need to be processed. Also how do we mark/identify which data sets in the queue is those that belongs to certain environmental change? in my case, I would need to shift the stage and take readings of the photodetector. How would we identify which reading in the queue belong to the shifted result and which belongs to the previous shift? Do we also need to encase the data with the stage reading value before we enqueued it? What's the more common practice?
2) Would a master and slave design sounds more practical?
Thanks for your help!
06-04-2007 06:36 AM
You could probably incorporate a check while enqueqeing data ( For example: use a Data range check and enqueue data inside a case structure, only if your constraints are met)
06-04-2007 08:20 AM - edited 06-04-2007 08:20 AM
About the wiring style. I've checked your test.vi... With all respect... Oh my God! What a mess!
Keep the code cleaning, immediately while your working!
Here's some tips:
Also try to avoid (non-flat) sequence structures, because they create input wires from the right. IF you need to use a sequence structure, then first pull the wires all the way to the left, and work from there.
Certainly, also read the suggested style guides.
In this case, probably pictures say more than a thousand words. Check out the differences.... NB: I've only moved wires and vi's around to make it more clear. I haven't changed any code at all!

Cleanup up:

Message Edited by Anthony de Vries on 06-04-2007 03:22 PM
06-04-2007 08:22 AM - edited 06-04-2007 08:22 AM


Message Edited by Anthony de Vries on 06-04-2007 03:26 PM
06-04-2007 01:16 PM