High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

Paramters are reseted anyway

Hello.
C++, Linux, NI-5114
I've noticed the interesting thing. I setup some attributes (let’s say NISCOPE_ATTR_TRIGGER_LEVEL or NISCOPE_ATTR_TRIGGER_DELAY_TIME) with non-zero value, check that the value was set correctly by reading directly from the attribute. Then I terminate the application by ctrl+C, and restart it. Right away after the initialization of the scope I read the attributes content and they are 0. Here is init code:
ViStatus rc = niScope_InitWithOptions (resName, VI_TRUE, VI_FALSE, "", &sessionId);

double delayTimeTmp, triggerLevelTmp;
niScope_GetAttributeViReal64 (sessionId, VI_NULL, NISCOPE_ATTR_TRIGGER_DELAY_TIME, (ViReal64*)&delayTimeTmp);
niScope_GetAttributeViReal64 (sessionId, VI_NULL, NISCOPE_ATTR_TRIGGER_LEVEL, (ViReal64 *)&triggerLevelTmp);
cout<<"__delayTimeTmp :"<<"__triggerLevelTmp :"<
So the device is reseted automatically despite the indicated VI_FALSE for reset option during initialization.

What can by the problem here?
0 Kudos
Message 1 of 3
(6,146 Views)
Hello Babay,
 
This behavior is expected.  The trigger level and delay properties will not persist after you close the niScope session.  The reset parameter in the InitwithOptions function determines whether or not to perform a hardware device reset during initialization.
 
If you want access to these values in subsequent runs of your application, don't close the niScope session and store the Instrument Handle for later use.  I was able to set and read my trigger level and store the Instrument Handle to a local variable in one run, then use the local variable in a later run to read the same values from my trigger properties.
 
I hope this helps.  Please let me know if you have any further questions.
 
Regards,
Sean Close
Product Support Engineer:  High Speed Digitizers
0 Kudos
Message 2 of 3
(6,137 Views)
Hello, Sean.

I'm doing the way you've proposed here, I was just wondering why it doesn't restore the previous values.

Ok. Thank you.
0 Kudos
Message 3 of 3
(6,135 Views)