Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't control RS232 and GPIB devices at the same time with labview.

Solved!
Go to solution

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.

0 Kudos
Message 1 of 17
(6,474 Views)
Rs232 and gpib can work at the same time. You must yourself hav done something wrong.
Did you open the connections before you try to access the devices?
greetings from the Netherlands
Message 2 of 17
(6,461 Views)

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:

labview initialize RS232.PNG

The VISA vi looks like this inside:

labview initialize RS232 inside VI.PNG

Then I connect the GPIB device. The vi that does this looks something like this:

labview initialize keithley SMU.PNG

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,

0 Kudos
Message 3 of 17
(6,447 Views)
No, they don't interfere except when your logic / wires interfere.
Post your complete program / vi, so we can look at it.
greetings from the Netherlands
Message 4 of 17
(6,439 Views)

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,

 
0 Kudos
Message 5 of 17
(6,434 Views)

It probably isn't your problem, but you need to close out your serial port reference as well.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 17
(6,427 Views)

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?

greetings from the Netherlands
Message 7 of 17
(6,423 Views)

"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,

0 Kudos
Message 8 of 17
(6,412 Views)

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?Smiley SurprisedSmiley SurprisedSmiley Surprised

 

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) Smiley Wink

 

 

Spoiler

 

As an alternative workaround get a rabid monkey to change the set temperature value 6,000 times a minute and remove the delay

 

 

 


"Should be" isn't "Is" -Jay
Message 9 of 17
(6,402 Views)

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.

0 Kudos
Message 10 of 17
(6,372 Views)