11-04-2011 01:52 PM
Hi, Im just starting to use LabView to automate a system for work.
I need to control DI/DOs AI/AOs a Kiethley 6485 and an Atomlab 300. The main problem Im having is trying to access the readings from the Kiethley in the AO structure. The Keithley will be used to determine the initial voltage of the AO. If any one can tell me any easy way to do this I would appreciate it!!
I left the wires disconnected where I would like the value to go.
Also this is my first LV program so any other advise or help in general would be appreciated!! thanks!!
11-08-2011 05:19 PM
To understand your VI correctly, the readings from the Kiethley come out in the event structure in the case "Timeout"? And the "AO" is the while loop that has the "Elapsed Time4" VI? That's my guess because it has unwired terminals.
Do you want to have the Keithley's measurement used only once, or constantly?
If you want it read constantly, it seems like what you're trying to do is explained by a concept called Producer-Consumer Loops. One loop produces data while the other reads it in, simultaneously. Here's a link to explain: http://zone.ni.com/devzone/cda/tut/p/id/3023
And here is an example that uses producer-consumer loops in two forms: https://decibel.ni.com/content/docs/DOC-2239
Basically, you can either use local variables or queues to pass the data across loops. A queue is recommended because it prevents memory leaks and race conditions, and it maintains a sense of data flow.
If you want it read just once so you can initialize your AO voltage, then I imagine you would want to have it run before the other loop starts? In that case, you can just wire the data out and bring it in to your AO loop.
11-10-2011 03:48 PM
Thanks!! You pointed me in the direction I needed and I got that working like I wanted.
I do have one more question. I have talked with tech support at both NI and Biodex, but neither can seem to figure out how to read from an Atomlab300 Dose Calibrator. I have tried initilizing it with VISA and using a read function and just about everything else I can think of, but no luck... It keeps timing out on the read function... (I have set the timeout manually to 30+ seconds with no better results.) I don't know if there's something special I need to do to read from it, but I havent been able to find anything (examples or otherwise) about someone trying to use labview with an Atomlab.
11-10-2011 04:22 PM
That device seems rather obscure so I doubt there are any pre-written instrument drivers available. This means you will have to write your own if you want to control it. Read its manual to find out its communication protocols, set-up a VISA session, try simple commands like "Identify" (*IDN?) to verify basic comm. Then, expand your command set with what functions you need in your program. It's not trivial, but not impossible either.
11-10-2011 04:53 PM
Ya, I have tried that... It's definitely functioning, I have the correct port selected, and I can access it with another program (non-Labview)... It seems like it should be relatively easy to get some response from it, but its like nothing is coming back...
11-10-2011 06:24 PM
If you're using a version of Windows on which PortMon runs (http://technet.microsoft.com/en-us/sysinternals/bb896644),
you can monitor the serial port for activity while the other non-LabVIEW program runs.
11-11-2011 07:53 AM
Just to clarify, what I meant by the other program is that i have something that can read from the atomlab to verify that it can comunicate with the computer. I don't have this program running (or need to have it running) once I start using labview.
11-11-2011 09:01 AM
Try putting a wait.vi (1000mSec) in between your VISA write and read. This shouldn't be required if everything is configured correctly but it may get your communication started.
11-11-2011 12:18 PM
11-11-2011 02:22 PM
What other program have you gotten it to work with? What kind of protocols or communication does that involve? Maybe we can troubleshoot based on that information.