Beruflich Dokumente
Kultur Dokumente
User Manual
OMICRON CMEngine
OMICRON CMEngine
Contents
1
Preface ......................................................................................................... 17
1.1
18
1.2
1.3
1.4
1.5
21
1.6
24
1.7
21
2.2
34
2.4
2.5
2.6
2.7
2.8
2.9
61
69
OMICRON CMEngine
3.2
3.3
79
93
93
93
94
95
96
99
OMICRON CMEngine
OMICRON CMEngine
4.2
4.3
4.4
4.5
OMICRON CMEngine
OMICRON CMEngine
OMICRON CMEngine
4.8
OMICRON CMEngine
10
OMICRON CMEngine
11
OMICRON CMEngine
332
12
OMICRON CMEngine
4.10.1 seq:set(exttime(id),
1<year>,<doy>,<hour>,<minute>,<second>) ............................. 365
4.10.1 Sequencer hints ........................................................................ 366
4.10.12Sequencer examples ................................................................ 367
3
4.11 Multimeter Commands ......................................................................... 371
4.11.1 inp:ana(<input_list>):rms?(<itime>) .......................................... 374
4.11.2 inp:ana(<input_list>):peak?(<rtime>) ........................................ 376
4.11.3 inp:ana(<input_list>):phase?(<itime>) ..................................... 378
4.11.4 inp:ana(<input_list>):freq?(<#periods>,<start level>) ............... 380
4.11.5 inp:ana(<input_list>):power?(<itime>) ...................................... 382
4.11.6 inp:ana(<input_list>):sum?(<itime>) ......................................... 384
4.11.7 inp:ana(<input_list>):diff?(<itime>) ........................................... 386
4.11.8 inp:ana:sync .............................................................................. 389
4.11.9 inp:ana:get?(<command handle>) ............................................ 390
4.11.1 inp:ana:clr(<command handle>) / inp:ana:clr(all) ..................... 392
4.12 Scope0 Mode Commands ..................................................................... 393
4.12.1 Configuration and Status Commands ....................................... 394
4.12.2 Trigger Commands ................................................................... 401
4.12.3 Block Transfer Commands ....................................................... 409
4.12.4 Harmonic Commands ............................................................... 415
4.13 CB Simulation Commands ................................................................... 422
4.13.1 cb:time(<trip>,<close>,<auto>,<52a% trip>,<52b% trip>,<52a
% close>,<52b% close) ............................................................ 423
4.13.2 cb:time? .................................................................................... 424
4.13.3 cb:def(trip[(<idx>)]|close|cb52a[(<idx>)]|cb52b[(<idx>)]|cb52a
or|cb52b or|cb52a and|cb52b and,<bool_expr>) ...................... 425
13
OMICRON CMEngine
14
OMICRON CMEngine
5.2
5.3
15
OMICRON CMEngine
16
Preface
Preface
Note: The CMEngine documentation was initially conceived to be a software-accompanying Help. You
can launch the Help from anywhere in Test Universe, either by clicking the Help Topics... command
on the Help pull-down menu or the respective Help Topics toolbar icon, by clicking available Help
buttons or via the context-sensitive Help feature at the toolbar. Pressing the <F1> key does the same.
However, to offer you the possibility of reading the CMEngine documentation without the necessity of
having to sit in front of a computer, and in order to ease the printing, we additionally provide the
CMEngine documentation as a user manual the one you are currently reading. This manual is
stored as CMEngine.pdf on your hard disk at installation folder\Test Universe\Doc. However, you
wont have to access this folder to view the manual. You find a direct hyperlink for the PDF manual in
the CMEngine Help topic Preface.
Contents of CMEngine Help and manual are identical.
This user manual is derived from the same source as the Help. The Help is regarded the reference
CMEngine documentation, and while we focussed on a correct formatting of the Help, the manual's
look and feel derives widely from stylesheet-controlled automatisms. We ask for your kind
understanding if you should come across page breaks, table or image dimensions that may not always
appear ideal to you. If you particularly dislike something and expect us to improve it, please contact us
( Support on page 489).
About CMEngine
The CMEngine is a program library for software developers to conveniently control and program one
or more CMC test sets.
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 CMEngine library to communicate with one or more CMC test
systems connected to the PC or to the notebook computer. The CMEngine provides 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.
More:
Which tasks can be performed using the CMEngine? on page 18
Command overview on page 18
Operating systems and compilers on page 21
17
OMICRON CMEngine
1.1
With the CMEngine command set, all functions of one or more CMCs connected to the PC can be
controlled:
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 CMCs memory and put them
out.
Measure signals fed into the analog and the binary inputs.
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).
1.2
Command overview
18
Preface
DevUnlock
Unlock CMCs.
DevGetList
Execute function
Exec Send commands to one or more CMCs connected to the PC.
Error handling functions
GetError
GetErrorText
LogAppend
LogGetInfo
Miscellaneous functions
Version
19
OMICRON CMEngine
String commands
CMEngine'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 CMEngine.
System commands "sys:..."
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 CMEngine about an external amplifier's
parameters and then use this external amplifier for current or
voltage output.
20
Preface
1.3
Operating systems
CMEngine is tested to be compliant with the same versions of Microsoft Windows operating systems
as the Test Universe version it is working with. Detailed up-to-date information about the operating
system and PC hardware requirements necessary to run CMEngine and Test Universe can be found
in a file named Requirements.txt on the Test Universe installation DVD.
Compilers
CMEngine is developed and tested with the compiler system Microsoft Visual C++. Nevertheless you
can use any compiler or application that can act as an OLE-Automation client.
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 server (CMEngAL.exe) is done by the installation program. If
you move the OLE Automation server, you have to register it at its new location. To re-register the
server, start it with the command line parameter "/register" ("CMEngAL.exe /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 CMEngine.
If you want to contact the OMICRON Technical Support, visit our website www.omicron.at for the
OMICRON Service Center address of your region, please.
1.4
Before your application program can use the CMEngine, you have to add to your project a reference
to the OMICRON CMEngine Adapter Layer 2.0. Then your application program has to create an
cmEngine object (e.g CreateObject("cmEngine.cmEngine")). When it does not need access to
CMEngine anymore, it has to release the object. This releases all resources the CMEngine reserved
for your application program.
1.5
A program that controls CMCs via the CMEngine must use at least the following of the CMEngine's
interface functions in logical order. Thus every program that controls CMCs using the CMEngine
consists of at least the following typical command structure.
21
OMICRON CMEngine
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, "sys:cfg?(cal)") ' Execute commands on this
CMC
engine.DevUnlock (devId)
GoTo ApplicationEnd
EngineError:
MsgBox Err.Description
Err.Clear
22
Preface
ApplicationEnd:
Set engine = Nothing
End Sub
23
OMICRON CMEngine
ExtractParameter = ""
Exit Function
End If
End If
ExtractParameter = Mid$(CmdResult, textpos1 + 1, textpos2 - textpos1 - 1)
End Function
This script searches for available CMC test sets and turns their outputs on. It will furthermore
find NET-1 test sets. So make sure that there is no NET-1 test set in your local network
before you run this script.
Before compiling this script, make sure to add the Omicron CM Engine Adapter Layer 2.0
Type Library at Tools > Preferences in MS Excel or Script > References in
Control Center, respectively. Else you will get a compilation error.
For more information about CMEngine programming, see Programming the CMEngine on page 29.
1.6
A CMEngine is licensed to one or more of your CMC devices. Thus your CMEngine can only control
the CMC devices that it is licensed to.
The license number(s) are kept in a license file "OMICRON.LIC". CMEngine 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, CMC 151, CMC 156). The name of the
key is CMENG for the CMEngine. The following is an example for the CMC 56 with the serial number
DA345D:
; OMICRON License File
[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.
24
Preface
1.7
This section explains how some special cases in the interaction between the CMEngine and CMC
devices must be handled by a programmer. If you read this manual for the first time, you may skip this
section.
More:
Automatic output switch off on page 25
CMC in use was switched OFF and ON again on page 27
Automatic output switch off
Under some special circumstances, the power outputs of a CMC are disconnected for the security of
the CMC and its user, which can occur for three different reasons:
a. If the communication between CMEngine 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 (CMC 151, CMC 156 and e only)
These special cases are to be handled accordingly.
Detect these cases by getting the contents of the primary status register with Exec ("sys:status?"):
case a)
25
OMICRON CMEngine
Reactivate a CMC with outputs that are already switched OFF (switch outputs ON again) by the
following calls to CMEngine 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 CMEngine.
26
Preface
27
OMICRON CMEngine
28
This section describes how to program the OMICRON test devices by means of the CMEngine
programming interface. It is not intended to describe in detail the CMEngine commands, their syntax
or usage, but to help the programmer in becoming familiar with the CMEngine way of programming. It
should serve as an introduction and companion to the CMEngine documentation, and should help the
programmer to make the most out of it. Therefore, the document is written in descriptive style, and few
detailed examples are included since what we want to show here is the global picture.
The CMEngine 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 CMEngine programming from within a given application, it will first be necessary to have the
CMEngine interface available. This can be done either linking statically to the CMEngine library, or
loading the CMEngine 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 CMEngine 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 CMEngine interface.
The easiest way to abstract oneself from these details is to use the "Batcher" application, delivered as
a sample with the CMEngine programming environment. This small application provides in effect a
command line interface to the CMC device. It will automatically load the CMEngine 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.
29
OMICRON CMEngine
More:
System Overview on page 30
Analog outputs on page 33
Using the Input Buffer on page 48
Using the Sequencer on page 53
Counter inputs on page 61
System control unit on page 68
The CMC 256 on page 69
VBA functions on page 75
2.1
System Overview
A set of signal generators grouped in triples (4 triples = 12 generators in the CMC 156)
2. Binary outputs
3. Analog inputs
4. Binary inputs
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
30
The sequencer allows internal storage of sequences of commands, which are later executed
internally.
7. Supervisory section
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.
Designing a CMEngine application
Before writing the first line of code, it is necessary to decide how the timing will be controlled. The
CMC timer is much more sophisticated than a normal timer device that is controlled by the closing of a
contact. Rather, the CMC timer can be said to have multiple virtual inputs, supervising changes in the
analog outputs and analog and binary inputs. These changes are then stored in the input buffer, as
will be described in detail in section Analog inputs on page 47. This gives the CMC device a very
high power and flexibility, at the cost of an increase in complexity since the contents of the input buffer
must be analyzed to extract the desired times.
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 CMEngine programming
interface:
31
OMICRON CMEngine
32
The file name can of course be any valid file name in the host operating system. Such a file will
register the CMEngine commands as were actually received, and the CMEngines 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.
2.2
Analog outputs
As we advanced in section Internal structure of a CMC device on page 30, the analog output section
can be separated in three components: The signal generators, the routing and scaling layer and the
voltage and current amplifiers. This separation is only important when the system must be configured.
Otherwise, the programmer addresses only a voltage or current output, and cares not what is behind.
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 CMC 256 or newer test set); in the case of a sine wave, this allows for a
maximum rms value of 5V (7.071Vrms on a CMC 256 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
CMC 151 the triples only contain one generator and the fourth internal voltage of a CMC 256 is also
considered a triple).
Before an amplifier can be used, it has to be defined. The system needs to know the amplifiers limits,
time delays for each channel and amplification factor, so all the necessary scaling calculations can be
carried out. The CMEngine is later programmed in absolute Amps or Volts at the amplifiers exit, so
the programs are totally portable across hardware as long as the amplifiers 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 CMEngine 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 CMEngines 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 CMEngine 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 CMEngine 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 signals in a triple have in common:
All the rest: waveform, frequency, amplitude, phase, etc. can be defined independently for each signal.
33
OMICRON CMEngine
More:
Definition and routing of amplifiers on page 34
Amplifier Configurations on page 37
Defining the signal parameters on page 41
2.2.1
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 CMEngine 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:
Amplification factor for the control signal, in A/V (current amplifiers) or V/V (voltage amplifiers).
OMICRON amplifiers typically have an input signal range of 5Vrms. Therefore you get the
amplification factor by dividing the maximum rms output value of the amplifier by 5Vrms.
Maximum rms output of the amplifier, in A or V. Must be equal to or smaller than the amplification
factor times the maximum low level output voltage of the CMC (5Vrms for CMCs prior to CMC 256,
7.071Vrms for CMC 256 or newer test sets). CMEngine will not allow giving values higher than the
maximum value to any signal routed to the amplifier.
Minimum and maximum frequency, in Hz. This defines the frequency range for which the amplifier
operates. If the amplifier is capable of outputting DC values, the minimum frequency should be set
to 0.
Propagation delays for each of the possible phases, in seconds. The CMEngine will use this
information to shift waves so differences between channels are compensated and the phases of
the signals are correct.
More:
Handling of internal amplifiers on page 34
Handling of external amplifiers on page 36
2.2.1.1
To know the number and nature of internal amplifiers, we use the out:cfg? command. This command
will return the analog and binary outputs of the CMC. For a standard CMC 156, this command would
return this string: 1,4,1/3/i,2/3/i,3/3/e,4/3/e;
34
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 CMC 156 are routed and defined by the CMEngine upon start-up; usually
there is no need to redefine them, but it is possible to do so if required. Lets analyze one of the
strings, for instance amplifier 1:
int
Voltage amplifier
Device type
BC284H
35
OMICRON CMEngine
2.2.1.2
External amplifiers are connected to the CMC via the CM Exif board. Intelligent amplifiers not only
provide their definition data to the CMC, but also can be turned off by the software when they have not
been defined. In this way, intelligent amplifiers can be daisy-chained and controlled by software.
Well look first at the definition of an external amplifier using the CMA 156 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, well 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;
As we see, external amplifier 1 is triple A of the CMA 156, and amplifier 2 is triple B.
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 CMA 156, we can choose whether we
want to use the triples independently or coupled. Lets do it both ways:
1) Two independent triples
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)
36
We have assigned the two amplifiers available for external use to the triples in the CMA 156, 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 CMEngine
can use them.
2) One coupled triple continued from last example
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 CMA 156 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)
2.2.2
Amplifier Configurations
37
OMICRON CMEngine
For a CMC 156 with a CMS 156 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
3
1.275000E+002
5.000000E+001
1.250000E+002
4.000000E-001
std
0
amp_no, 1
Routing ID on page 38
Number of Phases on page 38
Maximum Output on page 39
Maximum Power on page 39
Output at Maximum Power on page 39
Source Amplitude on page 39
Mode on page 39
Wiring Index on page 40
List of amplifiers involved in the configuration on page 41
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.
Number of Phases
This value represents the number of independent phases of the configuration. It is the number of
phases that will be addressable in the logical triple.
38
Maximum Output
Maximum output value of the configuration.
Maximum Power
The maximum power in VA that the configuration can reach.
Output at Maximum Power
This field represents the output value for which the maximum power is reached. It is not necessarily
equal to the maximum output.
Source Amplitude
Value of the maximum voltage (in current amplifiers) or current (in voltage amplifiers) that the system
can output. Please note that these values are just an indication the power curves of the amplifiers
are not linear, and their representation is to be found in the devices manual.
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 (CMC 256
or newer test sets, CMS251 and CMS252 not included):
Mode
Phases
Description
std
ser12
ser13
ser4
39
OMICRON CMEngine
Mode
Phases
Description
gen2
Generator 2 is signal, N is
reference
par1
par3
parser
For more detailed wiring instructions, and for the cases where the use of adapting resistors is needed,
please consult the hardware manuals.
Wiring Index
For OMICRON internal use index of an illustration of the wiring required for the configuration.
Lets see as an example on how to set the CMC 156 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. Connect the CMC test set as shown in the following illustration:
40
Please note that the use of adapting resistors is required, for example those in the SPA
device.
List of amplifiers involved in the configuration
This is an enumeration of the amplifiers that are required to form the configuration. Each entry in the
list is composed of two parts: an amplifier descriptor and an amplifier number.
The descriptor is a string, which may be either amp_no (internal amplifiers) or amp_id (external
amplifiers). In both cases, the amplifier number follows, with type integer.
For amp_no amplifiers, the number allows finding the amplifiers description in the return string of the
amp:def? command; for amp_id amplifiers, the number corresponds to the id returned by amp:scan?
and the information about the amplifier can be obtained by using the number as argument in the
amp:param? command.
2.2.3
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.
More:
Waveform on page 42
Amplitude, phase and frequency on page 43
41
OMICRON CMEngine
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:
- Sine (default)
- Square
- Triangle
- DC
- Exponential
- Sum of harmonics
- 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
CMEngine 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 generators 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 amplifiers maximum
output and the signals 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 amplifiers 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 CMC 156, 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 all
42
right 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 amplifiers 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. Lets 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 waves amplitude to the amplifiers maximum, so its weight is 1 and it does not
modify the sine wave in any way.
Our first instinct would be to write the code like this:
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 CMEngine, that 125 is the maximum amplifiers 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
Amplitude, phase and frequency
By default, these values are set to 0. It must be noted that 0 is a valid value for amplitude and phase,
but not for frequency. Therefore, it must be set to a value within the CMC range before issuing the on
command.
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
43
OMICRON CMEngine
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 CMEngine 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 amplifiers 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 generators phase settings to set the generators phase. With the differential mode with
reference channel, the on command applies the differences between the generators phase and the
reference generators 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.
44
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. Lets 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 CMEngine 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
45
OMICRON CMEngine
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.
2.3
Binary outputs
The handling of binary outputs is simple. The commands are effective the moment they are issued,
and are of three kinds: on, off and set; respectively, they allow to turn individual inputs on, to turn
them off or to set all inputs to a provided binary configuration.
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 groups characteristics, although
this is not necessary to handle the outputs from CMEngine (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).
46
2.4
Analog inputs
The analog inputs can be used both by polling their status and by recording their changes as events
into the input buffer. This latter method is far more powerful, and will be dealt with in the next section.
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 56CMC 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.
2.5
Binary inputs
The binary inputs can be used both by polling their status and by recording their changes as events
into the input buffer. This latter method is far more powerful, and will be dealt with in the next section.
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 CMC 156, 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 CMC 256 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 groups
characteristics by means of a out:bin(<out_module_idx>,<group_idx>):cfg? command.
47
OMICRON CMEngine
2.6
The input buffer is a FIFO (first in first out) ring buffer where the CMC stores all system events as
they happen. Each event is time-tagged with the reading of the CMC timer when the event happened.
The first event is stored with time 0, and the times grow from there.
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 Using the Sequencer on page 53).
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). CMEngine 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 CMEngine 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.
An event stored in the input buffer contains the following fields:
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).
Time
Time-tag of the event.
48
Data
Event data, to be interpreted according to the Type.
Index
Identifier, to be interpreted according to the Type.
Optional
Additional information for some events.
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 VBA
functions on page 75.
Declare Sub Sleep Lib "kernel32" (ByVal time As Long) '
Operating Time Version 1 '
----------------------------------------------------------------------------Option Explicit
Dim
Dim
Dim
Dim
result As String
Frequency As Double
IFault As Double
TripTime As Double
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
49
OMICRON CMEngine
50
"out:i(1):mix(sig(1))")
"out:i(1):sig(1):wav(sin)")
"out:i(1):f(" & Str(Frequency) & ")")
"out:i(1:1):a(" & Str(IFault) &
"out:i(1:2):a(" & Str(IFault) &
"out:i(1:3):a(" & Str(IFault) &
"out:on")
' outputs on
Do
Sleep (100) ' Return control to the operating system and suspend task
for 100ms
result = engine.Exec(devId, "inp:bin:get?")
Inputs = Val(ExtractParameter(2, result))
Loop While ((Inputs And 1) = 0)
' We leave when the binary input 1
is active
result = engine.Exec(devId, "out:ana:off(zcross)")
result = engine.Exec(devId, "inp:buf:sam(bin, off)")
' Variables for buffer analysis
Dim
Dim
Dim
Dim
Dim
BufType As String
BufData As String
BufIndex As Integer
BufTime As Double
BinaryState As Integer
51
OMICRON CMEngine
52
2.7
seq:begin
seq:end
seq:set()
seq:add
seq:status?
seq:stop
seq:wait
53
OMICRON CMEngine
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 outof-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 Branching within a sequence the seq:wait() command on page 54 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.
Branching within a sequence - the seq:wait() command
The seq:wait() command is the key of sequence programming. It serves both as trigger condition and
as jump destination.
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.
Trigger conditions can be:
54
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.
Declare Sub Sleep Lib "kernel32" (ByVal time As Long)
' This program will adjust the fault inception to a given angle
' It shows how the sequence can be used to control the analog
' output with great precision
'
----------------------------------------------------------------------------Option Explicit
Dim
Dim
Dim
Dim
Dim
Dim
Frequency As Double
InceptionAngle As Double
PrefaultCycles As Integer
IFault As Double
IPreFault As Double
FaultTime As Double
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
55
OMICRON CMEngine
56
"seq:begin")
"out:pmode(abs)")
"out:i(1):mix(sig(1))")
"out:i(1):sig(1):wav(sin)")
"out:i(1):f(" & Str(Frequency) & ")")
"out:i(1:1):a(" & Str(IPreFault) &
"out:on")
"out:pmode(diff)")
"out:i(1:1):a(" & Str(IFault) & ");p(0)")
"seq:wait(" & Str(DelayTime) & ",1)")
"out:on")
57
OMICRON CMEngine
58
engine.DevLock (devId)
Frequency = 50
IFault = 3
MaxTFault = 5
engine.Exec(devId, "seq:clr")
engine.Exec(devId, "inp:buf:clr")
engine.Exec(devId,
engine.Exec(devId,
engine.Exec(devId,
engine.Exec(devId,
engine.Exec(devId,
engine.Exec(devId,
' Ia
engine.Exec(devId,
' Ib
engine.Exec(devId,
' Ic
engine.Exec(devId,
engine.Exec(devId,
"seq:begin")
"inp:buf:sam(bin, on)")
"out:i(1):mix(sig(1))")
"out:i(1):sig(1):wav(sin)")
"out:i(1):f(" & Str(Frequency) & ")")
"out:i(1:1):a(" & Str(IFault) &
"out:i(1:2):a(" & Str(IFault) &
"out:i(1:3):a(" & Str(IFault) &
"out:on")
' outputs on
"seq:wait(bin(1), 2, " & Str(MaxTFault) &
"seq:wait(0, 1)")
"out:ana:off(zcross)")
"inp:buf:sam(bin, off)")
"seq:end")
59
OMICRON CMEngine
BufType As String
BufData As String
BufIndex As Integer
BufTime As Double
BinaryState As Integer
EndOfBuffer As Boolean
NoTrip As Boolean
TripDetected As Boolean
ReferenceTime As Double
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))
If BufType = "empty" Then
EndOfBuffer = True
ElseIf BufType = "bin" And BufIndex = 0 Then
' This is the
analog output change (fault time)
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
60
2.8
Counter inputs
The binary inputs in the CMC devices can be used as hardware counters, to count 1 > 0 or 0 > 1
transitions (programmable). This usage is independent of the standard operation, and both can
proceed in parallel. The value of the count can be polled at any time; additionally, certain events
create an entry in the input buffer for exact handling. The standard binary inputs in the CMC front
panel can count up to frequencies of 3 kHz; two high-speed counter inputs, sensitive to TTL-level
signals in the back panel can go up to 100 kHz. The standard counters use the identifier bcount
(binary counter) in the counter commands and in the input buffer entries. The high-speed counters use
the identifier ecount (extended counter).
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:
61
OMICRON CMEngine
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:
The slaves counter first pulse after the masters first pulse
The counters 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 masters 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 CMCs own voltage outputs to create
the pulses.
; OMICRON electronics
1998-10-08
62
inp:bin(1:1):def(10)
; Set up the counters
inp:count:clr
inp:count:set(bcount(1),16777208,+)
inp:count:set(bcount(2),0,+)
inp:count:join(bcount(1),bcount(2))
inp:count:on
; Read the counters (should display 16777208 and 0)
inp:count:get?(bcount(1))
inp:count:get?(bcount(2))
; Program the sequence
seq:begin
inp:buf:clr
; Make a time reference entry in the measurement buffer
inp:buf:sam(bin,1)
out:pmode(abs)
out:v(1:1):a(20);f(20);p(0);wav(sin)
out:v(1:2):a(20);f(50);p(180);wav(sin) out:on
out:pmode(diff)
seq:wait(0.400,1)
out:v(1:1):off
seq:wait(0.050,1)
out:v(1:2):off
seq:end
; Run it
seq:exec
; Wait until completed
#wait 2
; Read the results
#loop 6 inp:buf:get?
63
OMICRON CMEngine
Result
Result
Waiting
Result
Result
Result
Result
Result
Result
:
:
2
:
:
:
:
:
:
1,16777208;
1,0;
seconds ...
1,bin,0.0000000E+000,0,1,-;
1,bcount,3.4991632E-003,16777209,1,-;
1,bcount,1.1797179E-002,1,2,-;
1,bcount,3.5351546E-001,0,1,zcross;
1,bcount,3.7181109E-001,19,2,-;
1,empty,0.0000000E+000,0,0,-;
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:
64
2.9
The CMC 256 and newer test sets provide functionality to simulate the behavior of a circuit breaker.
When the simulation is active the binary inputs of the test set are monitored and if trip or close
commands are detected, the auxiliary contacts are simulated with the appropriate timing. The
simulation can be a single-phase or a three-phase simulation.
Architectural Concept of the CB Simulation
65
OMICRON CMEngine
66
67
OMICRON CMEngine
When the binary input sampling is active each state transition creates entries in the event buffer (time
stamp, index of new state, state of the binary inputs and outputs).
68
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 tests results. Please note that no user
action is required in any of the error conditions; the CMCs 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.
Auxiliary DC power
Analog measurement and recording capabilities added to the front-panel binary inputs.
In this section we will describe the CMC 256-6, as the CMC 256-3 is less complex due to the lack of
the second current triple.
More:
Amplifiers on page 69
The DC auxiliary output on page 71
The AC analog inputs on page 72
2.11.1 Amplifiers
It is important to note that, upon start-up, the CMC 256 is fully compatible with any software written for
the CMC 156. When the CMEngine 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 CMC 156 configuration will require no modification. Only when we
wish to take advantage of the CMC 256 unique features do we need to modify the existing software.
The first change is noticed when we request the output configuration; in a CMC 256-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 amplifiers. The single-phase internal amplifier, number 5, is the 4th 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 CMC 256 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.
69
OMICRON CMEngine
70
Mode
Phases
Description
zero
ser2
par6
Please note that configuration 8 is the only way to set both current triples in parallel to obtain a threephase, 25A current triple. The method described for the CMA 156 in section Handling of external
amplifiers on page 36 is not applicable for the CMC 256.
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.
71
OMICRON CMEngine
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 CMC 256 output 110VDC upon being powered-up, we
would program it like follows:
out:aux:def(110)
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.
RMS
Peak values
Phase
Frequency
Power
Sum
72
In binary mode, the inputs can work as potential-free or potential-sensing inputs, as described before
for the CMC 156. 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.
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 CMC 256 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.
73
OMICRON CMEngine
Measured quantity
Frequency of the first V signal, with 50 periods detection time and 1 volt
trigger level
74
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, lets 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.
ExtractParameter = ""
Counter = 0
75
OMICRON CMEngine
' If we leave the loop, then the comma is found. Let's find the
closing character
textpos2 = InStr(textpos1 + 1, CmdResult, ",", 0)
If (textpos2 = 0) Then
' We cannot find more commas
textpos2 = InStr(textpos1 + 1, CmdResult, ";", 0)
' Perhaps a
semicolon?
If (textpos2 = 0) Then
' No closing character. Probably wrong
string.
ExtractParameter = ""
Exit Function
End If
End If
ExtractParameter = Mid$(CmdResult, textpos1 + 1, textpos2 - textpos1 1)
End Function
76
77
OMICRON CMEngine
78
Interface Functions
Interface Functions
As already described in the chapter Typical program sequence on page 21, you can use the
CMEngine's interface functions in your program.
First, the following chapter supplies a quick overview of all error codes that the CMEngine'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 CMEngine.
More:
Error codes overview... on page 79
Which error codes can be caused by a specific function? on page 90
Interface function reference on page 91
3.1
The functions in the following chapter like Exec() throw an exception if there is an error.. In this case,
you can use the function GetError() to get the error code. Some Engine errors have an additional
extended error code which represents the error code returned by DOS or by the Windows-API.
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 CMEngine interface are listed in the following table for an
overview:
79
OMICRON CMEngine
No
Group
Description
000 CMERR_OK
001 CMERR_INIT
CM_API
002 CMERR_NO_LOCKED_CMC
003 CMERR_CMC_NOT_FOUND
004 CMERR_CMC_NOT_LOCKED
005 CMERR_CMC_ALREADY_LOCKED
006 CMERR_FILE_LOG
CM_FIL
007 CMERR_BUF_TOO_SMALL
008 CMERR_OUT_OF_RANGE
009 CMERR_SYNTAX
010 CMERR_PARSER_STACK_OVFL
011 CMERR_TOKEN_BUF_OVFL
012 CMERR_PUSHBACK_BUF_OVFL
013 CMERR_INVALID_INT
014 CMERR_INVALID_FLOAT
015 CMERR_OUT_OF_MEMORY
016 CMERR_DOWNLOAD_FILE
CM_FIL
017 CMERR_DOWNLOAD
018 CMERR_TRIPLE_NOT_DEF
019 CMERR_LOCK_UNLOCK_PORT
CM_API
020 CMERR_NO_CMC_CONNECTED
021 CMERR_COMM_API
CM_API
022 CMERR_COMM
023 CMERR_STILL_WORKING
80
Interface Functions
No
Group
Description
024 CMERR_IN_SEQ_MODE
025 CMERR_NOT_IN_SEQ_MODE
026 CMERR_NO_AMP_AVAIL
027 CMERR_NOT_SUPPORTED
028 CMERR_MIN_GT_MAX
029 CMERR_AMP_IN_USE
030 CMERR_KINDS_DONT_MATCH
031 CMERR_DOWNLOAD_NO_FW
CM_API
032 CMERR_OUT_OF_CMC_MEM
033 CMERR_INVALID_USER_SIG
034 CMERR_USER_SIG_IN_USE
035 CMERR_INVALID_BOOL
036 CMERR_PROT_FILE
CM_FIL
037 CMERR_CALDATA_CHECKSUM
038 CMERR_INCOMPATIBLE_DRIVER
040 CMERR_LICENSE_FORMAT
041 CMERR_INVALID_LICENSE
042 CMERR_PROC_EXHAUST
043 CMERR_TIMER
044 CMERR_TIMER_API
CM_API
81
OMICRON CMEngine
No
Group
Description
045 CMERR_PMODE_DIFF
046 CMERR_HW_OUT_OF_TOL
047 CMERR_AMP_INCOMP
048 CMERR_EXT_AMP_COMM
049 CMERR_INVALID_HANDLE
050 CMERR_CANNOT_GET_ERR
051 CMERR_PROT_FILE_API
CM_API
052 CMERR_SWITCH_RANGE
053 CMERR_COUNTER_ON
054 CMERR_COUNTER_NOT_ACTIVE
055 CMERR_COUNTER_MASTER_SLAVE
056 CMERR_GPS_NOT_FOUND
057 CMERR_INVALID_DATE
058 CMERR_GPS_BAD_RESPONSE
059 CMERR_GPS_COMM_ERR
060 CMERR_GPS_HW_ERR
061 CMERR_GPS_BUSY
062 CMERR_ALREADY_LOGGED
063 CMERR_INIT_MEAS
064 CMERR_NONEXIST_MEASJOB
065 CMERR_TASK_VECTOR_FULL
82
Interface Functions
No
Group
Description
066 CMERR_DCTASK_OFF
067 CMERR_BIN_INPUT
068 CMERR_INVALID_NO_INPUTS
069 CMERR_INVALID_VI_PAIR
070 CMERR_256_CMD
071 CMERR_RES_NOT_AVAIL
072 CMERR_RES_ALREADY_LOCKED
073 CMERR_RES_NOT_LOCKED
074 CMERR_POWER_SUPPLY
075 CMERR_TRANS_START
076 CMERR_TRANS_NOT_START
077 CMERR_NO_CHANNELS_SEL
078 CMERR_GEN_MEAS
079 CMERR_NOT_MM_MODE
080 CMERR_NOT_SCOPE_MODE
081 CMERR_ANA_OUT_NOT_AVAIL
83
OMICRON CMEngine
No
Group
Description
082 CMERR_ANA_OUT_ALREADY_LOCKED
083 CMERR_ANA_OUT_NOT_LOCKED
084 CMERR_AUX_DC_NOT_AVAIL
085 CMERR_AUX_DC_ALREADY_LOCKED
086 CMERR_AUX_DC_NOT_LOCKED
087 CMERR_MPINPUT_NOT_AVAIL
088 CMERR_MPINPUT_ALREADY_LOCKED
089 CMERR_MPINPUT_NOT_LOCKED
090 CMERR_BIN_INP_NOT_AVAIL
091 CMERR_BIN_INP_ALREADY_LOCKED
092 CMERR_BIN_INP_NOT_LOCKED
093 CMERR_BIN_OUT_NOT_AVAIL
094 CMERR_BIN_OUT_ALREADY_LOCKED
095 CMERR_BIN_OUT_NOT_LOCKED
096 CMERR_TRANS_OUT_NOT_AVAIL
84
Interface Functions
No
Group
Description
099 CMERR_DC_INP_NOT_AVAIL
100 CMERR_DC_INP_ALREADY_LOCKED
101 CMERR_DC_INP_NOT_LOCKED
102 CMERR_COUNTER_NOT_AVAIL
103 CMERR_COUNTER_ALREADY_LOCKED
104 CMERR_COUNTER_NOT_LOCKED
105 CMERR_GPS_NOT_AVAIL
106 CMERR_GPS_ALREADY_LOCKED
107 CMERR_GPS_NOT_LOCKED
108 CMERR_SEQ_NOT_AVAIL
109 CMERR_SEQ_ALREADY_LOCKED
110 CMERR_SEQ_NOT_LOCKED
111 CMERR_SAMPLE_BUFF_NOT_AVAIL
112 CMERR_SAMPLE_BUFF_ALREADY_LOCK
ED
113 CMERR_SAMPLE_BUFF_NOT_LOCKED
114 CMERR_MEAS_DSP_NOT_AVAIL
115 CMERR_MEAS_DSP_ALREADY_LOCKED
116 CMERR_MEAS_DSP_NOT_LOCKED
117 CMERR_ALL_PORTS_LOCKED
118 CMERR_FLASH_PROG
85
OMICRON CMEngine
No
Group
Description
119 CMERR_NO_BIN_OUT_TASKS
120 CMERR_EXT_AMP_SHUTDOWN
121 CMERR_OBSOLETE
122 CMERR_SYNC_LOST
123 CMERR_CANNOT_ADD_NEW_SLAVE
124 CMERR_CANNOT_REMOVE_LOST_SLAV
E
125 CMERR_LICENSE_EXPIRED
126 CMERR_HARM_NOT_RUNNING
127 CMERR_HARM_NOT_RUNNING_CH
128 CMERR_INVALID_LOCK_INFO
129 CMERR_CANNOT_INIT_MIC_FLASH
130 CMERR_CANNOT_READ_MIC_FLASH
131 CMERR_CANNOT_WRITE_MIC_FLASH
132 CMERR_MIC_FLASH_WRITE_FAILURE
133 CMERR_MIC_FLASH_PROTECTED
134 CMERR_REGISTRY_ERROR
CM_API
86
Interface Functions
No
Group
Description
135 CMERR_CANNOT_REGISTER_DEVICE
136 CMERR_CANNOT_GET_IP_CONFIG
CM_API
137 CMERR_CANNOT_SET_IP_CONFIG
CM_API
138 CMERR_CANNOT_GET_OPERATING_INF
O
CM_API
139 CMERR_REMOTE_CMD_EXEC_ERROR
CM_API
140 CMERR_CANNOT_GET_CPU_ID
CM_API
141 CMERR_SET_DATETIME_FAILED
CM_API
142 CMERR_INVALID_CMC_TYPE
143 CMERR_INVALID_GZIP_HEADER
144 CMERR_NOT_ASSOCIATED
145 CMERR_IFC_NOT_INITIALIZED
146 CMERR_GET_LPTNAME_ERROR
CM_API
147 CMERR_OMFIND_ERROR
CM_API
148 CMERR_HARM_CORR_ON
87
OMICRON CMEngine
No
Group
Description
151 CMERR_TIMESOURCE_ALREADY_LOCKE
D
152 CMERR_TIMESOURCE_NOT_LOCKED
153 CMERR_OVERTEMP_RECONN
154 CMERR_SV_CFG_NOT_ALLOWED
155 CMERR_GOOSE_CFG_SET_FAILED
CM_API
156 CMERR_GOOSE_CFG_GET_FAILED
CM_API
157 CMERR_SV_CFG_SET_FAILED
CM_API
158 CMERR_SV_CFG_GET_FAILED
CM_API
159 CMERR_CA_A_ACTIVATON_ERROR
160 CMERR_CA_B_ACTIVATON_ERROR
161 CMERR_ASSOC_MAX_CLIENT
162 CMERR_NOT_ALLOWED_NOMFREQ
163 CMERR_PROP_DELAY_TOO_HIGH
164 CMERR_OTHER_TP_RUNNING
88
Interface Functions
No
Group
Description
165 CMERR_LONG_CMD_PENDING
166 CMERR_TIMESRV_NOT_AVAILABLE
167 CMERR_NO_LICENSE
168 CMERR_FILE_TRANSFER_RUNNING
169 CMERR_FILE_TRANSFER_TIMEOUT
170 CMERR_FILE_OPEN_FAILED
171 CMERR_OTIMED_ERROR
172 CMERR_CORRUPT_FILE
173 CMERR_NOT_YET_IMPLEMENTED
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_FORMAT
CMERR_NO_LICENSE
89
OMICRON CMEngine
Error code
Explanation
CMERR_INVALID_LICENSE
3.2
There are general errors that can be caused by all interface functions or string commands. They are
listed in the following table:
Error code
Explanation
CMERR_COMM
CMERR_COMM_API
CMERR_OUT_OF_MEMORY
CMERR_OUT_OF_RANGE
CMERR_STILL_WORKING
CMERR_HW_OUT_OF_TOL
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 on page 79.
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 String commands on page 119.
90
Interface Functions
3.3
The interface functions are listed in alphabetical order. For the syntax descriptions of OLE-Automation
clients, the function and subroutine declarations from Visual Basic for Applications (VBA) are used.
For other OLE-Automation clients, these declarations must be converted accordingly.
For clients using the OLE-Automation interface, only OLE-Automation compatible types are used and
no special declarations are necessary.
Association
Associated on page 93
AssociationMode on page 93
DevAssociateAppend on page 93
DevAssociateAppendSpecific on page 94
DevAssociationCount on page 94
DevAssociationInfo on page 94
DevAssociationTime on page 95
DevAssosciationRequest on page 95
DevAssosiationRequestCancel on page 95
DevDisassociate on page 95
DevDisassociateSpecific on page 96
MaxAssociationTime on page 106
Device
DevGetList on page 96
DeviceAddress on page 97
DeviceType on page 97
DevLock on page 97
DevScanForNew on page 98
DevUnlock on page 99
Exec on page 100
FriendlyName on page 101
GetDevIDbyIPAddress on page 101
GetOfflineCfg on page 101
GetOfflineCfg2 on page 102
ImgDevTypePrefix on page 102
IPAddress on page 103
MinReqImgVersion on page 106
OutUserApp on page 106
ParallelPort on page 107
RemoveDevice on page 108
ResGetList on page 108
91
OMICRON CMEngine
92
Interface Functions
3.3.1
AddRegDev
Syntax VBA
Description
Parameters
IPAddresss
The IP Address of the CMC
3.3.2
Associated
Syntax VBA
Description
Parameters
DevId
The device ID of the CMC
3.3.3
AssociationMode
Syntax VBA
Description
Association Mode
Parameters
DevId
The device ID of the CMC for which the AssociationMode should be returned or
set
3.3.4
DevAssociateAppend
Syntax VBA
Description
Parameters
DevId
The device ID of the CMC to which an associated should be appended
93
OMICRON CMEngine
3.3.5
DevAssociateAppendSpecific
Syntax VBA
Description
Parameters
DevId
The device ID of the CMC to which a client should be associated
MACAddress
MAC Address of the client
3.3.6
DevAssociationCount
Syntax VBA
Description
Parameters
DevId
The device ID of the CMC
3.3.7
DevAssociationInfo
Syntax VBA
Description
Parameters
DevId
The device ID of the CMC
Index
The association index
94
Interface Functions
3.3.8
DevAssociationTime
Syntax VBA
Description
Parameters
DevId
The device ID of the CMC
Index
The association index
3.3.9
DevAssociationRequest
Syntax VBA
Description
Parameters
DevId
The device ID of the CMC
3.3.10 DevAssosiationRequestCancel
Syntax VBA
Description
Parameters
DevId
The device ID of the CMC
3.3.11 DevDisassociate
Syntax VBA
Description
DisassociateClient
Parameters
DevId
The device ID of the CMC
95
OMICRON CMEngine
3.3.12 DevDisassociateSpecific
Syntax VBA
Description
Parameters
DevId
The device ID of the CMC
MACAddress
The MAC address of the client which should be dissociated
3.3.13 DevGetList
Syntax VBA
Description
Returns a list of CMC devices with the following information for every device:
device ID number, serial number, number of the printer port used (LPT1, LPT2
etc.) and the device address on this printer port.
Parameters
Return Value
Be careful if you want to use a NET-1 device. Make sure to associate it; else you will not be
able to lock it
96
Interface Functions
3.3.14 DeviceAddress
Syntax VBA
3.3.15 DeviceType
Syntax VBA
Description
Parameters
DevId
The device ID of the CMC
3.3.16 DevLock
Syntax VBA
Description
Use this function to reserve ("lock") one or more of the connected CMCs for your
application program.
When a CMC is locked by a program, only this program can communicate with
this CMC.
You can get a list of the CMCs that are known to the CMEngine 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.
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 CMEngine error codes:
Error code
Explanation
CMERR_CMC_ALREADY_LOCKED
97
OMICRON CMEngine
Error code
Explanation
CMERR_CMC_NOT_FOUND
CMERR_FILE_LOG
CMERR_INVALID_INT
CMERR_LOCK_UNLOCK_PORT
CMERR_NO_LICENSE
3.3.17 DevScanForNew
Syntax VBA
Description
Description Scans all available parallel ports of the PC for connected CMCs. If a
new (not yet known) CMC is found, it is entered into the device list and a device
ID number (1,2,3,..) is assigned to it. Then the command initializes the unknown
CMC.
Devices in the list that are no longer connected are removed from the list.
Return Value
Boolean value that indicates if the command was executed without errors
(TRUE) or with errors (FALSE).
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_CALDATA_CHECKSUM
CMERR_DOWNLOAD
CMERR_DOWNLOAD_FILE
CMERR_DOWNLOAD_NO_FW
98
Interface Functions
Error code
Explanation
CMERR_FILE_LOG
CMERR_INCOMPATIBLE_DRIVER
CMERR_INIT
CMERR_LICENSE_FORMAT
CMERR_LOCK_UNLOCK_PORT
CMERR_NO_CMC_CONNECTED
3.3.18 DevUnlock
Syntax VBA
Description
Parameters
DevId
The parameter DevId is long value that contains the device ID number (e.g.
1,2,4).
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_CMC_NOT_FOUND
CMERR_FILE_LOG
CMERR_INVALID_INT
CMERR_LOCK_UNLOCK_PORT
99
OMICRON CMEngine
3.3.19 Exec
Syntax VBA
Description
The application program uses the function Exec() to send command strings to
one or more connected CMCs.
Parameters
DevID
Selects the CMC device that receives the command string with this parameter.
Command
The zero terminated command string is passed in this parameter. The structure
of a command string is explained in chapter String Commands on page 119.
Return Value
Before you can send string commands to a CMC, you must reserve this device for your
application program with the function DevLock() on page 97!
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_CMC_NOT_FOUND
CMERR_CMC_NOT_LOCKED
CMERR_FILE_LOG
CMERR_INVALID_INT
CMERR_NO_LOCKED_CMC
CMERR_SYNTAX
CMERR_PARSER_STACK_OVFL or
CMERR_PUSHBACK_BUF_OVFL or
CMERR_TOKEN_BUF_OVFL
Example:Exec(1,"out:off") - switch OFF all analog outputs of the CMC with DevId 1.
100
Interface Functions
Command:
Exec(1,"inp:cfg?")
Answer:
3.3.20 FriendlyName
Syntax VBA
Description
Parameters
DevId
The device ID of the CMC
3.3.21 GetDevIDbyIPAddress
Syntax VBA
Description
Get device ID for IP address of device (only valid for Ethernet devices)
Parameters
IPAddress
The IP Address of the CMC
3.3.22 GetOfflineCfg
Syntax VBA
Description
101
OMICRON CMEngine
3.3.23 GetOfflineCfg2
Syntax VBA
Description
3.3.24 GetStatusText
Syntax VBA
Description
When you get the content of the primary status register using the sys:status?
string command and at least one of the register bits is set, then normally you
fetch the content of the related secondary status register(s) (with a 2nd call to
sys:status?) to get the reason(s) for the error.
Then you pass the number of the secondary status register and its content you
received from the sys:status? string command to this function. The function
returns a string that contains a status message in the language CMEngine is
compiled for.
Parameters
Register
Number of the secondary status register you received from a preceding
sys:status? string command.
Mask
Bit mask you received with the above register number from a preceding
sys:status? string command.
Return Value
3.3.25 ImgDevTypePrefix
Syntax VBA
Description
102
Interface Functions
3.3.26 IPAddress
Syntax VBA
Description
Parameters
DevId
The device id of the CMC you are interested
3.3.27 LanguageForMessages
Syntax VBA
Description
3.3.28 LogAppend
Syntax VBA
Description
This function enables logging data to a log file with the name Filename. All
logging data will be appended to this file. If this file does not exist it is then
created. The log level is set to 1 (see LogSetLevel() on page 105).
Parameters
Filename
File name of the log file. The file name is a zero terminated string.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_FILE_LOG
103
OMICRON CMEngine
3.3.29 LogGetInfo
Syntax VBA
Description
Use this function to get for the current logging level and filename. If there is no
log file defined, an empty string is returned as a filename.
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.3.30 LogNew
Syntax VBA
Description
A new log file with the name FileName is created and opened with log level 1. If
a file with this name already exists it is deleted before creating the log file.
Parameters
Filename
File name of the log file. The file name is a zero terminated string.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_FILE_LOG
104
Interface Functions
Description
Changes the current log level to byLevel. A level of zero means that the logging
is OFF, thus you can also turn the logging ON or OFF with this function.
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
CMEngine 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 CMEngine error codes:
Error code
Explanation
CMERR_INVALID_INT
3.3.32 LogWrite
Syntax VBA
Description
The string Text is appended to the current log file. A new line is appended to the
text.
Parameters
Text
Zero terminated string to be appended at current log file.
Possible Errors
This command may cause the following CMEngine error codes:
105
OMICRON CMEngine
Error code
Explanation
CMERR_FILE_LOG
3.3.33 MaxAssociationTime
Syntax VBA
Description
Parameters
DevId
The device id of the CMC from which the MaxAssociationTime should be
returned
3.3.34 MinReqImgVersion
Syntax VBA
Description
Get minimum required version of the software image for the specified device type
Parameters
3.3.35 OutUserApp
Syntax VBA
Description
Appends samples to the specified user signal. This interface function can be
used as an alternative to the out:[ana:]user:app string command, saving the
user the need to convert the samples to text. The supplied samples are
appended to the user id provided in the function call.
Parameters
DevId
The deviceID of the target CMC.
UserSigNo
The User Signal Number to which we wish to append the sample; it must have
been allocated with out:[ana:]user:alloc() prior to use.
Samples (VBA)
Buffer containing the samples. Each byte in the buffer contains an individual
sample, according to the scaling conventions described in the String
Commands > Output Commands topic out:[ana:]user:app (<user_sig_no>,
<user_data>) on page 202.
106
Interface Functions
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_INVALID_INT
CMERR_IN_SEQ_MODE
CMERR_USER_SIG_IN_USE
3.3.36 ParallelPort
Syntax VBA
Description
Parameters
DevId
The device id of the CMC you are interested
3.3.37 RegDevCount
Syntax VBA
Description
3.3.38 RegDevItemInfo
Syntax VBA
Description
Parameters
3.3.39 RegDevItemIPAddress
Syntax VBA
Description
107
OMICRON CMEngine
3.3.40 RemoveDevice
Syntax VBA
Description
Remove Device
3.3.41 RemoveRegDev
Syntax VBA
Description
3.3.42 ResGetList
Syntax VBA
Description
Parameters
ListSelect
DevId
The device ID of the CMC
3.3.43 ResLock
Syntax VBA
Description
Parameters
DevId
The device ID of the CMC
ResGroup
ResGroup can have the following values:
rgAnaOut analog outputs
rgAuxDC
rgBinInp
rgBinOut
rgCounter
rgDCInp
rgFirst
108
Interface Functions
rgGPS
rgInternalCmds
rgInvalid
rgJustKeepConn
rgLast
rgMeasDSP
rgMultiInp
rgSampleBuf
rgSeq
rgTransOut
ResIndex
3.3.44 ResUnlock
Syntax VBA
Description
Parameters
DevId
The device ID of the CMC
ResGroup
See function ResLock on page 108
3.3.45 SerialNumber
Syntax VBA
Description
Serial number
Parameters
DevId
The device id of the CMC from which the SerialNumber should be returned
109
OMICRON CMEngine
3.3.46 SetLicInfo
Syntax VBA
Description
Parameters
DevId
The device id of the CMC from which you want to set the license information
3.3.47 Version
Syntax VBA
Description
Parameters
Version
Buffer for the version information string. The zero terminated string returned in
this buffer has the format V.RE.NNN[.B]. It always contains the following
information:
V - version number
R - revision number of the version
E - current error correction revision number
NNN - build number
and optionally contains the following information:
B - beta flag (character)
Return Value
110
Interface Functions
generator 0 generator 1
generator n-1 generator 0 generator 1
generator n-1
The number of samples per generator in a block is the return value of RealtimeBegin, the number of
blocks that fit into the CMC memory is returned in the pnBlocks parameter of this function.
For a CMC 156 with 3 voltage and 3 current generators in use you will get 7 blocks with 2048 samples
per generator in one block:
111
OMICRON CMEngine
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:
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 RealtimeStatus. 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:
**** pseudo code ****
BlockSize = RealtimeBegin(, pnBlocks);
MaxSamplesInCMCMemory = (*pnBlocks) * BlockSize;
RealtimeStatus(, SamplesToPlay);
FreeSamples = MaxSamplesInCMCMemory SamplesToPlay;
if (FreeSamples > BlockSize )
download new block(s)
endif
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.
112
Interface Functions
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:
113
OMICRON CMEngine
CMC 56/156
V1
V2
V3
I1
I2
I3
V1
V2
V3
I1A
I2A
I3A
Generator
10
11
CMC 56/156
LL out 1
LL out 2
LL out 3
LL out 4
LL out 5
LL out 6
where Sample is the integer value of the sample and A is the amplitude set with the out:ana:v|i():a()
command.
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:
114
Interface Functions
3.3.48.1
RealtimeBegin
Syntax VBA
Description
Parameters
DevId
Id of the CMC device to be prepared for real-time playback.
dSampleRate
115
OMICRON CMEngine
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 CMEngine error codes:
Error code
Explanation
CMERR_NOT_SUPPORTED
3.3.48.2
RealtimeEnd
Syntax VBA
Sub RealtimeEnd()
Description
3.3.48.3
RealtimeWrite
Syntax VBA
Description
Write a block of transient data for one generator to the CMC for realtime
playback. The block may contain data for several channels, even ones which are
not played back.
116
Interface Functions
Parameters
nCMCGen
Generator index in the CMC (see description above)
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).
117
OMICRON CMEngine
3.3.48.4
RealtimeStatus
Syntax VBA
Description
Parameters
wGenerator
Generator number to be checked (must be the last generator in use in the
current implementation).
plStatus
Pointer to buffer which receives the status.
Meaning of the bits in the returned status:
Bit 23: Error in data transfer occurred
Bit 22: Data underflow, data was transferred too slowly
Bits 0-21: Number of samples in CMC memory, which are not yet played back
3.3.48.5
RealtimeSetCheckChl
Syntax VBA
Description
Parameters
Channel
118
String Commands
String Commands
The following chapter explains everything that is important to assemble string commands for the
CMEngine: 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 string
commands are listed in groups of related commands.
Each command description also contains an entry called "Compatibility" which indicates which
platforms the command is available for.
4.1
The following symbols are used for notation purposes only (do not insert them into your string
commands):
Symbol
Meaning
<...>
[]
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.
Meaning
..
The special symbols used by the CMEngine in the string answers returned for string commands
containing a question mark are explained with the Exec() interface function.
119
OMICRON CMEngine
4.2
The following section describes the syntax rules needed to assemble the string commands you send
to CMEngine via 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).
E.g., SYS:RESET is accepted just as sys:reset or Sys:Reset.
In this manual, all string commands are written in lower case.
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.
Format: ... sub-command(parameter1, parameter2, parameter3, ... ) ...
Example:
sys:cfg?(ser)
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)
120
String Commands
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.
Example 1:
You can assemble the three commands out:ana:v(1):sig(1):wav(sin), out:ana:v(1):sig(1):a(10)
and out:ana:v(1):sig(1):f(60) into the following command
out:ana:v(1):sig(1):wav(sin);a(10);f(60)
Example 2:
out:ana:v(1):sig(1):a(30);a(100) sets the amplitude to 30V, the a(100) is ignored.
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.
The command in the previous example 1 may be shortened further as follows:
Instead of out:ana:v(1):sig(1):wav(sin);a(10);f(60) you may write out:v(1):wav(sin);a(10);f(60)
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.
121
OMICRON CMEngine
4.3
Overview of the parameter types for the parameters used in CMEngine string commands:
<integer>
Integer number between -231 and 231-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.
Examples for <integer>:
"1456", "0b10010111", "0x1F4C", "0x1f4c", "-22", "-0x1f4c".
<enumeration>
<triple_list_type>
<float>
122
String Commands
4.4
System Commands
At the left-hand side table of contents find the system command of your choice and click the
corresponding entry.
123
OMICRON CMEngine
4.4.1
sys:reset
Function
Description
All parameters of the device are reset to their startup values. All memories for
measurement data etc. are cleared. All data structures for this CMC in the
CMEngine are set to startup values.
The following operations are executed:
amp:route (v (<triple_no>), clr) for all generator triples
amp:route (i (<triple_no>), clr) for all generator triples
amp:def (<amp_no>, clr) for all amplifiers
amp:def (1, int)amp:def (2, int)
amp:route (v (1), 1)
amp:route (i (1), 2)
out:ana:clr
inp:buf:clr
inp:bin:thres(0)
seq:clr
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_CALDATA_CHECKSUM
CMERR_DOWNLOAD
CMERR_DOWNLOAD_FILE
CMERR_DOWNLOAD_NO_FW
CMERR_IN_SEQ_MODE
124
String Commands
4.4.2
sys:test? [(<filename>)]
Function
Description
Starts a self test and finally returns a message stating whether the execution was
OK or not OK.
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.
Parameters
<filename>
Name of the report file. This parameter is optional.
Answer
Returns a string which is the shortcut for a diagnostic message (see the following
table).
v1
v2
v3
vtemp
i1
i2
i3
itemp
ad
bin
errors occurred on at least one of the binary inputs or an input has voltage above
250 Volts
125
OMICRON CMEngine
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 CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_PROT_FILE
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.
126
String Commands
4.4.3
sys:cfg? (type|ser|hard|firm|cal)
Function
Parameters
You must specify one of the keywords type, ser, hard, firm or cal.
Answer
The command causes a string that contains the following data as shown in the
following table.
CMC model information string ("CMC 56" or "CMC151") and model number.
ser
Serial number of 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
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
127
OMICRON CMEngine
4.4.4
sys:status? [ (<bit_number>) ]
Function
Description
When you do not specify the optional parameter <bit_number>, this command
gets the primary status register (32 bits; bit 0 to bit 31).
The optional parameter <bit_number> denotes one of the secondary status
registers. If you specify a secondary register as parameter <bit_number> the
content of this register is returned (32 bits; bit 0 to bit 31).
Parameters
<bit_number>
This parameter is of type <integer> and is optional. It specifies the number of the
secondary register.
Answer
Compatibility
When you get the content of a secondary status register, the register content is deleted.
Error code
Explanation
CMERR_DOWNLOAD_FILE
CMERR_DOWNLOAD_NO_FW
CMERR_IN_SEQ_MODE
CMERR_INVALID_INT
Example
The command sys:status?(2) returns the content of secondary status register 2:
The answer string is e.g. "1, 512;". This means that the secondary status register of the device
contains the decimal number 512. In this register bit, number 9 is set to "1" (29=512) and the other bits
are "0". With the list of status register bits below you can find out that there is an overload on the 1st
generator of voltage generator triple 4.
128
String Commands
4.4.5
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.
Primary status register
Bit Meaning
0
Communication errors
GPS/PTP errors
Overload at inputs
IRIG-B errors
10
11
12
13
129
OMICRON CMEngine
Bit Meaning
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Secondary status register #0: communication errors
Bit Meaning
0
Initialization failed
130
String Commands
Bit Meaning
4
Communication interrupted
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
131
OMICRON CMEngine
Bit Meaning
28
29
30
31
Secondary status register #1: CMC-internal errors
Bit Meaning
0
3
4
Timeout in AD converter
Ground-wire break
10
11
12
13
14
15
16
17
132
String Commands
Bit Meaning
18
19
20
21
22
23
24
25
26
27
28
29
30
31
[1]: Should 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).
Secondary status register #2: overload at voltage generators
Bit Meaning
0
133
OMICRON CMEngine
Bit Meaning
6
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
134
String Commands
Bit Meaning
30
31
Secondary status register #3: overload at current generators
Bit Meaning
0
10
11
12
13
14
15
16
17
18
19
135
OMICRON CMEngine
Bit Meaning
20
21
22
23
24
25
26
27
28
29
30
31
Secondary status register #4: overtemperature at voltage generators
Bit Meaning
0
136
String Commands
Bit Meaning
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Secondary status register #5: overtemperature at current generators
137
OMICRON CMEngine
Bit Meaning
0
10
11
12
13
14
15
16
17
18
19
20
21
22
23
138
String Commands
Bit Meaning
24
25
26
27
28
29
30
31
Secondary status register #6: GPS/PTP errors
Bit Meaning
0
Hardware failure
Initialization error
6
7
8
9
10
11
12
13
139
OMICRON CMEngine
Bit Meaning
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Secondary status register #7: overload at inputs
Bit Meaning
0
Overload input 1
Overload input 2
Overload input 3
Overload input 4
140
String Commands
Bit Meaning
4
Overload input 5
Overload input 6
Overload input 7
Overload input 8
Overload input 9
Overload input 10
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
141
OMICRON CMEngine
Bit Meaning
28
29
30
31
Secondary status register #8: current amplifier internal errors
Bit Meaning
0
A: Supply error
A: Range error
A: Offset error
10
11
12
13
14
15
16
B: Supply error
17
B: Range error
142
String Commands
Bit Meaning
18
19
20
21
B: Offset error
22
23
24
25
26
27
28
29
30
31
143
OMICRON CMEngine
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
144
String Commands
Bit Meaning
23
24
25
26
27
28
29
30
31
145
OMICRON CMEngine
4.4.6
sys:goose:cfg(<filename>)
Function
Description
Transfers the GOOSE configuration specified in the file <filename> to the CMC
and activates it.
GOOSE operation is only supported on network-based CMC devices.
Parameters
<filename>
Name of the file holding the new GOOSE configuration.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_NOT_SUPPORTED
CMERR_GOOSE_CFG_SET_FAILED
146
String Commands
4.4.7
sys:goose:cfg?(<filename>)
Function
Description
Reads the GOOSE configuration from the CMC and stores it in the specified file
<filename>.
GOOSE operation is only supported on network-based CMC devices.
Parameters
<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 (see the following
table).
noconfigfile
The CMC did not contain a GOOSE configuration file, thus no file could be
retrieved.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_NOT_SUPPORTED
CMERR_GOOSE_CFG_GET_FAILED
4.5
Output Commands
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
147
OMICRON CMEngine
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 CMEngine 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
out:ana:v(1): ...
v(1)
out:ana:v(2:1): ...
v(2:1)
out:ana:v(1,3): ...
v(1,3)
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 CMEngine the following amplifier routings are predefined:
Logical generator
triple
v(1)
i(1)
148
String Commands
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 mixcommand (see below). After the startup of CMEngine 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 CMEngine 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.
In the left side table of contents find the output command of your choice and click the corresponding
entry.
149
OMICRON CMEngine
4.5.1
Function
This command defines the amplitude for the selected signal component of all
generators in <generator_list>.
Description
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>.
The keyword step is optional.
The new amplitude is defined with this command but is not set until the next on command
(e.g. out:ana:on).
150
String Commands
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_INVALID_FLOAT
CMERR_INVALID_INT
151
OMICRON CMEngine
4.5.2
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.
The default value for the frequency is 0 Hz.
When the current waveform is wav(dc), you cannot set a frequency.
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.
<frequency>
This parameter is of type <float>.
The keyword step is optional.
The new frequency is defined with this command but is not set until the next on command
(e.g. out:ana:on).
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_INVALID_FLOAT
CMERR_INVALID_INT
152
String Commands
4.5.3
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>
This parameter is 1 or 2 and selects either signal component 1 or component 2.
<period_time>
This parameter is of type <float>.
The newperiod time is defined with this command but is not set until the next on
command (e.g. out:ana:on).
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 CMEngine error codes:
Error code
Explanation
CMERR_INVALID_FLOAT
CMERR_INVALID_INT
153
OMICRON CMEngine
4.5.4
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.
The default value for all phases is 0 degrees.
If the current waveform is wav(dc), only a phase of 0 degrees is allowed.
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.
<phase>
This parameter is of type <float>.
The keyword step is optional.
The new phase is defined with this command but is not set until the next on command (for
example, out:ana:on).
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_INVALID_FLOAT
CMERR_INVALID_INT
154
String Commands
4.5.5
Function
This command defines the waveform <waveform> for the selected signal
component of all generators in <generator_list>.
Description
After the startup of CMEngine 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.
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.
155
OMICRON CMEngine
4.5.6
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 CMEngine error codes:
Error code
Explanation
CMERR_INVALID_INT
156
String Commands
4.5.7
out:[ana:]v|i (<generator_list>):[sig(<no>):]wav
(sum,<amplitude_factor1>, ...)
Function
Defines asignal that is a sum of a sine (the fundamental) and its harmonics for
the selected signal component of the generators in <generator_list>.
Description
Parameters
157
OMICRON CMEngine
<amplitude_factorX>
These parameters are of type <float> and are valid in the interval [0, 106].
<phaseX>
These parameters are of type <float> and are valid in the interval [-360, 360].
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 CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_INVALID_FLOAT
CMERR_INVALID_INT
CMERR_OUT_OF_CMC_MEM Internal CMC memory exhausted; cannot download and use this
waveform
CMERR_TRIPLE_NOT_DEF
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.
158
String Commands
159
OMICRON CMEngine
4.5.8
Function
Defines asignal 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.
160
String Commands
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
161
OMICRON CMEngine
<phaseX>
These parameters are of type <float> and are valid in the interval [-360, 360].
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 CMC 256 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 CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_INVALID_FLOAT
CMERR_INVALID_INT
CMERR_OUT_OF_CMC_MEM
CMERR_TRIPLE_NOT_DEF
162
String Commands
4.5.9
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.
The default <duty_cycle> of 0.5 causes the following waveform:
163
OMICRON CMEngine
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 CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_INVALID_FLOAT
CMERR_INVALID_INT
CMERR_OUT_OF_CMC_MEM Internal CMC memory exhausted, cannot download and use this
waveform
CMERR_TRIPLE_NOT_DEF
164
String Commands
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.
The default <duty_cycle> of 0.5 generates the following waveform:
<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>.
165
OMICRON CMEngine
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_INVALID_FLOAT
CMERR_INVALID_INT
CMERR_OUT_OF_CMC_MEM Internal CMC memory exhausted; cannot download and use this
waveform
CMERR_TRIPLE_NOT_DEF
166
String Commands
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>
This parameter 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>.
The keyword single is optional.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_INVALID_INT
167
OMICRON CMEngine
168
String Commands
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 CMEngine error codes:
Error code
Explanation
CMERR_INVALID_INT
169
OMICRON CMEngine
Description
The following formula illustrates the relation between the time constant, the
amplitude factor and the instantaneous value of the amplitude.
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 CMEngine error codes:
Error code
Explanation
CMERR_INVALID_FLOAT
CMERR_INVALID_INT
170
String Commands
Example:
The following commands 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):
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)
171
OMICRON CMEngine
Description
Parameters
<generator_list>
This parameter is of type <triple_list_type>.
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 CMEngine error codes:
Error code
Explanation
CMERR_INVALID_INT
172
String Commands
Description
Use this command when you want to switch OFF generators but leave the signal
parameters defined. You can use an on command to switch them ON again.
Parameters
<generator_list>
This parameter is of type <triple_list_type>.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_INVALID_INT
173
OMICRON CMEngine
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 CMEngine error codes:
Error code
Explanation
174
String Commands
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 listed
in the table below.
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.
Generators
Default
v(1)
175
OMICRON CMEngine
Triple
Generators
Default
i(1)
sig(1)
off
off
...
Overview of keywords:
Keyword Explanation
sig(1)
sig(2)
add
mult
off
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_INVALID_INT
176
String Commands
Error code
Explanation
CMERR_PROC_EXHAUST
CMERR_PMODE_DIFF
CMERR_NOT_SUPPORTED
177
OMICRON CMEngine
4.5.18 out:[ana:]save
Function
Description
Use this command to save the signal parameters for all generators. These
parameters include amplitude, phase and frequency for both signal components.
This command is useful when the signal parameters are not the same as were
originally set.
The parameters that are set with the analog output parameters commands
(out:ana:a(), out:ana:f(), etc.) are stored in a buffer, and passed to the
generators when an out:ana:on command is issued. There is therefore a
separation between the parameters set and the values actually output by the
generators.
Additionally, the out:ana:step command acts upon the generator values, without
modifying the parameters set. This command allows storing the values that the
generators are actually outputting to restore them later.
178
String Commands
4.5.19 out:[ana:]restore
Function
Description
Use this command to restore the signal parameters for all generators. These
parameters include amplitude, phase and frequency for both signal components,
and must have been saved with a previous out:ana:save command.
The command does not output the values to the generators for that, a further
out:ana:on or out:ana:step command are required.
To use the out:ana:restore command, the outputs must be already on. If they are off, the
restored values will be overwritten by the next out:ana:on command with the originally set
commands.
See also commands:
out:ana:save on page 178
out:ana:clr on page 185
out:ana:off on page 182
179
OMICRON CMEngine
Description
Parameters
<triple_no>
This parameter is of type <integer>.
<zero_factor>
Parameter of type <float>.
The zero factor range is: 4.0 = factor < 4.0
Negative factors will cause the output wave to be reversed in phase respect to
the calculated one. This factor is by default equal to 1.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_INVALID_INT
CMERR_INVALID_FLOAT
CMERR_OUT_OF_RANGE
180
String Commands
4.5.21 out:[ana:]on
Function
Description
Use this command to switch ON all generators with previously specified voltage
or current signals, or to apply all changes done to the generators parameters
since the last out:[ana:]on command.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
181
OMICRON CMEngine
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 CMS 151 and CMS 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 CMS 151.
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:
Example: i(2:3) & v(2:3)
generator 3 of current triple 2 is switched off in its zero crossing and generator 3
of voltage triple 2 is switched off simultaneously.
When the parameter before "&" is a generator triple, the parameters after "&"
must be generator triples too:
Example: i(2) & v(1) & v(2)
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
182
String Commands
generators v(1:3) and v(2:3) are switched off with the generator i(2:3).
Parameters
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_INVALID_INT
CMERR_TRIPLE_NOT_DEF
CMERR_PROC_EXHAUST
183
OMICRON CMEngine
Switches OFF v(1:2) at its zero crossing and i(1:2) with it. Switches OFF v(1:3) at its zero crossing and
i(1:3) with it. Switches OFF the generators of the 2nd current generator triple in their next zero
crossing.
184
String Commands
4.5.23 out:[ana:]clr
Function
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 CMS 151 and CMS 156 the power supplies are switched to stand-by mode
additionally (see amp:ctrl).
185
OMICRON CMEngine
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 CMEngine 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.
Parameters
You can use the command without additional keywords, with the keyword load or
with the keyword exec.
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).
See also commands:
out:ana:v():[sig(<no>):]a() on page 150
out:ana:v():[sig(<no>):]f() on page 152
out:ana:v():[sig(<no>):]p() on page 153
186
String Commands
Description
Voltage or current signal e.g. i(1:2)
Instantaneous phase belonging to sample k of
signal x
Instantaneous phase belonging to the following
sample k+1 of signal x
Old phase pointer
187
OMICRON CMEngine
diff
The new instantaneous phase belonging to the sample (k+1) is determined by the
current instantaneous phase and the difference between new and old phase pointer.
At the moment of the on-command the new signal starts with the old signal's current
phase.
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())
188
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.
String Commands
Explanation
189
OMICRON CMEngine
4.5.26 out:[ana:]pmode?
Function
Answer
Returns a string that contains the device number and the keyword corresponding
to the phase mode set.
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 CMEngine error codes:
Error code
Explanation
190
String Commands
4.5.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.
Answer
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
191
OMICRON CMEngine
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, a forward
jump to the 3rd sequence step is executed.
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
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)
seq:wait(1,1)
seq:wait(1,1)
out:resetopt
out:i(1):a(100)
192
String Commands
out:v(1):a(100)
out:on
seq:end
193
OMICRON CMEngine
4.5.28 out:[ana:]buf:sam[(lock|free)]
Function
Description
Parameters
The command may have the parameter lock, the parameter free or no
parameter.
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.
The command does not store wave form, mix mode or range information. It is the users
responsibility to make sure that the recorded values are meaningful when they are read.
See also:
out:ana:buf:get? on page 195
194
String Commands
Description
Answer
Returns a string containing: the device ID, a time tag, the amplitude, phase and
frequency of the selected generator and signal component. All values are of type
double, except the device ID, which is integer.
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).
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 CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
195
OMICRON CMEngine
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)
seq:wait(bin(1),2,0.5,1)
out:step
seq:wait(bin(1), 1, 0.5,0)
out:ana:buf:sam(lock)
out:off
seq:end
......
The PC program would run like this:
seq:exec
out:ana:buf:get?(v(1:1))
......
END DO
out:ana:buf:get?(v(1:1))
196
String Commands
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.
197
OMICRON CMEngine
Description
The frequency of the external signal must be between 40 and 70 Hz. All other
frequencies are ignored and the last valid frequency measured in the
synchronization input is used.
All generators ignore the frequency settings and adjust their frequencies to the
external source.
Parameters
ext:
The synchronization signal in the external interface is used.
+|-:
The positive (+) or negative (-) slope of the external signal will be used for
synchronization.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_NOT_SUPPORTED
See also:
command out:[ana:]sync(off) on page 199
198
String Commands
4.5.31 out:[ana:]sync(off)
Function
Description
The synchronization to an external signal is switched off and the frequency of the
analog outputs will stay on the last measured frequency.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
See also:
command out:[ana:]sync(ext, +|-) on page 198
199
OMICRON CMEngine
4.5.32 out:[ana:]user:...
Description
200
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,...).
String Commands
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 CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_INVALID_INT
CMERR_OUT_OF_CMC_MEM No internal CMC memory for new user-defined signals any more
See also:
out:ana:v(...):[sig(<no>):]wav
Examples:
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.
201
OMICRON CMEngine
Description
With this command you can store samples into the memory segment of the
waveform <user_sig_no> that you have allocated before. The parameter
<user_data> contains the list of samples.
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:
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>.
An out:ana:user:alloc? command must be successfully executed before you can use the
out:ana:user:app command.
The user signal you append data to must not be in use!
202
String Commands
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_INVALID_INT
CMERR_INVALID_USER_SIG
CMERR_OUT_OF_CMC_MEM Internal CMC memory for this user-defined signal is full; no free
samples left
CMERR_USER_SIG_IN_USE
See also:
command out:ana:user:alloc? on page 201
command out:ana:user:status? on page 205
interface function CMOutUserApp
Example:
The following commands
out:user:alloc?(10) (returns e.g. a user signal number of 2)
out:user:app(2, 32767:5, -32767:5)
out:ana:v(1:1):sig(1):wav(user, 2)
out:ana:v(1:1):sig(1):a(100)
out:ana:v(1:1):sig(1):f(50)
out:ana:v(1:1):on
define as user waveform a trapeze wave consisting of 5 samples with the normalized value 1 and 5
samples with the normalized value -1 with interpolated slopes.
Then signal 1 of generator 1 is set to this user waveform 2 with an amplitude of 100V and a frequency
of 50Hz.
203
OMICRON CMEngine
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.
The user signal of the memory you want to free must not be in use!
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_INVALID_INT
See also
command out:ana:user:alloc? on page 201
command out:ana:user:app on page 202
interface function CMOutUserApp
204
String Commands
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 CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_INVALID_INT
205
OMICRON CMEngine
4.5.37 out:bin:cfg?
Function
Description
Use this command to get the number of output modules available in a device.
Answer
See also:
out:bin(<out_module_idx>):cfg? on page 207
out:bin(<out_module_idx>:<group_idx>):cfg? on page 207
Example:
Command: out:bin:cfg?
Answer: "1,2;"
Device 1 has 2 binary output modules.
206
String Commands
4.5.38 out:bin(<out_module_idx>):cfg?
Function
Description
Use this command to get a complete description of each output module in the
addressed device.
Parameter
<out_module_idx>
Integer id of the output module for which information is desired. This value must
be greater than 0, and smaller or equal than the value returned by the
out:bin:cfg? command.
Answer
<dev_id>,<#groups>,<loc>,<loc_idx>,<mod_type>,<mod_ser_no>,<hard_ver>,<
dev_type>,<dev_ser_no>;
The return string contains the CMCs 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
Module Serial Number
The serial number of the output module. Please note that the output modules
have serial numbers independent from those of the device that hosts them.
Hardware Version
The version number of the hardware.
Device Type
207
OMICRON CMEngine
Type of device in which the outputs are included. For instance, CMC 256-6, CMB
IO-7, etc.
Device Serial Number
The serial number of the host device.
See also:
out:bin:cfg? on page 206
out:bin(<out_module_idx>:<group_idx>):cfg? on page 209
Example:
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. The location index is 1. Module
type and serial number are the same as those of the host CMC156-EP.
208
String Commands
4.5.39 out:bin(<out_module_idx>:<group_idx>):cfg?
Function
Description
Use this command to get a complete description of each output group within a
given module.
Parameters
<out_module_idx>
Integer id of the output module for which information is desired. This value must
be greater than 0, and smaller or equal than the value returned by the
out:bin:cfg? command.
<group_idx>
Integer id of the output group within the output module for which information is
desired. This value must be greater than 0, and smaller or equal than the value
returned by the out:bin(<out_module_idx>):cfg? command (return field
<#groups>).
Answer
<dev_id>,<#out>,<type>,<gnd_conn>,<common>,<res_group_type>,<res_group
_idx>;
The return string contains the CMCs device number, plus the following data for
the selected output group:
Number of Outputs
Number of binary outputs in this group (integer).
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.
209
OMICRON CMEngine
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.
Resource group type
String indicating the resource group of this output group. It must be one of the
following values:
binout -Resource group rgtBinOut.
transout - Resource group rgtTransOut.
Resource group index
Integer value of the index for this groups resource group.
See also:
out:bin:cfg? on page 206
out:bin(<out_module_idx>):cfg? on page 207
Examples:
Command: out:bin:cfg?
Answer: "1,2;"
The device has 2 output modules.
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 modules type and serial number are the same as the CMCs.
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;"
210
String Commands
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.
211
OMICRON CMEngine
4.5.40 out:bin(<out_module_idx>):on(<output_list>)
Function
Description
With this command you can set binary outputs to "1". The outputs are specified
through the parameter <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 CMEngine error codes:
Error code
Explanation
212
String Commands
Description
With this command you can set binary outputs to "0". The outputs are specified
through the parameter <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 CMEngine error codes:
Error code
Explanation
213
OMICRON CMEngine
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):
The logic of the set command follows the binary code system:
20 = 0001bin = 1dec ; sets BINARY OUTPUT 1
21 = 0010bin = 2dec ; sets BINARY OUTPUT 2
22 = 0100bin = 4dec ; sets BINARY OUTPUT 3
23 = 1000bin = 8dec ; sets BINARY OUTPUT 4.
(Least significant bit at the right; most significant bit at the left).
Commands overview to set the 4 binary outputs of a single CMC test set:
Note: To reflect the BINARY OUTPUTS array of a real CMC test set, the table below now shows the
least significant bit (= OUTPUT 1) at the left and the most significant bit (= OUTPUT 4) at the right.
BINARY OUTPUTS
Set command
out:bin(1):set(0)
214
2
0
3
0
4
0
String Commands
BINARY OUTPUTS
Set command
out:bin(1):set(1)
out:bin(1):set(2)
out:bin(1):set(3)
out:bin(1):set(4)
out:bin(1):set(5)
out:bin(1):set(6)
out:bin(1):set(7)
out:bin(1):set(8)
out:bin(1):set(9)
out:bin(1):set(10)
out:bin(1):set(11)
out:bin(1):set(12)
out:bin(1):set(13)
out:bin(1):set(14)
out:bin(1):set(15)
Examples:
The command out:bin(1):set(1) sets output 1 in module 1 and clears all the rest (1dec = 0001bin).
The command out:bin(1):set(11) sets outputs 1, 3 and 4 in module 1 and clears output 2
(11dec = 1011bin).
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
215
OMICRON CMEngine
4.5.43 out:bin(<out_module_idx>):get?
Function
Description
Use this command to get the states of all binary outputs in a module.
Parameter
<out_module_idx>
Integer id of the output module for which the output state must be read. This
value must be greater than 0, and smaller or equal than the value returned by the
out:bin:cfg? command.
Answer
A decimal number is returned that represents a 32 bit integer value. Bit 0 (LSB)
indicates the state of binary output 1; bit 1 indicates the state of binary output 2
etc. If the module had fewer than 32 outputs, the bits corresponding to the nonexisting outputs would be 0:
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 CMEngine error codes:
Error code
Explanation
216
String Commands
4.5.44 out:bin(<out_module_idx>:<group_idx>):name(<name>)
Function
Description
Parameters
<out_module_idx>
Integer id of the output module for which information is desired. This value must
be greater than 0, and smaller or equal than the value returned by the
out:bin:cfg? command.
<group_idx>
Integer id of the output group within the output module for which information is
desired. This value must be greater than 0, and smaller or equal than the value
returned by the out:bin(<out_module_idx>):cfg? command (return field
<#groups>).
<name>
String enclosed in single or double quotes.
See also:
out:bin(<out_module_idx>:<group_idx>):name? on page 218
217
OMICRON CMEngine
4.5.45 out:bin(<out_module_idx>:<group_idx>):name?
Function
Queries
Description
Parameters
<out_module_idx>
Integer id of the output module for which information is desired. This value must
be greater than 0, and smaller or equal than the value returned by the
out:bin:cfg? command.
<group_idx>
Integer id of the output group within the output module for which information is
desired. This value must be greater than 0, and smaller or equal than the value
returned by the out:bin(<out_module_idx>):cfg? command (return field
<#groups>).
Answer
<dev_id>,<name>;
The return string contains the CMCs 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.
218
String Commands
4.5.46 out:aux:cfg?
Function
Description
Use this command to get the number of auxiliary VDC outputs in a device.
Answer
Example:
Command: out:aux:cfg?
Answer: "1,1;"
Device 1 has 1 auxiliary output.
219
OMICRON CMEngine
4.5.47 out:aux(<idx>):cfg?
Function
Description
Use this command to get information about an auxiliary VDC output in a device.
Answer
<dev_id>,<dev_type>,<ser_no>,idx_on_dev>;
The return string contans the CMCs device number, the device type of the
device that the auxiliary VDC output belongs to, the device serial number and the
index of the auxiliary VDC output on that device.
Example:
Command: out:aux(1):cfg?
Answer: "1,CMC256,AG153F,1;"
Device 1 is a CMC 256 with serial number AG153F. The addressed auxiliary VDC output has index 1.
220
String Commands
4.5.48 out:aux(<idx>):on|off
Function
Description
This command switches the targeted auxiliary VDC output on or off, according to
the keyword used.
Parameter
<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 CMEngine error codes:
Error code
Explanation
CMERR_OUT_OF_RANGE
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() on page 222
out:aux(<idx>):a? on page 223
221
OMICRON CMEngine
4.5.49 out:aux(<idx>):a(<v_dc>)
Function
Description
This command sets the value of the DC voltage to be output in the targeted
auxiliary output. If the output is on, the new voltage is output immediately upon
execution of this command.
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.
<v_dc>
Value of the DC voltage to be output. This parameter is of type <float> and must
be zero or positive.
The VDC auxiliary outputs are intended to provide power to the devices being tested. Due to
this intended use, they do not have the same accuracy as the test signal generators and
cannot be set to negative values.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_NOT_SUPPORTED
CMERR_OUT_OF_RANGE
See also:
out:aux(<idx>):a? on page 223 and out:aux(<idx>):def() on page 224.
222
String Commands
4.5.50 out:aux(<idx>):a?
Function
Description
This command returns the status of the targeted VDC auxiliary output: whether it
is on or off, the set value and the maximum value.
Parameter
<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.
Answer
A string containing the device ID list, the output status ("on" or "off"), the set
voltage (<float>) and the maximum voltage of the output (<float>).
See also:
out:aux(<idx>):a() on page 222 and out:aux(<idx>):def().
Example:
out:aux(1):a(25)
out:aux(1):on
out:aux(1):a?
Return: 1,on,2.500000E+001,2.640000E+002;
223
OMICRON CMEngine
4.5.51 out:aux(<idx>):def(<pwr_on_v>)
Function
Description
When the host device is powered on, the VDC auxiliary output can be turned on
automatically. This is achieved by setting a non-zero value to the <pwr_on_v>
parameter. The value set will be stored in non-volatile memory so it is not lost
when the power is removed.
When the host device is powered on, the DC voltage of the auxiliary output is set
to <pwr_on_v>; if this value is greater than 0, the VDC output is automatically
turned on.
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.
<pwr_on_v>
Value of the DC voltage to be output on power-on. This parameter is of type
<float>.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_AUX_DC_NOT_LOCKED The VDC auxiliary output is not locked and cannot be accessed
CMERR_INVALID_FLOAT
CMERR_NOT_SUPPORTED
CMERR_OUT_OF_RANGE
See also:
out:aux(<idx>):a? on page 223
Examples:
out:aux(1):def(110)
Power-down a CMC 256, 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;
224
String Commands
4.5.52 out:aux(<idx>):def?
Function
Description
This command returns the value stored in non-volatile memory for the VDC value
on power-up. To find out the current status of the VDC output please use the
out:aux(<idx>):a? command.
Parameter
<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.
Answer
String containing the device number and the power-on value of the auxiliary VDC
(<float>).
See also:
out:aux(<idx>):def() on page 224
out:aux(<idx>):a? on page 223
225
OMICRON CMEngine
4.5.53 out:cfg?
Function
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.
4.6
The following section contains the commands that are needed to configure sampled values
generation. These commands work on each network-based CMC device. Each device supports up to
3 sampled values streams. The third stream is only available if the device has a LLO-2 board
assembled (12 low level outputs).
The sampled values streams are bound to the following amplifiers:
Sampled values
stream
Output type
Amplifier
Output range
Voltage
internal voltage
amplifier
highest of amplifier,
e.g. 300 V for CMC256
Current
internal current
amplifier A
highest of amplifier,
e.g. 12.5 A for
CMC256
Voltage
fixed to 250 V
Current
fixed to 25 A
226
String Commands
Sampled values
stream
Output type
Amplifier
Output range
Voltage
fixed to 250 V
Current
fixed to 25 A
In the left side table of contents find the sampled values command of your choice and click the
corresponding entry.
227
OMICRON CMEngine
4.6.1
out:[ana:]sv:def(<#blocks>, <nom_freq>)
Function
Description
This command configures the general sampled values settings for all available
sampled values streams.
Note:
If a sampled values stream is already running, it is stopped and restarted with the
new general settings.
Parameters
<#blocks>:
Number of blocks per transfer: 1, 2, or 4. This setting determines the amount of
sampled values 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 its
only a quarter of the full frequency.
<nom_freq>:
Nominal frequency for sampled values generation as double. Only the values
50Hz and 60Hz are supported.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_NOT_SUPPORTED
CMERR_SV_CFG_SET_FAILED
See also:
command out:ana:sv:def? on page 229
228
String Commands
4.6.2
out:[ana:]sv:def?
Function
Description
This command reads the current general sampled values settings of the device.
Answer
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
229
OMICRON CMEngine
4.6.3
Function
Configures the selected sampled values stream and turn the generation on.
Description
This command configures the sampled values stream which is selected with the
parameter <sv_idx>. The generation of the sampled values stream <sv_idx> is
turned on.
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
<sv_idx>:
Integer id of the sampled values stream which is the target of this command.
Allowed values are 1, 2 and 3.
<fact_i>:
Scaling factor for current sampled values as double. This factor is calculated with
the following formula:
<fact_v>:
Scaling factor for voltage sampled values as double. This factor is calculated with
the following formula:
<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.
230
String Commands
<eth_type>:
Type of Ethernet frame as 16bit integer. Only the value for sampled values
0x88BA is allowed.
<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.
<simulate>:
Specify if the simulation flag should be set or not. 0 does not set the flag, and 1
activates it.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_NOT_SUPPORTED
CMERR_SV_CFG_SET_FAILED
231
OMICRON CMEngine
See also:
command out:ana:sv:cfg?(...) on page 233
232
String Commands
4.6.4
out:[ana:]sv:cfg?(<sv_idx>)
Function
Description
This command reads the current sampled values settings of the device for the
specified stream <sv_idx>.
Parameters
<sv_idx>:
Integer id of the sampled values stream for which information is desired. Allowed
values are 1, 2 and 3.
Answer
233
OMICRON CMEngine
<svId_name>:
Name of the sampled values ID as string.
<simulated>:
Is the simulation flag set for that stream or not. Returns on or off.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_SV_CFG_GET_FAILED
CMERR_OUT_OF_RANGE
CMERR_NOT_SUPPORTED
See also
command out:ana:sv:cfg() on page 230
234
String Commands
4.6.5
out:[ana:]sv:off(<sv_idx>)
Function
Description
This command turns the generation of the sampled values stream <sv_idx> off.
Parameters
<sv_idx>:
Integer id of the sampled values stream which is the target of this command.
Allowed values are 1, 2 and 3.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_SV_CFG_SET_FAILED
CMERR_OUT_OF_RANGE
CMERR_NOT_SUPPORTED
235
OMICRON CMEngine
4.6.6
out:[ana:]sv:status?(<sv_idx>)
Function
Description
This command reads the current status of the sampled values stream <sv_idx>
out of the device.
Parameters
<sv_idx>:
Integer id of the sampled values stream for which information is desired. Allowed
values are 1, 2 and 3.
Answer
236
String Commands
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_COMM
Communication error
CMERR_OUT_OF_RANGE
CMERR_NOT_SUPPORTED
237
OMICRON CMEngine
4.7
Amplifier Commands
The following section contains the commands that are needed to change the default routing of the
generators to the outputs described above. Furthermore you can use these commands to inform the
CMEngine about an external amplifier's parameters and then use this external amplifier for current or
voltage output. You even can change the parameters of a predefined amplifier or optimize the power
output of an amplifier.
After the startup of CMEngine the following default settings are defined:
Logical generator
triple
v(1)
i(1)
In the left side table of contents find the amplifier command of your choice and click the corresponding
entry.
238
String Commands
4.7.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
Parameter
Answer
The command without arguments returns a string that contains the CMC's device
number and the number of available configurations of type <integer>.
If a configuration number is provided, the command returns a string with the
following structure:
239
OMICRON CMEngine
240
String Commands
<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
configurations 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
table below provides an example of connection diagram for each of the mode
strings.
{type (amp_no / amp_id), no.}
List of all physical amplifiers involved in the configuration. It is composed of one
or more double entries. Each entry is composed of two parts: an amplifier
descriptor and an amplifier number.
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.
String Phases Description
std
ser12
241
OMICRON CMEngine
ser4
gen2
par1
par3
parser 1
242
String Commands
ser2
par6
ser21
par31
par61
std31
243
OMICRON CMEngine
Example:
How to parallel the two current triples of a CMA 156 intelligent current amplifier, to obtain a threephase amplifier that can output 50A per phase.
The code would be as follows:
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 CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
The configuration(s) of the amplifiers, if any, will not be available until an amp:scan?
command is performed.
See also:
amp:scan? on page 255
amp:def on page 251
amp:route on page 258
out:cfg? on page 239
244
String Commands
4.7.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.
Parameter
<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 CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
See also:
amp:cfg?(<amp_id>,addr) on page 245
gps:setup:cfg?(firm) on page 245
Example:
Suppose you have connected a CMA 156 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.
245
OMICRON CMEngine
4.7.3
Function
246
String Commands
4.7.4
Function
Description
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 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.
247
OMICRON CMEngine
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>.
<t_corr1>, <t_corr2>, <t_corr3>:
These parameters are of type <float>.
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 CMEngine error codes:
Error code
Explanation
CMERR_AMP_IN_USE
CMERR_IN_SEQ_MODE
CMERR_MIN_GT_MAX
248
String Commands
4.7.5
Function
Description
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 parameter <id_list> specifies the IDs of the intelligent external amplifiers.
For an explanation of external amplifier IDs see the amp:scan? command.
Auto-definition of an amplifier means setting its parameters to default values.
You can use this command to reset its parameters after you have overridden the
parameters with the long variant of the amp:def command or to define an
amplifier without explicitly specifying all its parameters.
Auto-definition of external amplifiers is not supported for the DOS version of
CMEngine.
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, CMEngine tries to "combine" the
amplifiers. This means that CMEngine assumes an amplifier with cumulated
parameters:
Suppose you have connected a CMA 156 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),
CMEngine 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>:
249
OMICRON CMEngine
Explanation
CMERR_AMP_IN_USE
CMERR_IN_SEQ_MODE
CMERR_INVALID_INT
250
String Commands
4.7.6
Function
Description
<amp_no>:
This optional parameter is of type <integer>.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_INVALID_INT
251
OMICRON CMEngine
4.7.7
amp:def(off)
Function
Description
When this command is issued, all external amplifiers that are currently not
defined will be turned off.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
252
String Commands
4.7.8
amp:def? [(<amp_no>[,harm])]
Function
Description
Parameter
<amp_no>:
This parameter is of type <integer> and is optional.
Answer
253
OMICRON CMEngine
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 CMEngine error codes:
Error code
Explanation
CMERR_INVALID_INT
254
String Commands
4.7.9
amp:scan?
Function
Description
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
See also
command amp:param? on page 256
command amp:def on page 251
Examples:
Suppose you have connected a CMA 156 to the CMC, which consists of two amplifiers, you would get
the following answer to the command amp:scan?: "1,1,2;". This means that two intelligent external
amplifiers are connected to the CMC #1 and the IDs are 1 and 2.
255
OMICRON CMEngine
Description
The ID of the desired external amplifier can be specified as parameter <id>. The
command then returns the amplifier's parameters. If the optional keyword cal is
specified, the command returns the date of the last factory calibration of the
device.
Parameter
<id>:
This parameter is of type <integer>.
Answer
Without the cal keyword, 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).
<-|A|B>
Amplifier output group.
<amplification>
Amplification factor.
<max_out>
Maximum voltage for a voltage amplifier (in V) or maximum current for a current
amplifier (in A)
<f_min>, <f_max>
Minimum and maximum frequency (in Hz).
<t_corr1>, <t_corr2>, <t_corr3>
The 3 corrective propagation delays of the amplifier (in seconds).
<device_type>
Device type string.
<ser_no>
Serial number (OMICRON amplifiers only).
256
String Commands
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 CMEngine error codes:
Error code
Explanation
See also:
command amp:scan? on page 255
command amp:def on page 246
Example:
Suppose you have connected a CMA 156 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 CMA 156 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.44s.
257
OMICRON CMEngine
4.7.11 amp:route(clr|clrnooff)
Function
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 amplifiers definition is cleared. Please note that the output signals are
removed with both keywords, it is only the amplifiers power supply that is turned
off (clr) or not (clrnooff).
Parameters
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
258
String Commands
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
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.
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).
259
OMICRON CMEngine
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 on page 487 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).
Amplifier number
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_AMP_IN_USE
CMERR_IN_SEQ_MODE
CMERR_INVALID_INT
CMERR_KINDS_DONT_MATCH The parameters <triple_no> and <amp_no> are not of the same
generator type (voltage gen./ current gen.)
260
String Commands
See also:
command amp:def on page 246
command amp:cfg? [(<cfg_no>)] on page 239
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.
261
OMICRON CMEngine
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 CMEngine 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 CMEngine error codes:
Error code
Explanation
See also:
command amp:route on page 258
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.
262
String Commands
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 you know the maximum value that will be output during usage, the use of this
command allows the amplifier to optimally operate for the set range.
Parameters
<v|i>:
Here you must specify one of the keywords v or i.
<triple_no>:
This parameter is of type <integer>.
<range>:
This parameter is of type <float>.
Changing the range of a triple will affect all triples that are routed to an amplifier using the
same power supply.
For example: i(1) is routed to current amplifier A, i(2) to current amplifier B. The changes you
set for range for i(1) will also apply to i(2). For details check the according user manual of
your CMC test set.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
263
OMICRON CMEngine
See also:
command amp:range? on page 263
Compatibility: Win32
264
String Commands
4.7.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 you must specify one of the keywords v or i.
<triple_no>:
This parameter is of type <integer>.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
See also:
command amp:range on page 263
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.
Compatibility: Win32
265
OMICRON CMEngine
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 CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_INVALID_FLOAT
CMERR_INVALID_INT
CMERR_NOT_SUPPORTED
266
String Commands
Description
The type of amplifier v or i and the number of the generator triple <triple_no>
must be specified. Then the command returns the current value of the parameter
<v_ctrl> for a voltage or current amplifier (specified before with the command
amp:ctrl) as well as the valid range of the <v_ctrl> setting.
Parameters
<v|i>:
Here you must specify one of the keywords v or i..
<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 CMEngine error codes:
Error code
Explanation
See also:
command amp:ctrl on page 266
Example:
The command amp:ctrl? (i(1)) returns the string:
"1,5.600E+000,3.000E+000,6.000E+000;".
Thus the current generators of generator triple i(1) in CMC #1 supply a peak no-load output 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.
267
OMICRON CMEngine
4.7.18 amp:reset(<amp_id>)
Function
Description
Parameters
<amp_id>:
This parameter is of type <integer>.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
See also:
command gps:reset on page 321
Example:
Suppose you have connected a CMA 156 to the CMC then the command amp:reset(1) will perform a
reset on the amplifier with the ID 1.
268
String Commands
4.8
Input Commands
The following commands are related to the analog and binary inputs of a device: measurements,
querying of configuration data, etc. Analog inputs are available in the CMC devices, while the binary
inputs may be physically located in a CMC or in an IO expansion module (CMB).
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.
In the left side table of contents find the input command of your choice and click the corresponding
entry.
269
OMICRON CMEngine
4.8.1
inp:[ana:]v|i(<input_list>):get?[(all)]
Function
Measures the voltage/current in one or more DC analog inputs and return the
results.
Description
Parameters
<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 CMEngine error codes:
Error code
Explanation
CMERR_DCTASK_OFF
If the DC task is turned off in a CMC 256 or newer test set, the command will fail. In a
CMC 156, 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? on page 317
inp:ana:dc(on|off) on page 298
270
String Commands
Examples:
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.
271
OMICRON CMEngine
4.8.2
inp:[ana:]v|i(<input_list>):range?
Function
Returns the selected and possible ranges of one or more DC analog inputs.
Description
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>) on page 273
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 CMC 256.
272
String Commands
4.8.3
inp:[ana:]v|i(<input_list>):range(<range>)
Function
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 floatingpoint 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.
See also:
inp:[ana:]v|i(<input_list>):range? on page 272
Example:
inp:ana:i(1):range(0.001)
Sets the range of the DC current input to 1mA.
273
OMICRON CMEngine
4.8.4
inp:bin:cfg?
Function
Description
Use this command to get the number of input modules available in a device.
Answer
See also:
inp:bin(<inp_module_idx>):cfg? on page 275
inp:bin(<inp_module_idx>:<group_idx>):cfg? on page 277
Example:
Command: inp:bin:cfg?
Answer:"1,1;"
Device 1 has 1 binary input module.
274
String Commands
4.8.5
inp:bin(<inp_module_idx>):cfg?
Function
Description
Use this command to get a complete description of each input module in the
addressed device.
Parameter
<inp_module_idx>
The integer id of the input module for which 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.
Answer
<dev_id>,<#groups>,<loc>,<loc_idx>,<mod_type>,<mod_ser_no>,<hard_ver>,<
dev_type>,<dev_ser_no>;
The return string contains the CMCs 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
Module Serial Number
The serial number of the input module. Please note that the input modules have
serial numbers independent from those of the device that hosts them.
Hardware Version
The version number of the hardware.
Device Type
275
OMICRON CMEngine
Type of device in which the inputs are included. For instance, CMC 256-6, CMB
IO-7, etc.
Device Serial Number
The serial number of the host device.
See also:
inp:bin:cfg? on page 274
inp:bin(<inp_module_idx>:<group_idx>):cfg? on page 277
Example:
Command: inp:bin(1):cfg?
Answer: "1,10,front,1,CMC256-6,BJ611F,0,CMC256-6,BJ611F;"
Module 1 has 10 input groups and is located in the front of the device. The location index is 1. Module
type and serial number are the same as those of the host CMC 256.
276
String Commands
4.8.6
inp:bin(<inp_module_idx>:<group_idx>):cfg?
Function
Description
Use this command to get a complete description of each input group within a
given module.
Parameters
<inp_module_idx>
The integer id of the input module for which 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 for which 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>,<#inp>,<nom_min>,<nom_max>,<thres_min>,<thres_max>,<thres_gra
n>, <gnd_conn>,<common>,<res_group_type>,<res_group_idx>,<func>[,];
The return string contains the CMCs device number, plus the following data for
the selected input group:
Number of Inputs
Number of binary inputs in this group (integer).
Minimum Nominal Value
Floating point value representing the minimum value the input can accept (in
VDC).
Maximum Nominal Value
Floating point value representing the maximum value the input can accept (in
VDC).
Minimum Threshold Value
Floating point value representing the minimum sensing threshold that can be
programmed for the inputs in this group (in VDC).
Maximum Threshold Value
Floating point value representing the maximum sensing threshold that can be
programmed for the inputs in this group (in VDC).
Threshold granularity
String indicating the minimum unit for which the threshold is independently
settable. The following values can be returned:
277
OMICRON CMEngine
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 CMC 256, 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 groups 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? on page 274
inp:bin(<inp_module_idx>):cfg? on page 275
Examples:
Command: inp:bin:cfg?
Answer: "1,1;"
The device (a CMC 156 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 modules type and serial number are the same as the CMCs.
278
String Commands
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;"
Group 2 has 6 inputs, with same characteristics as those in group 1.
It will be remembered that, in a previous example, the CMC 256 turned out to have 10 groups, each
comprising just one input. Therefore, in the CMC 256 each input must be individually configured, while
in the CMC 156 it is possible (but not compulsory) to assign values to several inputs at the same time
279
OMICRON CMEngine
4.8.7
inp:bin(<inp_module_idx>):get?
Function
Description
Use this command to get the states of all binary inputs in a module.
Parameter
<inp_module_idx>
The integer id of the input module for which the input state must be read. 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)
indicates the state of binary input 1; bit 1 indicates the state of binary input 2 etc.
If the module had fewer than 32 inputs, the bits corresponding to the non-existing
inputs would be 0 (see the following table).
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 CMEngine error codes:
Error code
Explanation
280
String Commands
4.8.8
inp:bin(<inp_module_idx>):diff?
Function
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.
Parameter
<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 inputs state has changed since the
last inp:bin[(<inp_module_idx>)]:diff(reset) command, cleared otherwise.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
281
OMICRON CMEngine
4.8.9
inp:bin[(<inp_module_idx>)]:diff(reset)
Function
Description
Use this command to reset the state-change memory for a given module, or for
all modules in a device.
Parameter
<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 CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
See also:
inp:bin(<inp_module_idx>):diff? on page 281
282
String Commands
4.8.10 inp:bin(<inp_module_idx>:<group_idx>):debounce(<deb_time>)
Function
Sets 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 as shown in the following table.
100 s
3.2 - 6.4 ms
200 s
6.4 - 12.8 ms
400 s
12.8 - 25.6 ms
800 s
This command is not supported in CMC 156 and CMC 56 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? on page 284
283
OMICRON CMEngine
4.8.11 inp:bin(<inp_module_idx>:<group_idx>):debounce?
Function
Description
Use this command to get the debounce parameters for the selected input group.
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 query
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>).
Answer
<dev_id>,<deb_time>,<deb_res>;
The return string contains the CMCs 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.
In CMC 156 and CMC 56 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>) on page 283
284
String Commands
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.
This command is not supported in CMC 156 and CMC 56 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? on page 286
285
OMICRON CMEngine
4.8.13 inp:bin(<inp_module_idx>:<group_idx>):deglitch?
Function
Description
Use this command to get the deglitch parameters for the selected input group.
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 query
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>).
Answer
<dev_id>,<degl_time>,<degl_res>;
The return string contains the CMCs 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.
In CMC 156 and CMC 56 devices, the command will return 0, since the feature is not
available.
See also:
inp:bin(<inp_module_idx>:<group_idx>):deglitch(<degl_time>) on page 285
286
String Commands
4.8.14 inp:bin(<inp_module_idx>:<group_idx>[:<inp_idx>]):def(pf|<threshold>)
Function
Description
This command sets the configuration parameters for all the inputs in the group,
or for an individual input. The user can either configure the inputs as potential
free, using the keyword pf, or as potential sensing by specifying a threshold
value. This command should always be issued prior to using any input as a
binary input.
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".
In a CMC 256 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.
See also: inp:bin(<inp_module_idx>:<group_idx>[:<inp_idx>]):def? on page 289
287
OMICRON CMEngine
Examples:
inp:bin(1:1:1):def(10.0)
Configures input 1 in group 1 in module 1 as a potential sensing binary input with 10V threshold
inp:bin(1:2):def(pf)
Configures all inputs in group 2, module 1 as potential-free inputs
288
String Commands
4.8.15 inp:bin(<inp_module_idx>:<group_idx>[:<inp_idx>]):def?
Function
Description
This command queries the configuration parameters for all the inputs in the
group, or for an individual input.
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
query. 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 query.
Answer
<dev_id>,<setting>;
The return string contains the CMCs device number, plus the setting value for
the input or the group. This setting can be the string "pf" if the setting is potentialfree 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>) on page 287
289
OMICRON CMEngine
4.8.16 inp:bin(<inp_module_idx>:<group_idx>):name(<name>)
Function
Description
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 for which 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>).
<name>
String enclosed in single or double quotes.
See also:
inp:bin(<inp_module_idx>:<group_idx>):name? on page 291
290
String Commands
4.8.17 inp:bin(<inp_module_idx>:<group_idx>):name?
Function
Description
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 CMCs 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) on page 290
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";
291
OMICRON CMEngine
4.8.18 inp:ana(<input_list>):def(v,<range>) /
inp:ana(<input_list>):def(i,<range>,<CTRatio>)
Function
Description
This command implicitly sets all inputs in the input list as analog inputs and at the
same time sets their configuration parameters. It is only available for CMC 256 or
newer test set. This command should always be issued prior to using any input
as an analog input.
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 CMC 256 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 CMEngine error codes:
Error code
Explanation
292
String Commands
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.
293
OMICRON CMEngine
4.8.19 inp:ana(<input_list>):def?
Function
Description
Parameter
<input_list>:
Comma separated list of the analog inputs whose configuration is to be
displayed.
Answer
The return string contains the CMCs 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 inputs 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.
Example:
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
294
String Commands
4.8.20 inp:ana(<input_list>):range?
Function
Description
Each analog input can be set to a number of different measuring ranges. A lower
range means more resolution, whilst a higher range means being able to
measure bigger amplitudes. The ranges are applicable whether the input is being
set as voltage or current input.
Parameter
<input_list>:
Comma separated list of the binary/analog inputs whose ranges are to be
displayed.
Answer
The return string contains the CMCs 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>) on page 292
inp:ana(<input_list>):def(i,<range>,<CTRatio>) on page 292
Example:
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.
295
OMICRON CMEngine
4.8.21 inp:ana:cal(ac|dc)
Function
Description
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.
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.
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.
296
String Commands
4.8.22 inp:ana:cfg?(srate|avrg|firm|hard)
Function
Description
This command will only work on a CMC 256 or newer test set.
Parameters
See below
Answer
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
297
OMICRON CMEngine
4.8.23 inp:ana:dc(on|off)
Function
Description
This command is used to switch off and on the task which measures the DC
analog inputs. By default this task is always on. You only need to use this
command if, you're not using the DC analog inputs, and you want to free extra
resources (i.e. one task on the task vector will be freed). The DC task cannot be
turned off in the CMC 156 or CMC 56.
If you switch off the DC task and you try to read the DC analog inputs
you will get an error.
Parameters
Examples:
inp:ana:dc(off)
inp:ana:dc(on)
298
on|off
The keyword on switches the dc measurement on, while off switches it off.
String Commands
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>) as shown in the following table.
The maximum number for the analog voltage and current input can be queried by
a inp:cfg? command. The signature for binary inputs is a number which is stored
in the buffer together with the measured value and is used to identify a
measurement result later. The valid range of signatures is 1 to 9. For the
interpretation of the different signature values see the inp:buf:get? command.
The inp:buf:sam (bin, on|bin|off) command is used to turn automatic logging of
changes ON or OFF on the binary inputs. If the automatic logging is set to ON or
BIN, every time one of the binary inputs changes its state, a snapshot of all
binary inputs is taken and stored into the measurement buffer. So every change
of a binary input causes a inp:buf:sam (bin, 1) to be executed internally.
Additionally the execution of inp:buf:sam (bin, on) causes an initial entry in the
measurement buffer with signature 1 (see inp:buf:get?).
When automatic logging is set to ON the changes of the analog outputs also
produce an entry in the measurement buffer (equivalent to a inp:buf:sam (bin, 0)
command).
Parameters
<source>:
You must specify one of the keywords dcv, dci or bin as <source>.
<index>:
This parameter is of type <integer>. Its valid range depends on the source.
299
OMICRON CMEngine
Interpretation of <index>
dcv
Analog voltage input (origin "DC voltage") Number of analog voltage input
dci
bin
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
300
String Commands
4.8.25 inp:buf:sam(ext)
Function
Description
This command changes the format in which the input buffer entries are stored. It
must be used only once, and always before any other inp:buf: command to
avoid the possibility of wrong entries in the buffer. The standard and extended
formats for the input buffer entries are described in the inp:buf:get? command.
See also:
inp:buf:get? on page 302
301
OMICRON CMEngine
4.8.26 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 returned measurement result contains at least the information about the type and the time. The
following information is type-dependent:
Type information:
The type information is one of the keywords bin, dcv, dci, bcount, ecount, zcross, empty, overrun,
switchoff, irigb-enc, irigb-dec or trigin:
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 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?.
The keywords irigb-enc and irigb-dec denote entries from the IRIG-B encoder or decoder.
The keyword trigin denotes entries from an external PPS source (e.g. CMGPS).
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:
302
String Commands
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. CMEngine 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.
Overview:
The following table is an overview of all type information and their measurement data returned in the
answer string:
Type
Parameter Measurement format
information count
dcv
dci
bin
zcross
bcount or
ecount
bcount|ecount,<timeInfo>,<counterValue>,<counterNumber>,
<info>
<counterValue> ... counter value as integer
<counter Number> ... the counter number
<info> ... zcross if a zero crossing of the counter happened. Otherwise
it is -.
empty
empty,<timeInfo>,0,0,-
303
OMICRON CMEngine
Type
Parameter Measurement format
information count
overrun
overrun,<timeInfo>,0,0,-
switchoff
switchoff,<timeInfo>,0,0,-
irigb-enc
11
irigb-enc,<timeInfo>,<pps2ldac>,
0,<year>,<month>,<day>,<hour>,<minute>,<second>,<SBS>
<pps2ldac> ... PPS to LDAC edge (clocks of oscillator frequency)
<year>,<month>,<day>,<hour>,<minute>,<second> ... Date time
information of the IRIG-B encoder
<SBS> ... Straight binary seconds
irigb-dec
12
irigb-dec,<timeInfo>,<pps2ldac>,
0,<year>,<month>,<day>,<hour>,<minute>,<second>,<SBS>,<CF>
<pps2ldac> ... PPS to LDAC edge (clocks of oscillator frequency)
<year>,<month>,<day>,<hour>,<minute>,<second> ... Date time
information of the IRIG-B decoder
<SBS> ... Straight binary seconds
<CF> ... Code format
trigin
trigin,<timeInfo>,<pps2ldac>,0
<pps2ldac> ... PPS to LDAC edge (clocks of oscillator frequency)
Signature Explanation
0
User-defined signature
User-defined signature
User-defined signature
User-defined signature
User-defined signature
User-defined signature
User-defined signature
304
String Commands
Signature Explanation
9
User-defined signature
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
305
OMICRON CMEngine
4.8.27 inp:buf:get?(<no_of_entries>)
Function
Description
Get a certain number of entries in the input buffer. If there are fewer entries in the
buffer, then all entries are returned.
Parameter
<no_of_entries>
Integer number representing the number of entries that are requested from the
buffer. Only values between 0 and 50 are supported.
Answer
<dev_id>,<entries_read>{,<type_info>,<time_info>,<meas_data>,<index>,<optio
nal>};
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.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
306
String Commands
4.8.28 inp:buf:clr
Function
Description
This command executes inp:buf:sam (bin, off) and then clears all measurement
data currently stored in the measurement buffer.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
307
OMICRON CMEngine
4.8.29 inp:count:on
Function
Description
This command starts the counting of all counters that are set up with
inp:count:set.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
308
Counting is already on
String Commands
4.8.30 inp:count:off
Function
Description
This command stops the counting of all counters that were started with
inp:count:on.
See also:
inp:count:on on page 308
inp:count:set on page 311
inp:count:clr on page 310
309
OMICRON CMEngine
4.8.31 inp:count:clr
Function
Description
This command stops counting by a call to inp:count:off and then clears all
counter settings made by inp:count:set and inp:count:join.
See also:
inp:count:off on page 309
inp:count:set on page 311
inp:count:join on page 313
310
String Commands
Description
With the parameter <counter>, select the binary input (e.g. bcount(3) for binary
input #3) or the extended counter input (e.g. ecount(1) for the first extended
counter input) to be setup. The counting is not started. To start counting use
inp:count:on.
The counters are 24 bits wide (max count is 16777215).
The value of the counter is set to <count>. It is incremented with every edge of
the input signal (rising edge if <edge> is +, falling edge if <edge> is -). Every time
when the counter overflows to zero an entry in the measurement buffer is made
(see inp:buf:get?). When the counter is zero it is not reloaded with <count> but
starts with 1.
Due to the architecture of the extended input counters it can 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 this count was reached not the
time of the zero crossing.
Parameters
<counter>:
This parameter is of type <integer>.
<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 CMEngine error codes:
Error code
Explanation
See also:
inp:count:join on page 313
inp:count:on on page 308
inp:count:clr on page 310
inp:buf:get? on page 302
311
OMICRON CMEngine
Example:
Starting with inp:count:set(bcount(1),16777212,+) the counting sequence looks as follows:
16777212 => 16777213 => 16777214 => 16777215 => 0 => 1 => 2.
312
String Commands
Description
Parameters
<master_counter>:
This parameter is of type <integer>.
<slave_counter>:
This parameter is of type <integer>.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_NOT_ACTIVE
CMERR_COUNTER_ON
Counting is already on
313
OMICRON CMEngine
4.8.34 inp:count:get?(bcount|ecount(<counter>))
Function
Description
Parameter
<counter>:
This parameter is of type <integer>.
Answer
Returns a string that contains the device number and the count (type <integer>).
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
314
String Commands
4.8.35 inp:ana:cfg(<srate>,<avrg>)
Function
Sets 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 powerquality analysis and fault-recording. On the other hand, it increases the load in
the DSP and may cause a "Real Time Violation" error (see inp:ana:get?
(<command handle>) for a description of the validity flags associated to
measurements). For recorded signals, more memory is required to store them as
the sampling rate increases.
The command is only available for CMC 256 or newer test set.
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 CMC 256 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).
The averaging uses the following formula:
result = newValue * <avrg>+ oldValue * (1 - <avrg>)
Where:
newValue is the value of the new result before averaging has been applied
oldValue is the value of the previous, averaged result
315
OMICRON CMEngine
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.
316
String Commands
4.8.36 inp:cfg?[(ecount)]
Function
Gets information about the hardware configuration of the analog and binary
inputs.
Description
Parameter
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 CMEngine error codes:
Error code
Explanation
317
OMICRON CMEngine
4.9
GPS Commands
These commands are used to control the CMGPS synchronization unit. Please note that you must
issue a amp:scan? command so the CMGPS device is detected. Otherwise, all commands will return
the CMERR_GPS_NOT_FOUND error, even if the CMGPS is properly connected.
In the left side table of contents find the GPS command of your choice and click the corresponding
entry.
318
String Commands
4.9.1
gps:status?
Function
Description
This informs the application what information the CMGPS has obtained from the
satellites and if any special conditions have occurred.
Answer
Initializing
Time available
Height available
UTC changed
Almanac Saving
Almanac Error
Antenna Open
Antenna Short
10
not used
11
not used
12
not used
319
OMICRON CMEngine
Bit
13
not used
14
not used
15
not used
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_GPS_BUSY
The command was issued when the CMGPS was still initializing, or
processing the previous command.
Examples:
"1,30,5;": This means that the receiver is locked (Time, Latitude, Longitude, Height and Pulse
available) and 5 satellites tracking. (The first parameter means the CMGPS is connected to CMC 1)
1,256,0: Means the antenna is not connected and no satellites tracking.
320
String Commands
4.9.2
gps:reset
Function
Description
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
See also:
command amp:reset(<amp_id>) on page 268
Example:
Suppose you have connected a CMGPS to the CMC then the command gps:reset will perform a
reset on the GPS device.
321
OMICRON CMEngine
4.9.3
gps:sigma?
Function
Description
This is a value that indicates how accurate the time pulses are. Normally the
application will not need this information.
Answer
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_GPS_BUSY
The command was issued when the CMGPS was still initializing, or
processing the previous command.
322
String Commands
4.9.4
gps:pos?
Function
Answer
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_GPS_BUSY
The command was issued when the CMGPS was still initializing, or
processing the previous command.
323
OMICRON CMEngine
4.9.5
Function
Description
If the CMGPS has not already found its position, the searching process can be
sped up by loading the position manually (assuming it was previously stored.). If
the CMGPS has found its position, then this command has no affect.
Parameters
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_OUT_OF_RANGE
CMERR_GPS_BUSY
The command was issued when the CMGPS was still initializing, or
processing the previous command.
324
String Commands
Example:
gps:pos(63.2359,-100.3321,423.44)
Sets a position of 63.2359 latitude, -100.3321 longitude, 423.44 meters.
325
OMICRON CMEngine
4.9.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
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_GPS_BUSY
The command was issued when the CMGPS was still initializing, or
processing the previous command.
326
String Commands
4.9.7
gps:time:timemode?
Function
Description
This function returns the time mode which the CMGPS is operating under.
Answer
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
327
OMICRON CMEngine
4.9.8
gps:time:utc?
Function
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
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_GPS_BUSY
The command was issued when the CMGPS was still initializing, or
processing the previous command.
328
String Commands
4.9.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
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_INVALID_DATE
CMERR_GPS_BUSY
The command was issued when the CMGPS was still initializing, or
processing the previous command.
CMERR_OUT_OF_RANGE
Examples:
gps:time:sync(0,60,1998,7,12,12,0,0)
Sets channel 0, for a repeat rate of 1 minute, starting at 12/July/1998 12:00:00.
329
OMICRON CMEngine
gps:time:sync(1,0,1998,7,12,12,0,0)
Sets channel 1, to trigger a single pulse at 12/July/1998 12:00:00.
330
String Commands
4.9.10 gps:time:sync?(<ch>)
Function
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.
Parameter
<ch>:
Channel (0 or 1)
Starting time and date of the synchronization pulses.
Answer
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_INVALID_DATE
CMERR_OUT_OF_RANGE
CMERR_GPS_BUSY
The command was issued when the CMGPS was still initializing, or
processing the previous command.
Example:
gps:sync?(0)
Gets the synchronization rate and time for channel 0.
331
OMICRON CMEngine
Description
Has no effect if the CMGPS is already receiving the time from the satellites.
The time has to be set in 24 hour representation.
Parameters
All six parameters are of type <integer> and denote year, month, day, hour,
minutes, seconds.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_INVALID_DATE
CMERR_GPS_BUSY
The command was issued when the CMGPS was still initializing, or
processing the previous command.
Example:
gps:time:datetime(1998,10,23,18,20,0)
332
String Commands
4.9.12 gps:time:datetime?
Function
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 CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
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.
333
OMICRON CMEngine
4.9.13 gps:setup:mode?
Function
Answer
Integer between 0-3 (see the gps:setup:mode command for the description of the
different modes).
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_GPS_BUSY
The command was issued when the CMGPS was still initializing, or
processing the previous command.
334
String Commands
4.9.14 gps:setup:mode(<accuracy_mode>)
Function
Description
After the mode has been changed the CMGPS will do a warm start (i.e.
it will go into the initializing state for a few seconds).
Parameter
<accuracy mode>:
0
In this mode it waits for an extremely accurate position before it reaches the
"locked" state. For this reason mode 0 takes a long time to lock but it guarantees
+/- 1 micro second accuracy.
1
In this mode it needs to find the three-dimensional position to reach the "locked"
state. This mode still takes a relatively short time to lock, and the pulses are
more accurate than mode 2.
2
In this mode it only needs to determine the longitude and latitude of the position
to reach the "locked" state. It doesnt try to determine the altitude. Because of
this, low accuracy mode takes the shortest time to lock and is less accurate than
the other modes, however the accuracy is still quite acceptable (within a few
micro seconds).
3
No time RAIM activated (i.e. never goes into position hold mode). This mode
should only be used when CMGPS is operating as a regular GPS and not a
timing device.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_OUT_OF_RANGE
335
OMICRON CMEngine
Error code
Explanation
CMERR_COMM
CMERR_GPS_BUSY
The command was issued when the CMGPS was still initializing, or
processing the previous command.
Example:
gps:setup:mode(0) - sets accuracy mode 0.
336
String Commands
4.9.15 gps:setup:gmt?
Function
Description
This offset is added to the satellite time when the user issues the
gps:time:datetime? command.
Answer
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_GPS_BUSY
The command was issued when the CMGPS was still initializing, or
processing the previous command.
337
OMICRON CMEngine
Description
This offset is added to the satellite time when the user issues the
gps:time:datetime? command.
Parameters
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_OUT_OF_RANGE
CMERR_GPS_BUSY
The command was issued when the CMGPS was still initializing, or
processing the previous command.
Examples:
gps:setup:gmt(-5,0)
Sets offset to Eastern time (US & Canada).
gps:setup:gmt(0,0)
Sets offset to Greenwich Mean Time.
338
String Commands
4.9.17 gps:setup:cfg?(type|ser|firm)
Function
Parameters
One of the keywords type, ser, hard, cal or firm must be specified.
Answer
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
339
OMICRON CMEngine
4.9.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 CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
See also:
command amp:cfg?(<amp_id>,addr) on page 245
Example:
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.
340
String Commands
Description
Parameters
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_OUT_OF_RANGE
CMERR_GPS_BUSY
The command was issued when the CMGPS was still initializing, or
processing the previous command.
341
OMICRON CMEngine
Examples:
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.
342
String Commands
4.9.20 gps:setup:pulse?
Function
Description
Answer
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_GPS_BUSY
The command was issued when the CMGPS was still initializing, or
processing the previous command.
343
OMICRON CMEngine
4.9.21 gps:setup:cable?
Function
Answer
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
344
String Commands
4.9.22 gps:setup:cable(<delay>)
Function
Parameter
<delay>:
Specifies the time in nanoseconds. Integer between 0 and 999999.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_OUT_OF_RANGE
345
OMICRON CMEngine
4.9.23 gps:setup:save
Function
Description
Accuracy mode
Cable delay
Startup synchronization time & date and rates for channels 0 & 1
Explanation
CMERR_IN_SEQ_MODE
CMERR_GPS_BUSY
346
String Commands
Meaning
loop
Loop counter
This counter is decremented by 1 with every
seq:wait. Its default content is 0.
You can set this counter to a value in the 0 65535 range using the seq:set command.
count(1)
count(2)
timer
timeout
347
OMICRON CMEngine
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).
In the left side table of contents find the Sequencer command of your choice and click the
corresponding entry.
348
String Commands
4.10.1 seq:begin
Function: see command seq:end on page 350.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
349
OMICRON CMEngine
4.10.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 CMEngine 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?
inp:ana:v():get? and inp:ana:i():get?
inp:ana:v():param? and inp:ana:i():param?
inp:bin:get?
inp:bin:thres
inp:bin:thres?
inp:buf:get?
inp:cfg?
seq:begin
seq:clr
seq:exec
350
String Commands
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), )
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 CMEngine error codes:
Error code
Explanation
351
OMICRON CMEngine
4.10.3 seq:clr
Function
Clears 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 CMEngine error codes:
Error code
Explanation
352
String Commands
4.10.4 seq:exec
Function
Starts the sequence stored in the CMC's sequence buffer. This command implies
out:resetopt.
Description
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
353
OMICRON CMEngine
With this command you can set one of the user modifiable counters to a value.
Description
Parameter
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_INVALID_INT
CMERR_INVALID_FLOAT
354
String Commands
With this command you can add a number to the content of one of the user
modifiable counters.
Parameter
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_INVALID_INT
355
OMICRON CMEngine
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.
Parameter
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 CMEngine error codes:
Error code
Explanation
356
String Commands
4.10.8 seq:stop
Function:
Stops a currently running sequence. Implies the command out:resetopt.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
357
OMICRON CMEngine
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:
358
String Commands
<timeout_jump_distance> or
<trigger_jump_distance>
Jump target
-1
The following picture illustrates the effects of the jump distances described above:
359
OMICRON CMEngine
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 ms. The timeout value has the following limits:
0 = timeout = approx. 838 s.
Parameter <trigger_condition>:
In a trigger condition you can use the following expressions:
to test a counter:
loop=0
loop<>0
count(1)=0
count(1)<>0
count(2)=0
count(2)<>0
360
String Commands
as boolean operators:
not(<bin(X)>): negation of a binary input
and logical AND of 2 expressions or logical OR of 2 expressions
Use the following rules to assemble the above expressions:
Error(s):
361
OMICRON CMEngine
Absolute Time
When using time synchronization via IRIG-B or PTP, you can set an absolute time trigger condition
using
time(<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>)
time(<yyyy>,<doy>,<hh>,<mm>,<ss>)
<doy> stands for "day of year" (value from 1 to 366 allowed).
If the selected IRIG-B configuration does not contain the year information, the <yyyy> information
is ignored for the trigger.
If the trigger date and time is in the past, the trigger will never happen.
Parameters
Parameter
Description
<trigger_condition>
<trigger_jump_distance>
<timeout_condition>
<timeout_jump_distance>
362
String Commands
Explanation
CMERR_INVALID_BOOL
CMERR_INVALID_FLOAT
CMERR_INVALID_INT
363
OMICRON CMEngine
Description
With this command you can set the absolute time trigger condition of a
seq:wait(exttime(<id>),...) command. This has to be done outside of the
sequence.
This only works when using time synchronization using IRIG-B or PTP.
Specifying a date in the past returns an "Invalid Date" error.
Parameters
<id>: The index of the exttime condition to use. Currently only 1 is supported.
<year>,<month>,<day>,<hour>,<minute>,<second>: absolute time trigger
condition.
Error code
Explanation
CMERR_INVALID_DATE
Example:
seq:set(exttime(1),2013,6,25,12,12,15)
364
String Commands
Description
With this command you can set the absolute time trigger condition of a
seq:wait(exttime(<id>),...) command. This has to be done outside of the
sequence.
This only works when using time synchronization using IRIG-B or PTP.
Specifying a date in the past returns an "Invalid Date" error.
Parameters
<id>: The index of the exttime condition to use. Currently only 1 is supported.
<year>,<doy>,<hour>,<minute>,<second>: absolute time trigger condition
(<doy> stands for "day of year").
Error code
Explanation
CMERR_INVALID_DATE
Example:
seq:set(exttime(1),2013,123,12,12,15)
365
OMICRON CMEngine
366
String Commands
The following example outputs a sine signal of 100V and 100Hz on voltage output 1 with a duration
of 5 s:
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
367
OMICRON CMEngine
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
368
String Commands
The following example outputs a sine signal of 100V and 100Hz on voltage output 1 with a duration
of 3 s. 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
369
OMICRON CMEngine
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
370
String Commands
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.
Each command creates measurement tasks as follows:
371
OMICRON CMEngine
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
Inp = number of inputs specified in command
N = measurement tasks used by command
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)
The total tasks used are:
RMS: RoundUp(4/3) = 2
Phase: RoundUp(1 + (4 2) / 2) = 2
Power: 2
Freq: 2
Total = 2 + 2 +2 +2 + 1 = 9 (assuming DC task is on)
This is fewer than 15 tasks, so there is no problem.
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.
372
String Commands
In the left side table of contents find the multimeter command of your choice and click the
corresponding entry.
373
OMICRON CMEngine
4.11.1 inp:ana(<input_list>):rms?(<itime>)
Function
Description
Sets up a task to measure both the AC RMS values and the DC values of the
specified inputs. The results are later retrieved using the inp:ana:get?
command.
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 CMEngine error codes:
Error code
Explanation
CMERR_BIN_INPUT
374
String Commands
See also:
inp:mode(multimeter|scope) on page 396
inp:avail?(multimeter|scope) on page 395
inp:ana:get? on page 390
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.49874
1e-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.
375
OMICRON CMEngine
4.11.2 inp:ana(<input_list>):peak?(<rtime>)
Function
Description
Sets up a task to measure maximum and minimum peaks during a given time.
The results are later retrieved using the inp:ana:get? command.
Parameters
<input_list>
Comma separated list of the binary/analog inputs that are being measured.
<itime>
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 CMEngine error codes:
Error code
Explanation
CMERR_BIN_INPUT
376
String Commands
See also
inp:mode(multimeter|scope) on page 396
inp:avail?(multimeter|scope) on page 395
inp:ana:get? on page 390
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.
377
OMICRON CMEngine
4.11.3 inp:ana(<input_list>):phase?(<itime>)
Function
Description
Sets up a task to measure the relative phase of the specified inputs. The results
are later retrieved using the inp:ana:get? command. The first value in the input
list is the reference signal. The relative phases of all signals in the input list are
measured against the reference.
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 CMEngine error codes:
Error code
Explanation
CMERR_BIN_INPUT
378
String Commands
See also:
inp:mode(multimeter|scope) on page 396
inp:avail?(multimeter|scope) on page 395
inp:ana:get? on page 390
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.
379
OMICRON CMEngine
Description
Sets up a task to measure the relative phase of the specified inputs. The results
are later retrieved using the inp:ana:get? command.
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:
380
String Commands
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 CMEngine error codes:
Error code
Explanation
CMERR_BIN_INPUT
See also:
inp:mode(multimeter|scope) on page 396
inp:avail?(multimeter|scope) on page 395
inp:ana:get? on page 390
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.
381
OMICRON CMEngine
4.11.5 inp:ana(<input_list>):power?(<itime>)
Function
Description
This function measures the active, apparent and reactive power and the cos ?
(the power factor) for each "voltage / current" pair in <input_list>. The list must
contain an even number of inputs, which must be sorted in v/i pairs. So the first
input in the list must be a voltage input, the second one a current input, and so
on.
The results are later retrieved using the inp:ana:get? command.
Effective power is measured in Watts (W).
Apparent power is measured in Volt-Ampere (VA).
Reactive power is measured in Volt-Ampere reactive (var).
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.
382
String Commands
<var_validity>
Integer containing the validity flags of the <Reactive_power> measurement.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_BIN_INPUT
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) on page 396
inp:avail?(multimeter|scope) on page 395
inp:ana:get? on page 390
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
383
OMICRON CMEngine
4.11.6 inp:ana(<input_list>):sum?(<itime>)
Function
Description
Parameters
<input_list>
For each sum 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 v/i pair 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 CMEngine error codes:
Error code
Explanation
CMERR_BIN_INPUT
384
String Commands
Error code
Explanation
CMERR_NOT_MM_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) on page 396
inp:avail?(multimeter|scope) on page 395
inp:ana:get? on page 390
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
385
OMICRON CMEngine
4.11.7 inp:ana(<input_list>):diff?(<itime>)
Function
Description
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 v/i pair 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>
386
String Commands
Explanation
CMERR_BIN_INPUT
CMERR_INVALID_NO_INPUTS
The input list does not contain a valid (multiple of three) number
of inputs.
See also:
inp:mode(multimeter|scope) on page 396
inp:avail?(multimeter|scope) on page 395
inp:ana:get? on page 390
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;"
387
OMICRON CMEngine
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
388
String Commands
4.11.8 inp:ana:sync
Function
Description
This function synchronizes all multimeter commands having the same integration
time. In other words, it ensures that these command start at exactly the same
time. You should always use this command when you are measuring things that
are related to each other (for instance, RMS and phase). Only commands that
have the same integration time will be synchronized.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
389
OMICRON CMEngine
Parameter
<command handle>
This is the command handle used to retrieve the results of a previously issued
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:
bit4
bit3
bit2
bit1
bit0
overload
weak signal
not ready
already read
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.
Return values
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.
390
String Commands
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 CMEngine error codes:
Error code
Explanation
391
OMICRON CMEngine
Description
Removes running multimeter command and clears all the related measurement
tasks from the task vector.
Parameters
<command handle>
This is the command handle of the command to be deleted.
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 CMEngine error codes:
Error code
Explanation
392
String Commands
The scope mode commands allow sampling and recording of analog and digital signals and their
storage in the controlling PC.
In scope mode, recording is started by a trigger condition. The measuring DSP can be stopped (no
acquisition is taking place) or waiting for the trigger; in the latter case, acquisition is being performed
continuously, so the pre-trigger cycles can be registered.
393
OMICRON CMEngine
394
String Commands
4.12.1.1
inp:avail?(scope|multimeter)
Function
Description
Answer
The return value contains the device number and an integer representing the
availability of the selected function: 1 means the function is available, 0 means it
is not available.
Example
inp:avail(multimeter)
Result : "1,1;" Multimeter functionality is available.
395
OMICRON CMEngine
4.12.1.2
inp:mode(scope|multimeter)
Function
Description
Sets scope or multimeter mode for the operation of the measuring inputs. When
multimeter is selected, the scope commands are not available; when the scope
mode is selected, the multimeter commands are in their turn not available.
396
String Commands
4.12.1.3
inp:scope:cfg?(maxacq|minblock)
Function
Description
Answer
The return value contains the device number and an integer value with the
requested information.
Possible Errors
Examples
inp:scope:cfg?(maxacq)
Result: 1,1000000;
The acquisition memory can hold one million samples.
inp:scope:cfg?(minblock)
Result: 1,1024;
1024 samples are returned for each fetch command.
See also:
inp:mode(multimeter|scope) on page 396
inp:avail?(multimeter|scope) on page 395
inp:scope:transfer:fetch? on page 411
397
OMICRON CMEngine
4.12.1.4
inp:scope:status?
Function
Description
Answer
<dev_id>,<state>,<samples_acquired>,<last_acq_timestamp>;
<state>
String describing the state of the acquisition. It can be one of the following
values:
stop:
There is no acquisition in progress
wait:
The system is waiting for the trigger condition
acquire:
Acquisition is being performed
calculate: Calculations are being performed on the acquired data
<samples_acquired>
Integer containing the number of samples acquired during the present
acquisition. Valid only if <state> is acquire.
<last_acq_timestamp>
This is the value of the measuring DSP chronometer at the moment when the
last acquisition finished recording. It can be used to identify when a new record
has finished recording.
Possible Errors
Examples
inp:scope:status?
Result: 1,stop,0,0;
No acquisition is in progress.
inp:scope:status?
Result: 1,wait,0,3531355;
Waiting for trigger, no samples acquired.
inp:scope:status?
Result: 1,acquire,13821,3546853;
Acquisition is in progress, 13821 samples acquired so far.
See also:
inp:scope:trig:rearm(on|off) on page 404
inp:scope:trig:start on page 405
inp:scope:acquire(<input_mask>,<length>,<pretrigger>,<buff_mode>) on page 399
398
String Commands
4.12.1.5
inp:scope:acquire(<input_mask>,<total_length>,<pretrigger_length>,
<buff_mode>)
Function
Description
Use this command to program the parameters for the next acquisition. This
command does not start the acquisition, this is the task of the
inp:scope:trig:start command.
Parameters
<input_mask>
Integer number representing the inputs that must be sampled. Bit 0 represents
analog input 1, and bit 9 represents analog input 10. The bits are set if the inputs
must be sampled, cleared if they must not be sampled. Bit 10 enables binary
data acquisition for all the inputs where sampling is enabled.
<total_length>
Total length of the acquisition in seconds (floating point).
<pretrigger_length>
Part of the acquisition reserved for pre-trigger data (floating point). This number
must be smaller or equal than the <length> parameter. The length of the posttrigger data will therefore be equal to <total_length> <pretrigger_length>.
A negative number indicates that the acquisition starts after the trigger event. For
example, if pretrigger_length = -1, this means the acquisition starts 1 second
after the trigger event.
<buff_mode>
Keyword to select the acquisition buffer configuration. The buffer can be
configured as a flat memory extension (keyword full) or it can be split in two
buffers (keyword split). Normal operation is full, split is used when the
trigger automatic rearming is on, to keep the new data from overwriting the
acquisition memory.
Answer
<dev_id>,<input_mask>,<acq_len>;
<input_mask>
Integer number representing the inputs that are sampled. Bit 0 represents analog
input 1, and bit 9 represents analog input 10. The bits are set if the inputs must
be sampled, cleared if they must not be sampled.
<acq_len>
Acquisition length in samples.
Possible Errors
399
OMICRON CMEngine
Examples
inp:scope:acquire(32,0.5,0.4,full)
Acquisition is configured to read input 6, without binary data, for a total length of
500 ms, 400 ms of which will be pre-trigger data. The buffer is configured as one
single memory unit.
See also:
inp:scope:trig:rearm(on|off) on page 404
inp:scope:trig:start on page 405
inp:scope:status? on page 398
400
String Commands
401
OMICRON CMEngine
4.12.2.1
inp:scope:trig(<channel>,<slope>,<level>)
Function
Description
Use this command to program the trigger parameters for the next acquisition.
This command does not start the acquisition process, this is the task of the
inp:scope:trig:start command.
Parameters
<channel>
Integer number representing the input where the trigger condition must be
detected. The input may be configured as analog or binary, and does not have to
be selected for acquisition in the inp:scope:acquire() command.
<slope>
Keyword + or -. For analog inputs, this parameter represents the signal slope
that will fulfill the trigger condition. If the input is configured as binary input, then
the + keyword selects a 0 > 1 transition, while the - keyword selects a 1 > 0
transition.
<level>
Floating point value of the signal level that will fulfill the trigger condition in
analog inputs. In binary inputs, this parameter has no effect. Please note that this
is so even if the input is configured as potential-sensing; in that case, only the
input threshold will determine whether the input is sensing a 1 or a 0.
Answer
<dev_id>,<input_mask>,<acq_len>;
<input_mask>
Integer number representing the inputs that are sampled. Bit 0 represents analog
input 1, and bit 9 represents analog input 10. The bits are set if the inputs must
be sampled, cleared if they must not be sampled.
<acq_len>
Acquisition length in samples.
Possible Errors
Examples
inp:scope:trig(1,-,0.0)
If input 1 is binary, the trigger will be detected in a 1 to 0 transition. If it is analog,
then the trigger will be detected in a positive-to-negative (negative slope)
transition, at the value of 0 volts.
inp:scope:trig(5,+,25.0)
402
String Commands
403
OMICRON CMEngine
4.12.2.2
inp:scope:trig:rearm(on|off)
Function
Description
Use this command to configure the automatic rearming of the trigger. If this
feature is set to on, when an acquisition is finished the system will immediately
begin to look for the next trigger condition. If the feature is off, then the system
will stop acquiring and the trigger will have to be manually restarted (with the
inp:scope:trig:start command).
Possible Errors
See also:
inp:scope:trig:simple(<channel>,<slope>,<level>) on page 402
inp:scope:trig:start on page 405
inp:scope:trig:abort on page 407
inp:scope:trig:force on page 406
404
String Commands
4.12.2.3
inp:scope:trig:start
Function
Start an acquisition.
Description
Use this command to start an acquisition. When this command is issued, the
system goes into wait mode, looking for the trigger condition that has been
programmed with the inp:scope:trig:simple(<channel>,<slope>,<level>)
command.
Possible Errors
See also:
inp:scope:trig:simple(<channel>,<slope>,<level>) on page 402
inp:scope:trig:rearm(on|off) on page 404
inp:scope:trig:abort on page 407
inp:scope:trig:force on page 406
405
OMICRON CMEngine
4.12.2.4
inp:scope:trig:force
Function
Force trigger.
Description
Use this command to force a trigger. When this command is issued, the system
will go into acquire mode immediately without looking for the trigger condition
any longer. The trigger instant will be the moment the command was issued. It is
possible to issue this command when the system is in wait or stop states
there is no need for a previous inp:scope:trig:start command to be issued.
Possible Errors
See also:
inp:scope:trig:simple(<channel>,<slope>,<level>) on page 402
inp:scope:trig:rearm(on|off) on page 404
inp:scope:trig:start on page 405
inp:scope:trig:abort on page 407
406
String Commands
4.12.2.5
inp:scope:trig:abort
Function
Cancel acquisition.
Description
This command stops the acquisition immediately aborting any currently recording
acquisition. Use it to stop an acquisition and send the system back to stop
state. This command can be issued at any time and it will be effective
immediately. It is possible to issue this command when the system is in wait or
stop states there is no need for a previous inp:scope:trig:start command to
be issued.
Possible Errors
See also:
inp:scope:trig:simple(<channel>,<slope>,<level>) on page 402
inp:scope:trig:rearm(on|off) on page 404
inp:scope:trig:start on page 405
inp:scope:trig:stop on page 408
407
OMICRON CMEngine
4.12.2.6
inp:scope:trig:stop
Function
Cancel acquisition.
Description
This command waits for the currently recording acquisition to stop (if any) and
then goes into stop state, even if the rearm mode is on.
Possible Errors
See also:
inp:scope:trig:simple(<channel>,<slope>,<level>) on page 402
inp:scope:trig:rearm(on|off) on page 404
inp:scope:trig:start on page 405
inp:scope:trig:abort on page 407
408
String Commands
409
OMICRON CMEngine
4.12.3.1
inp:scope:transfer:start
Function
Description
Use this command to start a transfer. The data to be transferred are those of the
last acquisition. The user must take care that the acquisition buffer contains valid
data. For that, the command inp:scope:status? should be used.
Possible Errors
See also:
inp:scope:transfer:fetch? on page 411
inp:scope:transfer:finish? on page 412
410
String Commands
4.12.3.2
inp:scope:transfer:fetch?
Function
Fetch a block of data from the CMC test set to the shared memory file.
Description
Use this command to acquire a new block of data from the CMC tet set.
Answer
<dev_id>,<samples_transferred>;
<samples_transferred>
Integer value with the cumulative number of samples transferred so far. The user
will know the transfer is finished when two consecutive fetch commands return
the same value. Alternatively, the user may calculate the total number of
samples to be fetched based on the acquisition length, number of channels and
sampling rate, and thus know when the end of the transfer has been reached.
<acq_len>
Acquisition length in samples.
Possible Errors
Examples
inp:scope:transfer:start
inp:scope:transfer:fetch?
Returns: 1,1024;
inp:scope:transfer:fetch?
Returns: 1,2048;
...
See also:
inp:scope:transfer:start on page 410
inp:scope:transfer:finish? on page 412
411
OMICRON CMEngine
4.12.3.3
inp:scope:transfer:finish?
Function
Description
This command stops the transfer process and closes the shared memory file.
The contents of this file are then ready to be accessed by the users application.
Answer
<dev_id>,<file_ID_string>;
<file_ID_string>
Unique ID that can be used to open the shared memory file to access the data.
<acq_len>
Acquisition length in samples.
Possible Errors
See also:
inp:scope:transfer:start on page 410
inp:scope:transfer:fetch? on page 411
412
String Commands
4.12.3.4
Make an acquisition of 30 ms, pre-trigger 10 ms, 2 binary inputs, 9 kHz sampling rate.
CMExec: Parsing '1', 'inp:avail?(scope)'
CMExec: Returning '1,1;'
CMExec: Parsing '1', 'inp:mode(scope)'
CMExec: Returning''
CMExec: Parsing '1', 'inp:scope:cfg?(maxacq)'
CMExec: Returning '1,1000000;'
CMExec: Parsing '1', 'inp:scope:cfg?(minblock)'
CMExec: Returning '1,1024;'
CMExec: Parsing '1', 'inp:scope:status?'
CMExec: Returning '1,stop,0,0;'
CMExec: Parsing '1', 'inp:scope:trig(7,+,1.000000e+001)'
CMExec: Returning ''
CMExec: Parsing '1', 'inp:ana:cfg(9481,1.0)'
CMExec: Returning ''
CMExec: Parsing '1', 'inp:scope:acquire(1024,3.000000e-002,1.000000e-002,full)'
CMExec: Returning ''
CMExec: Parsing '1', 'inp:scope:trig:rearm(off)'
CMExec: Returning ''
CMExec: Parsing '1', 'inp:scope:trig:start'
CMExec: Returning ''
CMExec: Parsing '1', 'inp:scope:status?'
CMExec: Returning '1,wait,0,0;'
CMExec: Parsing '1', 'inp:scope:transfer:start'
CMExec: Returning ''
CMExec: Parsing '1', 'inp:scope:transfer:fetch?'
CMExec: Returning '1,284;'
CMExec: Parsing '1', 'inp:scope:transfer:finish?'
CMExec: Returning '1,Omicron Transient Record Shared Memory Area;'
Code Sample: How to Access a Shared Memory File from C++ using the ID String
Open the file using code like this:
HANDLE hMapping = CreateFileMapping((HANDLE)0xFFFFFFFF, NULL,
PAGE_READWRITE, 0, m_nSize, strID);
DWORD dwResult = GetLastError();
if (dwResult != ERROR_ALREADY_EXISTS) return false;
if (hMapping == NULL >> hMapping == INVALID_HANDLE_VALUE) return false;
// Convert the handle into a pointer.
m_p = (DWORD*)MapViewOfFile(hMapping, FILE_MAP_ALL_ACCESS, 0, 0, 0);
413
OMICRON CMEngine
In this code, the strID parameter in the call to CreateFileMapping is the string returned by
int:scope:transfer:finish?.
If binary data is selected it as treated as a separate channel (channel 11).
The layout of the acquisition buffer is as follows:
Each entry is a double word (32 bit).
There is a header where:
word 1 = acquisition length (in samples);
word 2 = bitmap of channels:
Bit
15
14
13
12
11
10
Inp
ut
bin
ary
10
Followed by a block of data for each channel, where each channel is in sequence according to its
number. For example, if you select an acquisition of 2 samples length for channels 2, 6, 7 and the
binary inputs, the buffer would look like this:
word 1:
word 2:
word 3:
word 4:
word 5:
word 6:
word 7:
word 8:
word 9:
word10:
414
0000002
00004C2
00xxxxx
00xxxxx
00xxxxx
00xxxxx
00xxxxx
00xxxxx
00xxxxx
00xxxxx
//
//
//
//
//
//
//
//
//
channels
sample 1
sample 2
sample 1
sample 2
sample 1
sample 2
sample 1
sample 2
2,
of
of
of
of
of
of
of
of
6, 7 & 11
channel 2
channel 2
channel 6
channel 6
channel 7
channel 7
binary inputs
binary inputs
String Commands
415
OMICRON CMEngine
4.12.4.1
inp:scope(<input_list>):harm(<req_harmonics>[,<pretrigger>])
Function
Description
This command tells the measuring DSP to configure a acquisition and then carry
out a harmonic analysis on the data of that acquisition. Therefore the parameters
from any previous inp:scope:acquire() command will be overwritten.
Parameters
<input_list>:
This parameter is of type <enumeration> and defines for which channels the
acquisition will take place. The first channel in the list is the reference channel for
the phase of the fundamental.
<req_harmonics>:
Number of harmonics to be calculated (integer). If the parameter is 1, only the
fundamental component is calculated. A value of 2 would request calculation of
the fundamental and the 2nd harmonic, and so on.
Depending on the capacity of the measuring DSP, the actual number of
harmonics calculated may be smaller than the number requested.
<pretrigger>:
This optional floating point value defines the length in seconds of the pre-trigger
time, if it is desired. The defined time must correspond to 2047 samples or fewer.
Answer
<dev_id>,<ref_input>,<input_mask>,<acq_len>;
<ref_input>
Reference input for the phase of the fundamental.
<input_mask>
Integer number representing the inputs for the harmonic analysis. Bit 0
represents analog input 1, and bit 9 represents analog input 10. The bits are set
if the inputs must be sampled, cleared if they must not be sampled.
<acq_len>
Acquisition length of the harmonic analysis.
Possible Errors
Examples
See also:
416
inp:scope(1,2,3):harm(5, 0.02)
Analysis is requested for inputs 1, 2 and 3; input 1 is phase reference.
Fundamental and harmonics up to 4th order are requested, with a pre-trigger
time of 20 ms.
String Commands
417
OMICRON CMEngine
4.12.4.2
inp:scope:harm?(transfer)
Function
Description
Use this command to transfer the harmonic data from the CMC test set to a
shared memory file. The data to be transferred are those of the last acquisition
with harmonic analysis. Take care that the harmonic analysis buffer contains
valid data. For that, use the command inp:scope:status?.
Answer
<dev_id>,<file_ID_string>;
<file_ID_string>
Unique ID that can be used to open the shared memory file to access the data.
Possible Errors
See also:
inp:scope:harm?(<channel>,<start_harm>) on page 420
inp:scope:transfer:finish? on page 412
2 No.
Harmonics
Requested
3 Channel #
(1st channel)
4 No.
Harmonics
calculated
5 Status Bits
6
Fundamental
freq.
7 Harm0 Ampl
9 Harm1 Ampl
Channel#
(2nd channel)
Fundamental
freq.
Harm0 Ampl
etc.
418
Harm0 Phase
9 Harm1 Ampl
10 Harm1
Phase
etc.
Harm1 Ampl
Harm1 Phase
etc.
String Commands
Unlike the <req_harmonics> parameter in the inp:scope:harm() command, the number of harmonics
actually calculated does not include the fundamental Therefore, a value of 0 means that only the
fundamental was calculated, a value of one means that the fundamental and the 2nd harmonic were
calculated, etc. It follows that the number here will be one smaller than the <req_harmonics>
parameter if all requested harmonics were calculated. If the number of harmonics calculated is 1,
then not even the fundamental was calculated.
The amplitude is in Volts or Ampere (depending on the type of the input). The phase of the harmonic
of each channel is always relative to the phase of the fundamental for the same channel, while the
phase for the fundamental is really the phase of the actual signal and relative to the phase of the
fundamental of the reference channel. This means the phase of the fundamental of the reference
channel is always 0.
Note: the fundamental frequency, all amplitudes and all phases are stored as 32 floating point
numbers represented in IEEE 754 format, i.e., in C or C++ cast it to a float to get the value in the
correct format.
Meaning of the status bits:
Bit 2
Bit 1
Bit 0
Weak signal
Overload
Overload indicates that the signal exceeded the maximum range of the channel during the
acquisition. Any overload will cause invalid results in the harmonic analysis (because the signal is
"chopped").
Weak signal means that the signal of the channel was below 10% of the range. This will cause the
harmonic analysis to be less accurate.
Frequency out of range means the frequency of the input signal was too high or too low for the given
sampling frequency. The maximum amount of data in the file is 5240 bytes; that is 10 channels, each
of which uses 3 bytes for channel header, and up to a maximum of 64 harmonics. So: (10 *(3 + 2*64))
* sizeof(DWORD) = 5240.
419
OMICRON CMEngine
4.12.4.3
inp:scope:harm?(<channel>,<start_harmonic>)
Function
Description
Use this command to return the harmonic data from the CMC test set in string
format. The data to be transferred are those of the last acquisition with harmonic
analysis. Take care that the harmonic analysis buffer contains valid data. For
that, use the command inp:scope:status?. This command will return data for a
maximum of 8 harmonics.
Parameters
<channel>:
Channel to retrieve the harmonics. It must be one of the channels specified in the
<input_list> parameter of the inp:scope:harm() command.
<start_harmonic>:
First harmonic for which the data must be returned. A value of 1 means to begin
with the fundamental data, a value of two with the second harmonics data, etc.
Since the command will return data for a maximum of 8 harmonics, repeated
commands with increasing values of this parameter are required if the number of
calculated harmonics (including the fundamental) is greater than 8
(<req_harmonics> parameter in the inp:scope:harm() command).
Answer
Possible Errors
420
CMERR_NOT_SCOPE_MODE
String Commands
Explanation:
Examples
inp:scope(8):harm(16, 0.05)
inp:scope:trig:force
inp:scope:status?
Result: "1,acquire,2048,3531355;"
inp:scope:status?
Result: "1,stop,0,3546853;"
inp:scope:harm?(8,1)
Result: "1,15, 3.000000e+002, 9.984131e+000,-8.221289e+001,
1.413003e-004,-2.477148e+001, 1.065843e-004,-1.069395e
+002,2.923355e-001,8.869141e+001, 3.105849e-004,-4.031860e
+000,2.542064e-004,1.589082e+002, 5.566329e-005,5.515039e
+001,2.153777e-004,1.313086e+002;"
inp:scope:harm?(8,9)
Result: "1,15, 3.461838e-004,-7.493555e+001,1.739971e-004,-1.234102e+002,
2.020113e-004,-4.169141e+001,8.604676e-005,1.682227e
+001,1.222454e-004,1.167246e+002,1.112260e-004,1.773672e+002,
1.260899e-004,1.215469e+002;"
See also:
inp:scope:harm?(transfer) on page 418
421
OMICRON CMEngine
422
String Commands
Set CB trip, close and auto-reset times and factors for the auxiliary contacts. This
command is only allowed as long as the CB simulation is deactivated.
Parameters
<trip>
Trip time of the circuit breaker in seconds.
<close>
Close time of the circuit breaker in seconds.
<auto>
Time in seconds after that the circuit breaker simulation automatically goes back
to its initial state.
<auto> = 0 disables auto-reset.
<52a% trip>
<52b% trip>
<52a% close>
<52b% close>
Timing of the auxiliary contacts in relation to the trip or close time (e.g., <52a %
trip> = 0.23, means 23% of the trip time).
See diagram below.
423
OMICRON CMEngine
4.13.2 cb:time?
Description
Answer
Returns the values in the same order as specified in the cb:time command.
424
String Commands
Define simulation input or output routing. This command is only allowed as long
as the CB simulation is deactivated.
Parameters
trip[(<idx>)]
close
Defines the routing of the simulation inputs. In case of trip it is possible to add an
index (1, 2, 3) specifying the pole (L1, L2, L3) to operate.
cb52a[(<idx>)]
cb52b[(<idx>)]
Defines the routing of the simulation outputs. It is possible to add an index (1, 2,
3) specifying the pole (L1, L2, L3) to operate.
cb52a or|and
cb52b or|and
Defines the OR or AND routing of the simulation outputs for all poles (L1, L2, L3)
of cb52a|b.
<bool_expr>
Defines the inputs or outputs that are used for the specified function.
425
OMICRON CMEngine
Answer
426
String Commands
4.13.5 cb:def(clr)
Description
Clears the simulation input and output routing. This command is only allowed as
long as the CB simulation is deactivated.
427
OMICRON CMEngine
4.13.6 cb:start(on|off)
Description
428
Activates CB simulation and sets CB initial state (on = closed or off = open). Can
also be used to change the CB state when simulation is active.
String Commands
4.13.7 cb:stop
Description
Deactivates CB simulation.
429
OMICRON CMEngine
4.13.8 cb:lock
Description
430
String Commands
4.13.9 cb:free
Description
Brings the CB simulation from the locked state back to opened or closed. If
the CB simulation is inactive or not locked, this command is ignored.
431
OMICRON CMEngine
4.13.10 cb:status?
Description
Query simulation status. Returns the current state of the state machine and the
initial state (integer state index). If both returned values are zero, the connected
CMC does not support CB simulation.
Answer
432
String Commands
You can use the time synchronization of CMIRIG-B, PTPv2 or CMGPS to use time-triggered signal
outputs for end-to-end tests. Synchronization via NTP is only synchronizing the internal device clock,
for example for the time stamps of GOOSE packets. For further details check the Synchronizing
CMC Test Sets section of the Test Universe Help.
Here is an overview of available time configurations (excluding synchronization via CMGPS). The
numbers in the first column are used by the commands sys:time:cfg? on page 438,
sys:time:cfg(<timeConfiguration>) on page 439, sys:time:def? on page 440 and
sys:time:cfg(<timeConfiguration>) on page 437.
Cfg.
Name
433
OMICRON CMEngine
Cfg.
Name
in synchronization with the
CMIRIG-B input on IRIG-B/
PPS IN.
434
String Commands
Cfg.
Name
435
OMICRON CMEngine
Cfg.
Name
436
String Commands
4.14.1 sys:time:cfg(<timeConfiguration>)
Function
Sets the specified time configuration for the CMC test set.
Description
With this command it is possible to set the CMC test sets time configuration.
Locking the time source resource is obligatory.
Parameters
<timeConfiguration>:
please check the table in the Time synchronization commands on page 433
topic.
Possible Errors
This command may cause the following CMEngine error codes:
CMERR_OUT_OF_RANGE
Value is out of range (configuration is not available).
CMERR_IRIGB_NOT_LOCKED
The time source resource is not locked.
Example
In this example the "Trigger via PTPv2" configuration is selected.
sys:time:cfg(6)
437
OMICRON CMEngine
4.14.2 sys:time:cfg?
Function
Description
With this command it is possible to read the list of available time configurations
(returned in a comma separated string). Time configurations 0 and 8 are always
available.
Answer
The command returns a list of available configuration numbers. For the meaning
of these numbers please check the table in the Time synchronization
commands on page 433 topic.
Example
In this example the time configurations "Not used", "Trigger via PTPv2", "NTP Client" are available.
sys:time:cfg?
Return value: 1,0,6,8;
438
String Commands
4.14.3 sys:time:cfg?(<timeConfiguration>)
Function
Description
This command returns additional info about the specified time configuration
mode.
Parameters
<timeConfiguration>:
please check the table in the Time synchronization commands on page 433
topic.
Answer
439
OMICRON CMEngine
4.14.4 sys:time:def?
Function
Indicates the currently selected time configuration and the connection state of an
IRIG-B device.
Description
Answer
Example
sys:time:cfg(6)
sys:time:def?
Return value: 1,6,1,0;
The CMC currently is in time configuration mode "Trigger via PTPv2"; a CMIRIG-B device is
connected directly to the CMC.
440
String Commands
4.14.5 sys:time:datetime?
Function
Gets the current date and time (depending on the selected time configuration).
Description
Returns the UTC date/time information. The source of this time is depending on
the selected time configuration.
Cfg.
Answer
Date/time source
PTP time
PTP time
441
OMICRON CMEngine
Possible Errors:
This command may cause the following CMEngine error codes:
Error Code
Explanation
CMERR_IN_SEQ_MODE
Example:
sys:time:datetime?
Return value: 1,2013,2,26,8,6,41,57,0,0;
442
String Commands
443
OMICRON CMEngine
4.14.6.1
irigb:def?
Function
Indicates whether a CMIRIG-B device has been found on the specified CMC and
returns the selected IRIG-B configuration.
Description
Answer
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
444
String Commands
4.14.6.2
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 IEEE C37.118 control function (CF) bits as
shown in the following table.
The <parity_mode> defines the parity calculation method to odd or even.
The <mod> parameter defines the modulation of the IRIG-B signal to PWM
(Pulse width code) or Manchester modulation.
<coded_expression> configures the content of the IRIG-B signal. For details take
a look at the IRIG-B specification.
With the <auto_inc> parameter it is possible to turn the second incrementation of
the encoder off/on. That means if it is off, the encoder stays at the current time.
For normal operation this is always on.
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 in the
chapter IRIG-B commands on page 443.
In the worst case it can take up to two seconds until the new
configuration takes effect.
Parameters
<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>:
Time and date to set for the encoder. With the specified date the day of the year
is calculated and set. If the selected coded expression does not contain the year
information (0-3) it is ignored for the IRIG-B signal. The year parameter is only
used to calculate the day of the year.
<yyyy>,<doy>,<hh>,<mm>,<ss>:
Date and time information based on the year and the day of the year. For the day
of the year values between 1 to 366 allowed (leap year). If the selected coded
expression does not contain the year information (0-3) it is ignored for the IRIG-B
signal.
<CF>:
This parameter is of type <int> and specifies the IEEE C37.118 control function
(CF) bits (see above).
445
OMICRON CMEngine
<parity_mode>:
Here you must specify one of the keywords odd or even.
<mod>:
This parameter is of type <int>. Value 0=PWM and 2=Manchester modulation
are 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.
<auto_inc>:
Here you must specify one of the keywords on or off.
<write_mode>:
Here you must specify one of the keywords sync or async.
Bit
Description
IRIG-B Pos. ID
Comment
LSP
P60
LS
P61
DSP
P62
Daylight Saving
Pending (DSP)
Becomes 1s up to 59s
before DST change
DST
P63
Time Offset 1
P65
Time Offset 2
P66
See bit 4
446
String Commands
Bit
Description
IRIG-B Pos. ID
Comment
Time Offset 4
P67
See bit 4
Time Offset 8
P68
See bit 4
P64
Time Offset-0.5h
P70
10
11
12
TimeQuality
P71
Time Quality
4-bit code representing
approx. clock time
error (details in ?????)
13
TimeQuality
P72
See bit 12
14
TimeQuality
P73
See bit 12
15
TimeQuality
P74
See bit 12
16
17
18
19
20
21
22
23
447
OMICRON CMEngine
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IRIGB_NOT_AVAIL
See also:
command irigb:enc:cfg? on page 449
448
String Commands
4.14.6.3
irigb:enc:cfg?
Function
Description
This command reads out the current configuration of the IRIG-B encoder.
Answer
Bit
Description
IRIG-B Pos. ID
Comment
LSP
P60
LS
P61
DSP
P62
Daylight Saving
Pending (DSP)
Becomes 1s up to 59s
before DST change
449
OMICRON CMEngine
Bit
Description
IRIG-B Pos. ID
Comment
DST
P63
Time Offset 1
P65
Time Offset 2
P66
See bit 4
Time Offset 4
P67
See bit 4
Time Offset 8
P68
See bit 4
P64
Time Offset-0.5h
P70
10
11
12
TimeQuality
P71
Time Quality
4-bit code representing
approx. clock time
error (details
in ??????)
13
TimeQuality
P72
See bit 12
14
TimeQuality
P73
See bit 12
15
TimeQuality
P74
See bit 12
16
17
18
19
450
String Commands
Bit
Description
20
21
22
23
IRIG-B Pos. ID
Comment
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
451
OMICRON CMEngine
4.14.6.4
irigb:enc:datetime?
Function
Description
This command returns the date and time of the IRIG-B encoder independent if it
is running or not. If the encoder date and time was not 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
Bit
Description
IRIG-B Pos. ID
Comment
LSP
P60
LS
P61
DSP
P62
Daylight Saving
Pending (DSP)
452
String Commands
Bit
Description
IRIG-B Pos. ID
Comment
Becomes 1s up to 59s
before DST change
DST
P63
Time Offset 1
P65
Time Offset 2
P66
See bit 4
Time Offset 4
P67
See bit 4
Time Offset 8
P68
See bit 4
P64
Time Offset-0.5h
P70
10
11
12
TimeQuality
P71
Time Quality
4-bit code representing
approx. clock time
error (details in ?????)
13
TimeQuality
P72
See bit 12
14
TimeQuality
P73
See bit 12
15
TimeQuality
P74
See bit 12
16
17
18
453
OMICRON CMEngine
Bit
Description
19
20
21
22
23
IRIG-B Pos. ID
Comment
Possible Errors:
This command may cause the following CMEngine error codes:
454
Error Code
Explanation
CMERR_IN_SEQ_MODE
CMERR_IRIGB_NOT_AVAIL
String Commands
4.14.6.5
Function
Description
This command configures the expected signal format of the IRIG-B decoder.
The <parity_mode> defines the parity calculation method to odd or even.
The <mod> parameter defines the modulation of the IRIG-B signal to PWM
(Pulse width code) or Manchester modulation. Currently only PWM is supported.
With the <parity_err_status> parameter it is possible to turn on/off the reporting
of 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 in the
chapter IRIG-B commands on page 443.
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 CMEngine error codes:
455
OMICRON CMEngine
Error code
Explanation
See also:
command irigb:dec:cfg? on page 457
456
String Commands
4.14.6.6
irigb:dec:cfg?
Function
Description
This command reads out the current configuration of the IRIG-B decoder.
Answer
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
457
OMICRON CMEngine
4.14.6.7
irigb:dec:scan?
Function
Description
Answer
Possible Errors
This command may cause the following CMEngine error codes:
458
String Commands
Error code
Explanation
CMERR_IN_SEQ_MODE
459
OMICRON CMEngine
4.14.6.8
irigb:dec:reset
Function
Description
This command executes a reset on the IRIG-B decoder. If the IRIG-B decoder
runs into the error state a reset is needed to get it running again. The status
information is cleared, too.
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
See also:
command sys:status? on page 128
460
String Commands
4.14.6.9
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 in the
chapter IRIG-B commands on page 443.
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 CMEngine error codes:
Error code
Explanation
CMERR_IRIGB_NOT_AVAIL
461
OMICRON CMEngine
4.14.6.10 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.
Answer
Possible Errors
This command may cause the following CMEngine error codes:
Error code
Explanation
CMERR_IN_SEQ_MODE
CMERR_INVALID_DATE
462
String Commands
463
OMICRON CMEngine
4.14.7.1
ptp:cfg(<domain>,<vlan_id>,<vlan_prio>)
Function
Description
With this command it is possible to set the configuration of the PTP stack.
Locking the time source resource is obligatory.
Parameters
<domain>
PTP domain to use (integer from 0 to 255, CMGPS 588 will always work with
domain 0).
<vlan_id>
VLAN Id of the network (integer from 0 to 4095).
<vlan_prio>
VLAN prio of the network (integer from 0 to 7).
Possible Errors:
This command may cause the following CMEngine error codes:
Error Code
Explanation
CMERR_NOT_SUPPORTED
CMERR_IRIGB_NOT_LOCKED
CMERR_OUT_OF_RANGE
Example:
ptp:cfg(4,1,0)
Set domain 4, VLAN id 1 and VLAN prio 0.
464
String Commands
4.14.7.2
ptp:cfg?
Function
Description
With this command it is possible to get the current configuration of the PTP
stack. Locking the time source resource is obligatory.
Answer
Possible Errors:
This command may cause the following CMEngine error codes:
Error Code
Explanation
CMERR_NOT_SUPPORTED
CMERR_IRIGB_NOT_LOCKED
Example:
ptp:cfg?
Return value: 1,POWER_SYSTEMS,IEEE_802_3,0,0,4;
465
OMICRON CMEngine
4.14.7.3
ptp:status?
Function
Description
This command returns information about the status of the PTP stack like current
PTP grandmaster and its identity and properties. Locking the time source
resource is obligatory.
Answer
<clock_identity>
Displays the clock identity. IEEE 1588-2008, clause 7.5.2.2, requires that
each clock in a PTP network has a unique clock identifier.
<clock_class>
Displays the current clock class of the selected PTP source. The clock class
is broadcast in the corresponding PTP data packets.
Possible values:
PRIMARY_REF_PTP (6)
The clock of the PTP grandmaster is locked to a primary reference time
source, i.e., to the GPS system.
PRIMARY_REF_PTP_HOLDOVER (7)
The clock was previously locked to GPS time but has lost GPS reception. The
internal oscillator is used as the source of time and provides time with the
accuracy given by the clock accuracy parameter.
NOT_IN_SPEC_PTP_A (52)
The clock is not locked to GPS time and is not within its holdover
specification.
SLAVE_ONLY (255)
There is no PTP grandmaster available.
<clock_acc>
Displays the current accuracy of the PTP synchronization with regard to TAI.
See IEEE 1588-2008, clause 7.6.2.5, for details.
<mean_path_delay>
466
String Commands
Displays the maximum time inaccuracy in ns that the PTP device contributes
to the network time inaccuracy. As the CMC uses the PTP "Power Profile",
which uses P2P connection, this will always be 0.
<offset_from_master>
Displays the network time inaccuracy in ns to be transmitted in IEEE C37.238
TLV. See IEEE C37.238-2011, clause 5.13.
<number_of_ports>
Number of Ethernet interfaces of the CMC.
<port_state>
List of port states according to IEEE 1588-2008, table 10.
Possible values include:
FAULTY
There is a problem in the PTP communication. Likely cause is that there are
two (or more) visible PTP clocks not separated via a transparent clock (which
breaks the PTP algorithms specified for the Power Profile).
LISTENING
There is no active PTP grandmaster visible from the given port.
UNCALIBRATED
There is an active PTP grandmaster visible on the given port, but its accuracy
is outside of the standard or the CMC has not yet synchronized its clock to
the PTP grandmaster.
SLAVE
The port is locked to a valid PTP grandmaster.
Possible Errors:
This command may cause the following CMEngine error codes:
Error Code
Explanation
CMERR_IRIGB_NOT_LOCKED
CMERR_NOT_SUPPORTED
CMERR_OTIMED_ERROR
467
OMICRON CMEngine
Example:
ptp:status?
Return value: 1,RUNNING,20:b7:c0:ff:fe:00:16:14,PRIMARY_REF_PTP (6),WITHIN_100_NS
(0x21),0,6,2,LISTENING,SLAVE;
The PTP stack is running, there is a PTP grandmaster on the ETH2 interface of the CMC, the
grandmaster has clock identity 20:b7:c0:ff:fe:00:16:14. It has accuracy of 100 ns and is a viable
primary reference time source.
468
String Commands
469
OMICRON CMEngine
4.14.8.1
ntp:cfg(unicast,<ntp_server>,<poll_interval>)
Function
Description
With this command it is possible to configure NTP to work in unicast mode and
set the corresponding parameters. Locking the time source resource is
obligatory.
When time configuration NTP client is selected the CMC will try to synchronize
its time with the specified NTP server.
Parameters
<ntp_server>
The NTP server to use.
URL in the example.com format or an IPv4 address of the format
xxx.xxx.xxx.xxx.
<poll_interval>
The NTP server will be polled every 2^<poll_interval> seconds.
Possible Errors:
This command may cause the following CMEngine error codes:
Error Code
Explanation
CMERR_IRIGB_NOT_LOCKED
CMERR_OUT_OF_RANGE
Example:
ntp:cfg(unicast,pool.ntp.org,4)
470
String Commands
4.14.8.2
ntp:cfg(multicast,<multicast_address>)
Function
Description
With this command it is possible to configure NTP to work in multicast mode and
set the corresponding parameter. Locking the time source resource is obligatory.
When time configuration NTP client is selected, the CMC will try to synchronize
its time listening to the specified multicast address.
Parameters
<multicast_address >
The multicast IP address to listen for.
Possible Errors:
This command may cause the following CMEngine error codes:
Error Code
Explanation
CMERR_IRIGB_NOT_LOCKED
Example:
ntp:cfg(multicast,224.0.1.1)
471
OMICRON CMEngine
4.14.8.3
ntp:cfg(broadcast)
Function
Description
Possible Errors:
This command may cause the following CMEngine error codes:
472
Error Code
Explanation
CMERR_IRIGB_NOT_LOCKED
String Commands
4.14.8.4
ntp:status?
Function
Description
With this command it is possible to get the status and configuration of the NTP
synchronization. Locking the time source resource is obligatory. This is only
possible when selecting time configuration "NTP client".
Answer
UNICAST
NTP is configured in unicast mode.
MULTICAST
NTP is configured in multicast mode.
BROADCAST
NTP is configured in broadcast mode.
<host>
IP address or name of the NTP server/multicast address as configured ("0" in
broadcast mode).
<poll_interval>
Interval how often the server will be polled (only set in unicast mode, "0" for
other modes), if this value is n then the poll interval will be 2n.
<stratum>
Stratum of the NTP source (integer, the lower the value, the better the
source).
The rest of the fields are only set in UNICAST mode, otherwise they are 0.
<status>
UNREACHABLE
Specified NTP server is not available.
SYNCED
CMC is synchronized to NTP server.
UNSYNCED
NTP server is visible, however, the CMC and the NTP are not is sync. This is
a normal state, not an error case. NTP may also react this way if the NTP
server is not available. The result will be a huge stratum.
473
OMICRON CMEngine
<delay>
Path delay of the NTP communication in s.
<offset>
Offset between the CMC clock and the NTP master clock in s.
<dispersion>
Dispersion in s.
Possible Errors:
This command may cause the following CMEngine error codes:
Error Code
Explanation
CMERR_IRIGB_NOT_LOCKED
CMERR_OTHER_TP_RUNNING
Example:
ntp:cfg(UNICAST,"127.0.0.1",4)
sys:time:cfg(8)
ntp:status?
Return value: 1,UNICAST,127.0.0.1,4,16,UNSYNCED,0,0,3992170;
474
String Commands
Replacement
inp:[ana:]v|i(<input_list>):param?
inp:[ana:]v|i(<input_list>):range?
inp:bin:get?
inp:bin(<inp_mod_idx>):get?
inp:bin[(<input_list>)]:thres(<threshold>)
inp:bin(<inp_mod_idx>,<group_idx>):def(pf|
<thres>)
inp:bin[(<input_list>)]:thres?
inp:bin(<inp_mod_idx>,<group_idx>):def?
inp:bin[(<input_list>)]:def(<threshold>,<range>)
inp:bin(<inp_mod_idx>,<group_idx>):def(pf|
<thres>)
inp:bin[(<input_list>)]:def(pf)
inp:bin(<inp_mod_idx>,<group_idx>):def(pf|
<thres>)
inp:bin[(<input_list>)]:def?
inp:bin(<inp_mod_idx>,<group_idx>):def?
out:bin[(trans)]:on (<output_list>)
out:bin(<out_mod_idx>):on(<output_list>)
out:bin[(trans)]:off (<output_list>)
out:bin(<out_mod_idx>):off(<output_list>)
out:bin[(trans)]:set (<data>)
out:bin(<out_mod_idx>):set(<data>)
out:cfg?(trans)
out:bin:cfg?
irigb:cfg(<cfg_no>)
sys:time:cfg(<timeConfiguration>)
irigb:cfg?
sys:time:cfg?
irigb:cfg?(<cfg_no>)
sys:time:cfg?(<timeConfiguration>)
irigb:datetime?
sys:time:datetime?
475
OMICRON CMEngine
476
Appendix
Appendix
5.1
Syntax Diagrams
More:
System Commands on page 478
Input Commands: Analog on page 479
Input Commands: General, Binary, Counter on page 480
Output Commands on page 481
Sequencer Commands on page 483
Amplifier Commands on page 484
GPS Commands on page 485
IRIG-B Commands on page 486
477
OMICRON CMEngine
5.1.1
478
System Commands
Appendix
5.1.2
479
OMICRON CMEngine
5.1.3
480
Appendix
5.1.4
Output Commands
481
OMICRON CMEngine
482
Appendix
5.1.5
Sequencer Commands
483
OMICRON CMEngine
5.1.6
484
Amplifier Commands
Appendix
5.1.7
GPS Commands
485
OMICRON CMEngine
5.1.8
486
IRIG-B Commands
Appendix
5.2
487
OMICRON CMEngine
5.3
This information is based on the IEEE C37.118-2005 standard "Synchrophasors for power systems".
Please read the Annex F of this standard to get familiar with the control functions.
Time quality indicator code
Binary
Hex
1111
1011
10s
1010
1s
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
488
Support
Support
When you are working with our products we want to provide you with the greatest possible benefits. If
you need any support, we are here to assist you!
24/7 Technical Support - Get Support
www.omicron.at/support
www.omicronusa.com/support
Offering our customers outstanding support is one of our top priorities. At our technical support hotline,
you can reach well-educated technicians for all of your questions. Around the clock competent and
free of charge.
Make use of our 24/7 international technical support hotline: +43 59495 4444.
Additionally, you can find the OMICRON Service Center or OMICRON Sales Partner closest to you at
www.omicron.at or www.omicronusa.com ? Contact.
Customer Area - Stay Informed
www.omicron.at/customer
www.omicronusa.com/customer
The customer area on our website is an international knowledge exchange platform. Download the
latest software updates for all products and share your own experiences in our user forum.
Browse through the Knowledge Library and find application notes, conference papers, articles about
daily working experiences, user manuals and much more.
OMICRON Academy - Learn More
www.omicron.at/academy
www.omicronusa.com/academy
Learn more about your product in one of the training courses offered by the OMICRON Academy.
OMICRON electronics GmbH, Oberes Ried 1, 6833 Klaus, Austria. +43 59495.
489
OMICRON CMEngine
490
Index
Index
A
Amplifier commands (CMEngine).............. 238
CMEngine
Amplifier commands............................. 238
block transfer commands..................... 409
CB Simulation commands.................... 422
Configuration and status commands.... 394
error codes overview.............................. 79
GPS commands................................... 318
Input commands................................... 269
IRIG-B commands................................ 443
Multimeter commands.......................... 371
NTP commands....................................469
Output commands................................ 147
PTP commands.................................... 463
Sampled Values commands.................226
Scope Mode commands.......................393
Sequencer commands......................... 347
string commands.................................. 119
syntax diagrams................................... 477
System commands............................... 123
time synchronization commands.......... 433
what is CMEngine?................................ 17
B
block transfer commands (CMEngine)...... 409
C
CB Simulation commands (CMEngine)..... 422
E
error codes overview (CMEngine)............... 79
G
GPS commands (CMEngine).................... 318
491
OMICRON CMEngine
M
Multimeter commands (CMEngine)........... 371
N
NTP commands (CMEngine)..................... 469
O
Output commands (CMEngine)................. 147
P
PTP commands (CMEngine)..................... 463
R
Real-time playback functions (CMEngine) 111
S
Sampled Values commands (CMEngine).. 226
492