LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling the KEYSIGHT B2912B with SCPI commands in labview

Hello, Community
I want to control KEYSIGHT B2912B using SCPI commands in lab view to measure the electrical conductivity. I am measuring the voltage when a current is applied, but the measurement range of the measured voltage is limited and I can only measure up to 2V. Attached below is the program I have created. I believe the problem is in the way the commands are controlled in labview, but I do not know the cause. Is it possible to set the measurement range on labview using SCPI commands?
Sorry if my english is wrong. Thank you in advance.
From kazunari

0 Kudos
Message 1 of 5
(1,455 Views)

Hi kazunari,

 


@kazunari wrote:

the measurement range of the measured voltage is limited and I can only measure up to 2V. Attached below is the program I have created. I believe the problem is in the way the commands are controlled in labview, but I do not know the cause. Is it possible to set the measurement range on labview using SCPI commands?

When you are unsure about SCPI commands and their parameters then you should read the (programming) manual of your device…

 

That being said:

  • There is no error handling in your VI…
  • There is a SENS:VOLT:RANG command with a parameter of "3": is the parameter valid and supported? Is the parameter useful here?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(1,445 Views)

Besides the solution I recommend following:

1) Build code in a way that it fits the size of one screen. Constant scrolling is nasty and let's you lose overview.

2) When wanting to send several commands in a sequence, put the commands into an array and put the VISA Write into a FOR loop.

3) Use timing between commands. I don't think the Keysight device can cope with the commands flying in like crazy.

 

Hints concerning your problem:

Check the device's documentation. Your suspicion might be right. SENS:VOLT:RANG already seems such a command. So you limit to 3 V here, but it measures only up to 2, also on its display?

0 Kudos
Message 3 of 5
(1,438 Views)

Why create your own VI when there is one available in IDnet?

Agilent B2900 Series - USB, Ethernet, IEEE 488.2 (GPIB) Driver for LabVIEW

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
0 Kudos
Message 4 of 5
(1,402 Views)

As written your SCPI commands are sent out of proper sequence for the voltage range to exceed the default 2V value.  You use ..

 

MEAS:CURR?

MEAS:VOLT?

 

These SCPI commands initiata the measurement and retrieving the data!  So the following command..

 

SENSE:VOLT:RANGE 3

 

will not affect the measurement, since the instrument doesn't receive that command until after you have already made the measurement.

 

The proper sequence of SCPI commands for instrument programming takes careful reading of the manuals.  I suggest you look at the example programs provided with the instrument (https://community.keysight.com/s/question/0D52L00005IdphcSAB/b2900-example-program-source-constant-v...), or download the IDNet LabVIEW driver as ZYOng suggested and look at their examples.  

 

Craig

0 Kudos
Message 5 of 5
(1,383 Views)