Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Access two different interfaces at the same time

I have a Problem accessing two different Interfaces at the same time. 

One VI is using a serial port and a second VI uses a USB-GPIB interface.

Both VIs run just fine when executed alone, but I need them to run at the same time.

 

Shouldn't it be possible in Labview to access two different Interfaces from two different VIs at the same time?

 

regards,

Joerg 

0 Kudos
Message 1 of 9
(4,352 Views)

Yes, and it's quite simple to access them at the same time. You just need to have them in parallel with no data dependency between them. Of course, your subVIs need to be written correctly and should not have something silly like their own while loop.

 

Message Edited by Dennis Knutson on 05-07-2009 08:19 AM
0 Kudos
Message 2 of 9
(4,347 Views)

I'm not sure that I understand that right.

I have this two VIs, each one accessing a different interface. They don't have any dependency, but the gpib VI freezes when run parallel to the serial one.

After closing the gpib vi I get a message "resetting vi: gpib.vi" that doesn't go away. I need to kill Labview in the Task Manager to be able to work again.

Download All
0 Kudos
Message 3 of 9
(4,338 Views)

It would have been much better if you had attached the actual code.

 

You have at least one while loop in the serial subVI and obviously, that has to terminate along with everything else in the subVI before code in the main can continue. That's basic dataflow.

0 Kudos
Message 4 of 9
(4,328 Views)

So the gpib vi and the serial vi cannot run at the same time?

They don't  have the same main vi. Is it not possible to run two main vis parallel?

 

0 Kudos
Message 5 of 9
(4,325 Views)
There is NO problem with running two in parallel. What you cannot do is run any subVI that has a while loop that requires some sort of user intervention to terminate or takes a long time to finish. It has nothing at all to do with VISA/Serial/GPIB. It has everything to do with dataflow. When you call a subVI, you pass exection control to the subVI and NOTHING in the main will run until the subVI finishes. You only posted an image of the serial VI. As I said, it would have been better to attach the actual VI. Need to see the code in order to determine how it can be changed so your main will not appear to be locked.
0 Kudos
Message 6 of 9
(4,312 Views)

Perhaps I make this more complicated then it is. 

I'll try to explain in full detail.

Ok, have attached the read_write_serial.vi and the gpib.vi

 

I have a main VI that calls the read_write_serial.vi and the gpib.vi is another main VI that I want to run parallel. 

It is NOT the main vi (calling read_write_serial) that freezes, but the gpib.vi IS the one freezing.

 

It can't be a data flow issue, because gpib.vi doesn't exchange data with read_write_serial.vi or other VIs calling it. 

 

Download All
0 Kudos
Message 7 of 9
(4,296 Views)
Looking at the serial VI, it looks like it has to meet several conditions before the while loop will exit. It it does not exit like you expect, then the other subVI and the main will appear to hang and that is the dataflow problem that I have been trying to describe. Have you set a breakpoint or used execution highlighting? Is the GPIB function actually running or waiting for the serial VI to finish? If you have in the main just the GPIB subVI and a VISA Read for the serial, does everything execute?
0 Kudos
Message 8 of 9
(4,282 Views)

What I have been trying to say is, that gpib is no subVI. Gpib is running and not waiting for the serial.

I didn't write the main and the serial part and I don't have time to understand the whole application.

Now I have created a Virtual Machine and I run the serial part inside that VM. That was the fastest way for me to solve this.

Thank you for your help. 

 

0 Kudos
Message 9 of 9
(4,272 Views)