LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB communication

I am trying to establish GPIB communication between two PCs using LabVIEW. Here is my setup:

  • PC1 (LabVIEW 2017): Has an NI GPIB PCI board installed.
  • PC2 (LabVIEW 8.6): Connected to PC1 via an NI GPIB cable.
  • Both PCs have the necessary NI GPIB drivers installed and can detect each other in NI MAX.
  • PC1 is set as the Controller-In-Charge (CIC).

What I Want to Achieve:

I want to send data from PC1 to PC2 using GPIB Write.vi and GPIB Read.vi in LabVIEW. However, I am facing issues in successfully sending and receiving data.

What I Have Tried:

  1. Checking GPIB Addresses:

    • PC1 (Controller) is GPIB0.
    • PC2 (Listener) is set to GPIB Address 2.
  2. LabVIEW Code:

    • On PC1, I used VISA Open.vi, followed by GPIB Write.vi to send a simple string message (e.g., "Hello").
    • On PC2, I used VISA Open.vi, followed by GPIB Read.vi to receive data.
  3. Troubleshooting:

    • Both PCs appear in NI MAX and can recognize each other as GPIB instruments.
    • I verified the cable connection and address settings.
    • Tried increasing timeout values in GPIB Read.vi.
    • Used NI-488.2 Troubleshooting Wizard, which shows no errors.

Issue Faced:

  • PC1 successfully executes GPIB Write.vi, but PC2 does not receive any data in GPIB Read.vi.
  • The Read.vi times out, indicating no response.
  • No GPIB errors appear in NI MAX or LabVIEW.

Questions:

  1. Are there additional settings required for PC2 to function correctly as a GPIB listener?
  2. Should I use a specific termination character for data transmission?
  3. Do I need to configure PC2 as a "Talker" after receiving data?
  4. Is there a better way to debug the data flow between the two PCs?

Any suggestions or sample code for achieving this communication would be greatly appreciated.

Thank you!

0 Kudos
Message 1 of 2
(204 Views)

While what you try to do is possible, it's a pretty obscure application of GPIB. It used to be a somewhat documented feature in the 90ies of last century (I worked in application engineering at NI at that time and we got occasionally such requests), but it required the use of low level command line tools like ibic or the according low level GPIB APIs.

 

Here are a few links that give you an idea what you will have to do but they are not exactly trivial to apply to modern LabVIEW.

 

This shows the principle operation required to do GPIB Controller to GPIB Device communication based on ibic command line tool. The ibic commands need to be translated to the according LabVIEW GPIB nodes. ibrd = GPIB Read, ibwrt = GPIB Write and the rest would be GPIB Misc

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x2Y3CAI

 

 

This shows the use of the GPIB nodes in LabVIEW to do your own bus address protocol. VISA does all of that for you under the hood, but if you use the GPIB API you need to do your own handshake handling by calling the according GPIB Command:

https://forums.ni.com/t5/Example-Code/GPIB-Example-for-LabVIEW/ta-p/3526176

 

Rolf Kalbermatter
My Blog
Message 2 of 2
(176 Views)