07-10-2013 07:11 PM
Hi all,
I have a temperature controller that has an RS232 connection to my computer and a source meter that has a GPIB to USB connection to my computer.
I have VIs that allow me to control each device seperately. But when I made a VI to control them together I can communicate with the GPIB device but not with the RS232 device. I think the VISA GPIB and VISA RS232 are having a problem running similtaneously.
Do you know of anything I can try to fix this problem?
Thanks for your help.
Solved! Go to Solution.
07-10-2013 11:02 PM
07-11-2013 11:05 AM
First I connect to the RS232 device and try to send a few commands, then I connect to the GPIB device, then I try to send commands to both devices in a loop.
To connect to the RS232 device I do this:
The VISA vi looks like this inside:
Then I connect the GPIB device. The vi that does this looks something like this:
The case statement in the image above is false because my device is a GPIB device. But there are controls on this vi that allow the user to input serial port settings like baud rate etc..
Do you think anything in these segements of code might interfere with each other?
Thanks again,
07-11-2013 11:39 AM
07-11-2013 11:55 AM
I've attached the main VI and the temperature controller module.
The main vi measures temperature, open circuit voltage, and short circuit current over time. It also allows the user to update the set temperature
of the controller while the program is running.
I am using a Keithley 2635a source meter with stock VIs from keithley to make IV measurements. I am using slightly modified VIs from TeTech to control a TC-36-25-RS232 temperature controller.
Please let me know what you think and let me know if it would be helpful to have more information or more VIs.
Thanks,
07-11-2013 01:44 PM
It probably isn't your problem, but you need to close out your serial port reference as well.
07-11-2013 02:25 PM - edited 07-11-2013 02:28 PM
Both vi's do a lot, especially the keithley one.
The default of the TEC controller seems to initialize all the time.
I would make a default that does nothing except maybe a wait ms.
And try to use a subvi for all the weird stuff.
e.g. use subvi's that have names for functions insead of calling the serial IO with a command. Try to group them in meaningful sets.
Are you running these vi's in parallel? Or is there a common main vi?
07-11-2013 03:16 PM
"20130708 measure Isc Voc & Temperature over time.vi" is the main VI. the other VI I attached is a module inside the main program. Sorry about the confusion.
Can you elaborate on this statement:
"The default of the TEC controller seems to initialize all the time.
I would make a default that does nothing except maybe a wait ms."
It seems to me that I am only initializing the controller once when I start the main program. Am I wrong about this?
Thanks,
07-11-2013 10:34 PM - edited 07-11-2013 10:52 PM
OK That is obvious! I can't believe Crossruz missed the huge error! Albert missed it too?
Open 20130708 measure Isc Voc & Temperature over time.vi Lets look at that event structure with the 10 mSec timeout and the delay express vi in the same loop! (Delaying longer with each itteration.) Oh no! LOOK again.
How many times does that timeout case need to execute before the value change event can be processed?
P-C Events please look at the Producer Consumer (Events) in the examples. A Peek into the finite measurment and analisys project template documentation might be a good way to understand what is wrong here too (and how to do it without losing ALL your hair)
As an alternative workaround get a rabid monkey to change the set temperature value 6,000 times a minute and remove the delay
07-12-2013 10:51 AM
I'll take a look at the event structure documentation you pointed out.
I don't have a great understanding of event structures in labview and I don't use them very often. My understanding is that an event structure is essentially a case structure that waits for user input to
execute one of its cases or times out. Is this an accurate interpretation of an event structure?
Thanks to everyone for your feedback. I'll let you know what I find.