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.
Many thanks in advance.
Panos from Impedans
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.
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?
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).