Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

TKTDS1k2k Library Horizontal Position

Hello,

 

I am trying to use the tktds1k2k drivers library to control a TDS 2022b from a C++ application.

 

Almost everything works great apart from this.

 

I am trying to give the option of delaying the trigger (or advancing it) as you can on the scope using the Horizontal Position knob, however I cant seem to find the attribute for it.

 

TKTDS1K2K_ATTR_ACQUISITION_START_TIME looks like the right thing but doesnt change the right value. Can anyone help?

 

Thanks

Dave

 

P.S I'm not looking for trigger holdoff, as thats a different thing entirely!

0 Kudos
Message 1 of 6
(4,129 Views)

Hello,

 

Okay, I've solved the problem, it was actually my code! I needed to call tktds1k2k_InvalidateAllAttributes to reload them into cache from the scope, hence the value not seeming to update!

 

I have noticed one quirk though. The value returned is always the value on the scope screen minus 5 * the seconds per div so for example a position of 5 us with 1us/div timebase is reported as 0 us position

 

Can anyone explain to me why this is?

 

(for now im just going to correct the value in my software so that what the user enters is reflected on the scope screen)

 

Thanks,

Dave

0 Kudos
Message 2 of 6
(4,124 Views)

Hello Dave,

       When you run one of the example programs does the offset occur?  If so, could you post the smallest portion of code that reproduces the problem?

 

Thanks,

 

NathanT

0 Kudos
Message 3 of 6
(4,113 Views)

tktds1k2k_SetAttributeViReal64(currentSession, "", TKTDS1K2K_ATTR_ACQUISITION_START_TIME, triggerDelay);

 

triggerDelay being the horisontal position desired.

 

so for example with a timebase of 1us/div  and triggerDelay = 5us the scope reads 0us on the screen for horizontal position.

 

I'm assuming that it is something which is meant to happen as its totally consistant and 5 * s/div is 5 divisions, i.e. enough divisions to push something off the scope screen, I would just like to understand why 😛

0 Kudos
Message 4 of 6
(4,109 Views)
Hi Dave,

The tktds1k2k_SetAttributeViReal64 function is derived from the Ivi_SetAttributeViReal64 function of the IVI Library.

I don't know if you are aware, but there is an example file included with the TKTDS1k2k driver library. I have attached the example file to this post.

If you want to find the driver files locally, they are located in:
 
<PROGRAM FILES>\IVI Foundation\IVI\Drivers\tktds1k2k.

This contains the driver c file and the example file as well.

 

The driver c file (tktds1k2k.c) contains all the function definitions for all the tktds1k2k calls. If you are using CVI, you can locate the function in question in the IVI Library and bring up the function help which will give a more detailed explanation.

Incase you are not using CVI, I have attached the function help for Ivi_SetAttributeViReal64

Please let me know if you need any more help,

 

Thanks,

 

Andrew McLennan
Applications Engineer
National Instruments
Download All
0 Kudos
Message 5 of 6
(4,071 Views)

Hello Dave,

      Please give the example a try and see if the problem occurs with it.  Also, it is recommended to use the high level API IVI driver functions to configure the instrument because the related settings are packaged together.

 

Thanks,

 

NathanT

0 Kudos
Message 6 of 6
(4,041 Views)