Posted Tue, 13 Dec 2022 03:00:14 GMT by Li, Jeremy
Hi All, Or It seems I should  say, Hi Teles, :-)

I'm tring to retrieve the Units  Manual P2-367 for the Math results,for example:MATH:MATH2:VUNIT?

But I always get "" instead of the correct units.

Could you help to advise what is wrong with my program or what is wrong with the scope setting?
Posted Tue, 13 Dec 2022 23:40:23 GMT by Teles, Afonso
Hi Jeremy!

The MATH:MATH2:VUNIT? command returns the name of the "Alternate Units" (empty by default, in which case V is used).

I believe the command you are looking for is display:waveview1:math:math2:vertical:scale? or MATH:MATH2:SCALE? (not mentioned in the manual but appears to be equivalent).

Posted Wed, 14 Dec 2022 00:48:49 GMT by Li, Jeremy
Hi Teles,
Thanks, just understood that the command MATH:MATH2:VUNIT? is to read the unit of what user defined.
I intend to fetch the unit for the Y-axis label name. 
for example , the unit for MATH2=INTG(CH1*CH2) display on the scope screen is uj or mj, how can I retrieve this kind of string?
Posted Wed, 14 Dec 2022 18:19:21 GMT by Teles, Afonso

Hi Jeremy,

The only way I've found to get the units of a math channel when those aren't custom is display:waveview1:cursor:cursor1:hbars:aunits?, this will query the units of the currently selected waveform view. To select a waveform, view you can do display:waveview1:cursor:cursor1:asource math2.

Cursors do not have to be enabled for this work.

Note this will only get you the unit, not the scale, for that you can use the commands we previously discussed.

Posted Thu, 15 Dec 2022 05:46:18 GMT by Li, Jeremy
Hi Teles,
It works, thank you very much.

You must be signed in to post in this forum.