Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

ViSession contents

Hello,

 

Does anyone know what types of variables/functions/parameters are contained by a ViSession object?

Also, does a declaration ViSession m_InstrSession; initialize all of them properly?

I am trying to reproduce the single sweep example, in order to remotely control a ZNB8 model.
It's not working, returning me errors, as seen in the attached screenshot. 

I am suspecting that it has to do with some of the variables in the m_InstrSession object, the rest seem pretty standard. 

Any ideas?

 

Many thanks in advance. 

 

Panos from Impedans

 

 

0 Kudos
Message 1 of 4
(4,007 Views)

A ViSession is defined in visatype.h as an ViUInt32 value. That means it is an unsigned 32 bit value only. There is nothing that will be defined by declaring a ViSession variable other than a 32 bit memory location containing whatever your compiler prefers to do with uninitialized variables.

 

The ViSession is initialized to a meaningful value when you execute  viOpenDefaultRM() and/or viOpen(), These functions create internally in Visa an object that contains all the data that is necessary and then returns a ViSession identifier that all other Visa functions use to locate the according object in the internal object registry table.

 

From the image you post it is basically impossible to even guess what might be wrong! It does however not look like a fundamental problem of Visa itself but rather something in the setup of the functions that you call. Somehow you send a command to the device that the device considers invalid in this particular case.

 

Please note that many instruments are rather complex devices. It's very possible that you can send an instrument a command with a certain parameter set to a specific value in one mode of the instrument while it considers the same value as invalid if it operates in a different mode. So you will have to check what command causes this error and then find out what parameter may not be compatible with the current operating mode of the instrument.

Rolf Kalbermatter
My Blog
Message 2 of 4
(3,992 Views)

Hello Rolf,

 

Many thanks for your response. It appears that only the command rsvna_TraceResponseSingleSweepData gives me trouble. The command rsvna_TraceResponseDataAllSData seems to work fine. Nonetheless, neither command gives you the opportunity to set input parameters, e.g. frequencies ertc. IS there any separate input commands that allow you do that? 

0 Kudos
Message 3 of 4
(3,984 Views)

@ImpedansPI wrote:

Hello Rolf,

 

command rsvna_TraceResponseSingleSweepData gives me trouble. The command rsvna_TraceResponseDataAllSData seems to work fine. Nonetheless, neither command gives you the opportunity to set input parameters, e.g. frequencies ertc. IS there any separate input commands that allow you do that? 


Measurement instruments expect you to setup everything such as what timing, channels, and other parameters to use, before triggering a measurement and only after that can you retrieve any data.

So you will need to find in your driver the according functions to first setup everything that needs to be configured, then start a measurement and after that you can retrieve the measurement. How that is done is different for each instrument so you will have to get familiar with your instrument and the commands it supports (and the driver functions that will issue those commands to the device).

Rolf Kalbermatter
My Blog
Message 4 of 4
(3,980 Views)