7-10 Relative and Math
User-defined math functions
In addition to the pre-defined math functions, you can also define your own functions by
using appropriate remote commands (user-defined math functions are not available from the
front panel). The following paragraphs summarize the basic commands for user-defined func-
tions and also list a basic programming example. See Section 17, Calculate subsystems, for
more details on user-defined math functions.
Commands for user-defined math functions
Table 7-5 summarizes the commands for user-defined math functions. To define a math
function:
1. If desired, assign units to the calculation result using :CALC:MATH:UNIT. Units is
stored for the calculation.
2. Assign a name to the expression (using up to 10 ASCII characters) using the
:CALC:MATH:NAME “user-name” command.
3. Define the expression using the :CALC:MATH:DEFine or :CALC:MATH:EXPression
command. The new expression is the one that will be presently selected.
4. Enable the math function by sending :CALC:STATE ON.
5. Turn on the output by sending :OUTP ON, then send :INIT to trigger the unit.
6. Request the data with the :CALC:DATA? query.
Table 7-5
Commands for user-defined math functions
Command Description
:CALCulate:MATH:UNITs <name>
:CALCulate:MATH:NAME <name>
:CALCulate:MATH[EXPression] <form>
:CALCulate:STATe <state>
:CALCulate:DATA?
Specified units for user-defined function (name = three ASCII
characters in quotes).
Define math name (name = “user-name”).
Define math formula (form = formula)
Valid names: VOLTage, CURRent, RESistance, TIME
Valid math operators: + - * / ^ log, ln, sin, cos, tan, exp
Enable/disable math (state = ON or OFF).
Query math data.