From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB Write doesn't work, but ibwrt in MAX does

Solved!
Go to solution

Hi All,

 

I'm trying to send commands to a very old Klinger CC1.1 motion controller over the GPIB from labview 8.6.  I've tried using a GPIB-USB-HS and a GPIB-USB-B.  The Klinger takes simple ASCII commands setting the speed, number of steps, etc.  When I try to send these commands using the GPIB Write sub VI in labview, the Klinger does not seem to receive them properly (I'll set it to move 100 steps, send the go command, and it will travel all the way to the end).  When I send the commands using MAX, they work just fine.  I used NI spy to moniter the commands I was sending, and it seems like the only difference is that MAX uses the ibwrt command, while Labview uses GPIB Write.

 

Is there a way to use the ibwrt command in labview?  If not, why wouldn't the commands be received properly when sent using GPIB Write?  I've tried using the GPIB initialize VI, but it doesn't seem to make a difference.

0 Kudos
Message 1 of 7
(3,446 Views)

Hi jhinton,

 

I think you might find this KB interesting:

Why Can I Communicate with My GPIB Instrument in MAX, but Not in LabVIEW?

Let me know if that helps.

 

Scott M.

Applications Engineer
National Instruments
0 Kudos
Message 2 of 7
(3,427 Views)
Solution
Accepted by topic author jhinton

jhinton wrote:

 

Is there a way to use the ibwrt command in labview?  If not, why wouldn't the commands be received properly when sent using GPIB Write?  I've tried using the GPIB initialize VI, but it doesn't seem to make a difference.


Depends on what you mean by "a way". Technically, you can call the ibwrt command by calling the DLL in which it resides. But I'm guessing that's probably not what you meant. Smiley Wink 

 

New code should use VISA rather than the GPIB functions. The problem may be with the mode that's being used. Can you upload a capture of NI Spy? It's best to upload a capture that you do using MAX, indicating a proper operation, and a capture using LabVIEW trying to do the same thing.

0 Kudos
Message 3 of 7
(3,416 Views)

I'm pretty certain that I have the GPIB address set properly.  If calling the ib function DLL would work, it sounds like a reasonable solution.  How would I do this/where would that DLL be located?  Why is it prefferable to use VISA functions (other than the issue of portability, which is not really that important to me)?

 

I'll upload the NI spy screen captures as soon as possible.

0 Kudos
Message 4 of 7
(3,406 Views)

I'd say the advantages of using VISA over GPIB programming is to avoid exactly the troubles you are having.  VISA does the talking to your instrument driver for you so you don't have to guess what the instrument is expecting.

 

Bill

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 7
(3,401 Views)
Whaddya know, works perfectly with VISA.  Thanks!
0 Kudos
Message 6 of 7
(3,383 Views)
Coolness!
Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 7
(3,365 Views)