10-08-2013 04:14 PM
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.
10-08-2013 05:25 PM
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?
10-09-2013 12:29 PM
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.
10-09-2013 12:35 PM - edited 10-09-2013 12:36 PM
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.
10-09-2013 01:00 PM
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.
10-09-2013 01:17 PM - edited 10-09-2013 01:17 PM
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)?
10-09-2013 01:23 PM