06-03-2013 12:52 PM
Dear colleagues!
I am new to LabView and I am only starting to learn the system (I have never been a programmer, I'm a chemist to be precise).
I have before me a task to interface an old analog scanning spectrophotometer to PC via LabView.
It has two output analog channels: one is wavelength (two ranges, currenlty let it be 190 to 390 nm; it reads on multimeter as 0.19-0.39 V range) and another one is absorbance (0-1V range). An UV spectrum sholud be an X-Y graph wherein X is wavelength and Y is absorbance.
I am able to read one channel OR another. I am able to read BOTH channels simultaneously, but how can I plot them AGAINST each other, not against TIME?
I am using DAQPad-1200 (LPT interface) and LabView 6.1 (that's why I am unable to read most of the VI's posted on the forum ).
Is such an interfacing even possible given my software and hardware limitations???
Thank you all in advance!
06-03-2013 02:32 PM
I don't know what a DAQPad-1200 is, but as for the presentation in LabVIEW, just create two arrays and use the XY Graph Control to plot one against the other (I know that was available in LV6.1, because I used it back in LV 4).
Cameron
(Oh, and you probably shouldn't be bragging about being a chemist in your first-ever post, but maybe nobody will see it )
06-03-2013 02:43 PM
I know some pretty good programmers who were chemists first.
Your project should not be a strain on the resources you have. I once converted a spectrophotometer to talk to a primitive computer via RS-232 before LabVIEW was available. Your biggest problem may be finding a reliable computer which is compatible with that old equipment and software.
What kind of spectrophotometer?
Lynn
06-03-2013 02:58 PM - edited 06-03-2013 03:07 PM
I'll try arrays, thanks.
DAQPad-1200 is this thing.
As for the device, it is actually a Tracor 970A scanning UV-VIS detector, and it can work as a spectrophotometer (made in 1979, works just fine). Finding a reliable computer is/was absolutely no problem - I have tons of surplus computer components.
06-03-2013 03:57 PM
Without seeing your code, it's difficult to provide specific advice. However, it seems you are already able to read the incomming data and are plotting it versus time (as such I'm going to assume you are reading it as Waveform data).
In order to plot Absorbance vs Wavelength, you need an XY graph (not a waveform plot or chart). To plot one versus the other, you will need to Bundle the two 1D arrays as a cluster. If you do indeed have Waveform data as I am assuming, you'll first have to extract the Data from it (waveform data will be a different color than the wires in my image). Wire this cluster to the XY graph and your done. I'm not familiar with LabVIEW 6.1, but this much should be possible. Here is a quick picture from LabVIEW 2009 showing what I mean; these are rather basic so I'm expecting them to exist in 6.1.
06-04-2013 07:14 AM - edited 06-04-2013 07:15 AM
(JFYI - I'm an analytical chemist, but don't tell anybody, it might make them jealous.)
Cameron
06-08-2013 08:46 AM
Thank everyone for tips!
I have tried many times to build a graph this way; however, I see no picture on it, only blinking. After a few hours of trying I have decided to acquire data from both channels, write them to a two-column file and work with that in another software.
However, it seems to me that Channel 1 (wavelength, 0.190-0.380 V, 1mV = 1nm ) is VERY noisy due to some reason (device hardware, I'm afraid, looks very noisy on oscilloscope too. Old device, naturally). Plotting a normal graph from these is impossible.
Perhaps, there is another way: I know from the manual that scan rate is approximately 50 nm per minute. Can I build in LV 6.1 something to put a number from a range 190-380 to the second row at this rate? What functions should I use to do it (my code is attached)?
Thanks in advance.
06-08-2013 02:54 PM
I no longer have LV 6.1 or the old DAQ drivers, so some things will be coming from foggy memory or guesses.
1. Your VI has charts, not graphs. The behavior of the two types of display is different. What do you see when you say "blinking?" There is a property node to set a control to blinking, but it does not make much sense for charts and your VI does not have the property nodes, so I think you mean something else. Posting an image of the fornt panel or the VI with some data saved as default might help.
2. The way you are creating the array you write to the file seems strange. How many points are in the absorbance array for each read? Is the array what you expect? Please post a sample data file - a small one with just a few seconds of data.
3. Do you know how the voltage proportional to wavelength is generated? Is there a potentiometer mechanically coupled to the wavelength drive?
4. The image below shows how you can use a shift register to estimate the current wavelength. If you do not always start at 190 nm, change the Initial Wavelength constant to a control. Similarly the Rate could be a control. If you reverse direction, change the Add to a Subtract. All of these things are available since at least LV 2.
One very likely cause of the noisy signal from your old instrument is bad capacitors in the power supply. You may have a large amount of power line frequency (times 2) on the signal representing the wavelength. I have "cured" many old instruments of noise and mysterious behavior problems by replacing all the electrolytic capacitors with new ones. Ground loops and dirty or noisy potentiometers are other possibilites. If you have an electronics shop available, have them look at those possibilities. PM me to discuss other options.
Lynn
06-11-2013 08:14 AM
Thanks a lot, johnsold!
I am now able to get something which looks like an UV spectrum! %)
1. I will post an image (later); however, my primary objective is to get two columns of numbers, not necessary to see an X-Y graph onscreen.
2. Without inserting arrays like I did LV always tells about error connecting this data line from two channels to save "2-D data to file" option telling me that input is 1D!
3. I have a manual for the device, it has all of the schematics. I am no electrician though. I will post scanned circuit diagrams then when I manage to scan them.
Now I see two more opportunities to control the device.
A. There is a circuit (+12V DC) on the rear of one of the modlues, which, if shorted for at least 500 milliseconds (according to Tracor manual) can initialize automatic scan. How can this be done using Labview and DAQ device? My first guess is to use an analog output and some kind of a relay, either electromagentic or semiconductor one. Is there any other possibility?
B. In my code I am always asked to write to a file after I initialize the sequence. Can this be done AFTER the sequence is finished?
C. Finally, is it possible to automatically stop the While loop when the number generated by shift register becomes equal to 190?
Here are attached a new code and a sample of data.
06-11-2013 08:26 AM
@Biginelli1983 wrote:
Now I see two more opportunities to control the device.
A. There is a circuit (+12V DC) on the rear of one of the modlues, which, if shorted for at least 500 milliseconds (according to Tracor manual) can initialize automatic scan. How can this be done using Labview and DAQ device? My first guess is to use an analog output and some kind of a relay, either electromagentic or semiconductor one. Is there any other possibility?
B. In my code I am always asked to write to a file after I initialize the sequence. Can this be done AFTER the sequence is finished?
C. Finally, is it possible to automatically stop the While loop when the number generated by shift register becomes equal to 190?
A. First, you want to make sure the automatic scan doesn't happen too fast for your data aquisition. Next, you can accomplish this using a +5VDC relay controlled by a DAQ. When on, the relay will short your terminals. Control the relay using a DAQ and LabVIEW
B. Where it asks you to write a file all depends on where this happens in your code. Simply move it to occur only after a scan.
C. Use Array Size to determine if the array is greater than or equal to 190. Using boolean logic, stop the while loop if a button is pressed or the array size reaches 190.