1
\$\begingroup\$

In the SCPI-99 standard command reference the command 'output:coupling' is specified as taking the parameters 'AC' or 'DC'. However, this is the first time such a data type is mentioned! Should these be translated to boolean values as 'ON' and 'OFF' are? I don't see them fitting into any other parameter data type...

(I cross-posted this from http://stackoverflow.com/q/23713557/1292918 as it wasn't getting much interest there, but Im not sure of the rules on X-posting across SO sites?)

\$\endgroup\$
  • \$\begingroup\$ I think the preferred way to migrate is to flag the SO post for moderator attention and say you'd like it migrated. I would have thought you'd pass it as AC or DC, I take it you're more interested in standards compliance and don't have something you can just try it on to see if it works? \$\endgroup\$ – PeterJ May 19 '14 at 8:47
  • \$\begingroup\$ @PeterJ Ta, will try that too. Yes standards compliance as I'm implementing from the device side and had implemented initiallly as 0, 1 boolean. SCPI-99 doesn't seem to map this particular command's parameters to any form such as <numeric_value> or <boolean>, in fact it seems to be the only time such a parameter is mentioned in the document :\ \$\endgroup\$ – Toby May 19 '14 at 9:00
  • 1
    \$\begingroup\$ My guess is they just don't bother defining for simple list items. Things like numeric values allow SI units and exponential notation etc so it probably makes more sense to give them a formal definition. \$\endgroup\$ – PeterJ May 19 '14 at 9:05
  • 1
    \$\begingroup\$ @PeterJ, AFAIK there's no numerical equivalents defined for anything except "ON", "OFF", "TRUE", and "FALSE". I believe this is deliberate, to avoid having to deal with errors like range checking (is 37.23 a valid oscilloscope trigger source?) and all the special numeric values (MIN, MAX, NAN, etc). The equivalencies for ON, OFF, TRUE, FALSE are likely only there to maintain compatibility with pre-standard equipment. \$\endgroup\$ – The Photon May 19 '14 at 17:34
2
\$\begingroup\$

Notice that section 7.1 of the SCPI-99 standard mentions "character program data" as a type of parameter for a command or query. Unfortunately it simply refers back to the IEEE 488.2 standard for the definition of this data type.

In practice, many instruments require character program data parameters for various operations. These often reflect an enumeration of different inputs, outputs, or modes of the instrument. For example, an oscilloscope I use regularly has this command for setting the trigger source:

:TRIGger:SOURce {FPANel | FRUN | LMODule | RMODule}

The enumerated parameters typically are not mapped to integers as an alternative form of input. In fact SCPI specifies in section 7.2 that numerical program data "shall not be used for selecting functions on a “One of N” position switch."

The :OUTPUT:COUPLING command isn't even the only command of this type that is specified in the SCPI standard. Just looking briefly, in section 9.2.1.2.2 they specify a command

:TRIGger[:SEQuence]:SOURce {BUS | IMMediate | ...}

and in 8.2.8.2 there is

[:SOURce]:FREQuency:MODE {CW | FIXed | LIST | ... }

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ My standard references are in Volume 1: Syntax and Style. I wasn't able to find an online copy of the complete standard including the full command reference (Vol 2). \$\endgroup\$ – The Photon May 19 '14 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.