Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

State dependent error messages with IVI

I'm having problems with the IVI scope class driver. With at least two of the configuration functions, I have encountered error messages with perfectly valid configurations. Then I try running some other code or interactive CVI function panels with the same parameters, and the error messages go away. At first I thought maybe there were dependencies on the order in which functions are called, but that is not the case with the my latest problem. Has anyone else run into this behavior and solved it???

The specific driver I'm using is for a Tektronix TDS220 and the function call is IviScope_ConfigureChannel(). I've attached a screen shot from NI Spy showing the function being called once and returning a "Not a valid confi
guration" error, then being called again with the same parameters with no error. The latter call was from a CVI interactive function panel. After that, I could run my original applicaiton with no errors. Could this be a state cache problem?
0 Kudos
Message 1 of 11
(5,293 Views)
Hi Mark,
I'm not sure, that problem is in cache. You can test it easy. Add function Ivi_InvalidateAllAttributes (tktds2x0); before ConfigureChannel(...) which returns error. If problem is in the cache function returns VI_SUCCESS.

In the next step independent on the result, replace your ConfigureChannel function with set attribute functions in following order.

IviScope_SetAttributeViBoolean (tktds2x0, channel, IVISCOPE_ATTR_CHANNEL_ENABLED, enabled);
IviScope_SetAttributeViReal64 (tktds2x0, channel, IVISCOPE_ATTR_PROBE_ATTENUATION, probeAttenuation);
IviScope_SetAttributeViReal64 (tktds2x0, channel, IVISCOPE_ATTR_VERTICAL_RANGE, range);
IviScope_SetAttributeViInt32 (tktds2x0, channel, IVISCOPE_ATTR_VERTICAL_COUPLING, coupling);
IviScope_SetAtt
ributeViReal64 (tktds2x0, channel, IVISCOPE_ATTR_VERTICAL_OFFSET, offset);

I believe that one from ATTENUATION or RANGE attributes returns this error. And you have set trigger type to IVISCOPE_VAL_AC_LINE_TRIGGER.

Please can you attach log file from spy instead of jpeg picture. I cannot reproduce this error.

Best Regards,
Zdenek
0 Kudos
Message 2 of 11
(5,293 Views)
Zdenek, you are right, it is the range attribute (I've attached the .spy file). However, the range is perfectly valid and the TDS220 even changes to the correct vertical range.

This problem is very strange because it seems to come and go. I tried your suggestion to run Ivi_InvalidateAllAttributes(), then I started getting a different error message after setting the probe attenuation. Now it complains about an invalid channel name.

I am using the AC line as a trigger source because the signal I'm acquiring is a DC signal. I don't think this should cause any problems.

I should also mention that I'm using Session Manager to get my IVI handles.

Thanks, Mark
0 Kudos
Message 3 of 11
(5,293 Views)
I'll look to sources and I let you know on monday.

Zdenek
0 Kudos
Message 4 of 11
(5,293 Views)
Hi Mark,
sorry for delay but I have been out yesterday. I fixed first problem, but I cannot reproduce problem 2 if I don't have instrument. Please retest the sequence invalidateBeforeEachSetAttribute.spy and invalidateOnceBeforeConfig.spy with driver again. Driver returns error IVI_ERROR_UNKNOWN_CHANNEL_NAME. I don't have the instrument so I cannot test it. Please can you attach log from spy which will capture on IviScope and NI-VISA. The problem should be in read callback of trigger type attribute, but I need know what is return from instrumnet.
The driver cannot returns unknown channel name in your sequence and we must fix it, because driver will not safe.

I need know what does instrument return:
":TRIG:MAI:EDGE:SOU?" - When AC L
ine trigger is active
":TRIG:MAI:TYP?" - When AC Line trigger is active

Zdenek
0 Kudos
Message 5 of 11
(5,293 Views)
Here are the new .spy files, including the trigger queries you asked for.

Mark
0 Kudos
Message 6 of 11
(5,293 Views)
Please, try attached driver. Use function IviScope_ConfigureChannel and try it with enabled/disabled cache. Let me know if it's working or some other problem has been occurred.

Regards,
Zdenek
0 Kudos
Message 7 of 11
(5,293 Views)
I get the same results. Contact me at marki@tek.com if you want to discuss where to go from here.

Mark
0 Kudos
Message 8 of 11
(5,293 Views)
In case anyone is still using the NI IVI driver for Tektronix TDS210, TDS220, and TDS224, it seems that there is still a bug when using AC line as the trigger source.  The IVI driver throws an error message saying "Unknown channel or repeated capability name..." because it expects the trigger source to be a channel (e.g. "CH1") instead of "LINE.".
0 Kudos
Message 9 of 11
(4,760 Views)

What reversion of the driver do you have?

Can you specify the version of ICP you have?

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