LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can a LabVIEW .exe file and an OEM program use the same GPIB port?

I, an LV newbie, have two programs---one I wrote in LabVIEW, the other an OEM program---that access the same device, a positioner, through the same GPIB port. The OEM program controls a large motor that rotates a pedestal, while the LabVIEW program I wrote (based on the sample GPIB read-and-write .vi provided with LabVIEW) simply reads off the position of the pedestal so that a smaller motor can move in the opposite direction (relevant subVI attached). When I have both programs going simultaneously (normal operation), nine times out of ten, one or both motors will either move in the wrong direction or not move at all.

 

How might I resolve this issue? It seems to me that it might be a timing or communication issue, since the two programs have cooperated in the past, and nothing has changed in the system between then and now.

 

I genuinely appreciate any and all guidance. Thank you.

0 Kudos
Message 1 of 7
(2,910 Views)

Hi Armando,

I can't see any .vi attached - are you sure you included it?

Are you getting any errors in your labview GPIB reads? Are the Read functions returning any data? Does it matter which order you open the applications in? Are either application exerting any GPIB Locks on the device, preventing the other from accessing the resource?

0 Kudos
Message 2 of 7
(2,899 Views)

Hmm. I thought I had attached the .vi. I'll try attaching it now.

 

The GPIB read function in the .vi does return data, and the only errors I see come from the OEM program (something about the GPIB read length in response to a status request being incorrect, I'm looking into that right now.)

 

I can tell you that we've had more luck when we stop the LabVIEW .exe file before operating the OEM program, then restarting the LabVIEW .exe. It isn't a foolproof method, but it's reduced the number of GPIB communication errors we've run into.

 

I can't really say if either program has locked out the GPIB port to the other. I'll look into how to find this out.

0 Kudos
Message 3 of 7
(2,867 Views)

ScreenHunter_03 Oct. 09 13.34.jpg

 

 

Let's try that attachment again. If that doesn't work, I've attached .jpgs of the Front Panel and Block Diagram. Note that the "Write then Read" selection does not change.ScreenHunter_02 Oct. 09 13.32.jpg

 

 

 

0 Kudos
Message 4 of 7
(2,865 Views)

You can only open the GPIB with one handle (e.g. one program at a time. Two programs must be run consecutively and not concurrently

using the same GPIB line and card. There is no way possible to run both program at once and have them work correctly.

0 Kudos
Message 5 of 7
(2,860 Views)

You can only open the GPIB with one handle (e.g. one program at a time. Two programs must be run consecutively and not concurrently

using the same GPIB line and card. There is no way possible to run both program at once and have them work correctly.

 

If that's the case, then how was I able to get both programs to work in the past (albeit after several tries)?

0 Kudos
Message 6 of 7
(2,853 Views)
If it worked once, it was pure luck. Think about how GPIB communication works. If one program issues a query, nothing stops the other program from issuing a write before the first program can do a read. This is just basic GPIB technology and nothing to do with LabVIEW.
0 Kudos
Message 7 of 7
(2,849 Views)