CMEngine
CMEngine
CMEngine
Version 2.2
OMICRON Test Universe
2
CM Engine
Table of Contents
1 Preface..........................................................................................................................9
1.1 Which tasks can be performed using the CM Engine?.......................................................9
1.2 Command overview ............................................................................................................9
1.3 Operating systems and compilers ....................................................................................11
1.4 Accessing the CM Engine from your program ..................................................................11
1.5 Typical program sequence................................................................................................11
1.6 CM Engine license administration.....................................................................................12
1.7 Handling special cases .....................................................................................................12
1.7.1 Automatic output switch off ...............................................................................................12
1.7.2 CMC in use was switched OFF and ON again .................................................................13
3 Interface Functions....................................................................................................43
3.1 Overview of error codes....................................................................................................43
3.2 Which error codes can be caused by a specific function?................................................47
3.3 Parameter types used in interface functions.....................................................................47
3.4 Interface function reference ..............................................................................................47
3.4.1 AddRegDev.......................................................................................................................47
3.4.2 Associated ........................................................................................................................47
3.4.3 AssociationMode...............................................................................................................48
3.4.4 DevAssociateAppend........................................................................................................48
3.4.5 DevAssociateAppendSpecific ...........................................................................................48
3.4.6 DevAssociationCount........................................................................................................48
3.4.7 DevAssociationInfo ...........................................................................................................48
3.4.8 DevAssosciationRequest ..................................................................................................48
3.4.9 DevAssosiationRequestCancel.........................................................................................49
4.4.6.10 irigb:dec:scan?................................................................................................................167
4.4.6.11 irigb:dec:reset .................................................................................................................168
4.4.6.12 irigb:dec:sync(<yyyy>, <mm>, <dd>, <hh>, <mm>, <ss>, <rate>, < write_mode>)
irigb:dec:sync(<yyyy>, <doy>, <hh>, <mm>, <ss>, <rate>, < write_mode>) ..................168
4.4.6.13 irigb:dec:sync? ................................................................................................................169
4.4.7 Sequencer commands....................................................................................................169
4.4.7.1 seq:begin ........................................................................................................................170
4.4.7.2 seq:end ...........................................................................................................................170
4.4.7.3 seq:clr .............................................................................................................................171
4.4.7.4 seq:exec..........................................................................................................................172
4.4.7.5 seq:set (loop | count(1) | count(2) | timer | timeout, <value>)..........................................172
4.4.7.6 seq:add (count(1) | count(2), <rel_steps>)......................................................................172
4.4.7.7 seq:status? (step | loop | count(1) | count(2) | mem) ......................................................172
4.4.7.8 seq:stop ..........................................................................................................................173
4.4.7.9 seq:wait ( [<trigger_condition>, <trigger_jump_distance>,] [<timeout_condition>,
<timeout_jump_distance>] ) ...........................................................................................173
4.4.8 Sequencer hints ..............................................................................................................177
4.4.9 Sequencer examples ......................................................................................................177
4.4.10 Measurement commands ...............................................................................................179
4.4.10.1 inp:avail?(scope|multimeter) ...........................................................................................179
4.4.10.2 inp:mode(scope|multimeter) ...........................................................................................180
4.4.11 Multimeter commands ....................................................................................................180
4.4.11.1 inp:ana(<input_list>):rms?(<itime>) ................................................................................181
4.4.11.2 inp:ana(<input_list>):peak?(<rtime>) ..............................................................................182
4.4.11.3 inp:ana(<input_list>):phase?(<itime>) ............................................................................183
4.4.11.4 inp:ana(<input_list>):freq?(<#periods>,<start level>) .....................................................184
4.4.11.5 inp:ana(<input_list>):power?(<itime>) ............................................................................185
4.4.11.6 inp:ana(<input_list>):sum?(<itime>) ...............................................................................186
4.4.11.7 inp:ana(<input_list>):diff?(<itime>) .................................................................................187
4.4.11.8 inp:ana:sync ....................................................................................................................189
4.4.11.9 inp:ana:get?(<command handle>) ..................................................................................189
4.4.11.10 inp:ana:clr(<command handle>) inp:ana:clr(all)..............................................................190
4.4.11.11 inp:ana:dc(on|off) ............................................................................................................191
4.4.11.12 inp:ana:cal(ac|dc)............................................................................................................191
4.4.12 Obsolete commands.......................................................................................................191
5 Appendix ..................................................................................................................193
5.1 Syntax Diagrams.............................................................................................................193
5.1.1 System Commands ........................................................................................................193
5.1.2 Input Commands: Analog ...............................................................................................193
5.1.3 Input Commands: General, Binary, Counter...................................................................194
5.1.4 Output Commands..........................................................................................................195
5.1.5 Sequencer Commands ...................................................................................................196
5.1.6 Amplifier Commands ......................................................................................................196
5.1.7 GPS Commands .............................................................................................................197
5.1.8 IRIG-B Commands .........................................................................................................197
5.2 Block diagram of Generators/Outputs of the CMC 56 ....................................................198
5.3 IEEE C37.118 control function details ............................................................................199
5.4 Contact Information / Technical Support ........................................................................200
Command index.............................................................................................................201
1 Preface
The CM Engine is a program library that a software developer can use to conveniently control and program
one or more CMC test systems.
The software developer is able to create a program for his special purposes in any of the common
programming languages like "C/C++", Visual Basic, VBA (Visual Basic for Applications), C# etc. In this
application program, he can use the CM Engine library to communicate with one or more CMC test systems
connected to the PC or to the notebook computer.
In other words, the CM Engine furnishes an interface with functions to the application program that can be
used to control one or more CMC devices. With a particular interface function, the Exec() function, the
application program can send string commands to the CMCs, which are then analyzed and executed. There
are string commands to set a CMC to a specific state, e.g. to output a certain voltage, and there are such
commands to get measurement data or other information from a CMC. This kind of command returns
detailed string answers containing the information desired by the programmer. The returned information may
be analyzed and processed further by the application program.
Convention: For the sake of readability, this document uses the abbreviation CMC256 to refer to a
CMC256, CMC256plus or CMC356 test set.
• Emit voltages or currents with selectable waveforms and waveform parameters. You may select one of
any predefined waveforms like sine, exponential function, square etc.
• Load transient or periodic signals as user-defined waveforms into the CMC’s memory and put them
out.
• Emit additive or multiplicative superposition of predefined and/or user-defined waveforms.
• Measure signals fed into the analog and the binary inputs.
• Set binary outputs.
• Execute fast real-time measurements on the CMC's analog and binary inputs.
• Store command sequences in a CMC for real-time command execution and control these sequences.
• Emit signals through external voltage or current amplifiers (e.g. CMA 56).
Execute function
Exec Send commands to one or more CMCs connected to the PC.
Log functions
LogNew Open a new log file.
LogAppend Append to a log file.
LogSetLevel Set logging level.
LogWrite Write text to a log file.
LogGetInfo Get logging level and log file name.
Miscellaneous functions
Version Get the CM Engine version number.
OutUserApp Appends samples to a specified user signal.
CM Engine's string commands are organized in groups and every group has a tree structure. So all logically
related string commands form a tree; the command diagrams in the appendix supply an overview of these
command trees. You usually assemble a string command walking along the command tree from its root to
the end of a branch, then you use the interface function Exec() to send the string to a CMC via CM Engine.
System commands "sys:..." Use the system commands to change the system settings of a CMC,
to ask for the CMC’s system status or to get some information about
the CMC’s hardware.
Output commands "out:..." The output commands control everything related to the output of
analog or binary signals. You may also select predefined waveforms or
define your own ones.
Input commands "inp:..." The input commands control everything related to the measurement of
analog or binary signals on the CMC’s inputs. In addition, some
special commands perform real-time measurements.
Amplifier commands "amp:..." The relations between your defined signals and the outputs used for
these signals, i.e., which signal is assigned to which output, are set by
default. Using the amplifier commands, you can change these default
settings according to your needs. Furthermore, you may inform the CM
Engine about an external amplifier's parameters and then use this
external amplifier for current or voltage output.
GPS commands "gps:... " The GPS commands let you configure all aspects of a connect GPS
device, e.g., retrieving time and position, set triggers, etc.
Sequencer commands "seq:..." The sequencer commands control everything related to sequences,
i.e. CMC commands executed in real-time mode. They enable you to
build sequences out of commands (signal output etc.) that you can
load into a CMC and then execute them. That is the way you can start
and control real-time executions of your commands.
The OLE Automation interface works in any directory if the OLE Automation server is registered
appropriately, which the installation program does.
The registration for the OLE Automation servers is done by the installation program. You have to register it at
its new location if you move the OLE Automation server. To re-register the server, start it with the command
line parameter “/register”.
Please tell us if you make your own adaptations for other compiler systems or applications so that we can
include them in future versions of the CM Engine.
For OMICRON technical support, please refer to the appendix on page Error! Bookmark not defined. of this
manual.
Example in VBA:
Sub Main()
Dim engine As cmEngine.cmEngine ' Declare engine as object used for OLE Automation
Dim result As String ' Variable for the result string returned by CMExec
On Error GoTo EngineError
' Create OLE Automation object
Set engine = New cmEngine.cmEngine
engine.DevScanForNew (False)
Dim deviceList As String
Dim devId As Integer
deviceList = engine.DevGetList(lsAllAssociatedAny)
If ExtractParameter(3, deviceList) = "0" And ExtractParameter(4, deviceList) = "0" Then 'we
have a net-1 device
devId = Val(ExtractParameter(1, deviceList))
If Not engine.Associated(devId) Then
engine.DevAssociateAppend (devId)
End If
ElseIf deviceList <> "" Then
devId = Val(ExtractParameter(1, deviceList))
Else
GoTo ApplicationEnd
End If
engine.DevLock (devId)
'The CMC can now be used by this application program
result = engine.Exec(devId, "out:ana:on") ' Execute commands on this CMC
ApplicationEnd:
Set engine = Nothing 'Release the CMEngine
End Sub
Please note:
This script searches for available CMCs and turns the output on. It also searches for net-1 device, so be
careful that there is no net-1 device in your local network before you run this script.
The license number(s) are kept in a license file "OMICRON.LIC". CM Engine needs a specific license number
in this file for every CMC. This license file uses the same syntax as Windows INI files. Each device has its
own section with keys for every application/component. The section name is built from the serial number of
the CMC and the device type (CMC 56, CMC151, CMC156). The name of the key is CMENG for the CM Engine.
The following is an example for the CMC 56 with the serial number DA345D:
[DA345D,CMC 56]
CMENG=7TUCU-RE2SR
The necessary license numbers are provided on the distribution disks or on an accompanying letter. The
license numbers provided on the disk are entered automatically. If you get the license numbers on a letter
you can use the „Add License“ Windows program to enter them. For a description on how to use this
program, just start it without any parameters. The license file has to be in the directory ...\Program
Files\Common Files\OMICRON.
a) If the communication between CM Engine and CMC is interrupted for more than two seconds
(communication cable disconnected etc.).
b) If there is an overtemperature on one of the built-in power amplifiers.
c) If there is an external infeed (CMC151, CMC156 and e only)
Detect these cases by getting the contents of the primary status register with Exec("sys:status?"):
case a) In the primary status register
- the bit ST_BIT_COMM (Bit 0),
- the bit ST_BIT_CMC_INTL (Bit 1)
- or both
are set.
case b) In the primary status register
- the bit ST_BIT_OVERTEMP_V (Bit 4),
- the bit ST_BIT_OVERTEMP_I (Bit 5)
or both
are set.
case c) In the primary status register
- the bit ST_BIT_CMC_INTL (Bit 1)
is set.
Reactivate a CMC with outputs that are already switched OFF (switch outputs ON again) by the following
calls to CM Engine commands:
case a) Get the secondary status registers 0 and 1 using Exec(…"sys:status?(0)"…) and
Exec(…"sys:status?(1)"…) until both registers contain a zero (no bits set any more).
Furthermore call GetError() until zero (= CMERR_OK) is returned.
case b) Get the secondary status registers 4 and 5 using Exec(…"sys:status?(4)"…) and
Exec(…"sys:status?(5)"…) until both registers contain a zero (no bits set any more).
Furthermore call GetError() until zero (= CMERR_OK) is returned.
case c) Remove the cause for the external infeed.
Get the secondary status register 1 using Exec(…"sys:status?(1)"…) until the register
contains a zero (no bits set any more).
Furthermore call GetError() until zero (= CMERR_OK) is returned.
For a sample implementation, refer to the EasyDiff sample program provided with CM Engine.
The CM Engine programming interface allows the use of all the capabilities of the CMC test devices. This
programming interface is implemented in different forms for different programming environments, but in all
cases it provides a set of interface control functions plus a gateway to communicate with the CMC device.
This communication takes place as an exchange of strings, where the system sends a command in string
format and gets back an answer, also in string format. For commands that require no answer, an empty
string is returned. To simplify parsing of the answer strings, the response for a given command has a fixed
format, although this format varies across commands.
To use CM Engine programming from within a given application, it will first be necessary to have the CM
Engine interface available. This can be done either linking statically to the CM Engine library, or loading the
CM Engine dynamic link library at run time, according to the design of the application and to the capabilities
of the programming environment and the operating system. Afterwards, the programmer will use the CM
Engine interface functions to scan the communication ports for connected CMCs and lock those that he
intends to use.
Once the CMCs have been successfully locked, the programmer will send the appropriate commands to
perform the desired operations, and to get back the desired information from the CMC device. Before
finishing, the application must unlock the locked CMCs and release the CM Engine interface.
The easiest way to abstract oneself from these details is to use the “Batcher” application, delivered as a
sample with the CM Engine programming environment. This small application provides in effect a command
line interface to the CMC device. It will automatically load the CM Engine and lock any CMC devices found.
Afterwards, it will take the user input as a command to the CMC, and will display the answer string, if any. In
this way it is possible to concentrate on the control of the CMC. In all the examples in this document it will be
assumed that the CMC is already locked, except where the scanning and locking functions are specifically
discussed.
In normal programming, the application will generate the strings by whatever means are adequate, and will
then parse the answer string to get back the necessary information. This information will in turn enable the
programmer to react to the events going on in the test.
The Exec function is the gateway by which all the strings are sent to the CMC. It is Boolean, returning “true” if
the execution of the command in the CMC device was successfully performed. A return value of “false”
means that the command could not be performed; the results of the command are returned in the return
string, and the possible system errors (overloads, hardware problems, etc.) are found in the status registers.
The PC-CMC protocol is designed as a master-slave communication type. The CMC will never initiate
communication, all data must be extracted by polling.
1. Analog outputs
• A set of signal generators grouped in triples (4 triples = 12 generators in the CMC 156)
• A routing and scaling layer
• A set of amplifiers (voltage or current). These amplifiers can be external or internal.
2. Binary outputs
• Relay outputs (dry contacts)
• Open-collector transistor outputs
3. Analog inputs
• DC-measuring inputs for voltage and for current
4. Binary inputs
• Binary inputs configurable as dry-contact or voltage sensing with programmable thresholds.
5. Event buffer
• The event buffer, or input buffer (both terms will be used in this document), stores all the
relevant events in the system, with a high precision time-tag for each event.
6. Sequencer
• The sequencer allows internal storage of sequences of commands, which are later executed
internally.
7. Supervisory section
• Self-test and system status, system information.
While the configuration of other CMC devices may be more complex, the above elements are found in all of
them and are amply sufficient for the purpose of this document.
The first four parts are used to output analog and binary signals, and to read back analog and binary
information. The event buffer and the sequencer allow the use of the high-precision system timer to control
the input and output sections.
The timer can also be used to control the analog outputs, thus allowing extremely sensible tuning of the
generated signals. Again, this comes at the cost of a certain added complexity, as the only way to take
advantage of the system timer to control the outputs is programming the Sequencer and executing the test
sequence from within the CMC. Programs in the CMC are harder to program and debug than those in
standard high-level programming languages, since the need for exact timing and low memory usage does not
allow for a high number of variables or complex flow-control structures.
There are three main ways to use the CMC from an application through the CM Engine programming
interface:
In this case, the commands to the outputs are given on-line, without the use of the Sequencer, and the state
of the binary and analog inputs are read by polling. This is the simplest way of programming with the CM
Engine, where all the control structures are provided by the language used.
This method cannot provide accurate timing, and is therefore only appropriate for applications where
measurement of operating time or accuracy in the timing of the outputs is not required. For example, to apply
a given voltage and current and check that the device under test closes a contact, as long as the time of
operation is not interesting.
Here the outputs are still controlled on-line, but the state of the inputs is analyzed by processing the entries in
the event buffer.
This method provides accurate timing of the detected events, but it cannot provide accurate control of the
outputs. It is quite useful for low-complexity applications, where the controlling program can be fully dedicated
to the handling of the CMC. For advanced programs, it has the inconvenience that it shifts the responsibility
for controlling the CMC output to the PC application, and so it requires more complex task handling on the
side of the program.
The application downloads a Sequence to the CMC and starts execution. When the Sequence is finished, the
program analyzes the contents of the Input buffer to find out what happened while the Sequence was
running. A complex application may consist of several sequences, which are programmed, executed,
analyzed and then deleted to make room for the next one.
This method is required whenever the state of the outputs must be tightly controlled. For instance, if the
output values must be ramped, this method is the only one that can ensure a precise step time and a linear
ramp.
While the Sequencer can be used without the input buffer, it is very seldom done, since it is not common that
applications requiring a high degree of precision in the control of the outputs do not require the same
precision when it comes to the inputs. Additionally, it is practically impossible to extract information about or
influence the running of the sequence from the outside, as we’ll see when the Sequencer is discussed in
more detail. The Sequencer and the Event Buffer have been designed to work together, and in this way the
full potential of the CMC device can be unleashed.
The best solution is to create a log file while the development process lasts. To achieve this, we would use
the following commands at the beginning of the code:
LogNew(HEngine, "c:\develop.log")
LogSetLevel(HEngine, 1)
The file name can of course be any valid file name in the host operating system. Such a file will register the
CM Engine commands as were actually received, and the CM Engine’s evaluation of them. This level is
usually more than enough to detect wrongly built commands and out-of-range command arguments. If the
problem is still not clear, this log file or even better, one created with log level 2 will be the best information to
send when you request support from OMICRON.
The signal generators are grouped in triples; they perform all the required calculations to produce an analog
voltage signal of the desired characteristics. This signal is emitted between +7.071 Vpeak and –7.071 Vpeak
(±10Vpeak on a CMC256 or newer test set); in the case of a sine wave, this allows for a maximum rms value
of 5V (7.071Vrms on a CMC256 or newer test set). The signal can then be routed to an amplifier, either
external or internal. Only triples can be routed to amplifiers, the routing of individual signals is not possible.
One specialty to note here is that a triple does not necessarily always consist of 3 generators. It rather is a
logical group of generators belonging together (in a CMC151 the triples only contain one generator and the
fourth internal voltage of a CMC256 is also considered a triple).
Before an amplifier can be used, it has to be defined. The system needs to know the amplifier’s limits, time
delays for each channel and amplification factor, so all the necessary scaling calculations can be carried out.
The CM Engine is later programmed in absolute Amps or Volts at the amplifier’s exit, so the programs are
totally portable across hardware as long as the amplifier’s parameters are redefined should the amplifier be
changed.
After definition, the signal path from the signal generators to the physical magnitudes is established. One
additional step is necessary: to allow the CM Engine to address the amplifiers, they must be routed to one of
the logical triples. These triples are i(1), i(2)…. for current signals and v(1), v(2)…… for voltage signals. All
the CM Engine’s commands use the logical triples to set signal parameters. Additionally, it is also possible to
route a triple to a configuration. A configuration is a virtual amplifier, which can involve one or more outputs in
one or more physical amplifiers. The CM Engine will handle all the necessary calculations to make these
outputs behave as a single amplifier. For instance, such a configuration allows using two current outputs of
the CMC connected in series as a single-phase amplifier with double the compliance voltage. The CM Engine
distributes the current between both outputs and takes care of the phase adjustments so the result is as
desired – the user deals simply with a logical amplifier.
All the rest: waveform, frequency, amplitude, phase, etc. can be defined independently for each signal.
As we said in the previous section, before a signal triple can be used it must be routed to a configuration, or
to an amplifier, which must in turn have been properly defined before. This section deals with amplifier
definition, routing to configurations will be described later.
The CM Engine distinguishes between internal and external amplifiers, and between intelligent and standard
amplifiers. An intelligent amplifier is one that can provide its own definition data to the CMC unit; at this
moment, only OMICRON amplifiers are intelligent. Any other amplifiers must be defined by the user before
they can be used.
For each amplifier that is defined, the CMC requires the following information:
This tells us that the device has 4 binary relay outputs, amplifiers 1 and 2 are 3-phase and internal, and
amplifiers 3 and 4 are equally 3-phase and external.
Afterwards, we ask how many amplifiers are defined, using the command amp:def? and getting the
following answer: 1,1,2;
We see that amplifiers 1 and 2 are defined; we can then request their definition data, as follows:
amp:def?
1,1,2;
amp:def?(1)
Result : 1,int,v,2.500000E+001,1.250000E+002,0.000000E+000,1.000000E+003,0.000000E+000,
0.000000E+000,0.000000E+000,CMC156,BC284H;
amp:def?(2)
Result : 1,int,i,-2.500000E+000,1.250000E+001,0.000000E+000,1.000000E+003,0.000000E+000,
0.000000E+000,0.000000E+000,CMC156,BB270T;
The internal amplifiers of the CMC156 are routed and defined by the CM Engine upon start-up; usually there
is no need to redefine them, but it is possible to do so if required. Let’s analyze one of the strings, for instance
amplifier 1:
We’ll look first at the definition of an external amplifier using the CMA156 as example. This amplifier, as it is
known, contains two current triples that can be used independently or grouped to create a single triple with
double the output current as each one of the individual triples. When connected to a CMC device, we must
use first the amp:scan? command to obtain the list of external amplifiers connected to the CM Exif board;
afterwards, we’ll use the amp:param? command for each of the IDs returned:
amp:scan?
Result : 1,1,2;
amp:param?(1)
Result : 1,ext,i,A,5.000000E+000,2.500000E+001,0.000000E+000,1.000000E+003,
0.000000E+000,0.000000E+000,0.000000E+000,CMA156,DL373C;
amp:param?(2)
Result : 1,ext,i,B,5.000000E+000,2.500000E+001,0.000000E+000,1.000000E+003,
0.000000E+000,0.000000E+000,0.000000E+000,CMA156,DL373C;
These parameters are read directly from the amplifiers by the amp:param? command. Before they are
available for use, we must define them; in the case of the CMA156, we can choose whether we want to use
the triples independently or coupled. Let’s do it both ways:
amp:def(3,ext,1)
amp:def(4,ext,2)
amp:def?(3)
Result : 1,ext,i,A,5.000000E+000,2.500000E+001,0.000000E+000,1.000000E+003,5.944444E-005,
5.944444E-005,5.944444E-005,CMA156,DL373C;
amp:def?(4)
Result : 1,ext,i,B,5.000000E+000,2.500000E+001,0.000000E+000,1.000000E+003,5.944444E-005,
5.944444E-005,5.944444E-005,CMA156,DL373C;
amp:route(i(2),3)
amp:route(i(3),4)
We have assigned the two amplifiers available for external use to the triples in the CMA156, and we have
obtained two totally independent current triples, each capable of outputting 25A as the definition command
reports to us. After assignation, we route them to two current logical triples so CM Engine can use them.
amp:route(i(2),clr)
amp:route(i(3),clr)
amp:def(3,clr)
amp:def(4,clr)
amp:def(3,ext,1,2)
amp:def?(3)
Result : 1,ext,i,-,1.000000E+001,5.000000E+001,0.000000E+000,1.000000E+003,5.944444E-005,
5.944444E-005,5.944444E-005,,;
The routing must be cleared first, then the definition; it is not possible to undefine an amplifier that is routed.
Afterwards, we use the amp:def command with a list of external amplifiers; the software couples them if
possible, otherwise the command fails. After definition, we are left with a single amplifier capable of outputting
50A. The software takes care of all details, and the user must only wire both amplifiers in parallel and use
them as one.
For non-intelligent amplifiers, we must provide all the required parameters. The system cannot check their
presence in the bus or whether they are turned on; this is the responsibility of the user. For example, to define
an amplifier with the same characteristics as the triple A in the CMA156 we would use the following
command:
amp:def:(3,ext,i,1.000000E+001,5.000000E+001,0.000000E+000,1.000000E+003,5.944444E-
005,5.944444E-005,5.944444E-005)
As mentioned before, a configuration is a virtual amplifier. Configurations are pre-defined in the amplifier, and
cannot be modified. Only OMICRON amplifiers support configurations.
The main advantage of using configurations is that they allow access to the full power of the hardware. It
allows using more power, or more output, or both in exchange usually for the available number of phases.
For amplifiers that admit paralleling of their outputs, like the CMA156, CMC256-6 or newer test sets, some
configurations will involve outputs in both amplifiers.
The configurations can be queried using the amp:cfg? command. It will return the available number of
configurations, which can then be individually queried by using the second form of the command:
amp:cfg?(n) where n is a number from 1 up to the value returned by the general query. If there are
intelligent amplifiers connected, their configurations follow those of the CMC; please note that an amp:scan?
command must be executed before the external amplifier’s configurations are available.
For a CMC156 with a CMS156 amplifier connected, the commands would be like this:
amp:cfg?
Result : 1,6;
amp:scan?
Result : 1,1,2;
amp:cfg?
Result : 1,11;
amp:cfg?(1)
Result : 1,9,3,1.275000e+002,5.000000e+001,1.250000e+002,4.000000e-001,std,0,amp_no,1;
The data in the result string that follow the device ID can be decomposed as follows:
9 Routing ID
3 Number of phases
1.275000E+002 Maximum output
5.000000E+001 Maximum power
1.250000E+002 Output at maximum power
4.000000E-001 Source amplitude
std Mode
0 Wiring index
amp_no, 1 List of amplifiers involved in the configuration
2.2.1.2.1 Routing ID
The routing ID is the argument we must pass to the amp:route command to use the given configuration.
The routing IDs from 1 to 8 are reserved for amplifiers defined with the amp:def command. It is very
important to remember that the mechanisms to obtain the parameters for a defined amplifier and for a
configuration are different. In the first case, we directly use the number returned by the amp:route?
command to query the system via amp:def? With configurations, the number returned by the amp:route?
command is the routing ID, not the configuration number. This means that the programmer must maintain the
link between routing IDs and configuration numbers. Alternatively, it is possible to store the parameters of all
configurations indexed by the routing ID. The configuration number is only necessary for the amp:cfg?
command, and can be discarded once all configurations have been queried and all data obtained.
2.2.1.2.7 Mode
String that conveys information about how to perform the external wiring that is required so the configuration
can be used. The possible modes a configuration can be wired are as follows (CMC256 or newer test sets,
CMS251 and CMS252 not included):
For more detailed wiring instructions, and for the cases where the use of adapting resistors is needed, please
consult the hardware manuals.
Let’s see as an example on how to set the CMC156 current amplifier to get 80VA in single phase mode:
amp:cfg?
Result : 1,6;
……………………………………………………
amp:cfg?(5)
Result: 1,13,1,1.250000e+001,8.000000e+001,1.250000e+001,6.400000e+000, ser12,2,amp_no,2;
amp:route(i(1),clr)
amp:def(2,clr)
amp:route(i(1),13)
After executing this code, only i(1:1) will be available, with the characteristics returned by the
amp:cfg?(5) command. The user would have to wire the CMC as shown in the following graphic:
Please note that the use of adapting resistors is required, for example those in the SPA device.
The signal parameters can be defined independently for each generator of each triple. To facilitate
programming, it is possible to address multiple generators simultaneously. For instance, a command such as
this would program all generators in triple v(1):
out:ana:v(1):…
The next one would program all generators in triples v(1) and v(2):
out:ana:v(1,2):…
Finally, this command would program generators 1 and 2 of triple v(1) and generator 3 of triple v(2):
out:ana:v(1:1,1:2,2:3):…
The changes done to the generators are propagated to the outputs only when an on command is issued. The
on command turns the outputs on if they happened to be off, and reprograms them with the values set for the
generators. Therefore, it is possible to change the signal parameters in any order, knowing that all changes
will be applied simultaneously when the on command is issued. This command accepts a generator list or it
can be applied to all analog signals simultaneously.
2.2.1.3.1 Waveform
Each generator in the CMC can use up to two signal components, named sig(1) and sig(2); each of these
components can be independently programmed, and then be added or multiplied together to form the signal
for that generator. A generator can then use sig(1) only (default), sig(2) only, sig(1) + sig(2), sig(1) * sig(2)
or it can be disabled (set to off). These relationships are programmed using the mix command.
In its turn, each of the signal components can be set to one of the following waveforms:
a Sine (default)
a Square
a Triangle
a DC
a Exponential
a Sum of harmonics
a User defined (sampled)
Please note that the DC wave is an independent waveform, and it is not the same as setting the frequency of
the signal to 0. Setting the frequency to 0 is not permitted, and the CM Engine will issue an error if it is
attempted.
Each of the two signal components can have a different waveform, amplitude, phase and frequency. This
approach provides the user with huge power and flexibility when it is needed, while staying out of the way for
simple cases where only a sine wave is required. By default, all commands apply to sig(1), which is
programmed to be the sole component of the generator’s signal, so outputting a voltage sine wave of 50V
through the internal voltage amplifier (defined and routed to v(1) by default) is as simple as this:
out:v(1):a(50);f(50)
out:on
The ana qualifier is not required if the command applies to the analog outputs.
A certain amount of care is necessary when using multiplication of signal components to set up the
waveform. Each signal is assigned a “weight” equal to the ratio between the amplifier’s maximum output and
the signal’s amplitude. If the signal is set to the same amplitude as the maximum output value of the
amplifier, its weight is 1; if it is set to half the output value of the amplifier, its weight is 0.5, and so on.
It is extremely important to take into account that the values for the amplifier’s definition are rms values; this
makes the handling of sine waves straightforward, but can bring confusion when DC or square waves are
used. The internal voltage amplifiers of a CMC156, for example, return a maximum output value (rms) of
125V. This means that a sine wave with amplitude of 125V has a weight of 1. However, a DC component with
a weight of 1 would have an amplitude of 125*√2, or 176.775V. It is perfectly legal to assign an amplitude of
176.775V to a DC or square wave signals, since due to their shape no part of the wave would be outside of
the amplifier’s peak limit. The same applies to the triangle wave, as there the amplitude command is taken as
the peak value of the triangle.
A small example will help to clarify matters. Let’s multiply a sine wave by a square wave of the same
frequency and 50% duty cycle so we rectify the sine wave and make all its cycles positive. We program the
square wave’s amplitude to the amplifier’s maximum, so its weight is 1 and it does not modify the sine wave
in any way.
out:v(1):a(50);f(50)
out:v(1):sig(2):wav(square)
out:v(1):sig(2):a(125);f(50)
out:v(1):mix(mult)
out:v(1):on
since we know, or have obtained from the CM Engine, that 125 is the maximum amplifier’s output. The output
of this code, though, would be a wave smaller than expected. The correct code would be:
out:v(1):a(50);f(50)
out:v(1):sig(2):wav(square)
out:v(1):sig(2):a(176.775);f(50)
out:v(1):mix(mult)
out:v(1):on
When the values for a generator have not been modified, and we issue an on command that affects that
generator, the amplitude and frequency are not altered. The phase however is set to the original value, which
may cause an unintended phase jump. For example, if we execute the following set of commands:
out:v(1):a(50);f(60)
out:v(1:1):p(0)
out:v(1:2):p(-120)
out:v(1:3):p(120)
out:on
#wait 5
out:v(1:3):a(1);p(180)
out:on
It is obvious that we want to output a balanced three-phase voltage system, with amplitude 50V and
frequency 60Hz, and after 5 seconds to set the voltage in L3 to 1V.
The system should stay unchanged except for the magnitude and phase of VL3; but with these commands
there will be a phase jump as the other two phasors shift to their original phase angles of 0 and -120 from
whatever phase angle they happened to have when the second out:on was issued. VL3 will also jump to
180 absolute degrees, which is not probably what we intended to achieve – most likely we wanted to reverse
the phase angle the wave had when we issued the on command.
To avoid this, the CM Engine allows setting how the phase parameter should be interpreted. In absolute
phase mode, the phases are applied with each new on command as described above. In differential
mode though the difference between the newly set phase value and the previous phase value is applied to
the phase angle of the wave the instant the on command is issued. Using differential mode for the previous
example would give us the following
out:pmode(abs)
out:v(1):a(50);f(60)
out:v(1:1):p(0)
out:v(1:2):p(-120)
out:v(1:3):p(120)
out:on
out:pmode(diff)
#wait 5
out:v(1:3):a(1);p(180)
out:on
Once set, the phase mode remains until it is changed or the system is reset (phase mode = absolute). It is
necessary that the phase mode is absolute the first time the on command is issued, so the CMC can
compensate for the amplifier’s delays. When the system is set to differential mode, the on command applies
to the analog signals the difference between the new setting and the previous setting. This value is applied to
the signals at whatever status they are when the on command is issued. In this example, VL1 and VL2 will
continue unchanged, and VL3 will be shifted 180° - not set to 180° as before.
There is a third phase mode than can be set, and it is setting the phase mode of the generators relative to
one of them. For that we use the following command:
out:ana:pmode(diff(v|i(<reference_generator>))
where <reference_generator> must be an individual voltage or current generator, not a triple. The main
usefulness of this command is to keep the phase shifts between generators when their frequencies change
independently to each other. Ordinarily, each on command would consider only a given generator’s phase
settings to set the generator’s phase. With the differential mode with reference channel, the on command
applies the differences between the generator’s phase and the reference generator’s phase. This mode can
be considered as an extension of the diff mode for generators with different frequencies. If this mode did
not exist, only the abs mode would keep the phase shifts between generators having different frequencies.
Note that the current implementation of this command requires the phase of the reference generator to be set
to 0° in order to provide correct operation. If it is set to a different value, the behavior is undefined.
There is also a restriction of the phase modes concerning signal generation: when mixing two signals by
either adding (mix(add)) or multiplying (mix(mult)) them, only the absolute phase mode is available.
When using a different phase mode, an error will be issued.
A small example will help to clarify the concepts. Let’s assume that we set two voltage generators with
different frequencies and then we change the amplitude of one of them. The results would be different with
each phase mode, as follows:
out:ana:v(1:1):a(100);f(50);p(0)
out:ana:v(1:2):a(100);f(51);p(-120)
out:on
. . . . . The previous code would be common to all phase modes . . . . .
out:pmode(abs)
out:ana:v(1:1):a(50)
out:ana:v(1:2):a(20);p(0)
out:on
This code would cause both generators to jump to phase 0, v(1:1) because that was its original setting and
v(1:2) because that is the new set value.
out:pmode(diff)
out:ana:v(1:1):a(50)
out:ana:v(1:2):a(20);p(0)
out:on
This code would leave v(1:1) unchanged and would add 120 degrees to whatever phase the generator
already had. Since both generators have different frequencies, the phase shift between them after the
command could be anything, depending only on the moment the command was issued.
out:pmode(diff(v(1:1)))
out:ana:v(1:1):a(50)
out:ana:v(1:2):a(20);p(0)
out:on
We have now defined v(1:1) as reference. The reference generator behaves in normal diff mode, so this
code would leave v(1:1) unchanged; v(1:2) on the other hand would be set to the phase shift between itself
and v(1:1). With the new settings this shift is 0, so v(1:2) would experiment a phase jump to set it to the same
phase as v(1:1).
An interesting and useful feature that CM Engine provides is the possibility to set a step value for each
magnitude and then apply all steps simultaneously. This allows for easy and convenient variation of
amplitude, phase and/or frequency for each or all signals. All step values will be added simultaneously upon
the execution of the out:step command. Since it is not possible to read back the values that are being
output, the user must keep count of the number of step commands issued. Also, after an off command,
the next on will return the original values set to the generators, losing all the increments applied with the
step command.
It is most likely that you will want to use the differential phase mode (pmode(diff)) when using the stepping
feature since the phase angles of all affected generators would be reset to the originally specified value for
each step. This is because a step command is a variation of the on command and therefore performs the
same calculations which would cause setting the phase angle to what was specified based on the
out:ana:..:p() command.
Binary outputs are grouped in “virtual” output modules, and the module index is used as qualifier in all output
commands. “Virtual” means that it stands for any kind of hardware that can host the outputs, such as the
CMC front panel, the transistor outputs in an EXIF/EXTOP board and any auxiliary output module located in
an external IO expansion device (like CMB IO). The exact details about this virtual module can be retrieved
by using the out:bin(<out_module_idx>):cfg? command. Whenever there is a CMC with a connected
CMB the available virtual output modules consist of the CMC internal relay outputs (accounting for one virtual
module), the CMC internal transistor outputs when available (a second virtual module) and the output
modules of the CMB, if any. Within a module, the outputs are divided in groups according to the output type
and the way the ground or reference is wired.
The method to address any given binary output is to use first the out:bin:cfg? command to get the
number of modules, and then issue a out:bin(<out_module_idx>):cfg? for each of those modules to
get information about them, including the number of groups. Then for each group we may issue a
out:bin(<out_module_idx>,<group_idx>):cfg? command to get the group’s characteristics,
although this is not necessary to handle the outputs from CM Engine (it is useful to know how to wire the
outputs though). If we know that we are addressing only a CMC unit, then we know in advance there will be
one or two output modules, module 1 being the four contact outputs in the front panel and module 2 being the
transistor outputs in the back panel (when available), so there is no need to go through the full process. We
must be aware though that, by hard-coding the module numbers in our program, we are blocking the
possibility of using external IO modules such as CMB.
For example, to close the relay contacts 1 and 3 in the front panel without altering the state of all the others,
we would issue this command: out:bin(1):on(1,3). If we had wanted to close those two and at the
same time make sure that contacts 2 and 4 are open, we would have issued (since we know we address
virtual module 1) the command out:bin(1):set(0b0101). The equivalent commands operating on the
transistor outputs would be out:bin(2):on(1,3) and out:bin(2):set(0b0101).
The status of the analog inputs can be polled at any time; the commands inp:ana:i(1):get? and
inp:ana:v(1):get? will read the DC inputs of a CMC 56/151/156 and will return the readings in A and V
respectively. At present all CMC devices having analog DC inputs have one DC Voltage input and one DC
current input, so there are no indexes above 1 for these commands.
Binary inputs are grouped in “virtual” input modules, and the module index is used as qualifier in all input
commands. “Virtual” means that it stands for any kind of hardware that can host the inputs, such as the CMC
front panel or any auxiliary input module located in an external IO expansion module (like CMB IO). The
exact details about a virtual module can be retrieved by passing its index to the
inp:bin(<out_module_idx>):cfg? command. Whenever there is a CMC with a connected CMB the
available virtual input modules consist of the CMC internal inputs (accounting for one virtual module) and the
input modules of the CMB, if any. Within a module, the inputs are divided in groups; inputs in a group share
debounce and deglitch times, and can be addressed as one for the inp:bin:def commands.
The status of the binary inputs can be polled at any time; the inp:bin(<inp_module_idx>):get?
command will return the state of the binary inputs in a given module.
Binary inputs can be configured either as potential-free or potential-sensing; in the latter case, it is possible to
configure a voltage range and a detection threshold. The commands for configuration and handling of the
inputs accept always a module index and a group index, and optionally an input index if the inputs admit
individual configuration.
For example, to configure all the binary inputs in module 1, group 1 as potential-free, the command would be:
inp:bin(1:1):def(pf). Please note that the actual consequences of this command depend on the
hardware that is addressed. For instance, in a CMC156, inputs 1 to 4 would be affected, since the 10 binary
inputs on the front panel are separated in two groups: 1 to 4 and 5 to 10. In a CMC256 or newer test set,
however, only input 1 would be affected, since each input on the front panel has its own group. It is important
therefore to query all the data for the binary inputs before configuring them. For that we would use first the
inp:bin:cfg? command to get the number of modules, and then for each of those modules we would
issue a inp:bin(<out_module_idx>):cfg? command to get information about them, including the
number of groups. Then we would request each group’s characteristics by means of a
out:bin(<out_module_idx>,<group_idx>):cfg? command.
There are two kinds of events: those that are logged expressly and those that are logged automatically. The
latter are only logged if automatic logging is enabled. To log an event in the input buffer expressly, the
inp:buf:sam(<src>,<indx>) command is used. Basically, this command allows recording the status of
one of the analog inputs, or of the binary inputs, and to assign an index to such an event. For analog inputs,
the index is the number of the input to be sampled, while for binary inputs it is an identifier to allow recognition
of the event and facilitate the task of buffer analysis. If automatic logging is enabled, the system automatically
records all changes in the binary inputs, or in both the binary inputs and the analog outputs, depending on the
type of automatic logging selected. The index 0 is automatically entered for changes in the analog outputs,
and the index 1 is also automatically entered for changes to the binary inputs. While it is possible to force a
sampling of the binary inputs and assign index 1 to it, with the command inp:buf:sam(<src>,<indx>),
this will in most cases lead only to confusion. It is better to leave the index 1 for automatic recording of
changes, and use any of the other indexes available to the user (from 2 to 9) to expressly sample the binary
inputs, or just to mark our way through a program (more in section 2.4 - Using the Sequencer).
Perhaps the most common use of the user events is to make sure that the event buffer timer does not
overflow. Times are computed using an internal CMC counter, which overflows every 27 minutes (1677.7216
seconds to be totally precise). CM Engine is capable of handling this overflow by itself, as long as at least one
event is generated within those 27 minutes. Thus you must make sure that no period of 27 minutes can
elapse without event generation. The best form to achieve this is to use a timer in your application, and to
generate a user event every 15 minutes or so. When the buffer is later analyzed, these events are simply
discarded.
The event buffer is the core of CMC programming. Most CM Engine programs work by arranging the output
commands in such a way as to create a certain stream of events in the buffer, and later analyzing the
contents of the buffer to find out what happened and to extract the timings. In general, the more thought over
the output control is, the simpler the buffer analyzer can be built. In general, the buffer is cleared and
automatic logging enabled, if required, just before the events we are interested in take place.
1) Type: String describing what kind of event has been stored. It determines which subsystem in the
test device originated the event or whether it contains buffer-management information (empty,
overrun).
2) Time: Time-tag of the event.
3) Data: Event data, to be interpreted according to the Type.
4) Index: Identifier, to be interpreted according to the Type.
5) Optional: Additional information for some events.
The complete description of the fields and their contents can be found in the CM Engine Reference Manual.
The most common event and probably the most useful too is the one of type bin. When automatic logging is
enabled, these events record any changes in the binary inputs and in the analog outputs. To enable full
automatic logging, the command inp:buf:sam(bin,on) is used. If only the automatic recording of the
changes in the binary inputs is desired, the command inp:buf:sam(bin,bin)is used instead.
inp:buf:sam(bin,off)will turn off automatic event logging. Most times we will want to measure the time
elapsed between a change in the analog outputs and the test object reaction, detected as changes in the
binary inputs. For this, full automatic logging is required.
As an application of all the concepts described this far, the following example, written in VBA (Visual Basic for
Applications) will output a 3-phase overcurrent fault and wait until the relay trips. The trip will be detected by
the activation of the binary input 1. The control of the program flow will be done in the PC, and the contents of
the input buffer will later be analyzed to determine the exact time elapsed between the onset of the fault and
the reaction of the relay.
The VBA auxiliary functions used in this and other VBA programs will be provided in section 2.8.
Option Explicit
Sub OvcTest()
Dim engine As cmEngine.cmEngine ' Declare engine as object used for OLE Automation
Dim result As String ' Variable for the result string returned by Exec
Dim deviceList As String
Dim devId As Integer
engine.DevScanForNew (False)
deviceList = engine.DevGetList(lsAllAssociatedAny)
If ExtractParameter(3, deviceList) = "0" And ExtractParameter(4, deviceList) = "0" Then 'we have
a net-1 device
devId = Val(ExtractParameter(1, deviceList))
If Not engine.Associated(devId) Then
engine.DevAssociateAppend (devId)
End If
ElseIf deviceList <> "" Then
devId = Val(ExtractParameter(1, deviceList))
Else
GoTo ApplicationEnd
End If
engine.DevLock (devId)
Frequency = 50
IFault = 3
EndOfBuffer = False
Tripped = False
ReferenceTime = 0
TripTime = 0
Do
result = engine.Exec(devId, "inp:buf:get?")
' Extract measurement value out of result string
' (e.g. "1,<type>,<time>,<data>,<index>;").
BufType = ExtractParameter(2, result)
BufTime = Val(ExtractParameter(3, result))
BufData = ExtractParameter(4, result)
BufIndex = Val(ExtractParameter(5, result))
result = engine.DevUnlock(devId)
EngineError:
MsgBox Err.Description
Err.Clear
ApplicationEnd:
Set engine = Nothing
End Sub
It is easy to expand this simple program by providing a pre-fault state to let the relay stabilize before the fault
magnitudes are applied, and especially by defining a maximum fault time to limit the application of the fault
values to the relay: in this example, the values are applied until the binary input goes active. An example with
all these improvements will be provided in section 2.4.
The Sequencer allows tight control of the execution times, so it is possible to be sure that the times between
commands will be as we program it, with the same precision and resolution as the internal CMC timer. This is
very important for exact control of the analog outputs in those cases where the waveform and timing of the
applied waves must be carefully controlled.
There can be only one sequence in the CMC at any given time; if a different sequence is desired, the
previous sequence must be cleared and the new one uploaded to the CMC. During the uploading of the
sequence the commands are only stored, not executed. When the sequence is executed, its commands are
processed one by one in the same order as they have been uploaded. A sequence can be executed any
number of times once it is in memory.
The commands that are specific to the sequence are the following:
It is important to keep clearly in mind that, aside from the control commands, there is absolutely no difference
between a command issued during a sequence and a command issued outside of a sequence. There are no
special commands or hidden resets either at the beginning or at the end of the execution of a sequence. It is
perfectly possible to divide the work between in-sequence and out-of-sequence commands if required by the
application.
The sequence is executed autonomously in the CMC, so the PC is free to do other tasks. Normally, the main
program waits until the sequence is finished, then it extracts whatever data it needs from the sequence and
continues with the processing. Sometimes, however, it can be useful to leave the sequence running and
extract the data from the input buffer as it is generated. This is usually required only when very complex
trigger conditions are needed that cannot be implemented with the seq:wait() command, or when it is
feared that the input buffer might overflow unless continuously emptied. Using seq:status?(step) we can
find out which sequence block, or step, is being executed (please see section 2.4.2 for the way the sequence
blocks are delimited). When the step is 0, the sequence is stopped and we can proceed.
To get data out of a sequence, the best and practically the only way is to analyze the contents of the input
buffer. There are no variables in which to store results that can be read from outside the sequence, except for
the loop counter; but since this counter is decremented automatically with each seq:wait() command, it
is highly sensitive to changes in the sequence. It is therefore much better to write user-defined events into the
buffer, by means of the inp:buf:sam(bin,<index>) command with indexes from 2 to 9. These events
can be used as markers to know which branch did a sequence actually take, or as counters to know how
many times a given loop was executed, or for any other transfer of information from within the sequence to
the main program.
1) As a trigger condition, it allows combining a trigger condition with a timeout condition, and will jump to
different points in the program according to what happens first. The trigger condition can also be used
alone, in which case execution stops until the trigger condition is fulfilled. It is equally possible to use the
timeout alone, to implement a fixed wait in the sequence.
2) The seq:wait() command is used to divide the sequence in blocks of code. It is only possible to
transfer execution to the first command in a block. Each block ends with a seq:wait() command,
except the last one that ends with the seq:end command. The jump destinations in the seq:wait()
command must be considered relative to the block that is currently being executed – that is, the block
that ends with the seq:wait() command that is the origin of the jump. Therefore, a jump offset of 0 will
repeat the block (i.e., jump back in the sequence) while a jump offset of 1 will execute the next sequence
instruction after the seq:wait() command, since that would be the beginning of the next block of code.
Jump offsets that point before the beginning of the sequence will be taken as pointing to the first
instruction of the sequence, while jump offsets that point after the end of the sequence will stop
execution. The allowed offsets go from –127 to 127.
It is often necessary to jump to an instruction that is not the beginning of a block. In these cases, the
instruction must be made the first of a block, by inserting an empty seq:wait() command before it. This
command would have a timeout condition only, the timeout time would be 0, and the jump would be to the
instruction immediately following it; its syntax would then be seq:wait(0,1).
Please note that, if a new trigger condition is inserted in any point of the sequence, all jump destinations must
be revised to make sure they are still correct. Jumps across the newly inserted instruction will have to be
changed. It is therefore highly advisable to design the sequence on paper before implementing it in code; this
will greatly reduce the need for changes to the actual code and will increase the reliability of the sequence.
The following examples will provide an introduction to the wide possibilities the use of the sequencer allows.
Sub FaultInception()
Dim engine As cmEngine.cmEngine ' Declare engine as object used for OLE Automation
Dim result As String ' Variable for the result string returned by Exec
Dim deviceList As String
Dim devId As Integer
engine.DevScanForNew (False)
deviceList = engine.DevGetList(lsAllAssociatedAny)
engine.DevLock (devId)
Frequency = 50
InceptionAngle = 90 'The fault will strike at 90 degrees
PrefaultCycles = 100
IPreFault = 1
IFault = 5
FaultTime = 1 'We keep the fault for 1 second
Period = 1 / Frequency
DelayTime = (Period * PrefaultCycles) + (Period * (InceptionAngle / 360))
'The delay time now is equal to an entire number of cycles, plus the part
'of a cycle corresponding to the inception angle. This code assumes that the
'original phase of the wave was 0
result = engine.DevUnlock(devId)
GoTo ApplicationEnd
EngineError:
MsgBox Err.Description
Err.Clear
ApplicationEnd:
Set engine = Nothing
End Sub
Sub OvcTest()
Dim engine As cmEngine.cmEngine ' Declare engine as object used for OLE Automation
Dim result As String ' Variable for the result string returned by Exec
Dim deviceList As String
Dim devId As Integer
engine.DevScanForNew (False)
deviceList = engine.DevGetList(lsAllAssociatedAny)
engine.DevAssociateAppend (devId)
End If
ElseIf deviceList <> "" Then
devId = Val(ExtractParameter(1, deviceList))
Else
GoTo ApplicationEnd
End If
engine.DevLock (devId)
Frequency = 50
IFault = 3
MaxTFault = 5 'Maximum fault time is 5 seconds
EndOfBuffer = False
NoTrip = False
ReferenceTime = 0
TripTime = 0
Do
result = engine.Exec(devId, "inp:buf:get?")
' Extract measurement value out of result string
' (e.g. "1,<type>,<time>,<data>,<index>;").
BufType = ExtractParameter(2, result)
BufTime = Val(ExtractParameter(3, result))
BufData = ExtractParameter(4, result)
BufIndex = Val(ExtractParameter(5, result))
ReferenceTime = BufTime
ElseIf BufType = "bin" And BufIndex = NoTripEvent Then 'The relay did not trip
NoTrip = True
ElseIf BufType = "bin" And BufIndex = 1 Then
BinaryState = Val(BufData)
If (BinaryState And 1) <> 0 Then 'If Binary input 1 was active
TripTime = BufTime - ReferenceTime
TripDetected = True
End If
End If
Loop While NoTrip = False And TripDetected = False And EndOfBuffer = False
engine.DevUnlock (devId)
GoTo ApplicationEnd
EngineError:
MsgBox Err.Description
Err.Clear
ApplicationEnd:
Set engine = Nothing
End Sub
The registers where the count is stored are 24-bit wide. Therefore, the maximum value they can hold is
2^24 – 1, or 16777215. The next pulse causes an overflow, which is registered as an event in the input buffer
together with the time at which the event was registered and the count at that moment. That count will most
times be zero, but not always; due to the architecture of the extended input counters it may happen that the
entry in the buffer is not zero as expected but already has advanced to a value up to 15. The time in the
buffer is the time when the count in the event entry was reached, not the time of the zero crossing. The user
must calculate the zero-crossing time from the given data.
A counter may be configured as “master” or “slave” counter. By default, all counters are configured as
masters. To configure them as slaves, the inp:count:join command is used. This command defines a
master-slave relationship between two counters. The following rules are applicable:
For instance, to define the standard counter 3 as an slave of the high-speed counter 1 the following
command would be used: inp:count:join(ecount(1),bcount(3))
When a counter is defined as slave, it generates additional events. As was already mentioned, all counters
generate an overflow event when rolling over from 16777215 to 0. An slave counter will generate two
additional events in the following cases:
9 The slave’s counter first pulse after the master’s first pulse
The counter’s overflow is marked by the zcross keyword in the Optional field in the generated event. Any
counter events not so marked are generated by a slave counter, and must be processed together with the
master’s overflow events to determine the exact sequence of events.
The following example will display the functionality of the counter inputs. We will count a fixed number of
pulses in one of the counters, and will determine how many pulses in a second counter are detected during
that time. This configuration is useful when testing energy meters, where a fixed number of pulses
(corresponding to a given energy value) is detected from the meter under test, while pulses detected from a
reference meter during the same period will give us the reference value for evaluation. To count a given
number of pulses, we program the counter with an initial value such that the last of the desired pulses triggers
the overflow event. The initial value to be programmed into the counter would then be: COUNTER_MAX –
DESIRED_PULSES + 1. In the example we will count eight pulses; therefore, the initial value of the counter
will be 16777215 – 8 + 1 = 16777208.
Please note that the counters are not self-reloading, and after the overflow the initial value will be lost and the
counter will continue counting from 1. We will use the CMC’s own voltage outputs to create the pulses.
inp:bin(1:1):def(10)
inp:count:get?(bcount(1))
inp:count:get?(bcount(2))
; Run it
seq:exec
#wait 2
#loop 6 inp:buf:get?
Lines 4 to 9 are the events extracted from the input buffer. The following graphic will help to relate the
sequence of pulses to the events:
Counter 2 1 2 3 4 5 6 7 8 9 10 11 11 12 13 14 15 16 17 18 19
At the beginning of the program, the sys:test? command may be used to make sure our test device is
operating correctly. It is sufficient to use this command once, when the program starts. The sys:status?
command though will inform us of errors or anomalies that happen during program execution, such as output
overload, output switch-off due to overtemperature, communication errors, etc. Since the CMC will never
initiate transmission, it must be polled by periodically calling this command to make sure that no anomalies
are appearing during test.
The way to implement such a feature depends entirely on the operating system, on which our program is
running, and on the complexity we want to give to the program itself. The cleanest way to implement this
feature is to assign it to a separate process or thread. If this is not convenient, a timer-invoked routine can
also be a good way to poll the CMC. The simplest way is to include the polling in a program loop – if
sequences are used, the loop where we wait for the sequence to end is a very common place to put it.
This last way has the inconvenience that it mixes what are really two independent tasks in the same code,
and it makes the code harder to debug and to understand. On the other hand, it allows knowing exactly in
which part of the test the error condition happened; this information may be very useful to correct the
problem.
The status registers are organized in a two-level structure. The first level is a 32-bit register, called “Primary
Register”, which is returned by a call to sys:status? without parameters. Each bit in this register is the
logic OR of all bits in a second-level (“Secondary”) 32-bit register that holds the actual error codes. The
secondary registers are accessed by passing their number as parameter to the sys:status? command.
The method of operation is to read the primary status register and check that it is 0. If it is, no errors are
detected anywhere and there is no need to read further. If any bit is 1, then the corresponding secondary
register should be read to find out the exact reason for the error.
For example:
sys:status?
Result : 1,0; ‘No errors
. . . . . . . . . . . . . . . . . . . . . . .
sys:status?
Result : 1,8; ‘Secondary register 3 holds errors
sys:status?(3)
Result : 1,5; ‘i(1:1) and i(1:3) are in overload
In this case, you may choose to cancel the test, since an overload makes the results unreliable, or finish it
and record the overload condition together with the test’s results. Please note that no user action is required
in any of the error conditions; the CMC’s firmware will take appropriate action for all critical conditions. For
example, if overtemperature is detected at the analog outputs, the generators will be turned off automatically
while the condition persists, and restored to operation after the generators have cooled themselves. The user
will know of this condition through the secondary status registers 4 and 5, but should (and in fact can) take no
action.
In this section we will describe the CMC256-6, as the CMC256-3 is less complex due to the lack of the
second current triple.
2.7.1 Amplifiers
It is important to note that, upon start-up, the CMC256 is fully compatible with any software written for the
CMC156. When the CM Engine initializes, all inputs are configured as potential-free binary inputs. The fourth
voltage and the second current triple are left undefined for maximum software compatibility. Therefore,
programs expecting the CMC156 configuration will require no modification. Only when we wish to take
advantage of the CMC256 unique features do we need to modify the existing software.
The first change is noticed when we request the output configuration; in a CMC256-6, the returned string will
look like this: 1,4,1/3/i,2/3/i,3/3/e,4/3/e,5/1/i,6/3/i;
As we see, there are two new internal amplifiers added after the previously existing internal and external
th
amplifiers. The single-phase internal amplifier, number 5, is the 4 voltage output, while number 6 is the
second current triple.
These amplifiers can be defined in the standard way, and used as independent triples; but the full power of
the CMC256 is reached through the use of amplifier configurations. Detailed descriptions about available
amplifier configurations for a test set can be found in the hardware manual.
amp:cfg?
Result : 1,11;
amp:cfg?(1)
Result : 1,9,3,3.000000e+002,8.500000e+001,8.500000e+001,1.000000e+000,std,0,amp_no,1;
amp:cfg?(2)
Result : 1,10,1,3.000000e+002,1.500000e+002,7.500000e+001,2.000000e+000,std,14,amp_no,5;
amp:cfg?(3)
Result : 1,11,3,3.000000e+002,5.000000e+001,7.500000e+001,6.600000e-001,zero,13,amp_no,1,amp_no,5;
amp:cfg?(4)
Result : 1,12,1,6.000000e+002,1.500000e+002,1.500000e+002,1.000000e+000,ser13,4,amp_no,1;
amp:cfg?(5)
Result : 1,13,2,6.000000e+002,1.500000e+002,1.500000e+002,1.000000e+000,ser2,17,amp_no,1,amp_no,5;
amp:cfg?(6)
Result : 1,14,3,1.250000e+001,7.000000e+001,7.500000e+000,1.000000e+001,std,18,amp_no,2;
amp:cfg?(7)
Result : 1,15,3,1.250000e+001,7.000000e+001,7.500000e+000,1.000000e+001,std,19,amp_no,6;
amp:cfg?(8)
Result : 1,16,3,2.500000e+001,1.400000e+002,1.500000e+001,1.000000e+001,par3,5,amp_no,2,amp_no,6;
amp:cfg?(9)
Result : 1,17,1,7.500000e+001,4.200000e+002,4.500000e+001,1.000000e+001,par1,7,amp_no,2,amp_no,6;
amp:cfg?(10)
Result : 1,18,1,1.250000e+001,2.800000e+002,7.500000e+000,4.000000e+001,ser4,10,amp_no,2,amp_no,6;
amp:cfg?(11)
Result :
1,19,1,3.750000e+001,4.200000e+002,2.250000e+001,2.000000e+001,parser,11,amp_no,2,amp_no,6;
amp:cfg?(11)
Result :
1,19,1,3.750000e+001,4.200000e+002,2.250000e+001,2.000000e+001,parser,11,amp_no,2,amp_no,6;
where we see the full range of capabilities that the CMC256-6 hardware offers us.
There are some additional connection modes for the CMC256-6, as follows:
Please note that configuration 8 is the only way to set both current triples in parallel to obtain a three-phase,
25A current triple. The method described for the CMA156 in section 2.2.1.1.2 is not applicable for the
CMC256.
Configuration 3 creates an amplifier with 4 voltages, three of which are accessible to the user while the fourth
outputs the automatically-calculated resultant of the other three. It is worth noting that the resultant is
calculated with instantaneous values, and is therefore accurate for whatever wave form is being output.
Notice: CMC356 test sets needs the ELT-1 option to have the DC auxiliary output available.
The analog output can be programmed to be active with a preset value when the CMC256 is powered-up.
That value will be output immediately even when no PC is attached to the CMC. To set this value, the user
would use the command out:aux:def(), passing the desired power-on value as an argument. For
instance, to set the CMC so that 48V are output on power-up, we would issue the following command:
out:aux:def(48). The command has no effect until the CMC is powered off and on again, but we can
query the power-on value with the out:aux:def? command.
At any time we can set the DC value with the out:aux:a() command. This command has immediate effect
and will set the output to the value that we pass as parameter. The complementary command out:aux:a?
queries the status and characteristics of the DC auxiliary output. It returns the current status as a string (“on”
or “off”), plus the value being output and the maximum value that can be output. Both the out:aux:def()
and the out:aux:a() commands will fail if values higher than the maximum possible are passed to them.
For example, assuming we wish to have the CMC256 output 110VDC upon being powered-up, we would
program it like follows:
out:aux:def(110)
out:aux:def?
Result : 1,1.100000E+002;
The next time we power up the CMC, it would immediately output 110VDC through the DC auxiliary output
without the need for intervention from us. We can make sure that it is doing so by querying the status of the
auxiliary output:
out:aux:a?
Result : 1,on,1.099566E+002,2.640000E+002;
We see here that the output is on, outputting the programmed value, and that the maximum value the source
can output is 264V. We can then use the out:aux:a() command to change the value if we want to.
Please note that it is not possible to program negative values in the DC auxiliary output. The acceptable
range is from 0 to the maximum value returned by the out:aux:a()command.
a RMS
a Peak values
a Phase
a Frequency
a Power
a Sum
In binary mode, the inputs can work as potential-free or potential-sensing inputs, as described before for the
CMC156. In analog mode, they can be configured as voltage or current inputs. Please note that the hardware
can measure only voltages; in the case of current inputs, the hardware needs a current clamp or a shunt
resistor, whose ratio is used as a configuration parameter of the input.
Notice: CMC356 test sets needs the ELT-1 option to have the AC analog inputs available.
To configure an analog input, we must provide the input type, the desired range and, for current inputs, the
CT ratio in Volts / Amp. For instance, the following commands:
inp:ana(1,3,5):def(v,120)
inp:ana(2,4,6):def(i, 10, 1)
will program inputs 1, 3 and 5 as voltage inputs with a range of 120V, and inputs 2, 4 and 6 as current inputs
with a range of 10V and a transformer ratio of 1V/A (allowing us to measure up to 10A). In fact, in a CMC256
the range set for the voltage inputs will be 650V, but it is still worth the effort to adjust the range to the
expected inputs, to take advantage of future improvements without any changes in the code.
Once we have defined the inputs as analog, we can start measuring tasks on them. The way to proceed is
always the same: the command to set the task needs one or more configuration parameters, usually the
integration time for the measurement; it returns a handle that we later pass to the inp:ana:get?()
command to obtain the results of the task.
Each result comes with an integer that contains its validity flags. These flags are as follows:
Bit 3: Overload
This means that the signal at the input is higher than the maximum for the current range and, as a result, the
readings will be wrong.
inp:ana(1,3,5):def(v,120)
inp:ana(2,4,6):def(i,10,1)
inp:ana:cal(ac)
inp:ana(1,2,3,4,5,6):rms?(1.0)
Result : 1,1;
inp:ana(1,2,3,4,5,6):peak?(1.0)
Result : 1,2;
inp:ana(1):freq?(50, 1)
Result : 1,3;
inp:ana(1,2,3,4,5,6):phase?(1.0)
Result : 1,4;
inp:ana(1,2,3,4,5,6):power?(1.0)
Result : 1,5;
inp:ana(1,3,5):sum?(1.0)
Result : 1,6;
inp:ana(1,3,5):diff?(1.0)
Result : 1,7;
inp:ana:sync
We have then defined three voltage and three current inputs, set their parameters, re-calibrated them after
the change in ranges (convenient but not mandatory) and started measuring values in them. Note that one
single command creates one single task, regardless of the number of inputs that form the input list.
After issuing all the commands, we have the following tasks running:
For a complete description of the commands, including the values that will be returned by inp:ana:get?(),
please look them up in the CM Engine Reference Manual.
The inp:ana:sync command ensures that all measuring tasks with the same integration time are
synchronized so the results are obtained simultaneously and are applicable to the same batch of samples. If
this command is not used, each task begins getting results the moment it is started, and there would be an
unavoidable time shift in the results. In this case, all tasks would be synchronized except the frequency
measurement, which has a number of periods instead of a time as integration parameter.
The tasks remain active until they are removed with the inp:ana:clr() command. The command allows
removal of one task or of all active tasks. If only one task is removed, the rest is not affected.
To finish the example, let’s get the results of some of the measurement tasks we have started:
inp:ana:get?(1)
Result :
1,4.967285e+001,0,1.198608e+000,0,1.319092e+000,0,1.146973e+000,0,4.968555e+001,0,9.019012e-
001,0,4.969406e-001,0,1.006195e+000,0,4.969238e+001,0, 1.081421e+000,0,5.218201e-001,0,9.777374e-
001,0;
This command returns the readings of the RMS measurement task. The readings are in the same order as
the inputs appeared in the input list when the command was issued. For each input in the list, two readings
are provided, each with its validity flags: the first reading is the AC RMS value and the second reading is the
DC component. This way, we see that the first voltage is approximately 50V with 1.19V of DC component; the
first current (input 2) is 1.31A with 1.14A of DC component, and so forth.
textpos1 = 0
Counter = 0
While Counter < (ParNumber - 1)
textpos1 = InStr(textpos1 + 1, CmdResult, ",", 0)
If ((textpos1 = 0) Or (textpos1 = Null)) Then 'We cannot find a comma that we need,
ExtractParameter = "" 'so the parameter does not exist in this
string
Exit Function
End If
Counter = Counter + 1
Wend
'If we leave the loop, then the comma is found. Let's find the closing character
3 Interface Functions
As already described in the chapter "Typical program sequence", you can use the CM Engine's interface
functions in your program.
First, the following chapter supplies a quick overview of all error codes that the CM Engine's interface may
cause. This is followed by a detailed description of every interface function, the error codes a specific function
may cause and the reasons are explained in this description. Each function description also contains an entry
called „Compatibility“ which indicates for which platforms the function is available.
Furthermore, you can get a more practical approach to the use of the interface functions if you read the
source code examples like BATCHER!, which are supplied with the CM Engine.
The error codes CMERR_XXX are partitioned into three groups: common Engine errors, file input/output
errors and errors from the interface of Windows 95 or Windows NT (Win32 API). Accordingly, the error
numbers are partitioned into three groups: CM_ENG, CM_FIL and CM_API.
If an error of the groups CM_FIL or CM_API occurs, the function GetError() returns an extended error
code in addition to the CMERR error code. If the CMERR error is of the group CM_FIL, the extended error
code is equivalent to the DOS error code (e.g. 2 = "file not found"). If the CMERR error code belongs to the
group CM_API, the extended error code is the value returned by the last call to a Win32-API function or a call
to GetLastError(). The error codes of the Win32-API are defined like the DOS error codes and you can
find them in the Win32 documentation. Use the Win32 function FormatMessage()) to translate the API error
code into a text message.
An interface function throws an exception it indicates that one or more errors occurred; thus the error queue
that stores the errors can contain one or more errors. That's the reason why you always have to call the
function CMGetError() in a loop until the error code returned is zero to get all the errors out of the queue.
All possible error codes returned by the CM Engine interface are listed in the following table for an overview:
Example:
LogNew() is called and returns FALSE. GetError() returns CMERR_FILE_LOG and an extended error
code of 5. Here the extended error code supplied with the log file error is equivalent to the DOS error code.
An extended error code of 5 indicates that the access to a file was denied.
The reasons for a license related error are explained in the following table:
Error code Explanation
CMERR_LICENSE_FILE CM Engine cannot find the license file "OMICRON.LIC".
CMERR_LICENSE_FORMAT The Engine found the license file but the required license number has
an invalid format.
CMERR_NO_LICENSE The Engine started up correctly, a CMDevScanForNew() was
executed, but you tried to lock a CMC with no valid license number in
the license file.
The other error codes that may only be caused by specific interface functions are listed with the description of
the function in section "Interface Functions".
The error codes that may be caused by the interface function Exec() depend on the string command that is
executed; thus these error codes are listed with the description of the string commands in chapter "This
section describes the CM Engine command set of string commands. The string commands are listed in
groups of related commands.String command reference".
3.4.1 AddRegDev
3.4.2 Associated
3.4.3 AssociationMode
3.4.4 DevAssociateAppend
3.4.5 DevAssociateAppendSpecific
3.4.6 DevAssociationCount
3.4.7 DevAssociationInfo
3.4.8 DevAssosciationRequest
3.4.9 DevAssosiationRequestCancel
3.4.10 DevAssociationTime
3.4.11 DevDisassociate
3.4.12 DevDisassociateSpecific
3.4.13 DeviceAddress
3.4.14 DeviceType
3.4.15 FriendlyName
3.4.16 GetDevIDbyIPAddress
3.4.17 GetOfflineCfg
3.4.18 GetOfflineCfg2
3.4.19 SetLicInfo
3.4.20 ResLock
ResGroup
ResGroup can have the following values:
rgAnaOut analog outputs
rgAuxDC
rgBinInp
rgBinOut
rgCounter
rgDCInp
rgFirst
rgGPS
rgInternalCmds
rgInvalid
rgJustKeepConn
rgLast
rgMeasDSP
rgMultiInp
rgSampleBuf
rgSeq
rgTransOut
ResIndex
3.4.21 ResUnlock
3.4.22 ResGetList
3.4.23 LanguageForMessages
3.4.24 ParalellPort
3.4.25 IPAddress
3.4.26 SerialNumber
3.4.27 MaxAssociationTime
3.4.28 RegDevCount
3.4.29 RegDevItemIPAddress
3.4.30 RegDevItemIndex
3.4.31 RemoveRegDev
3.4.32 MinReqImgVersion
3.4.33 RemoveDevice
3.4.34 ImgDevTypePrefix
3.4.35 DevGetList
3.4.36 DevLock
You can get a list of the CMCs that are known to the CM Engine and that are not locked now
with the function DevGetList(IsUnlocked) (see description of that command).
Parameters DevId
The parameter DevId is long value that contains a device ID number (e.g. 1). To lock all
unlocked CMCs use 0 for DevId.
Please note You must lock a device before you can send string commands to it using Exec() !
When you do not need the communication channel to the CMC anymore, you should release
it with the function DevUnlock() described below.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_CMC_ALREADY_LOCKED The CMC is already locked
CMERR_CMC_NOT_FOUND The CMC was not found
CMERR_FILE_LOG Log file related problem (detailed information is
provided with the extended API error code)
CMERR_INVALID_INT An integer value in device ID list is invalid
CMERR_LOCK_UNLOCK_PORT Port could not be locked
CMERR_NO_LICENSE You tried to lock a CMC without having a CM
Engine license for this CMC
3.4.37 DevScanForNew
3.4.38 DevUnlock
3.4.39 Exec
Command
The zero terminated command string is passed in this parameter. The structure of a
command string is explained in chapter "String Commands".
Return Value String value that contains the result from the CMC.
Please note Before you can send string commands to a CMC, you must reserve this device for your
application program with the function DevLock() described above!
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_CMC_NOT_FOUND The CMC was not found
CMERR_CMC_NOT_LOCKED The CMC is not locked to the application
CMERR_FILE_LOG Log file related problem (detailed information is
provided with the extended API error code)
CMERR_INVALID_INT The integer value in DevId is invalid
CMERR_NO_LOCKED_CMC When "0" is used as DevId: there is no locked
CMC that can receive commands
CMERR_SYNTAX Syntax error in string Command
CMERR_PARSER_STACK_OVFL or An expression is too complex or too long for the
CMERR_PUSHBACK_BUF_OVFL or parser
CMERR_TOKEN_BUF_OVFL
Example Exec(1,"out:off") ⇒ switch OFF all analog outputs of the CMC with DevId 1.
On every string command with a question mark, e.g., "sys:status?", the function Exec() returns an answer
that is a zero terminated string. The answer of a CMC starts with its device number and ends with a
semicolon.
Example 1
Task: Get the number of analog and binary inputs of device 1.
Command: Exec(1,"inp:cfg?")
Answer: "1, 1, 1, 10, 7;"
Device number 1 returns the values 1, 1, 10 and 7. It has one analog voltage input, one
analog current input and 10 binary inputs, and the I/O board’s version is 7.
3.4.40 GetStatusText
Mask:
Bit mask you received with the above register number from a preceding sys:status? string
command.
Return Value String value for the status message.
3.4.41 LogAppend
3.4.42 LogGetInfo
Parameters Level:
This buffer returns the current logging level (see CMLogSetLevel()).
Filename:
Buffer for the file name of the log file. The file name is returned as a zero terminated string.
3.4.43 LogNew
3.4.44 LogSetLevel
The logging level defines which and how much information is to be written into the log file:
In log level 1 the device list, the command string and the answer string of every string
command will be written into the log file.
In logging level 2, much of the Engine-internal information is additionally written into the log
file. This information is not useful for the application programmer but is required for
diagnostic purposes.
The logging level 2 should not normally be used by an application for the CM Engine since it
writes a large amount of data to the hard disk and thus could slow down the working speed of
the application.
Parameters Level:
The new log level to set.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter byLevel is invalid
3.4.45 LogWrite
3.4.46 OutUserApp
3.4.47 Version
signals have to be played back they have to be downloaded to the CMC while the playback is running. This
functionality is available through the RealTime… functions of the CM Engine interface. All functions in this
group are declared in CMEngFuncsEx.h.
The number of samples per generator in a block is the return value of CMRealTimeBegin, the number of
blocks that fit into the CMC memory is returned in the pnBlocks parameter of this function.
For a CMC156 with 3 voltage and 3 current generators in use you will get 7 blocks with 2048 samples per
generator in one block:
CMC memory
Each block contains
12288 samples
Block Block Block Block Block Block Block (6 generators x 2048
0 1 2 3 4 5 6 samples per generator)
playback pointer
When the playback is started, the playback pointer moves from sample to sample with the specified sampling
rate. When it reaches the end of the CMC memory (in this example the last sample of block 6), it jumps back
to the beginning of the CMC memory again. Until then the application must have replaced the data of block 0
with the data of block 7 (the next one after block 6). Actually block 0 can already be overwritten as soon as
the playback pointer reaches the first sample of block 1:
CMC memory
playback pointer
The faster the playback pointer moves (= the higher the sampling rate is), the less time is available to provide
the data. The download of a data block of course needs some time (depends on the PC hardware and CMC).
It might be useful to arrange the data in the necessary block structure before the download begins, so that no
data processing during download is needed.
The status of the playback can be queried with CMRealTimeStatus. In plStatus it returns the number of
samples in the CMC memory which are not yet played back. The difference between the maximum number
of samples in the CMC memory and this value is the number of samples, which can be overwritten. If this
number is bigger than the block size, a new block can be downloaded:
The CMC can check for data underflow (the PC does not download data blocks fast enough – see parameter
bCheckGen in function RealTimeWrite). The result of this check is also returned by RealTimeStatus.
BlockSize = RealTimeBegin(…);
The mapping of the channels in a data block to the CMC generators is done with RealTimeWrite(). Each
call to RealTimeWrite() maps one channel to one CMC generator and downloads the necessary samples
to the CMC.
The example in the following picture uses a data block containing 5 channels with 3 blocks per channel.
Channel 4 contains the data for generator I1, channel 1 those for generator I2, channels 0, 2 and 3 are
currently not used for playback:
Generator 0 1 2 3 4 5
CMC 56/156 V1 V2 V3 I1 I2 I3
CMC256/25 V1 V2 V3 I1A I2A I3A
6plus/356
Generator 6 7 8 9 10 11
CMC 56/156 Gen.out 7 Gen.out 8 Gen.out 9 Gen.out 10 Gen.out 11 Gen.out 12
CMC256/25 LL out 1 LL out 2 LL out 3 LL out 4 LL out 5 LL out 6
6plus/356
Generator 12 13 14 15 16 17
CMC 56/156 n/a n/a n/a n/a n/a n/a
CMC256/25 V4 n/a n/a I1B I2B I3B
6plus/356
Timing:
The CMC does not know when to stop the playback. It continues until it receives a out:ana:off command,
even if no more samples are downloaded, in which case it would play back garbage or already played back
data, which is not yet overwritten with new data. So it is up to the application to switch the outputs off as soon
as no more data is available. The easiest way to do this is to use a sequence. Here is an example how this
could look like:
seq:begin
out:ana:v(…):a(…)
out:ana:i(…):a(…)
out:ana:on
seq:wait(<total playback duration in seconds>, 1)
out:ana:off
seq:end
seq:exec
loop
if one or more blocks free (RealTimeStatus)
download next block(s) (RealTimeWrite)
endif
until all blocks downloaded
Wait until playback is finished (i.e. seq:status?(step) returns 0)
Bring CMC back to normal operation (RealTimeEnd)
Please note that the maximum time for the seq:wait command is 838 seconds. If you have longer signals
you have to use several seq:wait commands or use a loop.
These functions have an experimental status and might change in future releases of CM Engine.
3.4.48.1 RealTimeBegin
dSampleRate:
Sampling rate of the transient signal to be played back (in samples/second). Must be > 0 and
≤ 10000.
nUseVs:
Number of voltage triples to be used.
nUseIs:
pnBlocks:
Pointer to a buffer which receives the number of blocks that fit into CMC memory.
Please note nUseVs and nUseIs do not affect the generator indices in any way. They are only used for
block size calculation.
Return Value The return value is the size of one block (in samples) or zero if the function failed.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_NOT_SUPPORTED The connected CMC does not support this
function.
3.4.48.2 RealTimeEnd
3.4.48.3 RealTimeWrite
nBlockNo:
Block number in data block
pnBlock:
Data block in 16 bit signed integer format
wChannel:
Index of channel in data block to transfer
wNumChls:
Number of channels in data block
bCheckGen:
Set to TRUE if this CMC generator should be checked for underflow of data
Return Value Boolean value that indicates if the command was executed without errors (TRUE) or with
erors (FALSE).
3.4.48.4 RealTimeStatus
plStatus:
3.4.48.5 RealtimeSetCheckChl
4 String Commands
The following chapter explains everything that is important to assemble string commands for the CM Engine:
syntax rules of the string commands, parameter types used in string commands, symbols used in string
commands and the syntax and the usage of every string command.
The following symbols are used for notation purposes only (do not insert them into your string commands):
<...> parameters are enclosed like this, e.g., <filename>.
[ ] the command, parameter or keyword in brackets is optional.
| the "pipe sign" between keywords states that you can either use the keyword to the left or the
keyword to the right of this sign.
The special symbols used by the CM Engine in the string answers returned for string commands containing a
question mark are explained with the Exec() interface function.
• Any command consists of sub-commands that are separated by colons, e.g., out:ana:on.
• The string commands are not case sensitive (command strings are accepted no matter if they are
capitalized or not).
• Some of the string commands have a trailing question mark, e.g., sys:cfg?. The question mark must
be appended to the command without spaces. The "?" states that the command returns an answer in a
zero terminated string.
• After the keyword of a sub-command like wav or route there are possibly some additional command
parameters. A pair of parentheses encloses all these parameters.
Some sub-commands can be written with or without parameters. If the parameters are omitted, the
parentheses are omitted too.
Example: sys:status?
sys:status?(1)
• The sub-commands a, f, p, and wav from the out command tree can be connected with a semicolon
instead of the colon you normally use to separate two sub-commands. The difference is that after a
colon, you must append a sub-command that is in a lower hierarchical position in the command tree,
whereas after a semicolon, you can proceed at the same level of the command tree's hierarchy. This
feature was introduced to reduce the number of string commands needed for carrying out these
frequent tasks.
• There are sub-commands that can be omitted when building a string command. These subcommands
are used very often and are thus defined as default sub-commands to shorten the string commands.
Optional parts are shown in square brackets [] in the command tree.
In a string command for signal output (out: ...) you may omit the optional sub-commands ana or
sig(1).
If there is no ana or bin sub-command in the string command, ana is assumed. If there is no sig(1) or
sig(2) sub-command in the string command, sig(1) is assumed.
• Spaces are ignored between the sub-commands and their parameters, but do not insert spaces within
keywords of sub-commands, within keywords of parameters or within numerical parameters.
Overview of the parameter types for the parameters used in CM Engine string commands:
31 31
<integer> Integer number between -2 and 2 -1 (the precise limits of an integer parameter are
described with each command). This type corresponds to a 32 bit signed integer.
Normally you write the number in decimal notation.
with a prefix "0" (zero) it is octal,
with a prefix "0x" (zero-x) it is hexadecimal and
with a prefix "0b" (zero-b) it is binary.
The hexadecimal numbers are not case sensitive. All numbers can be signed or
unsigned.
<integer>,<integer>, ...
<integer>:<integer>
This parameter type is used to define the generators in an out:ana: ... command:
1 first generator triple.
1,2 first and second generator triple.
1:3 third generator of first generator triple.
1:3,2:1 third generator of first generator triple and
first generator of second generator triple.
<float> Whole or real number, with or without exponent, signed or unsigned; range is
±1.7E±308. This type corresponds to an IEEE floating point type with double precision.
Format of real number:
[+-] integer_digits "." fraction_digits [eE [+-] exponent_digits]
[+-] integer_digits "." [fraction_digits] [eE [+-] exponent_digits]
[+-] [integer_digits] "." fraction_digits [eE [+-] exponent_digits]
4.4.1.1 sys:reset
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_CALDATA_CHECKSUM Calibration data checksum mismatch
CMERR_DOWNLOAD Error downloading data to CMC
CMERR_DOWNLOAD_FILE Problem downloading data from file to CMC
(detailed information is provided with the
extended API error code)
CMERR_DOWNLOAD_NO_FW Problem downloading the firmware (detailed
information is provided with the extended API
error code)
CMERR_IN_SEQ_MODE Command not allowed within sequence
If you specify the sys:test? command with an additional filename, a report file with various
system parameters (all serial numbers, the tolerances of all generators etc.) is created.
Parameter <filename>:
Name of the report file. This parameter is optional.
Please note After a sys:test? a CMC is in the power-on state (same as after sys:reset).
Answer Returns a string which is the shortcut for a diagnostic message:
returned string diagnostic message
ok no errors were detected
v1 voltage at internal voltage generator 1 is outside of tolerance limits
v2 voltage at internal voltage generator 2 is outside of tolerance limits
v3 voltage at internal voltage generator 3 is outside of tolerance limits
vtemp temperature of internal voltage generators is above the limit
i1 current at internal current generator 1 is outside of tolerance limits
i2 current at internal current generator 2 is outside of tolerance limits
i3 current at internal current generator 3 is outside of tolerance limits
itemp temperature of internal current generators is above the limit
ad errors occurred on AD/DA converters or AD/DA board is not present
bin errors occurred on at least one of the binary inputs or an input has
voltage above 250 Volts
The answer string can consist of one or more of the above strings. If any combination of v1,
v2, v3, i1, i2, i3 is returned all commands except the sys commands are disabled and return
CMERR_HW_OUT_OF_TOL.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_PROT_FILE There is a problem with the given report file
(detailed information is provided with the
extended API error code)
Example The string command sys:test? is sent to CMC #1 and the following string is returned:
"1,v2,ad;". This means that in CMC #1 the voltage at internal voltage generator 2 is outside of
tolerance limits and errors occurred on the AD/DA converters.
Answer The command causes a string that contains the following data:
Keyword Returned data
type CMC model information string ("CMC 56" or "CMC151") and model number.
Answer is e.g. "1,CMC 56,0;": Device 1 is a CMC 56 with model number 0.
ser Serial number of the device.
Answer is e.g. "1, DA345D; ": Device 1 has the serial number DA345D.
hard Version number and clock frequency of signal processor board.
Answer is e.g. "1, 5, 3.300000000E+007;": Device 1 has a signal processor
board version 5 with a clock frequency of 33 MHz.
firm Version numbers of the firmware (monitor and overlay programs).
Answer is e.g. “1, 4.20, 4.20;“: Device 1 has a monitor program with version
number 4.20 and an overlay program with version number 4.20.
cal Date of last factory calibration.
Answer is e.g. “1,2000,3,4”: Device 1 was last calibrated on March 4, 2000.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
There is a primary status register. Every bit of the 32 bits of this primary status register (0 to 31) has a related
secondary status register (32 bits too).
The bits of a secondary status register are combined with a logical OR and this result is stored in the related
bit of the primary status register.
Thus every bit of a primary status register shows a summary of the related bits in the secondary status
register. If at least one of the bits in the secondary register is set, the related bit in the primary status register
is set too. Currently only the 10 secondary status registers 0 to 9 exist.
Example:
Bit 2 in the primary status register indicates if there is an overload on one or more voltage generators. The
bit(s) set in the secondary status register 2 show(s) which generator has an overload.
The following tables list the bits of the status registers and their meanings. All bits for which no meaning is
given are reserved by OMICRON for future enhancements.
1Should not occur in normal operation mode. If it occurs all commands except sys:status? are disabled. Switch the CMC OFF and ON
again to get back to normal operation mode (a reset with "sys:reset" does not help).
4.4.1.6 sys:goose:cfg(<filename>)
4.4.1.7 sys:goose:cfg?(<filename>)
Parameter <filename>:
Name of the file where the current GOOSE configuration will be stored.
Answer Returns a string which is the shortcut for a diagnostic message:
returned string diagnostic message
ok The CMC contained a GOOSE configuration which was stored in
<filename>.
noconfigfile The CMC did not contain a GOOSE configuration file, thus no file could
be retrieved.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_NOT_SUPPORTED Command is not supported on this device
CMERR_GOOSE_CFG_GET_FAILED Could not retrieve GOOSE configuration
The output command tree is divided into an analog part out:ana:... for the output of analog signals and a
binary part out:bin:... for the output of binary signals. Furthermore there is a command out:cfg? related to all
outputs.
The <out_module_idx> parameter contained in many of the binary output commands is a number (starting at
1) identifying a “virtual” output module. “Virtual” means that it not only stands for real output modules of the
CMB but also all other kinds of outputs like the relay outputs on the front panel of a CMC or the transistor
outputs on the EXIF/EXTOP board of a CMC. The exact details about this virtual module can be retrieved by
using the out:bin(<out_module_idx>):cfg? command. Whenever there is a CMC with a connected CMB
the available virtual output modules consist of the CMC internal relay outputs (accounting for one virtual
module), the CMC internal transistor outputs (a second virtual module) and the output modules of the CMB.
This makes these new/modified commands a complete replacement for the original commands thus allowing
the handling of all outputs by a single command set.
For the analog outputs, the CM Engine uses an output concept that maps logical generators to physical
outputs. A logical generator outputs a signal, which can consist of two signal components. Three logical
generators are combined to a generator triple (or just triple), which is mapped (or routed) to a physical
amplifier with three outputs. With the output commands out:... you can specify all parameters for the logical
generators (amplitude, phase, frequency, waveform of signal components and the mix-mode that defines the
way the signal components are superimposed).
In the output command tree the parameter type <triple_list_type> specifies the logical generator(s) or triple(s)
the sub-commands are applied.
Examples:
Command Applies to the following generators:
as parameter in words
st
out:ana:v(1): ... v(1) 1 generator triple v(1), i.e. the voltage generators v(1:1), v(1:2)
and v(1:3)
st nd
out:ana:v(2:1): ... v(2:1) 1 generator in 2 voltage triple
st rd
out:ana:v(1,3): ... v(1,3) 1 and 3 triple of the voltage generators
nd st rd rd
out:ana:i(1:2,3:3): ... i(1:2, 3:3) 2 generator in the 1 triple and 3 generator in 3 triple of the
current generators
With the amplifier commands amp:... you can specify the amplifier parameters and the routing of the logical
generators to the physical outputs (= amplifiers). Because there is a predefined routing of the logical
generators to the physical outputs, in most cases you don't need to use amp:... commands. After startup of
the CM Engine the following amplifier routings are predefined:
Logical generator triple Generators in this triple Predefined routing to outputs ...
v(1) v(1:1), v(1:2), v(1:3) outputs "Voltage 1,2,3" on front panel of CMC
i(1) i(1:1), i(1:2), i(1:3) outputs "Current 1,2,3" on front panel of CMC
An analog voltage signal or an analog current signal consists of either one signal component or a
superposition of two signal components. The way of superposition can be defined with the mix-command
(see below). After the startup of CM Engine the mix-mode is set to sig(1) (signal component 1 only). In the
following description of output string commands the sub-command sig(<no>) selects either the first signal
component sig(1) or the second signal component sig(1) of the generator(s) defined in parameter
<generator_list>.
In CM Engine there are two different ways to calculate new values for amplitude, frequency and phase. Every
parameter amplitude, frequency and phase has two related buffers; a buffer stores absolute values and the
other stores step values (6 buffers). If you use the commands to set amplitude, frequency and phase without
the keyword step the new values are interpreted as absolute values and written directly into the parameter's
absolute buffer. When you add the optional keyword step to the command the new values are written into the
parameter's step buffer. Then the command out:ana:step adds the step buffer's value to the absolute buffer.
The next on command takes the values in the absolute buffers for the new output signal.
You can also write a negative value into the step buffer for stepwise subtractions with step. The initial value
in all step buffers is zero.
When you assemble your own string commands, you can omit the sub-commands ana and sig(1) used in
the following command descriptions, because they are default sub-commands as described earlier.
Function This command defines the amplitude for the selected signal component of all generators in
<generator_list>.
Description Whether the parameter <amplitude> is interpreted as RMS value or as peak value of the
amplitude depends on the current waveform of this signal component. This is specified with
the waveform (see wav-command).
You can define a negative amplitude to mirror the current waveform at the time axis.
Use the command amp:def?(<amp_no>) to get the highest possible value of the amplitude.
The command returns a value <max_out> that is the highest possible value you can define
as amplitude. The returned amplitude represents the RMS value of a sine wave.
You can add the optional keyword step after the amplitude value. Then the amplitude value
is not interpreted as the new amplitude to be set, but is written into the step buffer for the
amplitude.
The default value is zero for the voltage amplitude and (for command out:ana:i()... ) zero for
the current amplitude.
Parameters <generator_list>:
This parameter is of type <triple_list_type>.
<no>:
This parameter is 1 or 2 and selects either signal component 1 or component 2.
<amplitude>:
This parameter is of type <float>.
Function This command defines the frequency <frequency> (in Hertz) for the selected signal
component of all generators in <generator_list>
Description Use the command amp:def?(<amp_no>) described below to get the upper and lower limits
of the frequency for a specific CMC. The frequency limits are returned in the parameters
<f_min> and <f_max> of the amp:def? command.
You can add the optional keyword step after the frequency value. Then the frequency value
is not interpreted as the new frequency to be set, but is written into the step buffer for the
frequency.
<no>:
This parameter is 1 or 2 and selects either signal component 1 or component 2.
<frequency>:
This parameter is of type <float>.
Function This command defines the period time <period_time> (in seconds) for the selected signal
component of all generators in <generator_list>.
Description When the current waveform is wav(exp) or wav(dc), you cannot set a period time.
Parameters <generator_list> :
This parameter is of type <triple_list_type>.
<no>:
<period_time>:
This parameter is of type <float>.
Please note! #1:
The new period time is defined with this command but is not set until the next on command
(e.g. out:ana:on).
#2:
With a wav(exp) command this command does not define the period time but the time
constant of the exponential decay
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_FLOAT Parameter of type <float> has errors
CMERR_INVALID_INT Parameter <generator_list> contains number that
is not an integer
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined
See also command out:ana:on
command out:ana:v():[sig(<no>):]wav()
Function This command defines the phase <phase> (in degrees) for the selected signal component of
all generators in <generator_list>.
Description You can add the optional keyword step after the phase value. Then the phase value is not
interpreted as the new phase to be set, but is written into the step buffer for the phase.
<no>:
This parameter is 1 or 2 and selects either signal component 1 or component 2.
<phase>:
This parameter is of type <float>.
Function This command defines the waveform <waveform> for the selected signal component of all
generators in <generator_list>.
Description After the startup of CM Engine the signal components of all generators are set to a sine
wave.
Every waveform you can choose has its own set of parameters. Therefore every selectable
waveform is described below as a different command.
Please note! After a new waveform is set, the signal parameters amplitude, frequency and phase are reset
to zero. You must set new values for the amplitude, phase and frequency when you have
changed the waveform, because amplitude, frequency and phase are interpreted in different
ways for every waveform. Therefore it is not possible to take the values from a previous
waveform for a new waveform.
When you use the ‘;’ to connect multiple commands like a(), f(), p() and wav(), the wav
command is always executed first, so any order of the commands is correct to define a new
waveform and its parameters amplitude, frequency and phase.
Function This defines a sine as new waveform for the selected signal component of the generators in
<generator_list>.
Description The amplitude value you define after the waveform has been changed is interpreted
according to the waveform defined.
After the waveform has been changed to sine the signal parameters are set to zero, as
described above. Please note that 0 is a valid value for the amplitude and the phase, but not
for the frequency. The frequency must be expressly set for all waveforms except DC, where it
cannot be set.
Parameters <generator_list>:
This parameter is of type <triple_list_type>.
<no>:
This parameter is 1 or 2 and selects either signal component 1 or component 2.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter <generator_list> contains a number
that is not of type integer
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined
See also command out:ana:v(...):[sig(<no>):]a(...)
Function Defines a signal that is a sum of a sine (the fundamental) and its harmonics for the selected
signal component of the generators in <generator_list>.
Description The frequency and phase of the fundamental is to be defined by the commands f() and p().
The first parameter <amplitude_factor1> after wav(sum, ...) sets the amplitude of the
fundamental relative to the setting of the a() command. The following parameters define the
harmonics.
A harmonic is defined by the three parameters <harmonicX>,<amplitude_factorX> and
<phaseX>. They define the order of the harmonic, its amplitude relative to the setting of the
a() command and its phase relative to the fundamental. For the definition of every harmonic
you must define its three parameters <harmonicX>, <amplitude_factorX> and <phaseX>.
The parameter <harmonicX> defines the order of a harmonic. If e.g. the fundamental has a
frequency of 50 Hz, then <harmonic2> = 2 defines a second harmonic of 100 Hz.
The parameter <amplitude_factorX> (for the fundamental and the harmonics) defines the
amplitude in the following way:
The amplitude set with the a() command is multiplied with <amplitude_factorX> to obtain the
amplitude of the fundamental or harmonic respectively.
For a sum signal, an amplitude value you define with the a() command is interpreted as the
RMS value of the fundamental with <amplitude_factor1> = 1.
The parameter <phase> defines the phase of the harmonic.
You can obtain a sum signal without fundamental by setting the <amplitude_factor1> to zero.
Parameters The related parameters <harmonic>, <magnitude> and <phase> must be defined once for
every harmonic.
<generator_list>:
This parameter is of type <triple_list_type>.
<no>:
This parameter is 1 or 2 and selects either signal component 1 or component 2.
<harmonicX>:
These parameters are of type <integer> and have to be greater or equal to 2.
<amplitude_factorX>:
6
These parameters are of type <float> and are valid in the interval [0, 10 ].
<phaseX>:
These parameters are of type <float> and are valid in the interval [-360, 360].
Please note The amplitude sum of fundamental and harmonics can exceed 1. This reduces the maximum
amplitude which can be set with the a() command.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_FLOAT Parameter of type<float> has errors.
CMERR_INVALID_INT Parameter <generator_list> or <harmonicX>
contains a number that is not of type integer
CMERR_OUT_OF_CMC_MEM Internal CMC memory exhausted; cannot
download and use this waveform
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined
Example The command string out:ana:v(1):sig(1):wav(sum,1,3,0.33,0);a(20);f(50) defines the
following signal for (the first signal component of) the first triple of voltage generators:
A sum signal that consists of a fundamental wave with 50Hz and the amplitude
1 × 20Vrms = 20Vrms and its third harmonic with the amplitude 0.33 × 20Vrms = 6.6Vrms.
Function Defines a signal that is a sum of a sine (the fundamental) and its harmonics for the selected
signal component of the generators in <generator_list>. This command allows to output
signals with harmonics up to 3 kHz.
Description The phase of the fundamental is to be defined by the command p(). The first parameter
<fund_frequency> after wav(sumcorr, ...) sets the frequency of the fundamental. Notice that
the frequency of the fundamental can NOT be changed afterwards. This command can only
be used for static output of a harmonic signal.
The parameter <amplitude_factor1> sets the amplitude of the fundamental relative to the
setting of the a() command. The following parameters define the harmonics.
A harmonic is defined by the three parameters <harmonicX>, <amplitude_factorX> and
<phaseX>. They define the order of the harmonic, its amplitude relative to the setting of the
a() command and its phase relative to the fundamental. For the definition of every harmonic
you must define its three parameters <harmonicX>, <amplitude_factorX> and <phaseX>.
The parameter <harmonicX> defines the order of a harmonic. If e.g.: the fundamental has a
frequency of 50 Hz, then <harmonic2> = 2 define a second harmonic of 100 Hz.
The parameter <amplitude_factorX> (for the fundamental and the harmonics) defines the
amplitude in the following way:
The amplitude set with the a() command is multiplied with <amplitude_factorX> to obtain the
amplitude of the fundamental or harmonic respectively.
For frequencies higher than 1.5 kHz there is a limitation of the amplitude to 150V for each
harmonic.
max-Ampl (Vrms)
350
300
200
150
100
50
0
0 500 1000 1500 2000 2500 3000 3500
frequency in Hz
For a sumcorr signal, an amplitude value you define with the a() command is interpreted as
the RMS value of the fundamental with <amplitude_factor1> = 1.
The parameter <phase> defines the phase of the harmonic relativ to the fundamental.
You can obtain a sumcorr signal without fundamental by setting the <amplitude_factor1> to
zero.
Parameters The related parameters <harmonicX>, <amplitude_factorX> and <phaseX> must be defined
once for every harmonic.
<generator_list>:
This parameter is of type <triple_list_type>.
<no>:
This parameter is 1 or 2 and selects either signal component 1 or component 2.
<fund_frequency>:
This parameter is of type <float> and specifies the frequency of the fundamental.
<harmonicX>:
These parameters are of type <integer> and have to be greater or equal to 2.
<amplitude_factorX>:
6
These parameters are of type <float> and are valid in the interval [0, 10 ].
<phaseX>:
These parameters are of type <float> and are valid in the interval [-360, 360].
Please note The amplitude sum of fundamental and harmonics can exceed 1. This reduces the maximum
amplitude which can be set with the a() command.
This command is only supported on a CMC256 or newer test sets with a 3 kHz calibration. It
is not allowed for external OMICRON amplifiers and the current amplifier of the CMC356.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_FLOAT Parameter of type<float> has errors.
CMERR_INVALID_INT Parameter <generator_list> or
<harmonicX> contains a number that is not
of type integer
CMERR_OUT_OF_CMC_MEM Internal CMC memory exhausted; cannot
download and use this waveform
CMERR_HARM_CORR_NOT_SUPPORTED Harmonic correction not supported for this
amplifier
CMERR_OUT_OF_RANGE The specified fundamental frequency or a
harmonic frequency is out of range.
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined
Function Defines a triangular signal as waveform for the selected signal component of the generators
in <generator_list>.
Description This waveform is a triangular waveform where the positive and the negative amplitudes have
the same size. The parameter <duty_cycle> can be used to change the signal form.
This command interprets the amplitude value defined with the a() command as peak value of
the amplitude.
Parameters <generator_list>:
This parameter is of type <triple_list_type>.
<no>:
This parameter is 1 or 2 and selects either signal component 1 or component 2.
<duty_cycle>:
This parameter is of type <float>.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
(see section "Error! Reference source not
CMERR_INVALID_FLOAT found.")
CMERR_INVALID_INT Parameter of type <float> has errors.
Parameter <generator_list> contains a number
CMERR_OUT_OF_CMC_MEM that is not of type integer
Internal CMC memory exhausted, cannot
CMERR_TRIPLE_NOT_DEF download and use this waveform
A triple in <generator_list> is not defined
See also command out:ana:v(...):[sig(<no>):]a(...)
Function Defines a square signal as waveform for the selected signal component of the generators in
<generator_list>.
Description This waveform is a square waveform with symmetric positive and the negative amplitudes.
The parameter <duty_cycle> can be used to change the duty factor of the waveform. The
default value for the duty factor is 0.5 (time of positive and time of negative signal are equal)
but you can change this when you specify the parameter <duty_cycle>:
The amplitude value defined with the a() command is interpreted here as the peak value of
the amplitude.
<no>:
This parameter is 1 or 2 and selects either signal component 1 or component 2.
<duty_cycle>:
The parameter is of type <float>.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_FLOAT Parameter of type <float> has errors.
CMERR_INVALID_INT Parameter <generator_list> contains a number
that is not of type integer
CMERR_OUT_OF_CMC_MEM Internal CMC memory exhausted; cannot
download and use this waveform
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined
See also command out:ana:v(...):[sig(<no>):]a(...)
Function Defines a user-defined waveform as waveform for the selected signal component of the
generators in <generator_list>.
Description Before you can use a user-defined waveform you must define it with the commands
out:ana:user:...: use the command out:ana:user:alloc? to reserve memory for the new
waveform. The command out:ana:user:alloc? returns a number for the user-defined
waveform that you need to specify this waveform. Store the amplitude samples for this
waveform into the previously allocated memory using the command out:ana:user:app.
Finally pass the number of the user-defined waveform to this command as <user_sig_no> to
use the new waveform as a generator's signal.
A user waveform is replayed periodically with the frequency set by the f() command, but you
can use the optional keyword single to define a non repetitive playback of the user
waveform. In this case the f() command sets the sampling frequency.
Parameters <generator_list>:
The parameter <generator_list> is of type <triple_list_type>.
<no>:
This parameter is 1 or 2 and selects either signal component 1 or component 2.
<user_sig_no>:
The parameter is of type <integer>.
Function Defines a DC signal as waveform for the selected signal component of the generators in
<generator_list>.
Description The amplitude value defined with the a() command is interpreted as the value of the DC
signal.
Parameters <generator_list>:
This parameter is of type <triple_list_type>.
<no>:
This parameter is 1 or 2 and selects either signal component 1 or component 2.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter <generator_list> contains number that
is not of type integer
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined
Function Defines a decaying exponential function as waveform for the selected signal component of
the generators in <generator_list>.
Description The following formula illustrates the relation between the time constant, the amplitude factor
and the instantaneous value of the amplitude.
Amplitude(t)=
A is the peak value of the exponential signal defined with the a() command and T is the time
constant of the exponential function defined by a t() command.
This waveform is not periodical, i.e. when you define this waveform for a signal only one
exponential decay is put out after the on command.
Parameters <generator_list>:
This parameter is of type <triple_list_type>.
<no>:
This parameter is 1 or 2 and selects either signal component 1 or component 2.
<timeconstant>:
This parameter is of type <float>.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_FLOAT Parameter of type <float> has errors
CMERR_INVALID_INT Parameter <generator_list> contains a number
that is not of type integer
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined
Example The following commands
out:ana:i(1):sig(1):wav(sin)
out:ana:i(1):sig(1):a(1)
out:ana:i(1):sig(1):f(50)
out:ana:i(1):sig(2):wav(exp)
out:ana:i(1):sig(2):a(0.5)
out:ana:i(1):sig(2):t(0.5)
out:ana:mix:i(1, add)
define a sine waveform with an amplitude of 1A and a frequency of 50 Hz for the first current
generator triple with a decaying displacement (time constant 0.5 s).
Parameters <generator_list>:
This parameter is of type <triple_list_type>.
Please note After you have defined your signals you must execute an on command to switch ON the
defined signals. This method enables you to set or change multiple generators
simultaneously.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter <generator_list> contains a number
that is not of type integer
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined
CMERR_OUT_OF_RANGE A generator has wrong signal parameter
definitions. Typically, the amplitude has been set
but the frequency has been left as 0.
See also command amp:route
For another version of this command see out:ana:on
Example out:ana:v(2):on
nd
All 3 generators of the 2 voltage generator triple are switched ON.
Function Switches OFF the generators or generator triples enumerated in <generator_list> and clears
all signal definitions.
Description This command sets all signal component amplitudes, frequencies and phases of the selected
generators to zero. The waveform of all signal components is set to sine. The mix-mode for
all selected generators is set to the initial values (sig(1) or off, see table with
out:ana:v():mix(sig(<no>) | add | mult | off)).
Parameters <generator_list>:
This parameter is of type <triple_list_type>.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined
See also For another version of the clr command see out:ana:clr
Example out:ana:v(2):clr
nd
Switches OFF the 3 generators of the 2 voltage generator triple of a CMC and clears all
signal definitions for these generators.
Function Defines how the two signal components sig(1) and sig(2) of every generator are mixed
together.
Description The setting sig(1) defines that the output signal of this generator only consists of signal
component 1 and signal component 2 is ignored. The setting sig(2) defines that the output
signal of this generator only consists of signal component 2 and signal component 1 is
ignored.
The keyword add defines that the output signal of the generator consists of the sum of the
two signal components.
When two signal components are mixed with mult, the amplitude of the resulting signal is
calculated in relation to the scaling amplitude of the signal components. The scaling
amplitude is the maximum amplitude calculated from the amplification specified in the
amp:def command (instantaneous, not rms). When you overlay two signal components that
have this maximum scaling amplitude, the resulting signal has the same maximum scaling
amplitude too. A signal component that has an amplitude less than the maximum scaling
amplitude reduces the amplitude of the resulting signal in direct proportion.
The option off allows to switch off the signal generation for the generators named in the
generator list. When the error code CMERR_PROC_EXHAUST indicates that the number of
signals to calculate exceeds the capacity of the CMC's signal generation unit, this feature has
to be used to switch off some of the signals you have defined. The calculation capacity
depends on the DSP board version of the CMC.
The default settings for the signal component mixers of the generators are:
Triple Generators Default
v(1) v(1:1), v(1:2), v(1:3) sig(1)
i(1) i(1:1), i(1:2), i(1:3) sig(1)
generators v(2), v(3) etc. ... off
generators i(2), i(3) etc. ... off
Overview of keywords:
Keyword Explanation
sig(1) Use only the first signal component to get the signal.
sig(2) Use only the second signal component to get the signal.
add Add both signal components to get the signal.
mult Multiply both signal components to get the signal.
off Switch off signal generation for the generators in list.
Please note The settings sig(2), add and mult can only be used when the phase mode is set to abs (see
command out:ana:pmode).
The setting mult is not supported in the following cases:
therefore, all voltage amplifiers configurations with the “ser” string in their mode parameter,
and all current amplifiers configurations with the “par” string in their mode parameter, cannot
use signal multiplication. Please see the amp:cfg?() command for details.
Parameters <generator_list>:
This parameter is of type <triple_list_type>.
<no>:
This parameter is 1 or 2 and selects either signal component 1 or component 2.
Thus you must specify one of the keywords sig(1), sig(2), add, mult or off here.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter <generator_list> contains number that
is not of type integer
CMERR_ TRIPLE_NOT_DEF A triple in <generator_list> is not defined
CMERR_PROC_EXHAUST Signal calculation capacity of CMC exhausted
(too many signals defined)
CMERR_PMODE_DIFF Operation not possible in diff mode (see "Please
note!" above)
CMERR_NOT_SUPPORTED Command is not supported on this device
See also command out:ana:pmode
command amp:cfg?()
4.4.2.18 out:[ana:]save
4.4.2.19 out:[ana:]restore
4.4.2.21 out:[ana:]on
4.4.2.22 out:[ana:]off[(zcross[,<off_generator_list>])]
Function Switches OFF all the generators, but leaves their signal parameters defined.
Description The generators are switched OFF, but their signal parameters are still defined. For CMC 151
and CMC 156 the power supplies are additionally switched to stand-by mode (see amp:ctrl).
You can use an on command to switch them ON again.
You can use the optional keyword zcross (derived from zero crossing) to simulate the
behavior of a power switch, i.e. to switch off signals in their zero crossing. When you specify
zcross without a generator list, all the signals of the active generators are switched OFF at
their next zero crossing. The out:ana:off command with the zcross keyword is not
supported for the CMC151.
When you specify zcross with a <off_generator_list>, only the generators selected in the list
are switched off at their next zero crossing.
When you want to switch some signals OFF simultaneously with other signals, you can
specify these signals in the parameter <off_generator_list> in the following way:
First specify the generator (or generator triple) that is to be switched off in its zero crossing,
then add "&" then and specify one or more generators (or generator triples) that are to be
switched off simultaneously.
When the parameter before "&" is a single generator, the parameters after "&" must be single
generators too:
When the parameter before "&" is a generator triple, the parameters after "&" must be
generator triples too:
The 3 current generators of the current triple 2 are switched off in their zero
crossings and the generators of voltage triples 1 and 2 are switched off
simultaneously, i.e.
generators v(1:1) and v(2:1) are switched off with generator i(2:1),
generators v(1:2) and v(2:2) are switched off with generator i(2:2) and
generators v(1:3) and v(2:3) are switched off with the generator i(2:3).
Parameters The keyword zcross is optional.
<off_generator_list>:
This parameter is optional and can only be used when zcross is specified first. Its structure
is a comma-separated list of generator triples, generators and combinations of generators or
generator triples connected using "&" (see examples). The list would look like this:
v|i(int)&v|i(int)... , v|i(int)&v|i(int)..., ...
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter <off_generator_list> contains a
number that is not of type integer
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined
CMERR_PROC_EXHAUST Not enough calculation capacity left for zcross
CMERR_NOT_SUPPORTED Command is not supported on this device
See also For another version of this command where you can specify generators or generator triples to
be switched OFF see out:ana:v():off
Examples out:ana:off
Switches OFF all generators of a CMC immediately.
out:ana:off (zcross)
Switches OFF all generators of a CMC at their next zero crossing.
4.4.2.23 out:[ana:]clr
Function Switches OFF all generators and clears all signal definitions.
Description This command sets all signal component amplitudes, frequencies and phases to zero. The
waveform of all signal components is set to sine. The mix-mode for all generator triples is set
to the initial values (sig(1) or off, see table with out:ana:v():mix(sig(<no>) | add | mult |
off)). For CMC 151 and CMC 156 the power supplies are switched to stand-by mode
additionally (see amp:ctrl).
See also command out:ana:off
Function After you have set the step buffers of amplitude, frequency and phase you can use this
command to add the contents of the three step buffers to the current values of amplitude,
frequency and phase.
Description You have to use the amplitude, frequency or phase commands a(), f() or p() with the
additional keyword step to store values into the step buffers before you execute the
out:ana:step command.
The execution of out:ana:step adds the values of all amplitude step buffers to the current
amplitudes, the values of all frequency step buffers to the current frequencies and the values
of all phase step buffers to the current phases.
All step values are buffered twice, in the CM Engine and in the CMC. A step command
downloads the current step values into the CMC and executes a step operation. With the two
optional parameters load and exec you can perform a separate download of the new step
values or perform a separate step operation using the CMC's current step value.
Please note Through the execution of multiple out:ana:step commands an overflow (greater than the
maximum) or underflow (smaller than the minimum) of the amplitude and frequency values
can occur. The resulting output values are not predictable. So take care that out:ana:step
does not produce any overflows (e.g. using a timeout condition within seq:wait).
Parameters You can use the command without additional keywords, with the keyword load or with the
keyword exec.
Function Set the phase mode. The phase mode defines the way the CM Engine interprets the phase
parameter of the command out:ana:v():[sig(<no>):]p().
Description The phase value you send with a p() command to a CMC can be interpreted in three ways
explained below.
E.g. for sine signals this has the following result (here the old and the new
signal both have a phase of zero p(0), but a different amplitude):
E.g. for sine signals this has the following result (here the old and the new
signal both have a phase of zero p(0), but a different amplitude):
diff(v|i()) This mode allows defining one single voltage or current generator as
reference. In this case, when the on command is issued, the generator
selected as reference operates in diff mode, as described in the previous
paragraph. All other generators are shifted so the original phase differences
between them and the reference generator are reapplied, whatever the
frequency of each generator may be. In the image, we can see a reference
generator (in red) and a second generator (green). Both have phase 0, but
generator 2 has a higher frequency than the reference generator. At a given
moment (vertical line) the frequency of generator 2 is made equal to that of
the reference generator; the phases are not changed. We see in the
diagram how the phase of the reference generator does not change, while
the second generator is shifted so the original phase shift between it and
the reference generator is restored. This shift was equal to zero, so both
generators are in phase after the change.
The option diff should only be activated for the execution of a specific on or off command
and then should be set back to abs.
Please note The option diff can only be activated when all generator(s) run in sig(1) mode (or are off).
If a reference generator is used, the phase for that particular generator must always be 0.
The results if the reference generator’s phase is not set to 0 are undefined.
Parameters You must specify one of the keywords abs or diff as command parameter. When specifying
a reference generator, only single generators can be used, not triples.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_PMODE_NOT_ALLOWED cannot switch to diff mode (see above)
4.4.2.26 out:[ana:]pmode?
For example:
out:pmode(abs)
out:pmode?
Return: 1,abs;
out:pmode(diff)
out:pmode?
Return: 1,diff;
out:pmode(diff(v(1:1)))
out:pmode?
Return: 1,diff(v(1:1));
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
See also Phase mode definition see command out:ana:pmode.
4.4.2.27 out:[ana:]resetopt
Function The amount of data sent to the CMC is optimized automatically. With this command you can
reset this optimization. This command is related to the string commands for the sequencer
and is only useful in conjunction with these commands.
Description To minimize the communication between PC and CMC, the amount of data is optimized
automatically. When you execute an on command, only the signal parameters that have
changed since the last on command are sent to the CMC. The resetopt command
inactivates this optimization and, when the next on command is executed, all parameters are
sent to the CMC. This feature is useful when you work with sequencer commands.
Example: The following sequence does not work properly because of this data optimization:
seq:begin
seq:wait(bin(1),2,1,1) ⇐ begin and end of sequence step #1
out:v(1):a(100) ⇐ beginning of step #2
out:on
seq:wait(1,1) ⇐ end of step #2
out:i(1):a(100) ⇐ beginning of step #3
out:v(1):a(100)
out:on
seq:end
Due to data optimization the second out:v(1):a(100) command is not downloaded into the
sequence buffer, because this command seems to be redundant.
seq:begin
seq:wait(bin(1),2,1,1)
out:v(1):a(100)
out:on
seq:wait(1,1)
out:i(1):a(100)
-
out:on
seq:end
But when the trigger condition bin(1) in the seq:wait(bin(1),2,1,1) command becomes true,
rd
a forward jump to the 3 sequence step is executed.
seq:begin
seq:wait(bin(1),2,1,1)
out:v(1):a(100)
out:on if bin(2) is true jump forward 2 steps
seq:wait(1,1)
out:i(1):a(100)
-
out:on
seq:end
After this jump the omitted command out:v(1):a(100) is needed and not redundant any more.
Thus the sequence only works properly when you insert an out:resetopt at the beginning of
the second sequence step. The full sequence including the second out:v(1):a(100) is
downloaded then:
seq:begin
seq:wait(bin(1),2,1,1)
out:v(1):a(100)
out:on
seq:wait(1,1)
out:resetopt
out:i(1):a(100)
out:v(1):a(100)
out:on
seq:end
The command without parameters performs a sampling of the signal settings, as described,
unless the buffer is locked; in this case it has no effect.
The command with the lock parameter performs a sampling and locks the buffer so future
sampling commands will have no effect. The sampled values are therefore protected from
being overwritten until the buffer is freed. If the buffer was already locked, the command has
no effect.
The command with the free parameter performs a sampling of the signal settings and stores
the results in the buffer. If the buffer was locked, it is unlocked.
Please note The command does not store wave form, mix mode or range information. It is the user’s
responsibility to make sure that the recorded values are meaningful when they are read.
See also out:ana:buf:get?
The time tag is 0 unless the automatic logging of binary inputs is turned on in the input buffer.
In this case, the time when the sample was taken is recorded, and can be matched against
the times of events in the input buffer.
Parameters <triple>:<gen>
Couple of integer values to identify the generator for which the values are requested.
sig<sig_no>
Optional parameter to select the signal component of the generator for which the values are
requested. Default is sig(1).
Please note The time tags will remain 0 until the command inp:buf:get? is executed at least once.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_TRIPLE_NOT_DEF Triple is not defined (routed)
See also out:[ana:]buf:sam[(lock | free)]
inp:buf:sam(bin, on|off|bin)
inp:buf:get?
Example: The following example uses a sequence to generate a ramp, in order to determine the value
for which a trigger (bin(1) in this case) becomes active. While the sequence is running, the
PC program samples the analog outputs to update the user interface with the signal values.
When the sequence detects the trigger, it samples the values and locks the buffer so the PC
task does not overwrite the readings at the operating point. To simplify the code, no check is
done to limit the number of ramp steps if no trip is detected.
The ramp step time is 0.5s
seq:begin
out:v(1:1):a(50);f(50);p(0)
out:v(1:1):a(1,step)
out:on
out:ana:buf:sam(free) ;Makes sure the buffer is unlocked
seq:wait(bin(1),2,0.5,1)
out:step
seq:wait(bin(1), 1, 0.5,0)
out:ana:buf:sam(lock) ;Sample and protect the operating point
out:off
seq:end
..................
As we see, the trigger was detected at an amplitude of 120V and a phase of -33.21°. The
frequency was unchanged and equal to 50Hz. The phase indicates the angle of the v(1:1)
phasor at the moment the sample was taken, not the original setting, which was 0°.
Please note that it is possible that some of the last readings within the DO loop may have
already gotten the locked values, due to the asynchronous way both loops are executed.
However, the one reading after the DO loop exits is guaranteed to have the operating point
values, while all the others may have been taken at any time during the execution of the
sequence.
4.4.2.31 out:[ana:]sync(off)
4.4.2.32 out:[ana:]user:...
Description The following commands out:ana:user ... are used to work with user-defined waveforms. A
user-defined waveform is sent to the CMC as a sequence of samples. When you have
defined a new waveform, you can assign this waveform to one or more signal components of
voltage or current signals with wav(user,...).
Function Use this command to prepare a CMC for the definition of a new waveform.
Description A CMC device has a memory for all waveforms. The alloc? command allocates memory in
the CMC for a user-defined signal that is made up of the number of samples specified in
<no_of_samples>. Then this allocated memory segment is prepared for the download of
samples that is done with the command out:ana:user:app.
Parameter <no_of_samples>:
This parameter is of type <integer>.
Answer The command returns an answer string that contains the device number of the CMC and the
user signal number (type <integer>) assigned to the allocated memory. Use the waveform
command wav() to define your new waveform as output signal for a generator.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT Parameter <no_of_samples> is not an integer
CMERR_OUT_OF_CMC_MEM No internal CMC memory for new user-defined
signals any more
See also command out:ana:v(...):[sig(<no>):]wav
Example: Use the alloc?(1024) command to allocate memory for 1024 samples; the user signal
number returned is 1. Then download 1024 samples into the CMC using the
out:ana:user:app command. Use out:ana:v(1):sig1:wav(user,1) to set signal component 1
of all 3 generators of voltage triple 1 (these are v(1:1), v(1:2) and v(1:3)) to your user-defined
waveform 1.
The samples in parameter <user_data> are either written at the beginning of the memory
segment of the user-defined waveform <user_sig_no> or are appended to the samples that
were already downloaded in a previous app. There must be enough free memory for the new
samples in the waveform's memory segment (this information can be queried with the
out:ana:user:status? command).
Samples are signed integers in the range -32767 to 32767 (-0x7FFF to 0x7FFF in
hexadecimal notation). The actual amplitude of a sample is:
Sample
AOutput = ⋅A
32767
where Sample is the integer value of the sample and A is the amplitude set with the out:...:a()
command.
The resulting signal is calculated through linear interpolation between two consecutive
sample values. This effect is seen most obvious if you use only a small number of sample
values.
Parameters <user_sig_no>:
This parameter is of type <integer>.
<user_data>:
This parameter is a list of comma-separated samples of type <integer>.
#2:
The user signal you append data to must not be in use!
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT Parameters <user_sig_no> or <user_data>
contain a number that is not a valid integer
CMERR_INVALID_USER_SIG Parameter <user_sig_no> is not a valid user
signal
CMERR_OUT_OF_CMC_MEM Internal CMC memory for this user-defined signal
is full; no free samples left
CMERR_USER_SIG_IN_USE The user signal <user_sig_no> is in use. Thus
appending samples is not possible
See also command out:ana:user:alloc?
command out:ana:user:status?
interface function CMOutUserApp
Function Frees the memory of a specific user-defined waveform or frees the memory used by all user-
defined waveforms.
Description This command clears all samples in the memory segment of the waveform with number
<user_sig_no>. When you don't specify a user signal number <user_sig_no> the memory
sections of all user-defined waveforms are freed.
Parameter <user_sig_no>:
This parameter is of type <integer> and is optional.
Please note The user signal of the memory you want to free must not be in use!
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT Parameter <user_sig_no> is not an integer
CMERR_INVALID_USER_SIG Parameter <user_sig_no> is not a valid user
signal
CMERR_USER_SIG_IN_USE The user signal <user_sig_no> is in use. Thus
freeing this user signal is not possible
See also command out:ana:user:alloc?
command out:ana:user:app
interface function CMOutUserApp
Function Gets status and memory information for a specific user waveform or for all user waveforms
together.
Parameter <user_sig_no>:
This parameter is of type <integer> and is optional.
Answer Without parameter the command returns the number of user signals defined, the maximum
number of samples that can be stored in the CMC's memory, the number of samples that are
still free (not allocated) and the number of samples that can be stored in the largest block of
free memory.
When you specify a user-defined waveform by its <user_sig_no>, the command returns the
number of samples allocated for this waveform and the amount of free samples in this
allocated memory segment.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT Parameter <user_sig_no> is not an integer
CMERR_INVALID_USER_SIG Parameter <user_sig_no> is not a valid user
signal
Function Configures the sampled value settings and turn the generation on.
Description This command configures the sampled value generation and turns it on.
Please note! The range switching is turned off for the amplifiers and the phase correction is set to zero.
Thus the generator outputs are not corrected.
Parameters <#blocks>:
Number of blocks per transfer: 1, 2, or 4. This setting determines the amount of sampled
value network packets being sent together as well as the frequency of sending them. Full
sampling frequency is 80 times the nominal frequency. When #blocks equals 2 the actual
frequency is only half and when #blocks equals 4 it’s only a quarter of the full frequency.
<nom_freq>:
Nominal frequency for sampled value generation as double. Only the values 50Hz and 60Hz
are supported.
<fact_i>:
Scaling factor for current sampled values as double. This factor is calculated with the
following formula:
I nom, prim
fact _ i =
I nom ,sec
<fact_v>:
Scaling factor for voltage sampled values as double. This factor is calculated with the
following formula:
Vnom , prim
fact _ v =
Vnom,sec
<adapter>:
Ethernet adapter number as integer. 0 corresponds to ETH1 and 1 corresponds to ETH2.
<dest_mac_adr>:
Destination MAC address as string without '-'. The allowed range is 010CCD040000 to
010CCD0401FF.
<eth_type>:
Type of Ethernet frame as 16bit integer. The default value is 0x88BA.
<app_id>:
Application ID for Ethernet frame. The default value is 0x4000. The allowed range is 0x4000
to 0x7FFF.
<vlan_tag>:
16 bit integer value.
Bit 0 to 11 define the VLAN ID.
Bit 12 defines CFI (usually 0).
Bit 13 to 15 define VLAN Priority.
<quality>:
The value given here specifies the 13 quality bits as defined in IEC 61850-7-3. The default
value is 0. The 14th bit (derived) is always set according to the context by the firmware.
<svId_name>:
The sample value ID name as string with a minimum length of 10 and a maximum length of
34 characters. The allowed character set is ISO 646 (also called IA5 IRV International
Alphabet No. 5), which is essentially 7-bit ASCII with some exceptions. In Windows it is
represented by code page 20105.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_NOT_SUPPORTED Command not supported on this device
CMERR_SV_CFG_SET_FAILED Could not set Sampled Values configuration
CMERR_SV_CFG_NOT_ALLOWED Sampled Values configuration not allowed while
analog outputs are switched on
CMERR_OUT_OF_RANGE One of the parameter value is out of range
See also command out:ana:sv:cfg?
4.4.2.38 out:[ana:]sv:cfg?
Function Gets the current sampled value configuration settings of the device.
Description This command reads the current sampled value configuration settings of the device.
Answer The command returns 12 values:
<on_off>,<#blocks>,<nom_freq>,<fact_i>,<fact_v>,<adapter>,<dest_mac_
adr>,<eth_type>,<app_id>,<vlan_tag>,<quality>,<svId_name>
<on_off>:
Is sampled value generation turned on or off.
<#blocks>:
Number of blocks per transfer: 1, 2, or 4. This setting determines the amount of sampled
value network packets being sent together as well as the frequency of sending them. Full
sampling frequency is 80 times the nominal frequency. When #blocks equals 2 the actual
frequency is only half and when #blocks equals 4 it’s only a quarter of the full frequency.
<nom_freq>:
Nominal frequency for sampled value generation as double.
<fact_i>:
Scaling factor for current sampled values as double.
<fact_v>:
Scaling factor for voltage sampled values as double.
<adapter>:
Ethernet adapter number as integer. 0 corresponds to ETH1 and 1 corresponds to ETH2.
<dest_mac_adr>:
Destination MAC address as string without '-'.
<eth_type>:
Type of Ethernet frame as 16bit integer.
<app_id>:
Application ID for Ethernet frame.
<vlan_tag>:
16bit integer value.
Bit 0 to 11 represents the VLAN ID.
Bit 12 represents CFI (usually 0).
Bit 13 to 15 represents VLAN Priority.
<quality>:
13 quality bits. Integer value between 0 and 0x1FFF.
<svId_name>:
Name of the sampled value ID as string.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_SV_CFG_GET_FAILED Could not retrieve Sampled Values configuration
CMERR_NOT_SUPPORTED Command not supported on this device
See also command out:ana:sv:cfg(…)
4.4.2.39 out:[ana:]sv:off
4.4.2.40 out:bin:cfg?
4.4.2.41 out:bin(<out_module_idx>):cfg?
The return string contains the CMC’s device number, plus the following data for the selected
output module:
Number of Groups
The binary outputs are divided in groups. All outputs in a group share location and output
type.
Location of Outputs
String describing the location of the outputs in the device. The following values can be
returned:
front Outputs situated in the front panel of the device
back EXIF/EXTOP board on the back of the device
slot Outputs mounted in a backplane slot
Location Index
1 for “front” and “back”, mounting slot number for “slot”. The slots are numbered starting at 1.
Module Type
The kind of module where the outputs are located. For instance: OUT1-16R…
Hardware Version
The version number of the hardware.
Device Type
Type of device in which the outputs are included. For instance, CMC256-6, CMB IO-7, etc.
4.4.2.42 out:bin(<out_module_idx>:<group_idx>):cfg?
The return string contains the CMC’s device number, plus the following data for the selected
output group:
Number of Outputs
Type
String indicating the type of the outputs in the group. The following values can be returned:
relay Relay (dry contact, normally open) outputs.
transistor Transistor (TTL level) outputs.
Ground Connector
String indicating the configuration of the ground connector. The following values can be
returned:
group There is one single ground connector for the whole group.
single Each output has its own ground connector.
Please note that in the single case, the existence of a separate ground connector for each
output does not necessarily mean that such grounds are electrically independent too. In the
case of relay contacts, where there is no voltage applied, “signal reference” should be
understood instead of “ground”.
Common
String indicating the polarity of the common ground connector. It must be one of the following
values:
neutral Common ground connector is neutral.
plus Common ground connector is positive.
Command: out:bin(1):cfg?
Answer: "1,4,front,1,CMC156-EP,DB011D,0,CMC156-EP,DB011D;"
Module 1 has 4 output groups and is located in the front of the device. As is the case with
CMC devices, the module’s type and serial number are the same as the CMC’s.
Command: out:bin(2):cfg?
Answer: " 1,1,back,1,CMC156-EP,DB011D,0,CMC156-EP,DB011D;"
Module 2 has 1 output group and is located in the back of the device.
Command: out:bin(1:1):cfg?
Answer: "1,1,relay,single,binout,1;"
Group 1 in module 1 has 1 output, of relay type, with independent signal reference
connection. The answer for the other three groups would be the same.
Command: out:bin(2:1):cfg?
Answer: " 1,4,transistor,group,transout,1;"
Group 1 in module 2 has 4 outputs of transistor type, with one ground connection for the
complete group.
4.4.2.43 out:bin(<out_module_idx>):on(<output_list>)
In the output list, all binary outputs within a module can be specified. You can get the number
of available outputs with the command out:bin(<out_module_idx>):cfg?. Thus you can
specify in the <output_list> numbers between 1 and this maximum.
Parameters <out_module_idx>
Integer id of the output module that is the target of this command. This value must be greater
than 0, and smaller or equal than the value returned by the out:bin:cfg? command.
<output_list>:
This parameter is of type<enumeration>.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter in <output_list> is not an integer
Example Command: out:bin(1):on(1,2,3)
Sets outputs 1, 2 and 3 in output module 1. Relays are closed and transistor outputs are set
to 5V.
In the output list, all binary outputs within a module can be specified. You can get the number
of available outputs with the command out:bin(<out_module_idx>):cfg?. Thus you can
specify in the <output_list> numbers between 1 and this maximum.
Parameters <out_module_idx>
Integer id of the output module that is the target of this command. This value must be greater
than 0, and smaller or equal than the value returned by the out:bin:cfg? command.
<output_list>:
This parameter is of type<enumeration>
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter in <output_list> is not an integer
Example Command: out:bin(1):clr(1,2,3)
Clears outputs 1, 2 and 3 in output module 1. Relays are open and transistor outputs are set
to 0V.
Function Simultaneously set and/or clear multiple binary outputs in an output module.
Description The desired states are specified in a number of parameter type <integer>. In this number bit
0 defines the desired state of the binary output 1, bit 1 the state of output 2 etc. (see table):
Bit … 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Output - - - - - - - - - - - - 4 3 2 1
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter <data> is not an integer
Example: The command out:bin(1):set(0b01) sets output 1 in module 1 and clears all the rest.
4.4.2.46 out:bin(<out_module_idx>):get?
Bit … 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Output … 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
Example Command: out:bin(1):get?
Answer: "1,1;"
Output 1 in module 1 is “off”, all the rest are “on”.
4.4.2.47 out:bin(<out_module_idx>:<group_idx>):name(<name>)
4.4.2.48 out:bin(<out_module_idx>:<group_idx>):name?
4.4.2.49 out:aux:cfg?
4.4.2.50 out:aux(<idx>):cfg?
Parameters <idx>
Integer id of the auxiliary output that is being addressed. This value must be greater than 0,
and smaller or equal than the value returned by the out:aux:cfg? command.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_AUX_DC_NOT_LOCKED The auxiliary output DC is not locked and cannot
be accessed
CMERR_NOT_SUPPORTED Command not supported in this device
CMERR_OUT_OF_RANGE VDC value or <idx> out of range
Please note Unlike other outputs, the auxiliary DC output does not turn itself off automatically upon being
unlocked. Therefore, if we actually desire to turn it off, it must be expressly done before
exiting the software.
See also out:aux(<idx>):a()
out:aux(<idx>):a?
4.4.2.52 out:aux(<idx>):a(<v_dc>)
4.4.2.53 out:aux(<idx>):a?
Example out:aux(1):a(25)
out:aux(1):on
out:aux(1):a?
Return: 1,on,2.500000E+001,2.640000E+002;
4.4.2.54 out:aux(<idx>):def(<pwr_on_v>)
Power-down a CMC256, then power it up again; the VDC output will go on automatically.
Please note that you must restart “Batcher” at this point, or you will get cached results.
out:aux(1):a?
Return: 1,on,1.100000E+002,2.640000E+002;
4.4.2.55 out:aux(<idx>):def?
4.4.2.56 out:cfg?
Function Get information about the analog and binary outputs of a CMC.
Description This command returns the number of binary outputs in the CMC and a list of all available
amplifier numbers, consisting of the following information:
- Amplifier number.
- Number of generators.
- Information if the amplifier number can be used for internal and/or external amplifiers.
Answer A string with the device number, the number of binary outputs (type <integer>), the amplifier
number (type <integer>) followed by a slash ("/" ), the number of generators (type <integer>)
followed by a slash ("/" ) and the possible location information ("n" for none, "i" for internal, "e"
for external and "b" for both internal and external) is returned.
Example The command out:cfg? returns e.g. the string "1,2,1/3/b,2/3/b,3/3/e,4/3/e;". This means that
the CMC with device number 1 has 2 binary outputs, its amplifiers 1 and 2 have 3 generators
and can be used for internal and external amplifiers, its amplifiers 3 and 4 also have 3
generators but can be used for external amplifiers only.
After the startup of CM Engine the following default settings are defined:
Logical generator triple Generators in this triple Predefined routing to the following outputs
v(1) v(1:1), v(1:2), v(1:3) outputs "Voltage 1,2,3" on front panel of CMC.
i(1) i(1:1), i(1:2), i(1:3) outputs "Current 1,2,3" on front panel of CMC.
4.4.3.1 amp:cfg?[(<cfg_no>)]
Function Queries the number of possible amplifier configurations that the device plus all its attached
intelligent amplifiers allow, or the characteristics of one of them if the optional <cfg_no>
parameter is provided.
Description An amplifier configuration is a virtual amplifier that is obtained by wiring together outputs from
one or more physical amplifiers in a given configuration. Such a virtual amplifier serves two
purposes:
1) To allow access to special capabilities of the software that are not available for all the
elements of a triple. For instance, the output V2 of the CMC156 is capable of outputting more
power than V1 and V3. If the three are assigned to the same voltage triple, this capability is
lost, since only the power of the weaker outputs can be guaranteed. A virtual single-phase
amplifier connected only to V2-N can be used where higher power is needed.
2) To simplify rearranging the physical amplifiers into logical amplifiers more adapted to our
requirements. In a CMC256, for instance, the four voltages V1, V2, V3 and V4 are part of two
separate physical amplifiers, one of them 3-phase and the other single-phase. The use of the
amp:def command would allow us only to route one voltage triple to each of these amplifiers.
There is a configuration, however, where the four outputs are considered as 3-phase
amplifiers, while V4 outputs the resultant of the three phase voltages. When we route a triple
to this configuration, we address only the three phase voltages, and the CMC internal DSP
calculates the resultant. V4 is no longer directly addressable.
It must be noted that this functionality could be achieved in some (but not all) cases by
assigning two triples to the amplifiers with the amp:def command and calculating the
resultant vector in the program. The design of the out:on command ensures that the four
voltages would be in sync. This command saves the user a lot of effort and the possibility of
calculation or synchronization errors, and also ensures that the resultant is correct in all
possible cases, even when some of the signals have harmonic content, exponential decay
component, etc.
<dev_id>
The CMC’s device number – integer
<config_ID>
ID of the configuration to be used in the amp:route command, if we want to route a triple to
this configuration. It is completely independent of the configuration number, which is the
parameter that we have passed to the amp:cfg? command. This is a number of type
integer.
Please note that the configuration ID is not guaranteed to be the same in all cases; it may
change if the hardware is different or the CM Engine version has changed.
<phase_count>
Number of phases of the virtual amplifier. It is the number of phases that can be
independently addressed and set with the out:ana commands. The number of phases that
are actually output may be different (for instance, when Vo is automatically calculated from
the three phase voltages in the CMC256 or newer test set). This is a number of type integer.
<max_out>
Maximum output value of the configuration. It may be in V or A, depending on the type of the
amplifier. Number of type double.
<max_power>
Maximum output power of the configuration (approximate – please refer to the HW manual
for exact data), in VA. Number of type double.
<max_out_at_max_power>
Output value for which the maximum power is reached (approximate – please refer to the
HW manual for exact data). Number of type double.
<src_amp>
Maximum complementary magnitude (that is, V for I amplifiers and I for V amplifiers) that the
configuration can reach. If the amplifier power curves were linear, it would happen that
<src_amp> * <max_out_at_max_power> = <max_power>
This value is a double.
<mode>
Value of type string. It encodes the way the different outputs of the physical amplifiers
involved in the configuration are to be tied together to achieve the configuration’s
characteristics.
<wiring_id>
Internal OMICRON identifier. It refers to a connection diagram depicting the connections
encoded in <mode>. This field is of integer type.
The correspondence between the <mode> strings and the wiring_id is not 1:1 – one string
may correspond to several ids if the involved amplifiers change. The following table provides
The descriptor is a string, which may be either “amp_no” or “amp_id”, if the amplifier is
respectively internal or external. In both cases, the amplifier number follows, with type
integer. If the amplifier is identified as amp_no, the number corresponds to that returned by
the out:cfg? command, whereas for amplifiers identified as amp_id, the number
corresponds to the id returned by amp:scan? This allows the user to identify the amplifiers
and find out whether they are Voltage or Current amplifiers.
Example How to parallel the two current triples of a CMA156 intelligent current amplifier, to obtain a
three-phase amplifier that can output 50A per phase.
amp:scan?
Result : 1,1,2;
amp:cfg?
Result : 1,14;
amp:cfg?(11)
Result : 1,19,3,5.000000e+001,1.400000e+002,1.500000e+001,1.000000e+001,
par3,5,amp_id,1,amp_id,2;
amp:route(i(2),19)
After scanning the bus for amplifiers, we request the available number of configurations.
Ordinarily, we would have to parse them one by one to find that configuration we are
interested in. In this case, we have gone directly to #11, which is a 3-phase amplifier with
maximum output of 50 that involves external amplifiers 1 and 2 (see the list of amplifiers at
the end of the result string) in wiring configuration par3. Then we route i(2) to <config_ID>
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_OUT_OF_RANGE The int parameter supplied does not correspond
to an existing configuration
CMERR_COMM Communication error during command execution.
Please note The configuration(s) of the amplifiers, if any, will not be available until an amp:scan?
command is performed.
See also amp:scan? amp:def amp:route out:cfg?
4.4.3.2 amp:cfg?(<amp_id>,firm)
Function Returns the firmware versions (boot and main) for the specified amplifier.
Description This command reads the firmware versions from the specified amplifier and returns them as
a string.
Parameters <amp_id>:
This parameter is of type <integer>.
Answer The command returns a string that contains the main firmware version and the boot firmware
version.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_OUT_OF_RANGE There is no amplifier with the specified ID
CMERR_COMM Communication error during command execution.
See also command amp:cfg?(<amp_id>,addr)
command gps:setup:cfg?(firm)
Examples Suppose you have connected a CMA156 to the CMC you would get an answer like this to the
command amp:cfg?(1,firm): “1,V1.05,V1.01;”. This means that the intelligent external
amplifier with ID 1 has a boot firmware of version 1.01 and a main firmware of version 1.05.
Function Use this command to provide the parameters of an external amplifier or change the
predefined parameters of an internal amplifier. You can also auto-define an „intelligent“
amplifier (not available in the DOS version of CM Engine) or undefine an amplifier. Because
of the significant differences across the four variations of this command, each variation is
described separately.
Function Use this command to provide the parameters of an external amplifier or change the
predefined parameters of an internal amplifier.
Description The command uses the following parameters:
- The parameter <amp_no> is the number of the amplifier whose parameters are specified.
- The keywords int or ext define if the amplifier is one of the CMC-internal ones with output
at the front panel or an external one which is connected at the back of the CMC (socket
"Gen. Out X").
- The keywords v or i specify if the amplifier is to be defined is a current or a voltage
amplifier.
- The parameter <amplification> is the voltage or current amplification of the amplifier.
The voltage amplification of a voltage amplifier is calculated as follows:
max .VoltageOutput[Volt ]
amplification =
max .VoltageInput[Volt ]
The maximum input voltage is 5Vrms. Through the amplification the scaling amplitude for
the signals is defined which is used with out:ana:mix(mult).
- The parameter <max_out> defines the maximum output voltage of the voltage amplifier (in
Volt) or the maximum output current of a current amplifier (in Ampere) as RMS value of a
sine wave. This value is used to limit the possible amplitude values set by out:ana:a() and
has to be smaller than or equal the scaling amplitude.
- The parameters <f_min> and <f_max> define the minimum and maximum output frequency
of the amplifier (in Hz). A minimum frequency of zero Hertz enables DC for this amplifier.
- The parameters <t_corr1>, <t_corr2> and <t_corr3> define the three corrective propagation
delays for the three amplifiers (in seconds).
The internal amplifiers of the CMC and their parameters are already predefined, but you can
change their parameters. This can be useful if you connect a voltage or current transformer
to a CMC-internal amplifier.
Parameters <amp_no>:
This parameter is of type <integer>.
<int|ext>:
Here you must specify one of the keywords int or ext.
<v|i>:
Here you must specify one of the keywords v or i.
<amplification>:
This parameter is of type <float>.
<max_out>:
This parameter is of type <float>.
<f_min>, <f_max>:
These parameters are of type <float>.
Auto-definition of external amplifiers is not supported for the DOS version of CM Engine.
When you want to auto-define an intelligent external amplifier you have to provide a list of
amplifier IDs. Currently only OMICRON amplifiers connected to the CM Exif board (see also
the amp:route command) are considered intelligent. If <id_list> contains more than one ID,
CM Engine tries to „combine“ the amplifiers. This means that CM Engine assumes an
amplifier with cumulated parameters:
Suppose you have connected a CMA156 to the CMC which consists of two amplifiers with
25A output current. The amp:scan? command would report two IDs, 1 and 2. If you define
an external amplifier with amp:def (3, ext, 1, 2), CM Engine assumes that you have an
amplifier with 50A output current. The only thing you would have to do is to connect the
corresponding outputs of the amplifier (L1 of current output A with L1 of current output B and
the same for L2, L3 and N).
The combination is performed successfully when all amplifiers are of the same type (voltage
or current) and have the same amplification.
The other parameters are merged in the following way: output values are summed up, the
minimum frequency is set to the highest of a values, the maximum frequency is set to the
lowest of all values and the corrective propagation delays are set to the average value of all
amplifiers.
Parameters <amp_no>:
This parameter is of type <integer>.
<int|ext>:
Here you must specify one of the keywords int or ext.
<id_list>:
This parameter is of type <enumeration>.
Please note The parameters of the internal amplifiers of the CMC are already predefined.
Before you can use an external amplifier, you must define the amplifier with amp:def.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_AMP_IN_USE Amplifier is in use (routed)
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT Parameter <amp_no> is not an integer
If the keyword clrnooff is specified, the amplifier parameters are cleared, but the amplifier
itself is not turned off. This reduces the wear of the equipment due to on/off cycles.
Please note that the output signals are removed with both keywords, it is only the amplifier’s
power supply that is turned off (clr) or not (clrnooff).
If no amplifier number is provided, the clr or clrnooff keyword applies to all amplifiers.
Parameters <amp_no>:
This optional parameter is of type <integer>.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_OUT_OF_RANGE The desired amplifier is not defined
CMERR_AMP_IN_USE Amplifier is in use (routed)
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT Parameter <amp_no> is not an integer
4.4.3.7 amp:def(off)
When no amplifier number is specified, a list of all defined amplifiers (predefined or user-
defined with amp:def) is returned. After startup of the CM Engine the amplifier list only
contains the internal amplifiers of the CMC.
Parameter <amp_no>:
This parameter is of type <integer> and is optional.
Answer When an amplifier number is specified, the command returns a string that contains the CMC
device number and the following information (the parameters and their types are explained
with the amp:def command):
<int | ext>, Internal or external amplifier.
<v | i>, Type of amplifier (voltage or current).
The amplifier output group refers to the output sockets of the amplifier: All amplifiers that do
not have more than one amplifier of the same type in the same case return „-“. The others
return „A“ for output group A and „B“ for output group B.
With the harm keyword, the command returns the maximum frequency for harmonic signals
of the specified amplifier.
When no amplifier number is specified the command returns a string that contains the CMC
device number and a list of all defined amplifiers in or connected to a CMC. For every
amplifier the following information is returned:
<amp_no> Amplifier number
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_OUT_OF_RANGE The desired amplifier is not defined
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT Parameter <amp_no> is not an integer
See also command amp:def
Examples The command amp:def? returns the string “1,1,2;”. This means that the CMC with device
number 1 contains the definitions of an amplifier 1 and an amplifier 2. You can thus route
generator triples to the amplifiers 1 or 2.
The command amp:def?(1,harm) returns the string “1,3.000000E+003;”. This means that
the amplifier 1 in the CMC with device number 1 can output harmonic signals up to 3 kHz.
4.4.3.9 amp:scan?
Function Searches for intelligent external amplifiers and returns a list of IDs.
Description This command searches for connected intelligent external amplifiers. Currently only
OMICRON amplifiers connected to the CM Exif board (see also the amp:route command)
are considered intelligent. Each amplifier found is assigned an ID for further reference.
These IDs are integer values and are not necessarily consecutive. If the optional parameter
list is specified the scan is only done at the first call. Further calls will only return the ID list.
Answer The command returns a string that contains the IDs for all amplifiers found.
Please note This command performs a lengthy operation. It typically lasts more than 10 seconds.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_AMP_IN_USE Amplifier is in use. This error code is returned if
any intelligent amplifier is defined using the
The amplifier output group refers to the output sockets of the amplifier: All amplifiers that do
not have more than one amplifier of the same type in the same case return „-“. The others
return „A“ for output group A and „B“ for output group B.
With the cal keyword, the command returns a string that contains the CMC device number,
followed by the year, month and day of the last factory calibration, separated by commas.
The three numbers are of type <int>.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_OUT_OF_RANGE There is no amplifier with the specified ID
CMERR_IN_SEQ_MODE Command not allowed within sequence
See also command amp:scan?
command amp:def
Examples Suppose you have connected a CMA156 to the CMC, which consists of two amplifiers with
25A output current, you would get the following answer to the command amp:param?(1):
“1,ext,i,A,1.000E+1,2.500E+1,0.000E+0,1.000E+3,5.944E-5, 5.944E-5,
5.944E-5,CMA156,BF176A;”. This means that the amplifier with ID 1 is a current amplifier
CMA156 with serial number BF176A and output on the output group A. The amplification
factor is 10, its maximum output current is 25A, the frequency range is from 0 to 1000 Hz, the
corrective propagation delay is 59.44µs.
Description With this command it is possible to clear the routings of all triples, whether they are routed to
amplifiers or to amplifier configurations.
You can replace the keyword clr by clrnooff; in this case, if the triple was routed to an
amplifier configuration, the physical amplifier(s) are not turned off when the virtual amplifier’s
definition is cleared. Please note that the output signals are removed with both keywords, it is
only the amplifier’s power supply that is turned off (clr) or not (clrnooff).
Parameters Keyword clr or clrnooff.
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
See also amp:route (v | i (<triple_no>), <amp_no> | clr | clrnooff)
Function With this command you can define which generator triple <triple_no> (voltage or current
triple) is logically connected to which amplifier <amp_no>, i.e. to which outputs.
Description This command connects the three logical generators of a generator triple (voltage or current
triple) to an amplifier, i.e. to three outputs of the CMC or of an external amplifier.
The following table shows the relationship between the amplifier number <amp_no> and the
outputs for the three generators (see also chapter „Block diagram of Generators/Outputs of
the CMC 56“ in the appendix):
You can replace the parameter <amp_no> by the keyword clrnooff; in this case, if the triple
was routed to an amplifier configuration, the physical amplifier(s) are not turned off when the
virtual amplifier’s definition is cleared. Please note that the output signals are removed with
both keywords, it is only the amplifier’s power supply that is turned off (clr) or not (clrnooff).
Parameters <v|i>:
For this parameter you must specify one of the keywords v or i.
<triple_no>:
This parameter is of type <integer>.
<amp_no>:
This parameter is of type <integer>; it can be replaced by the keywords clr and clrnooff.
Please note #1:
Before you can use the amp:route command to route a generator triple to an external
amplifier, you must use the amp:def command to define the parameters of this external
amplifier. This does not apply to amplifier configurations (see amp:cfg?[(cfg_no)]
command).
#2:
Due to the hardware architecture of a CMC, there are two restrictions for the routing (see
also chapter „Block diagram of Generators/Outputs of the CMC 56“ in the appendix):
The outputs "Voltage 1-3" (front panel) and the outputs for external amplifiers "Gen.Out 4-6"
(back panel) are mutual exclusive, i.e. you can only use one of these output groups at the
same time.
The same is valid for the outputs "Current 1-3" (front panel) and the outputs for external
amplifiers "Gen.Out 1-3" (back panel).
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_AMP_IN_USE The amplifier is already routed to a different triple
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT Parameter <triple_no> or <amp_no> is not an
integer
CMERR_KINDS_DONT_MATCH The parameters <triple_no> and <amp_no> are
not of the same generator type (voltage gen./
current gen.)
See also command amp:def
command amp:cfg? [(<cfg_no>)]
Example: amp:route (i(1), 2)
This command routes the generator triple 1 for current output to amplifier number 2. This
means that the generators i(1:1), i(1:2) and i(1:3) are routed to the outputs "Current 1-3" on
the front panel of the CMC or to the outputs "Gen.Out 1-3" at the back panel of the CMC.
Function Use this command to get the current route settings of a voltage or current triple (predefined
settings or settings set with amp:route).
Description The type of the triple (voltage or current triple) is specified with the keywords v or i and the
number of the generator triple is passed to CM Engine as parameter <triple_no>.
The command returns the number of the amplifier the logical generator triple is routed to.
Parameters <v|i>:
Here you must specify one of the keywords v or i.
<triple_no>:
This parameter is of type <integer>.
Answer The command returns a string that contains the CMC's device number and the generator
triple of type <integer>.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT Parameter <triple_no> is not an integer
See also command amp:route
Example The command amp:route?(v(1)) returns the string “1,1;”. This means that in CMC #1 the
voltage generator triple 1 is routed to amplifier 1.
Description Use this command to tell the CMC which maximum amplitude (rms) is needed. The CMC
automatically selects the appropriate range.
This command internally executes the out:ana:<triple_no>:clr command. The keywords v or i
specify the type of the amplifier (voltage or current amplifier). The parameter <triple_no>
specifies the number of the generator triple. The parameter <range> specifies the maximum
rms value that is needed on this amplifier output. The CMC will select the smallest range that
fits the specified value.
If the user knows the maximum value that will be output during usage, the use of this
command allows the amplifier to operate optimally for the set range, usually increasing the
output power and the
Parameters <v|i>:
Here specify one of the keywords v or i.
<triple_no>:
This parameter is of type <integer>.
<range>:
This parameter is of type <float>.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_FLOAT Parameter <range> has errors
CMERR_INVALID_INT Parameter <triple_no> is not an integer
See also command amp:range?
Compatibility Win32
4.4.3.15 amp:range?(v|i(<triple_no>))
Function Returns the currently selected amplifier range and a list of possible ranges.
Description Parameters:
The keywords v or i specify the type of the amplifier (voltage or current amplifier). The
parameter <triple_no> specifies the number of the generator triple.
Parameters <v|i>:
Here specify one of the keywords v or i.
<triple_no>:
This parameter is of type <integer>.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_FLOAT Parameter of type <float> has errors
CMERR_INVALID_INT Parameter <triple_no> is not an integer
See also command amp:range
Compatibility Win32
Example The command amp:range?(i(1)) returns the string
“1,1.250000E+001,1.250000E+000,1.250000E+001;” when executen on a CMC156EP. This
means that the currently selected range is 12.5A and that there are 2 ranges, one 1.25A and
one 12.5A.
Function This command executes a power optimization of an amplifier for a specific CMC application.
Description The command optimizes the output power of the three generators of a voltage or current
triple for a specific application. Use this command to tell the CMC which maximum voltage
you need for your application and the CMC automatically optimizes the power output for this
case.
Parameters:
- The keyword i specifies the current amplifier (this command is not supported for voltage
amplifiers).
- The parameter <triple_no> specifies the number of the generator triple.
- The parameter <v_ctrl> specifies the peak no-load output voltage (in V) of the amplifier
outputs.
Parameters <i>:
Here you must specify the keyword i.
<triple_no>:
This parameter is of type <integer>.
<v_ctrl>:
This parameter is of type <float>.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_FLOAT Parameter of type <float> has errors
CMERR_INVALID_INT Parameter <triple_no> is not an integer
CMERR_NOT_SUPPORTED Command is not supported on this device
CMERR_NO_YET_IMPLEMENTED Command is not yet implemented
This error code is returned only when the triple is
routed to an intelligent external amplifier.
<triple_no>:
This parameter is of type <integer>.
Answer The device number, the current, minimum and maximum voltage (type <float>).
If the amp:ctrl command is not supported for this device, the min and max return values are
zero.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT Parameter <triple_no> is not an integer
See also command amp:ctrl
voltage of 5.6V. The valid range is 3V to 6V. If the same command is executed on an CMC
56, the answer would be „1,0.000E+000,0.000E+000,0.000E+000;“. This means that power
control is not supported.
4.4.3.18 amp:reset(<amp_id>)
In the binary input commands, the <inp_module_idx> parameter contained in them is a number (starting at 1)
identifying a “virtual” input module. “Virtual” means that it not only stands for real input modules of the CMB
but also all other kinds of inputs like the inputs on the front panel of a CMC. The exact details about this
virtual module can be retrieved by using the inp:bin(<inp_module_idx>):cfg? command. When there is a
CMC with a connected CMB the available virtual input modules consist of both the CMC internal inputs
(accounting for one virtual module) and the input modules of the CMB.
4.4.4.1 inp:[ana:]v(<input_list>):get?[(all)]
inp:[ana:]i(<input_list>):get?[(all)]
Function Measure the voltage/current in one or more DC analog inputs and return the results.
Description This command measures the voltage/current at one or more analog DC inputs. The inputs for
which the measurement is to be performed are specified in <input_list>.
The number of existing DC analog voltage and current inputs can be queried with the
inp:cfg? command.
Parameter <input_list>:
This parameter is of type <enumeration>
all:
causes the validity of the measurement to be returned after the actual measurement. See
command inp:ana:get?(<command handle>) for the meaning of the validity flags.
Answer Returns the measurement data as one or more values of type <float>. When a voltage
measurement was executed, the return value is in Volts and when a current measurement
was executed the return value is in Amperes. If the parameter all has been specified, each
measurement is followed by an <integer> with the validity flags.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT Parameter <input_list> contains a number that is
not an int
CMERR_DCTASK_OFF The DC task has been turned off – no
measurement is possible
Please note If the DC task is turned off in a CMC256 or newer test set, the command will fail. In a
CMC156, it is not possible to turn off the DC task, even if the inp:ana:dc(off) command will
be accepted.
See also inp:cfg?
inp:ana:dc(on|off)
Example inp:i(1):get?
Answer: "1, 0.145E-001;"
The DC current input 1 returned a current of 14.5 mA.
inp:v(1):get?(all)
Answer: "1, 1.000E+001,0;"
The DC voltage input 1 measured 10V. The measurement is valid.
4.4.4.2 inp:[ana:]v|i(<input_list>):range?
Function Return the selected and possible ranges of one or more DC analog inputs.
Description This command replaces inp:[ana:]v|i (<input_list>):param?, which is now obsolete. It
returns the currently selected range followed by the list of available ranges.
Parameters <input_list>:
Comma separated list of the DC analog inputs on which the command applies. The
maximum number for the analog voltage and current input can be queried by the inp:cfg?
command.
v:
means the analog DC voltage inputs are read. Results are returned as a floating point
number in Volts.
i:
means the analog DC current inputs are read. Results are returned as a floating point
number in Amps.
Answer The returned string contains the device number, followed by a series of floating point
numbers. The first number is the selected range, and the numbers that follow are the
available ranges. All DC inputs are symmetrical, and can measure from -<range> to
+<range>.
See also inp:[ana:]v|i(<input_list>):range(<range>)
Example inp:ana:i(1):range?
Result : 1,2.000000e-002,1.000000e-003,2.000000e-002;
The example shows that the currently selected range is 20 mA and the available ranges are
1 mA and 20 mA. This is the case for a CMC256.
4.4.4.3 inp:[ana:]v|i(<input_list>):range(<range>)
Description Sets the range of the current or voltage analog DC input. Some CMCs only have one range
(in which case this command will have no effect). You can use the
inp:[ana:]v|i(<input_list>):range? command to see how many ranges are supported
beforehand.
Parameters <input_list>
Comma separated list of the DC analog inputs on which the command applies. The
maximum number for the analog voltage and current input can be queried by the inp:cfg?
command.
v:
means the analog DC voltage input is read. Results are returned as a floating-point number
in volts.
i:
means the analog DC current input is to be read. Results are returned as a floating-point
number in amps.
<range>
floating point number. Specifies the range. The next equal or higher range is selected. If it is
above the maximum then and error will be returned.
Example inp:ana:i(1):range(0.001)
Sets the range of the DC current input to 1mA.
4.4.4.4 inp:bin:cfg?
4.4.4.5 inp:bin(<inp_module_idx>):cfg?
The return string contains the CMC’s device number, plus the following data for the selected
input module:
Number of Groups
The binary inputs are divided in groups. All inputs in a group share debounce and deglitch
times, and can be addressed as one for the inp:bin:def commands.
Location of Inputs
String describing the location of the inputs in the device. The following values can be
returned:
front Inputs situated in the front panel of the device
back EXIF/EXTOP board on the back of the device
slot Inputs mounted in a backplane slot
Location Index
1 for “front” and “back”, mounting slot number for “slot”. The slots are numbered starting at 1.
Module Type
The kind of input module where the inputs are located. For instance: INP1-24…
Hardware Version
The version number of the hardware.
Device Type
Type of device in which the inputs are included. For instance, CMC256-6, CMB IO-7, etc.
4.4.4.6 inp:bin(<inp_module_idx>:<group_idx>):cfg?
The return string contains the CMC’s device number, plus the following data for the selected
input group:
Number of Inputs
Number of binary inputs in this group (integer).
Ground Connector
String indicating the configuration of the ground connector. The following values can be
returned:
group There is one single ground connector for the whole group.
single Each input has its own ground connector.
Please note that in the single case, the existence of a separate ground connector for each
input does not necessarily mean that such grounds are electrically independent too. The
CMC256, for instance, has a separate ground connector for each input, but each two inputs
share a common ground.
Common
String indicating the polarity of the common ground connector. It must be one of the following
values:
neutral Common ground connector is neutral.
plus Common ground connector is positive.
Resource group type
String indicating the resource group of this input group. It must be one of the following values:
bininp Resource group rgtBinInp.
multiinp Resource group rgtMultiInp.
Resource group index
Integer value of the index for this group’s resource group.
Input functions
Comma-separated list of the functions that the inputs in the group support. The list will
include one or more of the following strings:
bin Binary input function (including voltage-sensing).
count Pulse counter function.
v Voltage measuring function.
i Current measuring function.
See also inp:bin:cfg?
inp:bin(<inp_module_idx>):cfg?
Example Command: inp:bin:cfg?
Answer: "1,1;"
The device (a CMC156 in this case) has 1 input module.
Command: inp:bin(1):cfg?
Answer: "1,2,front,1,CMC156-EP,DB011D,0,CMC156-EP,DB011D;"
The module has 2 input groups and is located in the front of the device. As is the case with
CMC devices, the module’s type and serial number are the same as the CMC’s.
Command: inp:bin(1:1):cfg?
Answer: "1,4,0.000000E+000,2.500000E+002,7.220574E-
002,1.798000E+002,single,single,bininp,1,bin,count;"
Group 1 has 4 inputs, with range from 0 to 250V, threshold settable from 0.0722V to 179.8V,
independently for each input. Each input has a separate ground connector, and they are
capable of binary detection and pulse counting.
Command: inp:bin(1:2):cfg?
Answer: " 1,6,0.000000E+000,2.500000E+002,7.220574E-
002,1.798000E+002,single,single,bininp,2,bin,count;"
It will be remembered that, in a previous example, the CMC256 turned out to have 10 groups,
each comprising just one input. Therefore, in the CMC256 each input must be individually
configured, while in the CMC156 it is possible (but not compulsory) to assign values to
several inputs at the same time.
4.4.4.7 inp:bin(<inp_module_idx>):get?
Bit … 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Input … 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
See also inp:bin[(<inp_module_idx>)]:diff(reset)
inp:bin(<inp_module_idx>):diff?
Example Command: inp:bin(1):get?
Answer: "1,44;"
The inputs 3,4 and 6 in module 1 are set and the others are cleared.
4.4.4.8 inp:bin(<inp_module_idx>):diff?
Function Get the change mask of the selected module’s binary inputs.
Description Use this command to get a bit-mask representing the binary inputs that have changed states
since the last inp:bin[(<inp_module_idx>)]:diff(reset) command.
Parameters <inp_module_idx>
Integer id of the input module for which the bit mask is requested. This value must be greater
than 0, and smaller or equal than the value returned by the inp:bin:cfg? command.
Answer A decimal number is returned that represents a 32 bit integer value. Bit 0 (LSB) represents
binary input 1; the bit is set if the input’s state has changed since the last
inp:bin[(<inp_module_idx>)]:diff(reset) command, cleared otherwise.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_NOT_SUPPORTED Command not supported in this device
Please note This command is not currently supported in CMC devices.
See also inp:bin[(<inp_module_idx>)]:diff(reset)
Example Command: inp:bin(1):diff?
Answer: "1,1;"
Only binary input 1 changed state since the last inp:bin[(<inp_module_idx>)]:diff(reset)
command was issued.
4.4.4.9 inp:bin[(<inp_module_idx>)]:diff(reset)
Function Clear the change mask of the selected module’s binary inputs.
Description Use this command to reset the state-change memory for a given module, or for all modules
in a device.
Parameters <inp_module_idx>
The integer id of the input module for which the change memory must be cleared. This value
must be greater than 0, and smaller or equal than the value returned by the inp:bin:cfg?
command. If the parameter is omitted then all input modules in the addressed device are
reset.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_NOT_SUPPORTED Command not supported in this device
Please note This command is not currently supported in CMC devices, only in CMB.
See also inp:bin(<inp_module_idx>):diff?
4.4.4.10 inp:bin(<inp_module_idx>:<group_idx>):debounce(<deb_time>)
Function Set the debounce time for all inputs in the selected group.
Description After a change in a given binary input, the device starts counting the debounce time for that
input. During that time, all changes in the input are ignored.
Parameters <inp_module_idx>
Integer id of the targeted input module. This value must be greater than 0, and smaller or
equal than the value returned by the inp:bin:cfg? command.
<group_idx>
Integer id of the input group within the input module for which we want to set the debounce
time. This value must be greater than 0, and smaller or equal than the value returned by the
inp:bin(<inp_module_idx>):cfg? command (return field <#groups>).
<deb_time>
This floating point parameter represents the debounce time in seconds. A value of 0 disables
the feature. The maximum debounce time is 25.6ms (higher values can be set without
receiving an error message but are internally cut down do 25.6ms). Setting the debounce
time changes the time resolution of the binary inputs:
Please note This command is not supported in CMC156 and CMC56 devices. The command will be
accepted for these devices, but it will have no effect.
See also inp:bin(<inp_module_idx>:<group_idx>):debounce?
4.4.4.11 inp:bin(<inp_module_idx>:<group_idx>):debounce?
The return string contains the CMC’s device number, plus the following data for the selected
input group:
Debounce Time
Debounce time in seconds (floating point).
Debounce Resolution
Floating point value representing the debounce resolution in seconds.
Please note In CMC156 and CMC56 devices, the command will return 100e-6 seconds, which is the
sampling rate of the binary inputs.
See also inp:bin(<inp_module_idx>:<group_idx>):debounce(<deb_time>)
4.4.4.12 inp:bin(<inp_module_idx>:<group_idx>):deglitch(<degl_time>)
Function Set the deglitch time for all inputs in the selected group.
Description After a change in a given binary input, the device starts counting the deglitch time for that
input. During that time, the input must not change again. Pulses with width shorter than the
deglitch time are not considered. When the deglitch feature is active, changes in all binary
inputs are recorded with a delay equal to the deglitch time. This affects all information and
operations involving binary inputs, including trigger conditions.
Parameters <inp_module_idx>
Integer id of the targeted input module. This value must be greater than 0, and smaller or
equal than the value returned by the inp:bin:cfg? command.
<group_idx>
Integer id of the input group within the input module for which we want to set the deglitch
time. This value must be greater than 0, and smaller or equal than the value returned by the
inp:bin(<inp_module_idx>):cfg? command (return field <#groups>).
<degl_time>
This floating point parameter represents the deglitch time in seconds. A value of 0 disables
the feature.
Please note This command is not supported in CMC156 and CMC56 devices. The command will be
accepted for these devices, but it will have no effect.
See also inp:bin(<inp_module_idx>:<group_idx>):deglitch?
4.4.4.13 inp:bin(<inp_module_idx>:<group_idx>):deglitch?
The return string contains the CMC’s device number, plus the following data for the selected
input group:
Deglitch Time
Deglitch time in seconds (floating point).
Deglitch Resolution
Floating point value representing the deglitch resolution in seconds.
Please note In CMC156 and CMC56 devices, the command will return 0, since the feature is not
available.
See also inp:bin(<inp_module_idx>:<group_idx>):deglitch(<degl_time>)
Please Note In a CMC256 or newer test set, a potential-sensing input can be used as an analog input, and
the measurement tasks can be started on it. Trying to start a measurement task in a
potential-free input will cause an error.
Parameters <inp_module_idx>
Integer id of the targeted input module. This value must be greater than 0, and smaller or
equal than the value returned by the inp:bin:cfg? command.
<group_idx>
Integer id of the input group within the input module whose inputs we want to configure. This
value must be greater than 0, and smaller or equal than the value returned by the
inp:bin(<inp_module_idx>):cfg? command (return field <#groups>).
<inp_idx>
Integer id of the individual input to configure. This optional parameter is only allowed for
setting thresholds, and then only if the inputs can be individually programmed (see the return
string for the inp:bin(<inp_module_idx>:<group_idx>):cfg? command), return field
<thres_gran>.
<threshold>:
Floating point number in volts. Specifies the binary threshold. A DC voltage on this input
greater than or equal to the threshold will be taken to be a '1', a voltage less than the
threshold will be taken to be a '0'.
pf:
By specifying the keyword pf the input is configured as “potential free”.
inp:bin(1:2):def(pf)
Configures all inputs in group 2, module 1 as potential-free inputs
4.4.4.15 inp:bin(<inp_module_idx>:<group_idx>[:<inp_idx>]):def?
The return string contains the CMC’s device number, plus the setting value for the input or
the group. This setting can be the string “pf” if the setting is potential-free sensing, or a
floating point value containing the threshold value for the input or the group. If the setting
value is requested for a group whose inputs have been individually programmed, the
command will return a threshold of 0.
See also inp:bin(<inp_module_idx>:<group_idx>[:<inp_idx>]):def(pf|<threshold>)
4.4.4.16 inp:bin(<inp_module_idx>:<group_idx>):name(<name>)
4.4.4.17 inp:bin(<inp_module_idx>:<group_idx>):name?
Parameters <inp_module_idx>
Integer id of the input module that the information is desired. This value must be greater than
0, and smaller or equal than the value returned by the inp:bin:cfg? command.
<group_idx>
Integer id of the input group within the input module that the information is desired. This value
must be greater than 0, and smaller or equal than the value returned by the
inp:bin(<inp_module_idx>):cfg? command (return field <#groups>).
Answer <dev_id>,<name>;
The return string contains the CMC’s device number, plus the name assigned to the group
enclosed in quotes. If no name has been set for the group, then the command returns an
empty string.
See also inp:bin(<inp_module_idx>:<group_idx>):name(name)
Examples inp:bin(1:1):name?
Result: 1,””; // Group 1 in module 1 has no name assigned
inp:bin(1:1):name(”Input block 1”)
inp:bin(1:1):name?
Result: 1,”Input block 1”;
4.4.4.18 inp:ana(<input_list>):def(v,<range>)
inp:ana(<input_list>):def(i,<range>,<CTRatio>)
Parameters <input_list>:
Comma separated list of the binary/analog inputs to be configured.
v,i:
v means the input is configured as a voltage input and i means a current input. Please note
that the CMC measures always voltages in its analog inputs. For the measuring of currents, a
shunt resistor or current clam with voltage output must be provided.
<range>:
Floating point number in volts. Sets the range of the specified inputs. The range must match
the expected input in order to provide optimum resolution.
The following ranges are available for the CMC256 or newer test set: 100mV, 1V, 10V, 100V
and 600V. From these available ranges, the closest that is equal to or greater than the
provided <range> parameter is selected.
<CTRatio>:
Floating point number in V/A. This is the ratio of volts per amp of the current clamp or current
shunt being used.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_256_CMD Command requires CMC256 or greater
Examples inp:ana(4,2,5):def(v,5.0)
Configures inputs 4,2 & 5 as voltage inputs with 10V range.
inp:ana(6,10,8):def(i,1.0,0.1)
Configures inputs 6,10 & 8 as current inputs with a 1V range and a CT ratio of 100 mV/A.
inp:ana(1):def(i,0.1,0.01)
Configures input 1 as a current input with a 100 mV range and a CT ratio of 10 mV/A.
4.4.4.19 inp:ana(<input_list>):def?
Parameters <input_list>:
Comma separated list of the analog inputs whose configuration is to be displayed.
Answer The return string contains the CMC’s device number, plus one set of data for each input in
the list, as follows:
Input number
An integer with the input to which the following data refers.
Function
String: “v” for voltage inputs, “i” for current inputs, “pf” for potential-free inputs and “ps” for
potential-sensing inputs.
range
A floating point number containing the input’s range.
binary threshold
Floating point; for binary inputs in potential-sensing mode, value that the sensed voltage must
reach in order to be read as “active”
CT ratio
Floating point; current clamp or shunt ratio in V/A
Some of these values are of no relevance for a particular input (for instance the CT ratio for a
voltage input or the binary threshold for an analog input). In this case the user should simply
ignore them.
Examples inp:ana(1,2,3):def?
Result : “1,1,i,1.000000e-001,2.500000e+000,1.000000e-002,
2,ps,1.000000e+002,1.200000e+002,1.000000e+000,3,i,1.000000e-
001,2.500000e+000,2.000000e-001;”
Where:
input#1 is an analog current input with 100mV range, 2.5v binary threshold and 0.01 V/A CT
ratio
input#2 is a potential-sensing binary input with 100 V range and 2.5v binary threshold and 1
V/A CT ratio
input#3 is a current input with 100 mV range, 2.5v binary threshold and 0.2 V/A CT ratio
4.4.4.20 inp:ana(<input_list>):range?
amplitudes. The ranges are applicable whether the input is being set as voltage or current
input.
Parameters <input_list>
Comma separated list of the binary/analog inputs whose ranges are to be displayed.
Answer The return string contains the CMC’s device number, plus one set of range data for each
input in the list. The range data are a list of floating point numbers sorted from lowest to
highest, each of which represents one measuring range in RMS. Please note that no
indication of the input to which the values belong is provided; it is therefore recommended to
issue this command once for each input whose ranges we wish to obtain.
See also inp:ana(<input_list>):def(v,<range>)
inp:ana(<input_list>):def(i,<range>,<CTRatio>)
Examples inp:ana(1):range?
Result : “1,1.000000e-
001,1.000000e+000,1.000000e+001,1.000000e+002,6.000000e+002;”
This shows that input 1 has 4 possible ranges: 100mV, 1V, 10V, 100V & 600V.
Function Executes a measurement (selectable source) and stores the result into the measurement
buffer in the CMC.
Description Measures the voltage on the analog voltage input or the current on the analog current input
or the states of all binary inputs. The second version of this command is used to enable or
disable automatic sampling of all binary inputs on every change on a binary input and all
nominal change events in a signal output caused by the execution of any on or off command
(see inp:buf:get?). The results are not returned but stored into the CMC-internal
measurement buffer. You can get the samples in this buffer using the inp:buf:get?
command.
The buffer has a length of 2048 samples and it has a ring architecture. Thus if you make
more than 2048 samples without getting a sample, the samples 2049 and higher overwrite
the samples at the beginning of the buffer. When this overrun occurs, the next inp:buf:get?
command returns the keyword overrun (see description of inp:buf:get?).
The parameter <index> has different meanings for the different sources (<source>):
<index>:
This parameter is of type <integer>. Its valid range depends on the source.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter <index > is not an integer
See also inp:buf:sam(ext)
inp:buf:get?
4.4.4.22 inp:buf:sam(ext)
4.4.4.23 inp:buf:get?
Function Get the next value of all the measurements generated by inp:buf:sam commands and stored
in the buffer.
Description The first invocation of this command returns the first entry of the measurement buffer,
subsequent invocations return the following entries.
Answer Every measurement result returned consists of five pieces of information:
a type information, a time information, measurement data, an index and an optional
information.
Type information:
The type information is one of the keywords bin, dcv, dci, bcount, ecount, zcross, empty,
overrun or switchoff:
• The keywords dcv, dci, bin denote that the measurement data returned is a valid
sample from the source DC voltage inputs, DC current inputs or binary inputs made
with inp:buf:sam.
• The keyword zcross denotes that this entry was generated by a zero cross event on
any signal which was activated by a out:ana:off(zcross) command.
• The keyword empty is returned as type information when there are no entries in the
measurement buffer.
• The keywords bcount and ecount denote entries from counters.
• The keyword overrun is returned when a buffer overrun happened (The measurement
buffer in the CMC is a ring buffer. If data are fetched too slowly, values that have not
been read yet are overwritten with new ones). In both cases all other parameters
returned are 0.
• When the CMC discovers an overtemperature on one of the amplifiers the CMC's
outputs are switched OFF and the entry "switchoff" is placed into the measurement
buffer. In this case the keyword switchoff is returned with inp:buf:get?.
If the extended mode is selected (inp:buf:sam(ext) command has been issued) then the bin
type information is followed by the index of the input module for which the inputs have been
sampled. The type then is bin(<inp_module_idx>) where <inp_module_idx> is an integer
from 1 to the value returned by the inp:bin:cfg? command.
Time information:
The time information represents the content of a counter in the CMC that is converted into
seconds. The difference between the time information of two measurements represents the
time between these measurements. The first entry always contains a time information of 0.
The counter for the time information is a 24-bit counter that is incremented every 0.1ms; it
therefore overflows every 27 minutes approximately. CM Engine is capable of handling this
overflow by itself and provide accurate times, as long as at least one event is generated
within those 27 minutes. Thus you must make sure that no period of 27 minutes can elapse
without event generation, and manually generate events if needed.
Measurement data:
• If the type information is dcv or dci, a value of type <float> is returned representing the
voltage or current measured.
• If the type information is bin, an <integer> number is returned containing the states of
the binary inputs as bits set or cleared. Bit 0 represents the state of binary input 1, bit 1
represents the state of binary input 2, etc.
• If the type information is zcross an information is returned that denotes the voltage or
current generator that was switched off in its zero crossing. This information contains
kind of generator (voltage/current), the generator triple number and the generator
number.
Thus it either has the format v(<triple_no>:<gen>) or i(<triple_no>:<gen>). For
every single signal switched off in its zero crossing there is a separate entry although
they probably have been initiated together as a triple . Signals specified to be switched
off simultaneously with a signal in its zero crossing do not create an entry (see
out:ana:off(zcross)).
• If the type information is bcount or ecount an <integer> number is returned
• If the type information is overrun or empty, no valid data is returned.
Index:
If the type information keyword is dcv or dci the index information is the number of the analog
input.
• If the type information keyword is bin the index is a signature with the following meaning:
Signature Explanation
0 Nominal Change (automatically inserted with every out:ana:on or
out:ana:v():on or out:ana:i():on if automatic logging of binary inputs
changes is enabled – see inp:buf:sam(bin, on))
1 Entry produced by automatic logging or by inp:buf:sam(bin, 1) or by
inp:buf:sam(bin, on)
2 User-defined signature
3 User-defined signature
4 User-defined signature
5 User-defined signature
6 User-defined signature
7 User-defined signature
8 User-defined signature
9 User-defined signature
Optional information:
The optional information is only for entries of type bcount and ecount. All other entries
return - as optional information. For the counter entries the optional information is zcross if a
zero crossing of the counter produced the entry. Otherwise it is -.
Summary:
The following table is a summary of all type information and their measurement data returned
in the answer string:
Type information Measurement data Index Optional info
dcv measured voltage on voltage Number of voltage input -
input in Volts
type <float>
dci measured current on current Number of current input -
input in Amps
type <float>
bin measured binary inputs Signature -
type <integer>
4.4.4.24 inp:buf:get?(<no_of_entries>)
Function Get one or more of the next entries in the input buffer.
Description Get a certain number of entries in the input buffer. If there are fewer entries in the buffer, then
all entries are returned.
Parameters <no_of_entries>
Integer number representing the number of entries that are requested from the buffer. It must
be greater than 0.
Answer <dev_id>,<entries_read>{,<type_info>,<time_info>,<meas_data>,<index>,<optional>}…;
The returned string contains the device number, the number of entries actually read from the
buffer (integer value from 0 if the buffer was empty to <no_of_entries> if all requested entries
were successfully read) plus as many measured buffer entries as returned in the
<entries_read> parameter; each entry has the same format as those returned by the
inp:buf:get? command.
See also inp:buf:get?
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
Example We want to get the next 5 entries in the input buffer.
Command: inp:buf:get?(5)
Return : "1,3,bin(1),0,708,1,-,bin(1),0,708,9,-,bin(1),0,708,9,-;"
This means that only three entries were available in the buffer, the data for which follows. All
entries are binary, the second and third with index 9 meaning that they are the result of a
inp:buf:sam(bin,9) command. The extended mode is active, and all inputs have been
sampled in input module 2 of the targeted device.
4.4.4.25 inp:buf:clr
4.4.4.26 inp:count:on
4.4.4.27 inp:count:off
4.4.4.28 inp:count:clr
<count>:
This parameter is of type <integer>.
<edge>:
This parameter must be either + for rising edge or - for falling edge.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CM_ERR_COUNTER_ON Counting is already on
Possible Errors This command may cause the following CM Engine error codes:
4.4.4.32 inp:ana:cfg(<srate>,<avrg>)
Function Set the samplig frequency and averaging factor of the measuring DSP.
Description The sampling rate is the rate at which time measuring DSP makes measurements (e.g. a
sampling rate of 3.16 kHz means measurements are made 3160 times every second).
Higher sampling frequencies mean a finer resolution of the sampled wave; this is useful for
applications such as power-quality analysis and fault-recording. On the other hand, it
increases the load in the DSP and may cause a “Real Time Violation” error (see
Parameters <srate>:
Floating point number in hertz. Sets the sampling frequency of the Measuring DSP. The next
available range that is equal to or higher than the parameter is selected (so for example, a
value of 3000 will select the 3.16 kHz range). If it is above the maximum range then an error
is returned. For a CMC256 or newer test set the ranges are 3.16, 9.48 & 28.444 kHz.
<avrg>:
Floating point number. Is the averaging factor for all the multimeter commands.
The averaging factor is a value equal or less than 1 and greater than 0. It causes the results
of the multimeter commands to be averaged over a period of time. An averaging factor of 1
means no averaging. A factor close to zero means a high amount of averaging (0 is illegal).
This affects the rms, phase, frequency and power commands and is configured globally for
all of them.
By default averaging is switched off (<avrg> set to one), however if you are measuring a
steady state signal and you need extra accuracy, setting an averaging factor less than 1 will
increase the accuracy by effectively "smoothing" out any noise. (If the signal is varying quickly
it's better to have no averaging).
Where:
newValue is the value of the new result before averaging has been applied
oldValue is the value of the previous, averaged result
Examples inp:ana:cfg(9000,0.5)
Sets the 9.48 kHz sampling rate and an averaging factor of 0.5
inp:ana:cfg(28444,1.0)
Sets the 28.44 kHz sampling rate with no averaging
4.4.4.33 inp:cfg?[(ecount)]
Function Get information about the hardware configuration of the analog and binary inputs.
Description This command gets the following information about the CMC:
- number of analog inputs for DC voltage measurement
- number of analog inputs for DC current measurement
- number of binary inputs
- version number of the input/output board
or
- number of 100 kHz counter inputs
Parameters ecount (optional):
When this parameter is specified the command returns the number of 100 kHz counter
inputs.
Answer The version without parameter of the command returns a string that contains the CMC's
device number, a sequence of four comma separated <integer> values and a trailing ";".The
version with ecount returns a string that contains the CMC's device number, an <integer>
value and a trailing ";".
Possible Errors This command may cause the following CM Engine error codes:
4.4.4.34 inp:ana:cfg?(srate|avrg|firm|hard)
Answer The returned values depend on which option you supply as a parameter.
srate:
Returns the sample rate.
avrg:
Returns the averaging factor.
firm:
Returns the firmware version of the Measuring DSP.
hard:
Returns the hardware version of the Measuring DSP.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
Examples inp:ana:cfg?(srate)
Result : “1,2.844444e+004;”
inp:ana:cfg?(avrg)
Result : “1,1.000000e+000;”
inp:ana:cfg?(firm)
Result : “1,1.0.0;”
inp:ana:cfg?(hard)
Result : “1,1.0;”
4.4.5.1 gps:status?
Possible Errors This command may cause the following CM Engine error codes:
4.4.5.2 gps:reset
4.4.5.3 gps:sigma?
4.4.5.4 gps:pos?
<latitude>:
Latitude in degrees.
<longitude>:
Longitude in degrees.
<height>:
Height in meters.
<DOP>:
The DOP (ranges between 0 and 99.9) is an indication of the quality of the results that can be
expected from a GPS point position.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_GPS_BUSY The command was issued when the CMGPS was
still initializing, or processing the previous
command.
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.
<longitude>:
Longitude in degrees. Valid range from -180 to 180.
<height>:
Height in meters. Valid range from -1000.00 to 18000.00
Possible Errors This command may cause the following CM Engine error codes:
Example gps:pos(63.2359,-100.3321,423.44)
Sets a position of 63.2359° latitude, -100.3321° longitude, 423.44 meters
4.4.5.6 gps:def?
Function Indicates that a CMGPS device has been found on the specified CMC.
Description It is useful to issue this command first to see if any CMGPS devices have been detected
before issuing any other GPS commands.
Answer 1 = CMGPS device has been found
0 = no CMGPS exists
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_GPS_BUSY The command was issued when the CMGPS was
still initializing, or processing the previous
command.
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.
4.4.5.7 gps:time:timemode?
4.4.5.8 gps:time:utc?
Function Get the time difference between UTC and GPS time.
Description This function returns the time difference between UTC and satellite time. This time difference
has to be added to the satellite time to get UTC.
Answer returns two integers: <UTC diff>,<valid>
<UTC diff>:
time difference in seconds
<valid>:
0 = the time difference is not valid (i.e. not available yet), 1 = time difference is valid
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_GPS_BUSY The command was issued when the CMGPS was
still initializing, or processing the previous
command.
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.
4.4.5.9 gps:time:sync(<ch>,<rate>,<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>)
Function Sets the synchronization rate and time for synchronization pulses on the specified channel.
Description The CMGPS has two "trigger" channels. The start date and time and the rate of pulses on
both channels can configured using this command.
Parameters All 8 parameters are of type <integer>
<ch>:
channel (0 or 1)
<rate>:
synchronization rate in seconds, allowed values (0..65535). Note: a value of 0 means only a
single pulse will be triggered.
<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>:
starting time and date of the synchronization pulses
Please note Do not use leading zeroes in any of the parameters.
Possible Errors This command may cause the following CM Engine error codes:
4.4.5.10 gps:time:sync?(<ch>)
Function Gets the synchronization rate and time for specified channel.
Description The CMGPS has two "trigger" channels. The configured start date and time and the rate of
pulses on either channels can be returned using this command.
Parameters <ch>:
channel (0 or 1)
Answer The command returns 7 values of type <integer>:
<rate>,<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>.
<rate>:
synchronization rate in seconds, allowed values (0..65535). A value of 0 means only a single
pulse is triggered.
<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>:
starting time and date of synchronization pulses
Possible Errors This command may cause the following CM Engine error codes:
4.4.5.12 gps:time:datetime?
Description This always returns satellite time + the GMT offset, but not including seasonal offset (i.e.
Winter saving time). If the status is queried, it can be seen if the time received from the
satellites is available. If the satellite time is not available, then this command will return the
time from the internal CMGPS clock.
Answer The command returns date and time as six values of type <integer>:
<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.
CMERR_GPS_BUSY The command was issued when the CMGPS was
still initializing, or processing the previous
command.
Example The command gps:time:datetime? returns e.g. the string "1,1998,10,12,11,54,34;". This
stands for October 12, 1998, 11:54:34 am.
4.4.5.13 gps:setup:mode?
4.4.5.14 gps:setup:mode(<accuracy_mode>)
Possible Errors This command may cause the following CM Engine error codes:
4.4.5.15 gps:setup:gmt?
<mm>:
Minutes. Valid range from 0 to 59.
Possible Errors This command may cause the following CM Engine error codes:
4.4.5.18 gps:setup:cfg?(addr)
Function Returns the device address for serial communication for the GPS device.
Description This command returns the address for serial communication as a string. This address can be
used to communicate with the device over the RS485 interface.
Answer The command returns a string that contains the GPS device address.
Possible Errors This command may cause the following CM Engine error codes:
Examples Suppose you have connected a CMGPS to the CMC you would get an answer like this to the
command gps:setup:cfg?(addr): “1,3;”. This means that the device address of the GPS
device is 0x03.
If the edge type is changed, the change only takes effect the next time the user configures
the pulse using the gps:time:sync command.
Parameters All 4 parameters are of type <integer>
<LED ch>:
channel that the LED is connected to (0 or 1).
<sync type>:
0 = channels operate separately, 1 = channels connected together (i.e. they operate in sync)
<edge type0>:
edge type for channel 0, 0 = negative, 1 = positive
<edge type1>:
edge type for channel 1, 0 = negative, 1 = positive
Possible Errors This command may cause the following CM Engine error codes:
Example gps:setup:pulse(1,0,1,1)
means that the LED reflects status of channel 1, the channels are separate and the edge
type is positive for both channels
gps:setup:pulse(0,1,0,0)
means that the LED reflects status of channel 0, both channels are in sync and the edge type
is negative
4.4.5.20 gps:setup:pulse?
<LED ch>:
channel that the LED is connected to (0 or 1).
<sync type>:
0 = channels operate separately, 1 = channels connected together (i.e. they operate in sync)
<edge type0>:
edge type for channel 0, 0 = negative, 1 = positive
<edge type1>:
edge type for channel 1, 0 = negative, 1 = positive
Possible Errors This command may cause the following CM Engine error codes:
4.4.5.21 gps:setup:cable?
4.4.5.22 gps:setup:cable(<delay>)
4.4.5.23 gps:setup:save
4.4.6.1 irigb:cfg(<cfg_no>)
Parameters <cfg_no>:
The number of the IRIG-B configuration that should be applied.
Please note! If a configuration activates the IRIG-B decoder it could be possible that a reset of the decoder
is needed after the configuration.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IRIGB_NOT_LOCKED Communication error during command execution.
CMERR_IRIGB_NOT_AVAIL IRIG-B functionality is not available on this device
CMERR_OUT_OF_RANGE IRIG-B configuration number is out of range.
4.4.6.2 irigb:cfg?
4.4.6.3 irigb:cfg?(<cfg_no>)
4.4.6.4 irigb:def?
Function Indicates whether a CMIRIG-B device has been found on the specified CMC and returns the
selected IRIG-B configuration.
Description With this command it is possible to determine if a CMIRIG-B device is connected to the CMC
and to read the selected IRIG-B configuration from the device. If a CMIRIG-B device is
detected an additional value indicates whether an external device (e.g., CMGPS) is
connected to the CMIRIG-B device.
Please note! IRIG-B functionality is available on each network-based CMC device. The CMIRIG-B device
is not necessary to use IRIG-B.
Answer The command returns three values:
<cfg_no>,<dev_conn>,<ext_dev_conn>
<cfg_no>:
Configuration number of the selected IRIG-B configuration. 0 means that IRIG-B is not
configured. In this case the two following values are 0.
<dev_conn>:
1 = CMIRIG-B device has been found
0 = no CMIRIG-B device connected
<ext_dev_conn>:
1 = external device is connected to the CMIRIG-B device
0 = no external device is connected to the CMIRIG-B device
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
4.4.6.5 irigb:datetime?
Function Gets the current date and time of the active IRIG-B source depending on the selected IRIG-B
configuration.
Description This command returns the current date and time of the active IRIG-B source. The selected
IRIG-B configuration defines where the date/time is taken from. If no configuration is set the
command returns zero for each value.
The received IEEE C37.118 control function (CF) value and the straight binary seconds
(SBS) value are returned as well. The IEEE C37.118 control function (CF) value contains the
parity bit. With the SBS value it is possible to check the received time.
Answer The command returns 9 values:
<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>,<doy>,<SBS>,<CF>
<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>,<doy>:
Current date and time of the IRIG-B decoder. <doy> is the day of the year.
<SBS>:
Straight binary seconds. Seconds of the day. This is redundant information to the time.
<CF>:
The CF value is of type <int>. The IEEE C37.118 control function (CF) assignment can be
found in the following table:
Bit Description IRIG-B Comment
Pos. ID
0 LSP P60 Leap Second Pending (LSP)
Becomes 1s up to 59s before
leap second insert
1 LS P61 Leap Second (LS)
0 = add LS / 1 = delete LS
2 DSP P62 Daylight Saving Pending (DSP)
Becomes 1s up to 59s before
DST change
3 DST P63 Daylight Savings Time (DST)
Becomes 1 during DST
Please note! If a coded expression is selected which doesn't contain the year information the returned
values <yyyy>,<mm>,<dd> are calculated based on the year 2000.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_IRIGB_NOT_AVAIL IRIG-B functionality is not available on this device
Function Configures the IRIG-B encoder format and sets the date and time.
Description This command configures the signal format of the IRIG-B encoder and sets the date and
time.
The <CF> parameter specifies the following IEEE C37.118 control function (CF) bits:
Bit Description IRIG-B Comment
Pos. ID
0 LSP P60 Leap Second Pending (LSP)
Becomes 1s up to 59s before
leap second insert
1 LS P61 Leap Second (LS)
0 = add LS / 1 = delete LS
2 DSP P62 Daylight Saving Pending (DSP)
Becomes 1s up to 59s before
DST change
3 DST P63 Daylight Savings Time (DST)
Becomes 1 during DST
4 Time Offset 1 P65 Time Offset binary
5 Time Offset 2 P66 Offset from coded IRIG-B time
6 Time Offset 4 P67 to UTC time
7 Time Offset 8 P68
8 Time Offset sign P64 Time offset sign
0 = +, 1 = -
9 Time Offset-0.5h P70 0.5h Time Offset
0 = none, 1 = additional 0.5h
time offset
10 0
11 0
12 TimeQuality P71 Time Quality
13 TimeQuality P72 4-bit code representing
14 TimeQuality P73 approx. clock time error
15 TimeQuality P74 (details in Error! Reference
source not found.)
16 0
17 0
18 0
19 0
20 0
21 0
22 0
23 0
4.4.6.7 irigb:enc:cfg?
parity errors in the general status register. A parity error is always reported in the IRIG-B
status register.
It is possible to write the new configuration to the encoder in two ways: synchronously (sync)
and synchronously (async). Which one should be used can be defined with the
<write_mode> parameter. Details can be found at the beginning of chapter 4.4.6.
Please note! In worst case it can take up to two seconds until the new configuration takes effect.
Parameters <parity_mode>:
Here you must specify one of the keywords odd or even.
<mod>:
This parameter is of type <int>. Only Value 0=PWM is allowed.
<coded_expr>:
This parameter is of type <int>. Values from 0 to 7 are allowed. Details can be found in the
IRIG-B specification.
<parity_err_status>:
Here you must specify one of the keywords on or off.
<write_mode>:
Here you must specify one of the keywords sync or async.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IRIGB_NOT_LOCKED Communication error during command execution.
CMERR_IRIGB_NOT_AVAIL IRIG-B functionality is not available on this device
See also command irigb:dec:cfg?
4.4.6.9 irigb:dec:cfg?
4.4.6.10 irigb:dec:scan?
The <successful> value shows if the detection was successful or not. After a successful
detection the IRIG-B decoder is configured with the detected parameter values and a reset of
the IRIG-B decoder is performed. In case of an unsuccessful detection the configuration of
the IRIG-B decoder is left unchanged.
If control function (CF) bits are detected the reporting of parity errors in the general status
register is turned on otherwise off.
If you use this command to detect the IRIG-B decoder signal parameters check always the
IRIG-B status register afterwards.
Answer The command returns 5 values:
<successful>,<parity_mode>,<mod>,<coded_expr>,<parity_err_status>
<successful>:
This value is of type <int>. Value 0="No successful detection" or 1="Detection was
successful".
<parity_mode>:
odd or even parity calculation.
<mod>:
This value is of type <int> and can have the value 0 for PWM or 2 Manchester modulation.
<coded_expr>:
This value is of type <int> and can have a value between 0 and 7. Details can be found in the
IRIG-B specification.
<parity_err_status>:
Parity error reporting in general status register on or off.
Please note! This command can take up to five seconds.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_IRIGB_NOT_LOCKED Communication error during command execution.
CMERR_IRIGB_NOT_AVAIL IRIG-B functionality is not available on this device
4.4.6.11 irigb:dec:reset
4.4.6.12 irigb:dec:sync(<yyyy>, <mm>, <dd>, <hh>, <mm>, <ss>, <rate>, < write_mode>)
irigb:dec:sync(<yyyy>, <doy>, <hh>, <mm>, <ss>, <rate>, < write_mode>)
Function Sets the trigger date, time and pulse rate for the IRIG-B decoder.
Description This command defines a trigger time for the IRIG-B decoder at which it should start to send
the programmable pulse (PPX) defined with the pulse rate.
The <rate> parameter defines the pulse rate in seconds.
It is possible to write the new configuration to the decoder in two ways: synchronously (sync)
and synchronously (async). Which one should be used can be defined with the
<write_mode> parameter. Details can be found at the beginning of chapter 4.4.6.
Parameters <yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>:
Time and date to be set for the trigger. If the configured coded expression for the decoder
does not contain the year information (0-3) it is ignored for the trigger. The year parameter is
only used to calculate the day of the year.
<yyyy>,<doy>,<hh>,<mm>,<ss>:
Time and day of the year to be set for the trigger. Values between 1 to 366 allowed (leap
year). If the configured coded expression for the decoder does not contain the year
information (0-3) it is ignored for the trigger.
<rate>:
This parameter is of type <int>. Pulse rate in seconds for the programmable pulse (PPX).
<write_mode>:
Here you must specify one of the keywords sync or async.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IRIGB_NOT_LOCKED Communication error during command execution.
CMERR_INVALID_DATE The date and time is not valid
CMERR_IRIGB_NOT_AVAIL IRIG-B functionality is not available on this device
4.4.6.13 irigb:dec:sync?
Function Gets the current configured trigger start time and the pulse rate.
Description This command returns the configured start time and pulse rate of the IRIG-B decoder trigger.
A sequence consists of one or more steps. Every step consists of an execution part with one or more string
commands and a terminating seq:wait command. The string commands in the execution part are common
string commands (e.g. out:v(1):a(20);f(50)) or a string command to control the sequence (e.g. seq:set or
seq:add). Note: not all string commands are allowed in sequences, the commands that are not allowed are
listed below.
You can set this counter to a value in the 0 - 65535 range using the seq:set command.
You can set these two counters to a value in the following range using the seq:set or seq:add
commands:
24
0 ≤ count(n) ≤ 2 -1
• timer
This is a user definable timer that you can modify via the seq:set and seq:add commands.
You can set it to a value in seconds in the following range:
0 ≤ timer ≤ approx. 838 seconds
• timeout
Normally this counter is set and used in a seq:wait command only, but you can also modify it via the
seq:set and seq:add commands in the same range as the timer counter.
In a seq:wait command the values of all counters except timeout can be compared to zero; i.e. you can ask
if a specific counter equals zero or not. The timeout counter is tested in the timeout condition of the seq:wait
statement, not in the trigger condition (see seq:wait command).
4.4.7.1 seq:begin
4.4.7.2 seq:end
Function Use the commands seq:begin and seq:end to mark the beginning and the end of a string
command sequence that can be executed by a CMC in real-time.
Description All commands you send to the CM Engine between the commands seq:begin and seq:end
are not executed immediately but are interpreted as parts of a sequence and thus are stored
in the sequence buffer in the CMC.
The seq:begin command implies the execution of an out:resetopt and a seq:clr, i.e. all
signal settings are written to the sequence buffer and the sequence buffer is cleared.
After you have stored a complete sequence in the buffer, you can start it with the seq:exec
command.
The string commands that you can't use in a sequence, i.e. that you can't send between a
seq:begin and a seq:end, are as follows:
sys:reset
sys:cfg?
sys:status?
sys:test?
amp:def
amp:def?
amp:scan?
amp:param?
amp:route
amp:route?
amp:ctrl
amp:ctrl?
seq:begin
seq:clr
seq:exec
seq:status?
seq:stop
out:pmode?
out:user:alloc?
out:user:app
out:user:status?
out:user:free
out:cfg?
The string commands that you can't use outside a sequence, i.e. that you can't execute
outside a seq:begin and a seq:end, are as follows:
seq:set(count(n), )
seq:set(timer, )
seq:add(count(n), )
Please note The command seq:begin clears the sequence buffer and thus erases all sequence data of a
previous sequence!
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_NOT_IN_SEQ_MODE Command can only be used after seq:begin
See also command seq:exec
4.4.7.3 seq:clr
Function Clear the sequence buffer and all sequence data stored there.
Description Use this command to erase all your previous sequence definitions from the sequence buffer.
This command implies out:resetopt.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
4.4.7.4 seq:exec
Function Start the sequence stored in the CMC's sequence buffer. This command implies
out:resetopt.
Description If there is no sequence stored in the CMC's sequence buffer nothing happens.
See also command seq:stop
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
Function With this command you can set one of the user modifiable counters to a value.
Description All keywords specify user-modifiable counters except the timeout keyword. If this is used,
the timeout of the currently executing sequence statement is set to the provided <value>. The
sequence must be waiting as a seq:wait() statement whith a timeout, otherwise the
command is disregarded. If the timeout value is set to 0, the execution of the sequence
continues immediately, jumping to the jump distance defined for the case of timeout elapsed.
In this way, the time delay hard-coded in the sequence programming can be modified at run-
time.
Parameters You must specify one of the keywords loop, count(1), count(2), timer or timeout.
<value>:
The parameter <value> is of type <integer> for loop and count and of type <float> for timer
and timeout.
The possible range for every counter is described above with the description of the counters.
It is possible to set the loop counter outside of sequence programming either before starting
a sequence with seq:exec or during a running sequence.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT Parameter <value> has to be <integer>
CMERR_INVALID_FLOAT Parameter <value> has to be <float>
CMERR_NOT_IN_SEQ_MODE Command can only be used after seq:begin
Function With this command you can add a number to the content of one of the user modifiable
counters.
Parameters You must specify one of the keywords count(1) or count(2)
<rel_steps>:
This parameter is of type <integer>. The possible range for the two counters count(n) is
described above with the description of these counters.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter <rel_steps> is not an integer
CMERR_NOT_IN_SEQ_MODE Command can only be used after seq:begin
Description When a sequence is running, you can use the keyword step (command seq:status?(step))
to get the number of the sequence step that is currently executed. The sequence steps in the
sequence memory are numbered from 1 to n. When the command returns a zero, there is no
sequence in the buffer or the sequence in the buffer is not running.
When a sequence is running, or after the sequence is finished, you can use the keyword
loop (command seq:status?(loop)) to get the content of the loop counter described above.
You can equally use the keywords count(1) (command seq:status?(count(1))) and
count(2) (command seq:status?(count(2))) to read the values in these user-modifiable
counters.
With the keyword mem (command seq:status?(mem)) you can get the amount of free
memory in the sequence buffer. While storing a sequence into the CMC's sequence buffer
you can use this command to look up the amount of memory that is still free. When you use
this command before you have stored any commands into the sequence buffer (or after a
seq:clr) it returns the total amount of memory of the sequence buffer. The number returned
is in units of memory words. But the amount of memory consumed by different commands
stored within a sequence depends on the complexity and the number of parameters and can
not be exactly specified.
Parameters You must specify one of the keywords step, loop, count(1), count(2) or mem.
Answer The answer string contains the device number and a value of type <integer>.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
4.4.7.8 seq:stop
Function Mark the end of a sequence step. The command contains one of the following conditions
- A trigger condition that halts the execution of the sequence and waits until the trigger
condition is fulfilled. When the trigger condition is fulfilled, the sequencer jumps to a
sequence step defined by <trigger_jump_distance> and continues the execution there.
- A time limit in seconds. The sequencer halts the execution of the sequence until this
timeout condition is reached. When this timeout condition is fulfilled, the sequencer jumps
to a sequence step defined by <timeout_jump_distance> and continues the execution
there.
- When you specify both a trigger condition and a timeout condition in this command, the
commands waits until the trigger condition is fulfilled or until the timeout condition is fulfilled.
Description The end of a sequence step is always marked by a seq:wait command.
As already described there are three possible combinations of wait conditions that can be
specified in this command:
- A <trigger_condition> together with its related parameter <trigger_jump_distance>.
One sequence step consists of all statements between two seq:wait commands and
between the seq:begin and the first seq:wait or the last seq:wait and the seq:end
command respectively.
seq:begin
out:...
out:... jump_distance=0
seq:wait
jump_distance=1 jump_distance=-1
out:...
out:... jump_distance=2
seq:wait
out:...
jump_distance>1
out:...
seq:end
Parameter <timeout_condition>:
A timeout condition is a number of type <float> that defines the length of the time interval in
seconds, e.g.: 0.34 defines a timeout condition of 340 milliseconds. The timeout value has
the following limits:
0 ≤ timeout ≤ approx. 838 seconds
Parameter <trigger_condition>:
In a trigger condition you can use the following expressions:
- to name a specific binary input:
bin(<integer>) binary input number <integer>, e.g. bin(1).
⇒ The condition is TRUE, when this input is active ("1").
count(1)=0
count(1)<>0
count(2)=0
count(2)<>0
- as boolean operators:
not(<bin(X)>) negation of a binary input
and logical AND of 2 expressions
or logical OR of 2 expressions
The expression
not(bin(1) and bin(2)) or bin(3) and bin(4)
is transformed into the valid trigger condition
not(bin(1)) or not(bin(2)) or bin(3) and bin(4).
- The resulting expression must comply with the following rules:
A binary input can either be used negated or not negated and every or expression can
only have one and expression as argument.
Parameters <trigger_condition>:
This parameter is assembled as described above.
<trigger_jump_distance>:
This parameter is a number of type <integer>.
<timeout_condition>:
This parameter is a value of type <float>.
<timeout_jump_distance>:
This parameter is a number of type <integer>.
Example seq:wait(bin(2),2,0.5,1)
This wait-command waits until the binary input 2 is "1" or until 0.5 seconds have passed. The
If you want to use the waveforms tri, square, sum, user in a sequence, please use the following method.
Normally you would define a waveform in a sequence like this:
seq:begin
out:ana:v(1:3):wav(sum, 1, 3, 0.33, 0)
seq:end
To use the above waveforms in a sequence you have to assign this waveform to the desired signal before the
beginning of the sequence:
out:ana:v(1:3):wav(sum, 1, 3, 0.33, 0)
seq:begin
out:ana:v(1:3):wav(sum, 1, 3, 0.33, 0)
seq:end
The reason is that sample values used within a sequence must be downloaded before the execution of the
sequence.
• The following example outputs a sine signal of 100V and 100Hz on voltage output 1 with a duration of 5
seconds:
seq:begin
out:ana:v(1:1):a(100);f(100)
out:ana:v(1:1):on
seq:wait(5, 1)
out:ana:v(1:1):off
seq:end
seq:exec
• The following example outputs a sine signal of 100V and 100Hz on voltage output 1 until digital input 1 is
active (HIGH):
seq:begin
out:ana:v(1:1):a(100);f(100)
out:ana:v(1:1):on
seq:wait(bin(1), 1)
out:ana:v(1:1):off
seq:end
seq:exec
• The following example outputs a sine signal of 100V and 100Hz on voltage output 1 until digital inputs 1 or
2 are active (HIGH):
seq:begin
out:ana:v(1:1):a(100);f(100)
out:ana:v(1:1):on
seq:wait(bin(1) or bin(2), 1)
out:ana:v(1:1):off
seq:end
seq:exec
• The following example outputs a sine signal of 100V and 100Hz on voltage output 1 until digital inputs 2
and 3 are active (HIGH):
seq:begin
out:ana:v(1:1):a(100);f(100)
out:ana:v(1:1):on
seq:wait(bin(2) and bin(3), 1)
out:ana:v(1:1):off
seq:end
seq:exec
• The following example outputs a sine signal of 100V and 100Hz on voltage output 1 until digital input 3 is
HIGH or digital input 5 is LOW:
seq:begin
out:ana:v(1:1):a(100);f(100)
out:ana:v(1:1):on
seq:wait(bin(3) or not(bin(5)), 1)
out:ana:v(1:1):off
seq:end
seq:exec
• The following example outputs a sine signal of 100V and 100Hz on voltage output 1 and decrements it by
10V every second. A HIGH on digital input 1 switches off this signal.
seq:begin
out:ana:v(1:1):a(100);f(100)
out:ana:v(1:1):on
out:ana:v(1:1):a(-10, step)
seq:wait(0, 1)
out:ana:step
seq:wait(bin(1), 1, 1, 0)
out:ana:v(1:1):off
seq:end
seq:exec
• The following example outputs a sine signal of 100V and 100Hz on voltage output 1 with a duration of 3
seconds. In this example the timer is used to set the time limit.
seq:begin
out:ana:v(1:1):a(100);f(100)
out:ana:v(1:1):on
seq:set(timer, 3)
seq:wait(timer, 1)
out:ana:v(1:1):off
seq:end
seq:exec
• The following example outputs a sine signal of 100V and 100Hz on voltage output 1 that is decremented 5
times by 10V every 1 second.
seq:begin
out:ana:v(1:1):a(100);f(100)
out:ana:v(1:1):on
out:ana:v(1:1):a(-10, step)
seq:set(loop, 6)
seq:wait(1, 1)
out:ana:step
seq:wait(loop = 0, 1, 1, 0)
seq:wait(1,1)
out:ana:v(1:1):off
seq:end
seq:exec
• The following example outputs a sine signal of 100V and 100Hz on voltage output 1 that switched on for a
second and then switched off for a second. If digital input 1 is HIGH this loop is ended and the output is
switched off immediately.
seq:begin
out:ana:v(1:1):a(100);f(100)
seq:wait(0, 1)
out:ana:v(1:1):on
seq:wait(bin(2), 2, 1, 1)
out:ana:v(1:1):off
seq:wait(bin(1), 1, 1, -1)
out:ana:resetopt
out:ana:v(1:1):off
seq:end
seq:exec
4.4.10.1 inp:avail?(scope|multimeter)
4.4.10.2 inp:mode(scope|multimeter)
The Measurement DSP (digital signaling processor) then processes each task on the task vector once every
sample period. In order to get a more accurate reading the measuring DSP does not return the results of
these individual samples immediately, but takes a number of samples over the integration time, and then
returns an average result of all the samples.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Samples
In the above example the integration time is 10 samples, which would be 3.16 ms if the sampling frequency
were on the 3.16 kHz range.
To calculate the maximum amount of commands that can be issued simultaneously requires considering how
the measurement workload is assigned to the Measurement DSP.
Each multimeter command that the user issues, causes a certain amount of "measurement tasks" to be
issued on the task vector of the Measurement DSP. Only 15 measurement tasks are allowed on the task
vector at any one time. The DC input handling counts as one measurement task.
RMS command:
N = RoundUp(Inp / 3)
Phase:
N = RoundUp(1 + (Inp – 2) / 3)
Freq:
N = Inp
Power:
N = number of power signals being measured (i.e. Inp / 2)
DC task:
N = 1, if it's on
You have to apply the appropriate formula once for each multimeter command issued, then add the results.
Example:
The following commands are issued:
inp:ana(1,2,3,4):rms?(1.0)
inp:ana(1,2,3,4):phase?(1.0)
inp:ana(1,5,2,6):power?(1.0)
inp:ana(3,4):freq?(24, 0.0)
Note:
If you issue two of the same commands the formulas have to be applied separately for each of them, for
example:
inp:ana(1):rms?(1.0)
inp:ana(2):rms?(1.0)
...uses 2 tasks, while
inp:ana(1,2):rms?(1.0)
...uses only one.
For this reason you should try to group all inputs into one command.
4.4.11.1 inp:ana(<input_list>):rms?(<itime>)
Parameters <input_list>
Comma separated list of the binary/analog inputs that are being measured.
<itime>
Integration Time in seconds.
Answer The return value contains the device number and the command handle that will be later
passed as parameter to inp:ana:get?
When invoked later, inp:ana:get? will return a string containing the device number followed
by one set of data per input in <input_list>, as follows:
<RMS_AC >
Floating point value containing the RMS value of the AC component of the measured signal.
<rms_validity>
Integer containing the validity flags of the <RMS_AC> measurement.
<DC_value>
Floating point value containing the DC component of the measured signal.
<dc_validity>
Integer containing the validity flags of the <DC_value> measurement.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_BIN_INPUT Some of the inputs in the input list was configured
as binary input.
CMERR_TASK_VECTOR_FULL The DSP cannot accept more tasks
CMERR_NOT_MM_MODE This command is only allowed in multimeter
mode
See also inp:mode(multimeter|scope)
inp:avail?(multimeter|scope)
inp:ana:get?
Examples inp:ana(4,5,6):rms?(1.0)
Result : “1,1;”
inp:ana:get?(1)
Result : “1,2.733320e-004,0,-2.831995e-003,0,5.412996e-004,0,-2.797413e-
002,0,2.704000e-002,0,-2.498741e-001,0;”
In this example inputs 4, 5 & 6 are being measured. The integration time is 1 second.
For each input a AC and a DC result is returned (6 results for the given example), each with
its applicable validity flags.
4.4.11.2 inp:ana(<input_list>):peak?(<rtime>)
Parameters <input_list>
Comma separated list of the binary/analog inputs that are being measured.
<rtime>
Time interval for the detection of the peak values in seconds.
Answer The return value contains the device number and the command handle that will be later
passed as parameter to inp:ana:get?
When invoked later, inp:ana:get? will return a string containing the device number followed
by one set of data per input in <input_list>, as follows:
<Peak_max>
Floating point value containing the maximum peak value detected during <rtime>.
<max_validity>
Integer containing the validity flags of the < Peak_max > measurement.
<Peak_min>
Floating point value containing the minimum peak value detected during <rtime>.
<min_validity>
Integer containing the validity flags of the < Peak_min > measurement.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_BIN_INPUT Some of the inputs in the input list was configured
as binary input.
CMERR_TASK_VECTOR_FULL The DSP cannot accept more tasks
CMERR_NOT_MM_MODE This command is only allowed in multimeter
mode
See also inp:mode(multimeter|scope)
inp:avail?(multimeter|scope)
inp:ana:get?
Examples inp:ana(4):peak?(10)
Result : “1,1;”
inp:ana:get?(1)
Result : “1,3.55423e+001,0,-3.55312e+001,0;”
In this example input 4 is set to detect the peak values of the signal during time intervals of
10s. For each input a maximum and minimum peak are returned, each with its applicable
validity flags.
4.4.11.3 inp:ana(<input_list>):phase?(<itime>)
Parameters <input_list>:
Comma separated list of the binary/analog inputs that are being measured. The first input is
always the reference channel.
<itime>
integration time in seconds.
Answer The return value contains the device number and the command handle that will be later
passed as parameter to inp:ana:get?
When invoked later, inp:ana:get? will return a string containing the device number followed
by one set of data per input in <input_list>, as follows:
<Phase >
Floating point value containing the phase of the AC component of the measured signal. Since
the first input in the list is the reference, the value of <Phase> for it will always be 0.
phase_validity>
Integer containing the validity flags of the <Phase> measurement.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_BIN_INPUT Some of the inputs in the input list were
configured as binary input.
CMERR_TASK_VECTOR_FULL The DSP cannot accept more tasks
Examples inp:ana(4,5,6):phase?(1.0)
Result : “1,1;”
inp:ana:get?(1)
Result : “1,0.0,0,0.000000e+000,2,0.000000e+000,2;”
In this example inputs 4, 5 & 6 are being measured. The integration time is 1 second.
Because this command measures the frequency over a set number of periods, instead of
having a fixed integration time, the lower the frequency of the signal is, the longer it takes to
return a result.
Parameters <input_list>:
Comma separated list of the binary/analog inputs that are being measured.
<#periods>:
Integer. The number of periods over which the frequency is measured. Normally 25 are
enough to get an accurate reading.
<start level>:
Floating point. This is the level that the measurement takes as the beginning of the cycle. For
example if the start level were two volts then the period would be measured as follows:
whilst if the level were 0V then the measurement would be like this:
Answer The return value contains the device number and the command handle that will be later
passed as parameter to inp:ana:get?
When invoked later, inp:ana:get? will return a string containing the device number followed
by one set of data per input in <input_list>, as follows:
<Frequency >
Floating point value containing the frequency of the measured signal.
<freq_validity>
Integer containing the validity flags of the <Frequency> measurement.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_BIN_INPUT Some of the inputs in the input list were
configured as binary input.
CMERR_TASK_VECTOR_FULL The DSP cannot accept more tasks
CMERR_NOT_MM_MODE This command is only allowed in multimeter
mode
See also inp:mode(multimeter|scope)
inp:avail?(multimeter|scope)
inp:ana:get?
Examples inp:ana(4):freq?(25,0.0)
Result : “1,1;”
inp:ana:get?(1)
Result : “1,5.012000e+001,0;”
This shows the frequency being measured on inputs 4,5 & 6 over 25 periods, starting at a
level of 0V.
4.4.11.5 inp:ana(<input_list>):power?(<itime>)
See the inp:ana:get? command for the explanation of the validity codes.
Parameters <input_list>:
For each power measurement being made, you need to specify the voltage input and the
current input, as follows: <Power1Volt>, <Power1Current>, <Power2Volt>, <Power2Current>,
etc...
<itime>:
Integration time in seconds.
Answer The return value contains the device number and the command handle that will be later
passed as parameter to inp:ana:get?
When invoked later, inp:ana:get? will return a string containing the device number followed
by one set of data per v/i pair in <input_list>, as follows:
<Active_power>
Floating point value containing the measured active power, in Watts
<W_validity>
Integer containing the validity flags of the <Active_power> measurement.
<Apparent_power>
Floating point value containing the measured apparent power, in VA
<va_validity>
Integer containing the validity flags of the <Apparent_power> measurement.
<Reactive_power>
Floating point value containing the measured reactive power, in var
<var_validity>
Integer containing the validity flags of the <Reactive_power> measurement.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_BIN_INPUT Some of the inputs in the input list were
configured as binary input.
CMERR_TASK_VECTOR_FULL The DSP cannot accept more tasks
CMERR_NOT_MM_MODE This command is only allowed in multimeter
mode
CMERR_INVALID_NO_INPUTS The input list does not contain a valid (even)
number of inputs
CMERR_INVALID_VI_PAIR The inputs in the input list are not correctly
arranged in v/i pairs
See also inp:mode(multimeter|scope)
inp:avail?(multimeter|scope)
inp:ana:get?
Examples inp:ana(2,1):power?(1.0)
Result : “1,1;”
inp:ana:get?(1)
Result : “1,3.662120e-006,0,3.483803e-005,0,3.464501e-005,0,1.051185e-001,0;”
In this example input 2 is configured as voltage and input 1 as current. The integration time is
1 second. The results returned are: Active Power = 3.662120e-006 W, Apparent Power =
3.483803e-005 VA, Reactive Power = 3.464501e-005 var, cos ϕ = 1.051185e-001
4.4.11.6 inp:ana(<input_list>):sum?(<itime>)
<itime>:
Integration time in seconds.
Answer The return value contains the device number and the command handle that will be later
passed as parameter to inp:ana:get?
When invoked later, inp:ana:get? will return a string containing the device number followed
by one set of data per input triple in <input_list>, as follows:
<RMS_SUM >
Floating point value containing the RMS value of the AC component of the calculated
resultant.
<rms_validity>
Integer containing the validity flags of the <RMS_SUM> measurement.
<DC_SUM>
Floating point value containing the DC component of the calculated resultant.
<dc_validity>
Integer containing the validity flags of the <DC_SUM> measurement.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_BIN_INPUT Some of the inputs in the input list were
configured as binary input.
CMERR_TASK_VECTOR_FULL The DSP cannot accept more tasks
CMERR_NOT_MM_MODE This command is only allowed in multimeter
mode
CMERR_INVALID_NO_INPUTS The input list does not contain a valid (multiple of
three) number of inputs
See also inp:mode(multimeter|scope)
inp:avail?(multimeter|scope)
inp:ana:get?
Examples inp:ana(1,2,3):sum?(1.0)
Result : “1,1;”
inp:ana:get?(1)
Result : “1,3.662120e-006,0,3.483803e-005,0,3.464501e-005,0,1.051185e-001,0;”
In this example input 2 is configured as voltage and input 1 as current. The integration time is 1 second. The
results returned are: Effective = 3.662120e-006, Apparent = 3.483803e-005, Reactive = 3.464501e-005,
cos ϕ =1.051185e-001
4.4.11.7 inp:ana(<input_list>):diff?(<itime>)
Parameters <input_list>:
For each diff measurement being made, you need to specify three inputs that will be taken as
a three-phase system.
<itime>:
Integration time in seconds.
Answer The return value contains the device number and the command handle that will be later
passed as parameter to inp:ana:get?
When invoked later, inp:ana:get? will return a string containing the device number followed
by one set of data per input triple in <input_list>, as follows:
<RMS_VAB >
Floating point value containing the RMS value of the AC component of VAB.
<vab_validity>
Integer containing the validity flags of the <RMS_VAB> measurement.
<DC_VAB>
Floating point value containing the DC component of VAB.
<dcab_validity>
Integer containing the validity flags of the <DC_VAB> measurement.
<RMS_VBC >
Floating point value containing the RMS value of the AC component of VBC.
<vbc_validity>
Integer containing the validity flags of the <RMS_VBC> measurement.
<DC_VBC>
Floating point value containing the DC component of VBC.
<dcbc_validity>
Integer containing the validity flags of the <DC_VBC> measurement.
<RMS_VCA >
Floating point value containing the RMS value of the AC component of VCA.
<vca_validity>
Integer containing the validity flags of the <RMS_VCA> measurement.
<DC_VCA>
Floating point value containing the DC component of VCA.
<dcca_validity>
Integer containing the validity flags of the <DC_VCA> measurement.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_BIN_INPUT Some of the inputs in the input list were
configured as binary input.
CMERR_TASK_VECTOR_FULL The DSP cannot accept more tasks
CMERR_NOT_MM_MODE This command is only allowed in multimeter
mode
CMERR_INVALID_NO_INPUTS The input list does not contain a valid (multiple of
three) number of inputs
See also inp:mode(multimeter|scope)
inp:avail?(multimeter|scope)
inp:ana:get?
Examples inp:ana(1,2,3):sum?(1.0)
Result : “1,1;”
inp:ana:get?(1)
Result : “1,3.662120e-006,0,3.483803e-005,0,3.464501e-005,0,1.051185e-001,0;”
In this example input 2 is configured as voltage and input 1 as current. The integration time is 1 second. The
results returned are: Effective = 3.662120e-006, Apparent = 3.483803e-005, Reactive = 3.464501e-005,
cos ϕ =1.051185e-001
4.4.11.8 inp:ana:sync
inp:ana(4,5,6):rms?(1.0)
Result : “1,2;”
inp:ana(4):freq?(25,0.0)
Result : “1,3;”
inp:ana:sync
The phase and rms commands will be restarted by the sync command. The freq command is
unaffected, as it has no integration time. If you had not used the sync command, the phase
and rms commands would have slightly different starting times, because of the inherent
delays in executing the commands.
Description Measurements are performed in two stages. First the particular multimeter command is
issued (e.g. inp:ana(1):phase?(1.0)). This puts the command on the task vector of the
measurement DSP and returns a command handle. This command handle is then used to
retrieve the results of the multimeter command.
Return values The return values depend on which measurement task you are retrieving the result for, but in
general it will have the form: <result input1>,<validity>,<result input2>,<validity>, etc...
The first number is the actual result and is a floating-point number. The second number
indicates the validity of the result and is an integer.
Validity There exist four validity conditions, which are indicated bit-wise:
Already Read
This is not an error. The results of most commands are updated at the end of the integration
time. If you read the result a second time before it has time to update, you will get this flag
set.
Not Ready
This means that the command hasn't got any results yet. For example if you ask for the
results of a command that has just been issued, without waiting for the integration time to be
finished, you will get this validity code.
Weak Signal
This only occurs for the results of the frequency command. It means that there are valid
results, but the signal is too weak to measure the frequency accurately.
Overload
This means that the signal at the input is higher than maximum for the current range and, as
a result, the readings will be wrong.
A combination of these validity codes can be set, for example, a validity of 0 means the result
is okay, 3 means that the result is not ready & this is the second time it has already been
read.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_NONEXIST_MEASJOB Measurement job does not exist
Examples inp:ana(4,5,6):rms?(1.0)
Result : "1,2;”
(This means 2 is the command handle assigned to this command)
inp:ana:get?(2)
Result : “1,1.233320e+001,8,2.831995e-003,8,5.412996e-004,0,-2.797413e-002,0
,2.704000e-002,0 ,-2.498741e-001,0;”
This shows the first 2 results have an overload, but the last 4 are okay.
all:
Using the keyword all as a parameter causes all the currently running multimeter commands
to be deleted.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_NONEXIST_MEASJOB Measurement job does not exist
Examples inp:ana(4,5,6):phase?(1.0)
Result : “1,1;”
inp:ana(4,5,6):rms?(1.0)
Result : “1,2;”
inp:ana:clr(2)
The rms measurement is cleared, phase measurement continues unaffected.
4.4.11.11 inp:ana:dc(on|off)
4.4.11.12 inp:ana:cal(ac|dc)
Parameters dc|ac
If this command is used with the dc keyword the DC analog inputs are calibrated, if it is used
with the ac keyword the binary/analog inputs are calibrated.
Note: This command can cause a real time violation if any other multimeter commands
running. You should clear the any errors set in the system status register afterwards using
the sys:status? command.
Please note Calibration of the inputs, especially of the DC inputs, make take some seconds to complete;
in any case, all ongoing measurement tasks will be restarted.
Examples inp:ana:i(1):range(0.001)
inp:ana:cal(dc)
inp:ana(4,2,5):def(v,10.0)
inp:ana:cal(ac)
sys:status?(1)
Both an AC and a DC calibration are performed after the range for the DC analog current and
the range for inputs 4, 2 & 5 has been changed. The status of the Measurement DSP is then
checked to clear any real time violations that may have occurred.
This section contains those commands that have been rendered obsolete by the development of CM Engine.
All of them remain operational for code compatibility, but they have been replaced by other commands that
are better, more flexible or more general than they were. The user should avoid using these commands in
new code, and should try to replace them in the existing code whenever possible.
5 Appendix
test? [(<filename>)] Ö <dev_id>,ok | [v<idx>] [,vtemp] [,vovld] [,i<idx>] [,itemp] [,iref] [,ad] [,bin] [,mea] ;
:sync
range (<range>)
diff (reset)
get? Ö <dev_id>,<binary_inputs>;
diff? Ö <dev_id>,<binary_inputs_changes>;
diff (reset)
debounce? Ö <dev_id>,<deb_time>;
deglitch (<degl_time>)
deglitch? Ö <dev_id>,<degl_time>;
name (<name>)
name? Ö <dev_id>,<name>;
get? Ö <dev_id>,dcv | dci | bin | bcount | ecount | zcross | empty | overrun | switchoff,
<time>,<measured_value>,<index>,- | zcross;
get? (<no_of_entries>) Ö <dev_id>,<#entries_read>{,dcv | dci | bin | bcount | ecount | zcross | empty | overrun | switchoff,
<time>,<measured_value>,<index>,- | zcross} ...;
clr
count: on
off
clr
f (<frequency> [,step])
t (<period_time>)
p (<phase> [,step])
wav (sin)
(dc)
(exp)
(sum,<harmonic_list>)
on
(tri [,<duty_cycle>])
off (square [,<duty_cycle])
(user,<user_sig_no> [,single])
clr
on
clr
save
restore
sync (ext,+ | -)
sync (off)
resetopt
app (<user_sig_no>,<user_data>)
free [(<user_sig_no>)]
status? Ö <dev_id>,<#user_sig>,<samples_max>,<samples_free>,<samples_free_block>;
f (<sampling_freq>)
clr
status? Ö <dev_id>,<playing_chunk>,<free_chunks>,<underflow>;
start
stop
off
a (<v_dc>)
a? Ö <dev_id>,<v_dc>;
(<pwr_on_v>
def
)
def? Ö <dev_id>,<pwr_on_v>;
off (<output_list>)
set (<data>)
get? Ö <dev_id>,<binary_outputs>;
(<out_mod_idx>:<group_idx)): cfg? Ö <dev_id>,<#bin_outs>,<type>,<gnd_conn>,<common>,
<res_group_type>,<res_group_idx>;
name (<name>)
name? Ö <dev_id>,<name>;
end
clr
wait (<trigger_condition>,<trigger_jump_distance>)
(<timeout_condition>,<timeout_jump_distance>)
(<trigger_condition>,<trigger_jump_distance>,<timeout_condition>,<timeout_jump_distance>)
status? (step) Ö <dev_id>,<step_no>;
(loop) Ö <dev_id>,<loop>;
(count(1) | count(2)) Ö <dev_id>,<count(1) | count(2)>;
(mem) Ö <dev_id>,<free_mem>;
exec
stop
cfg? Ö <dev_id>,<#cfgs>;
range (v | i (<triple_no>),<range>)
ctrl (i (<triple_no>),<v_ctrl>)
ctrl (<amp_no>,<v_ctrl>)
def? Ö <dev_id>,0 | 1;
pos (<latitude>,<longitude>,<height>)
pos? Ö <dev_id>,<latitude>,<longitude>,<height>,<dop> ;
sigma? Ö <dev_id>,<sigma>;
status? Ö <dev_id>,<status>,<#satellites>;
utc? Ö <dev_id>,<uts_diff>,<valid>;
datetime (<yyyy>,<mm>,<dd>)
datetime? Ö <dev_id>,<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>;
sync (<ch>,<rate>,<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>)
mode (<accuracy_mode>)
mode? Ö <dev_id>,<accuracy_mode>;
gmt (<hh>,<mm>)
gmt? Ö <dev_id>,<hh>,<mm>;
pulse (<LED_ch>,<sync_type>,<edge_type0>,<edge_type1>)
pulse? Ö <dev_id>,<LED_ch>,<sync_type>,<edge_type0>,<edge_type1>;
cable (<delay>)
cable? Ö <dev_id>,<delay>;
save
cfg (<cfg_no>)
def? Ö <dev_id>,<cfg_no>,<dev_conn>,<ext_dev_conn>;
datetime? Ö <dev_id>,<yyyy>,<mm>,<dd>,<doy>,<hh>,<mm>,<ss>,<SBS>,<CF>;
cfg (<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>,<CF>,<parity_mode>,<mod>,<coded_expr>,<auto_inc>,<write_mode>)
cfg? Ö <dev_id>,<CF>,<parity_mode>,<mod>,<coded_expr>,<auto_inc>;
cfg (<parity_mode>,<mod>,<coded_expr>,<parity_err_status>,<write_mode>)
cfg? Ö <dev_id>,<parity_mode>,<mod>,<coded_expr>,<parity_err_status>;
reset
sync (<yyyy>,<doy>,<hh>,<mm>,<ss>,<rate>,<write_mode>)
sync (<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>,<rate>,<write_mode>)
sync? Ö <dev_id>,<yyyy>,<mm>,<dd>,<doy>,<hh>,<mm>,<ss>,<rate>;
0 ... 5 Vrms
Gen. out 4-6 External 3
software controlled amplifier
muting of outputs
for digital input
board version 7 0 ... 5 Vrms
and newer. Gen. out 1-3 External 3
amplifier
0 ... 5 Vrms
Gen. out 7-9 External 3
3 amplifier
To contact OMICRON's technical support service, please use one of the following ways:
Asia, Pacific
OMICRON electronics Asia Ltd. Hong Kong
Phone: +852 2634 0377
E-Mail: support@asia.omicron.at
Web: www.omicron.at
For addresses of OMICRON offices with customer service centers, regional sales offices or offices for
training, consulting and commissioning please see our website.
Command index
Alphabetical index of all CM Engine commands (interface functions and string commands):