Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Properties for Controlling IviScope Simulation

Solved!
Go to solution

Does anybody knows if Properties for Controlling IviScope Simulation for TDS2000 series works. I've tried to set it through MAX properties like WAVEFORM, FREQUENCY so I can set different simulation from the deafualt one with no success. It did not affect the soft panel in TS 4 IviScope step.

Thank you.

Elik

0 Kudos
Message 1 of 11
(4,978 Views)

Hello Elik,

         I tested this on my system and it works fine.  Please make sure that you save the configurable initial settings in MAX to apply them to the IVI Configuration File.  Also confirm that the Specific Driver Session is configured to use the Class Simulation Driver.  You can see from my screenshots that the frequency and amplitude that I configure in MAX are being applied to the Simulation driver.

 

 

 

 

Cheers,

 

NathanT

Message Edited by NathanT on 05-13-2009 11:54 AM
0 Kudos
Message 2 of 11
(4,950 Views)

Thanks Nathan,

I'm trying to do the same with TDS driver tktds1k2k witn no success. The niScope works fine. As you can see from the attached file the I define waveform  as 2 for square wave and frequency. It also define the configurable setting for the driver at the driver session.

What am I doing wrong?

0 Kudos
Message 3 of 11
(4,944 Views)

Here is the additional file.

0 Kudos
Message 4 of 11
(4,942 Views)

Hello Elik,

         Thank you for the clarification.  The configurable initial settings are not going to apply to IVI Specific Driver simulation for most IVI Specific Drivers.  For advanced simulation, you should use the Class Simulation Drivers.  You can look at the source code for the tktds1k2k and see that the tktds1k2k_FetchSimData( ) function does not give much control over the data returned.  The great thing is that you can edit the instrument driver to return different simulated data.

 

Cheers,

 

NathanT

0 Kudos
Message 5 of 11
(4,931 Views)

Hi Nathan,

I look for the function tktds1k2k_FetchSimData( )  in the driver file and could not find one. The fetch functions are all related to the waveform. Where is this function located?

 

Elik

0 Kudos
Message 6 of 11
(4,927 Views)

Hello Elik,

       The FetchSimData() function is in the tktds1k2k.c file, which is probably located at "C:\Program Files\IVI Foundation\IVI\Drivers\tktds1k2k"

 

Cheers,

 

NathanT 

0 Kudos
Message 7 of 11
(4,909 Views)

Hi Nathan,

I did look at the suggested directory in both tktds1k2k and niScope driver and could not find the function. Under Aquisition Fuction I've found all kind of Fetch functions but there is no simulation functions. I guess I have to dig in. Is there any documentation that describe the part of simulation function. I also could not find it NI IVI Driver help. Any suggestions?

Thanks.

Elik

0 Kudos
Message 8 of 11
(4,904 Views)

Hello Elik,

       The full name of the function is "tktds1k2k_FetchSimData", try searching for that.  I will attach the tktds1k2k.c file just in case.  IVI simulation is defined by the IVI foundation specifications.  They are available at ivifoundation.org

and I recommend looking at "IVI-3.1: Driver Architecture Specification" first.  As long as a developer follows the specifications, they have some latitude in choosing how to implement simulation.

 

Cheers,

 

NathanT

 

p.s.  Here is part of the code for "tktds1k2k_FetchSimData" :

 

/*****************************************************************************
 * Function: tktds1k2k_FetchSimData                                
 * Purpose:  This function fetches and returns a simulated acquisition.             
 ******************************************************************************/
.....

         <section removed>

......

       checkErr( Ivi_GetAttributeViReal64 (vi, channel,
                                            TKTDS1K2K_ATTR_VERTICAL_RANGE,
                                            0, &yRange));
        checkErr( Ivi_GetAttributeViReal64 (vi, channel,
                                            TKTDS1K2K_ATTR_VERTICAL_OFFSET,
                                            0, &offset));
        checkErr( Ivi_GetAttributeViInt32 (vi, VI_NULL,
                                           TKTDS1K2K_ATTR_TRIGGER_SLOPE,
                                           0, &triggerSlope));
        checkErr( Ivi_GetAttributeViInt32 (vi, channel,
                                           TKTDS1K2K_ATTR_VERTICAL_COUPLING,
                                           0, &vCoup));
        checkErr( Ivi_GetAttributeViReal64 (vi, VI_NULL,
                                            TKTDS1K2K_ATTR_TRIGGER_LEVEL,
                                            0, &level));
        checkErr( Ivi_GetAttributeViReal64 (vi, VI_NULL,
                                            TKTDS1K2K_ATTR_HORZ_TIME_PER_RECORD,
                                            0, xIncrement));
        theta = asin (2*level/yRange);
        if (triggerSlope == TKTDS1K2K_VAL_POSITIVE)
            k = 1.0;
        else
            k = -1.0;
       
        *initialX = 0.0;
        if( *actualPoints>waveformSize )
            *actualPoints = waveformSize;  /* Checking number of points to write */
        *xIncrement /= *actualPoints;

        if (vCoup == TKTDS1K2K_VAL_DC)
            simOffset = 0.5;
        if (vCoup == TKTDS1K2K_VAL_GND)
            k = 0.0;
        for (x = 0; x < *actualPoints; x++)
            {
            ViReal64 y = simOffset + k * 2.5 * sin (*xIncrement * 12560 * x + k * theta) + // ~2 periods of 1kHz sinewave
                            (!(x%20)) * (16384 - rand())/150000.0;
            waveform[x] = (offset + yRange/2) > y ? ((offset - yRange/2) < y ? y : (offset - yRange/2)) : (offset + yRange/2);
            }      
Error:
    return error;
}

0 Kudos
Message 9 of 11
(4,882 Views)

Hello Nathan,

Thanks for the code. I've found the function in the file. My mistake was looking at the driver functions.

Thanks again

Elik

0 Kudos
Message 10 of 11
(4,873 Views)