Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

how to get RS232 and GPIB data flow synchronize in labview

Solved!
Go to solution

Dear All, SOS.

 

I got to built a sys with 2 GPIB instruments and 1 Serial RS232 instrument.

The VI runs well with high light execution. But when I run the program normally with out highlight step by step, what I can get is only the GPIB data flow. The serial data can not be found following the readout of the GPIB data.

 

I wonder if this is a non-synchronization issue. If so, how can I get those two data flow synchronized?

 

BTW: I was trying to use the RS232-GPIBCVA convertor to connect GPIB, but always got error6 at visa read. I still can not figure it out. Without the RS232-GPIB convertor, data can be read with the serial socket.

 

I have fighting the this case many days, hope you guys can give me some suggestions!  Many thanks!

 

zhenxing

0 Kudos
Message 1 of 10
(5,078 Views)
When a program only works with highlight execution mode turned on, that is often a sign of incorrect data flow and/or misuse of local variables. Can you attach the VI so that someone can see what you've done?
0 Kudos
Message 2 of 10
(5,074 Views)

Thanks dan!

 

I just figured out the connection of RS232-GPIB, 

I'm going to run the sys with all GPIB data flow to see how is going to be.

I will post the result later.

 

Many thanks!

0 Kudos
Message 3 of 10
(5,071 Views)

Who's dan?

 

Using an RS-232 adapter when you have an available com port and when the instrument has a serial connection, does not provide any value, imho. The connection speed is still limited to RS-232 rates and the box is pretty expensive.

0 Kudos
Message 4 of 10
(5,067 Views)

Thanks! Dennis!

 

Attached is my VI.

 

There is a serial data flow for Temprature, GPIB for Resistence.

I'm going to draw a R-T 2 array plotting at the end. without highlight execution, always only Resistence but Tshow a "0.0".

Could you pls help check it? Or maybe there is some local variables setted wrong?

 

I appreciate your great help!

zhenxing

0 Kudos
Message 5 of 10
(5,058 Views)

Please try to follow a basic LabVIEW course and try to modularize your program.

Make specific vi's for each instrument and call those in your main vi.

 

Also look at better structures than a bunch of case statements that completely hide all your doing.

 

It is not really bad but impossible to read for somebody else.

greetings from the Netherlands
0 Kudos
Message 6 of 10
(5,056 Views)

thank you for the suggestion...

 

but it really works with highlight execution,

Just want to find where is the bug...

 

Thanks.

0 Kudos
Message 7 of 10
(5,055 Views)
Solution
Accepted by topic author zhenxing

A quick look and I'm not sure why you need any local variables. And while you have the error clusters wired inside all of those sequence structures (which you should also get rid of), you don't have any wired to indicators or passing them from sequence to sequence. I question some of your other code. With each iteration of the inner loop, you are resetting each instrument. It's highly unlikely that you need to do  reset or initialize serial port more than once.

 

You also need to get rid of the constant wired to the outer while loop's termination terminal. Using the abort button is not the correct way to stop a program.

 

Highlight execution slows the program down by quite a bit. You may need to add some delay. Run in normal mode and set some breakpoints so that most of the code runs at normal speed. By process of elimination, you will eventually find the problem area.

 

p.s. If these are Keithley instruments, you should really try the drivers that are available.

0 Kudos
Message 8 of 10
(5,044 Views)

Thanks for all the comments,

I just start to learn labview couples of weeks and this is really all I can do for a real system now.

 

The program runs well with highlight execution, I think that tell me at least it can be run.

You mean breakpoints can be set on the data flow in normal mode?

I will try like that!

 

Thanks for your detailed suggestions instead of just blabla like someone else...

 

best

  

0 Kudos
Message 9 of 10
(5,041 Views)

I reorganized the loops, and the sys runs well now.

Thanks all for the help!

 

0 Kudos
Message 10 of 10
(4,946 Views)