Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Best way to talk to a Tektronix AFG320 using GPIB

Solved!
Go to solution

I have a Tektronix AFG320 that I would like to talk to using GPIB with a GPIB-USB-HS interface. It appears up to date drivers are no longer available. At least I haven't found them. Dod I miss them? If not, what is the best way to interface to these instruments in the Community edition of LabView (Version 2022 Q3 (32-bit) 22.3f0? The last time I did any programming with GPIB was back in 2005. It seems much has changed in the last twenty years. Just trying not to reinvent the wheel and am looking for general guidance on the best way to proceed.

0 Kudos
Message 1 of 8
(418 Views)

Since the advent of VISA drivers, how you control GPIB has remained the same. Either someone created the VIs for standard functionalities of the instruments using the VISA library (typically the instrument manufacturer), or you will have to create them from scratch using the instrument's SCPI reference.

 

Google found two versions of drivers right at the top (not sure what you mean by you haven't found them)

santo_13_0-1711334401070.png

 

https://www.tek.com/en/support/software/driver/afg300-series-labview-driver

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 8
(383 Views)

Santhosh,

 

Thank you for your reply. I have found and installed both of these drivers into the instrument driver libraries.

 

When I run the tektronix version (from 2005) I get a message the drivers are to old to convert. I read (and assume) the drivers must be converted to an intermediate version of LabView before I can convert them to the 2022 version of LabView. This is  not encouraging as I am using the Community version of LabView and am not at all sure I can load an earlier version (8.2.1 is recommended) but will attempt this if necessary.

 

I have the NI drivers in the IVI  directory. Somehow LabView knows I am using a AFG320 which is encouraging. But I find no example programs to try the IVI drivers out. (I can use the GPIB drivers which do work but means I must program everything pretty much from scratch.) So I'm writing something from scratch without anything that I can work from. I thought surely there must be a simple example program that I can work from but so far haven't had much success.

 

Long story short, all paths sound like an awful lot of work. I've spent way too many hours spinning my wheels downloading drivers and example vi's that so far haven't worked. Hence my question of how best to proceed: try to convert the old 2005 drivers or work with the IVI drivers, forego the IVI and instrument drivers and write my own functions using the GPIB drivers or is there another path I've missed?

 

Sage advice is most welcomed.

 

Dan

0 Kudos
Message 3 of 8
(361 Views)

You can use the Version Conversion board to get help in upgrading the drivers to the latest LV-compatible version.

https://forums.ni.com/t5/Version-Conversion/bd-p/VersionConversion

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 4 of 8
(340 Views)
Solution
Accepted by Danl_B

If you are capable of programming the AFG320 by the front panel, then you can control the instrument using the SCPI Protocol.  It is fairly simple at this point:

  1. Open the VISA instrument (AFG320)
  2. Write to the VISA instrument (Send the SCPI command/query from the manual as a string)
  3. Read if expecting a response (Usually query contains the '?' as part of the written string)
  4. Close the VISA instrument.
Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
Message 5 of 8
(338 Views)

It seems there are several issues that I had difficulty separating. Most significant was the com port (GPB channel?) bot being released when the program stopped on an error. This prevented me from successfully writing or reading to the instrument the next time I ran the program. Rather than clicking on the link in the error message to find out what the error was about I just assumed (I so hate that word) I had something wrong in the VISA GPIB Resource string. Nothing like paying attention to detail. I'm a little concerned as with the port already opened I should be able to write to the port again but I will save that problem for another time.

 

I'm sure there will be other issues as I move forward. It's been a few years since I've done any LabView programming. It is so nice to have someone to seek help and assistance from. I truly appreciate the comments and advice from the forum.

0 Kudos
Message 6 of 8
(322 Views)

@Danl_B wrote:

It seems there are several issues that I had difficulty separating. Most significant was the com port (GPB channel?) bot being released when the program stopped on an error. This prevented me from successfully writing or reading to the instrument the next time I ran the program. Rather than clicking on the link in the error message to find out what the error was about I just assumed (I so hate that word) I had something wrong in the VISA GPIB Resource string. Nothing like paying attention to detail. I'm a little concerned as with the port already opened I should be able to write to the port again but I will save that problem for another time.

 

I'm sure there will be other issues as I move forward. It's been a few years since I've done any LabView programming. It is so nice to have someone to seek help and assistance from. I truly appreciate the comments and advice from the forum.


One nice thing about VISA is that it will allow you multiple closes without error.  This means that you can always perform a close prior to an open if you fear that your program may not have closed the communications stream properly.

  1. Close
  2. Close ...
  3. Open
  4. Write
  5. Read
  6. Close
Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
Message 7 of 8
(310 Views)

Sounds like sage advice. I will eventually be controlling several instrument so closing the communications channel will be prudent.

0 Kudos
Message 8 of 8
(288 Views)