Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Keysight DAQ970A sending SCPI commands

Solved!
Go to solution

Hey Everyone,

 

I am trying to program a Keysight DAQ970A using Labview but I am finding the pre-made instrument control VIs rather lacking as there are several options I cannot set through the VIs.

Does anyone know how to send generic SCPI commands to the instrument using Labview?

 

The specific command I need currently is the ROUTe:CHANnel:DELay specified in the SCPI programming guide which can be found here:

https://www.keysight.com/dk/en/assets/9018-04756/programming-guides/9018-04756.pdf

 

Thank you in advance for any assistance you can provide.

0 Kudos
Message 1 of 8
(1,099 Views)

Hi

I'm not a fan of the Keysight IOlibraries. They tend to mix up with the NI visa libraries.

So I did not install all their libs just to understand what they did.

But they should have a VISA write command somewhere and that allows you to send scipi commands to the DAQ system, and a VISA read to read back the answer.

Can you send sone or two of the existing vi's just to see what is in there?

So I can have alook at them to see how they build them?

greetings from the Netherlands
0 Kudos
Message 2 of 8
(1,069 Views)
Solution
Accepted by mc5000

Just try this simple VI to query the Instrument ID if it is set for SCPI communications.

LV2016 VISAwrc.png

Enter into the write buffer ==> *IDN?

Select the correct VISA resource name for the desired Instrument

 

Run the VI and see the results in the read buffer output. 

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
Message 3 of 8
(1,051 Views)

May need to append a newline "\n" character to the end of the write buffer.  This should check the integrity of the instrument communications using the LabVIEW VISA primitives.

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
0 Kudos
Message 4 of 8
(1,041 Views)

Hey Albert and Minions,

 

Thank you for your replies!

The VIs supplied by Keysight use IVI instead of VISA for communication, so all the VIs they supply do is to call .dll files (see screenshots below and attachments, left is initialize and right is measure DC voltage).

mc5000_1-1623746598417.pngmc5000_0-1623746556967.png

 

 

Minions suggestion with simple VISA communication does work (I did not have to add the newline character). I did a simple test VI where I used the supplied VI to initialize and then take turns in changing settings with the IVI VIs and a simple VISA command and it doesn't spawn any errors (also attached as DAQ_Test - IO.vi):

mc5000_3-1623747297447.png

 

However, this approach would mean that I go back and forth between VISA and IVI communication to the same instrument could this not be problematic and potentially lead to communication failure?

Previously I have been advised against opening and closing a VISA port too often in the program as this could lead to errors but I have very little experience with IVI and no experience with mixing IVI and VISA in this way. If I continue with a mix like this do you know if it would be best to keep the VISA port open throughout the program or close it after each VISA command to ensure it is closed when the next IVI command is sent?

 

Best,

0 Kudos
Message 5 of 8
(1,016 Views)

Hi

In IVI there should be a vi that sends a command and reads back data.

Just like VISA but implemented in the IVI layer.

 

It is a loophole to add specific commands that are not available in the generic IVI driver for those kind of instruments.

 

IVI was invented to have a universal interface for standard instruments but because instrument vendors all try to differentiate to sell more instruments it never became a really standard.

Also because there were more IVI implementations that were not compatible it in fact failed.

 

So if you don't need it after implementing your own stuff, you will not miss it.

greetings from the Netherlands
0 Kudos
Message 6 of 8
(1,005 Views)

@Albert.Geven wrote:

Hi

In IVI there should be a vi that sends a command and reads back data.

Just like VISA but implemented in the IVI layer.

 

It is a loophole to add specific commands that are not available in the generic IVI driver for those kind of instruments.

 

IVI was invented to have a universal interface for standard instruments but because instrument vendors all try to differentiate to sell more instruments it never became a really standard.

Also because there were more IVI implementations that were not compatible it in fact failed.

 

So if you don't need it after implementing your own stuff, you will not miss it.


Unfortunately I cannot seem to find IVI read, write or query VIs, neither basic Labview ones (like for VISA) nor specific ones in the instrument drivers.

0 Kudos
Message 7 of 8
(1,004 Views)

@Minions wrote:

Just try this simple VI to query the Instrument ID if it is set for SCPI communications.

LV2016 VISAwrc.png

Enter into the write buffer ==> *IDN?

Select the correct VISA resource name for the desired Instrument

 

Run the VI and see the results in the read buffer output. 


I have used the VISA write function in combination with the IVI drivers for a while now and have not seen any issues with it so far. Keysight has also confirmed that the drivers doesn't come with simple read / write functions.

However, just for others out there I also realized that the Keysight drivers comes with a reference list which lists which VIs from the driver uses which SCPI commands which can also be quite handy. It is located under "Welcome -> Instrument Reference", see the screen shot below:

mc5000_0-1624539607010.png

 

0 Kudos
Message 8 of 8
(814 Views)