CMEngine

Download as pdf or txt
Download as pdf or txt
You are on page 1of 202

CMEngine

Programming Interface for


CMC Test Systems

Version 2.2
OMICRON Test Universe

Article Number VESD5008 - Manual Version: CMENG.AE.7


© OMICRON electronics 2008. All rights reserved.
This manual is a publication of OMICRON electronics GmbH.
All rights including translation reserved. Reproduction of any kind, e.g., photocopying, microfilming,
optical character recognition and/or storage in electronic data processing systems, requires the explicit
consent of OMICRON electronics.
Reprinting, wholly or in part, is not permitted.The product information, specifications, and technical data
embodied in this manual represent the technical status at the time of writing and are subject to change
without prior notice.
We have done our best to ensure that the information given in this manual is useful, accurate and
entirely reliable. However, OMICRON electronics does not assume responsibility for any inaccuracies
which may be present.
The user is responsible for every application that makes use of an OMICRON product.

2
CM Engine

Table of Contents

Table of Contents ..............................................................................................................3

1 Preface..........................................................................................................................9
1.1 Which tasks can be performed using the CM Engine?.......................................................9
1.2 Command overview ............................................................................................................9
1.3 Operating systems and compilers ....................................................................................11
1.4 Accessing the CM Engine from your program ..................................................................11
1.5 Typical program sequence................................................................................................11
1.6 CM Engine license administration.....................................................................................12
1.7 Handling special cases .....................................................................................................12
1.7.1 Automatic output switch off ...............................................................................................12
1.7.2 CMC in use was switched OFF and ON again .................................................................13

2 Programming the CM Engine....................................................................................14


2.1 System Overview ..............................................................................................................14
2.1.1 Internal structure of a CMC device ...................................................................................14
2.1.2 Designing a CM Engine application ..................................................................................15
2.1.3 Debugging a CM Engine application.................................................................................16
2.2 Using the analog and binary units.....................................................................................16
2.2.1 Analog outputs ..................................................................................................................16
2.2.1.1 Definition and routing of amplifiers....................................................................................17
2.2.1.2 Amplifier Configurations....................................................................................................19
2.2.1.3 Defining the signal parameters .........................................................................................22
2.2.2 Binary outputs ...................................................................................................................25
2.2.3 Analog inputs ....................................................................................................................26
2.2.4 Binary inputs .....................................................................................................................26
2.3 Using the Input Buffer .......................................................................................................26
2.4 Using the Sequencer ........................................................................................................29
2.4.1 Description of the Sequencer............................................................................................29
2.4.2 Branching within a sequence – the seq:wait() command .................................................30
2.5 Counter inputs...................................................................................................................34
2.6 System control unit ...........................................................................................................36
2.7 The CMC256.....................................................................................................................37
2.7.1 Amplifiers ..........................................................................................................................37
2.7.2 The DC auxiliary output.....................................................................................................38
2.7.3 The AC analog inputs .......................................................................................................39
2.8 VBA functions ...................................................................................................................41

3 Interface Functions....................................................................................................43
3.1 Overview of error codes....................................................................................................43
3.2 Which error codes can be caused by a specific function?................................................47
3.3 Parameter types used in interface functions.....................................................................47
3.4 Interface function reference ..............................................................................................47
3.4.1 AddRegDev.......................................................................................................................47
3.4.2 Associated ........................................................................................................................47
3.4.3 AssociationMode...............................................................................................................48
3.4.4 DevAssociateAppend........................................................................................................48
3.4.5 DevAssociateAppendSpecific ...........................................................................................48
3.4.6 DevAssociationCount........................................................................................................48
3.4.7 DevAssociationInfo ...........................................................................................................48
3.4.8 DevAssosciationRequest ..................................................................................................48
3.4.9 DevAssosiationRequestCancel.........................................................................................49

OMICRON electronics Page 3


CM Engine

3.4.10 DevAssociationTime .........................................................................................................49


3.4.11 DevDisassociate ...............................................................................................................49
3.4.12 DevDisassociateSpecific...................................................................................................49
3.4.13 DeviceAddress..................................................................................................................49
3.4.14 DeviceType .......................................................................................................................49
3.4.15 FriendlyName....................................................................................................................50
3.4.16 GetDevIDbyIPAddress ......................................................................................................50
3.4.17 GetOfflineCfg ....................................................................................................................50
3.4.18 GetOfflineCfg2 ..................................................................................................................50
3.4.19 SetLicInfo ..........................................................................................................................50
3.4.20 ResLock ............................................................................................................................50
3.4.21 ResUnlock.........................................................................................................................51
3.4.22 ResGetList ........................................................................................................................51
3.4.23 LanguageForMessages ....................................................................................................51
3.4.24 ParalellPort........................................................................................................................52
3.4.25 IPAddress .........................................................................................................................52
3.4.26 SerialNumber ....................................................................................................................52
3.4.27 MaxAssociationTime.........................................................................................................52
3.4.28 RegDevCount ...................................................................................................................52
3.4.29 RegDevItemIPAddress .....................................................................................................52
3.4.30 RegDevItemIndex .............................................................................................................52
3.4.31 RemoveRegDev................................................................................................................53
3.4.32 MinReqImgVersion ...........................................................................................................53
3.4.33 RemoveDevice..................................................................................................................53
3.4.34 ImgDevTypePrefix ............................................................................................................53
3.4.35 DevGetList ........................................................................................................................53
3.4.36 DevLock ............................................................................................................................54
3.4.37 DevScanForNew...............................................................................................................54
3.4.38 DevUnlock.........................................................................................................................55
3.4.39 Exec ..................................................................................................................................55
3.4.40 GetStatusText ...................................................................................................................56
3.4.41 LogAppend........................................................................................................................56
3.4.42 LogGetInfo ........................................................................................................................56
3.4.43 LogNew.............................................................................................................................57
3.4.44 LogSetLevel ......................................................................................................................57
3.4.45 LogWrite ...........................................................................................................................57
3.4.46 OutUserApp ......................................................................................................................58
3.4.47 Version..............................................................................................................................58
3.4.48 Functions for Real-time Playback of Transient Signals ....................................................58
3.4.48.1 RealTimeBegin .................................................................................................................61
3.4.48.2 RealTimeEnd ....................................................................................................................62
3.4.48.3 RealTimeWrite ..................................................................................................................62
3.4.48.4 RealTimeStatus ................................................................................................................62
3.4.48.5 RealtimeSetCheckChl.......................................................................................................63

OMICRON electronics Page 4


CM Engine

4 String Commands ......................................................................................................64


4.1 Symbols used in string commands ...................................................................................64
4.2 Syntax rules for string commands ....................................................................................64
4.3 Parameter types used in the string commands ................................................................65
4.4 String command reference ...............................................................................................66
4.4.1 System commands ...........................................................................................................66
4.4.1.1 sys:reset............................................................................................................................66
4.4.1.2 sys:test? [(<filename>)].....................................................................................................67
4.4.1.3 sys:cfg? (type | ser | hard | firm | cal) ................................................................................67
4.4.1.4 sys:status? [ (<bit_number>) ] ..........................................................................................68
4.4.1.5 Organization of the status command register structure: ...................................................69
4.4.1.6 sys:goose:cfg(<filename>)................................................................................................79
4.4.1.7 sys:goose:cfg?(<filename>)..............................................................................................79
4.4.2 Output commands ............................................................................................................80
4.4.2.1 out:[ana:]v (<generator_list>):[sig(<no>):]a (<amplitude> [, step ] ) out:[ana:]i
(<generator_list>):[sig(<no>):]a (<amplitude> [, step ] ) ...................................................81
4.4.2.2 out:[ana:]v (<generator_list>): [sig(<no>):]f (<frequency> [, step ] ) out:[ana:]i
(<generator_list>):[sig(<no>):]f (<frequency> [, step ] ) ....................................................82
4.4.2.3 out:[ana:]v (<generator_list>):[sig(<no>):]t (<period_time>) out:[ana:]i
(<generator_list>):[sig(<no>):]t (<period_time>) ...............................................................82
4.4.2.4 out:[ana:]v (<generator_list>):[sig(<no>):]p (<phase> [, step ] ) out:[ana:]i
(<generator_list>):[sig(<no>):]p (<phase> [, step ] ) .........................................................83
4.4.2.5 out:[ana:]v (<generator_list>):[sig(<no>):]wav (<waveform>, ...) out:[ana:]i
(<generator_list>):[sig(<no>):]wav (<waveform>, ...)........................................................84
4.4.2.6 out:[ana:]v (<generator_list>):[sig(<no>):]wav (sin) out:[ana:]i
(<generator_list>):[sig(<no>):]wav (sin) ............................................................................84
4.4.2.7 out:[ana:]v (<generator_list>):[sig(<no>):]wav (sum,<amplitude_factor1>
,<harmonic2>,<amplitude_factor2>,<phase2>
[,<harmonic3>,<amplitude_factor3>,<phase3>] [, ... ] ) out:[ana:]i
(<generator_list>):[sig(<no>):]wav (sum,<amplitude_factor1>
,<harmonic2>,<amplitude_factor2>,<phase2>
[,<harmonic3>,<amplitude_factor3>,<phase3>] [, ... ] ) ...................................................84
4.4.2.8 out:[ana:]v (<generator_list>):[sig(<no>):]wav (tri [ ,<duty_cycle>] ) out:[ana:]i
(<generator_list>):[sig(<no>):]wav (tri [ ,<duty_cycle>] )...................................................86
4.4.2.9 out:[ana:]v (<generator_list>):[sig(<no>):]wav (square [ ,<duty_cycle>] ) out:[ana:]i
(<generator_list>):[sig(<no>):]wav (square [ ,<duty_cycle>] )...........................................90
4.4.2.10 out:[ana:]v (<generator_list>):[sig(<no>):]wav (user, <user_sig_no> [,single] )
out:[ana:]i (<generator_list>):[sig(<no>):]wav (user, <user_sig_no> [,single] ).................91
4.4.2.11 out:[ana:]v (<generator_list>):[sig(<no>):]wav (dc) out:[ana:]i
(<generator_list>):[sig(<no>):]wav (dc).............................................................................91
4.4.2.12 out:[ana:]v (<generator_list>):[sig(<no>):]wav (exp) out:[ana:]i
(<generator_list>):[sig(<no>):]wav (exp)...........................................................................92
4.4.2.13 out:[ana:]v (<generator_list>):on out:[ana:]i (<generator_list>):on....................................92
4.4.2.14 out:[ana:]v (<generator_list>):off out:[ana:]i (<generator_list>):off ...................................93
4.4.2.15 out:[ana:]v (<generator_list>):clr out:[ana:]i (<generator_list>):clr ....................................93
4.4.2.16 out:[ana:]v (<generator_list>):mix (sig(<no>) | add | mult | off) out:[ana:]i
(<generator_list>):mix (sig(<no>) | add | mult | off)...........................................................94
4.4.2.17 out:[ana:]save ...................................................................................................................95
4.4.2.18 out:[ana:]restore................................................................................................................95
4.4.2.19 out:[ana:]v (<triple_no>):zero(<zero_factor>) out:[ana:]i (<triple_no>):
zero(<zero_factor>) ..........................................................................................................96
4.4.2.20 out:[ana:]on .......................................................................................................................96
4.4.2.21 out:[ana:]off[(zcross[,<off_generator_list>])] .....................................................................96
4.4.2.22 out:[ana:]clr .......................................................................................................................98
4.4.2.23 out:[ana:]step [(load | exec)]..............................................................................................98
4.4.2.24 out:[ana:]pmode (abs | diff[(v|i(<reference_generator>)]) .................................................99
4.4.2.25 out:[ana:]pmode? ............................................................................................................100
4.4.2.26 out:[ana:]resetopt ............................................................................................................101
4.4.2.27 out:[ana:]buf:sam[(lock | free)] ........................................................................................102
4.4.2.28 out:[ana:]buf:get? (v | i (<triple>:<gen>) [:sig (<sig_no>))...............................................103
4.4.2.29 out:[ana:]sync(ext, +|-) ....................................................................................................104

OMICRON electronics Page 5


CM Engine

4.4.2.30 out:[ana:]sync(off) ...........................................................................................................104


4.4.2.31 out:[ana:]user:... ..............................................................................................................104
4.4.2.32 out:[ana:]user:alloc? (<no_of_samples>) .......................................................................105
4.4.2.33 out:[ana:]user:app (<user_sig_no>, <user_data>)..........................................................105
4.4.2.34 out:[ana:]user:free [(<user_sig_no>)]..............................................................................106
4.4.2.35 out:[ana:]user:status? [(<user_sig_no>)] ........................................................................107
4.4.2.36 out:[ana:]sv:cfg(<#blocks>, <nom_freq>, <fact_i>, <fact_v>, <adapter>,
<dest_mac_adr>, <eth_type>, <app_id>, <vlan_tag>, <quality>, <svId_name>) ...........107
4.4.2.37 out:[ana:]sv:cfg?..............................................................................................................108
4.4.2.38 out:[ana:]sv:off ................................................................................................................109
4.4.2.39 out:bin:cfg? .....................................................................................................................109
4.4.2.40 out:bin(<out_module_idx>):cfg? .....................................................................................109
4.4.2.41 out:bin(<out_module_idx>:<group_idx>):cfg? ................................................................110
4.4.2.42 out:bin(<out_module_idx>):on(<output_list>) .................................................................112
4.4.2.43 out:bin(<out_module_idx>):off (<output_list>) ................................................................112
4.4.2.44 out:bin(<out_module_idx>):set (<data>).........................................................................113
4.4.2.45 out:bin(<out_module_idx>):get? .....................................................................................113
4.4.2.46 out:bin(<out_module_idx>:<group_idx>):name(<name>) ..............................................113
4.4.2.47 out:bin(<out_module_idx>:<group_idx>):name? ............................................................114
4.4.2.48 out:aux:cfg? ....................................................................................................................114
4.4.2.49 out:aux(<idx>):cfg? .........................................................................................................114
4.4.2.50 out:aux(<idx>):on | off .....................................................................................................114
4.4.2.51 out:aux(<idx>):a(<v_dc>)................................................................................................115
4.4.2.52 out:aux(<idx>):a? ............................................................................................................115
4.4.2.53 out:aux(<idx>):def(<pwr_on_v>).....................................................................................116
4.4.2.54 out:aux(<idx>):def? .........................................................................................................116
4.4.2.55 out:cfg? ...........................................................................................................................116
4.4.3 Amplifier commands .......................................................................................................117
4.4.3.1 amp:cfg?[(<cfg_no>)]......................................................................................................117
4.4.3.2 amp:cfg?(<amp_id>,firm)................................................................................................121
4.4.3.3 amp:def (<amp_no>, ...) .................................................................................................121
4.4.3.4 amp:def (<amp_no>, int | ext , v | i, <amplification>, <max_out>, <f_min>,
<f_max>, <t_corr1>, <t_corr2>, <t_corr3>) ...................................................................121
4.4.3.5 amp:def (<amp_no>, int) amp:def (<amp_no>, ext, <id_list>) .......................................123
4.4.3.6 amp:def ([<amp_no>,] clr | clrnooff)................................................................................124
4.4.3.7 amp:def(off) ....................................................................................................................124
4.4.3.8 amp:def? [(<amp_no>)] ..................................................................................................124
4.4.3.9 amp:scan? ......................................................................................................................125
4.4.3.10 amp:param? (<id> [,cal]).................................................................................................126
4.4.3.11 amp:route(clr | clrnooff)...................................................................................................126
4.4.3.12 amp:route (v | i (<triple_no>), <amp_no> | clr | clrnooff).................................................127
4.4.3.13 amp:route? ( v | i (<triple_no>)).......................................................................................128
4.4.3.14 amp:range(v|i(<triple_no>), <range>) .............................................................................128
4.4.3.15 amp:range?(v|i(<triple_no>))...........................................................................................129
4.4.3.16 amp:ctrl (i (<triple_no>), <v_ctrl>)...................................................................................130
4.4.3.17 amp:ctrl? (v | i (<triple_no>)) ...........................................................................................130
4.4.3.18 amp:reset(<amp_id>) .....................................................................................................131
4.4.4 Input commands .............................................................................................................131
4.4.4.1 inp:[ana:]v(<input_list>):get?[(all)] inp:[ana:]i(<input_list>):get?[(all)] ............................131
4.4.4.2 inp:[ana:]v|i(<input_list>):range?.....................................................................................132
4.4.4.3 inp:[ana:]v|i(<input_list>):range(<range>) .......................................................................132
4.4.4.4 inp:bin:cfg?......................................................................................................................133
4.4.4.5 inp:bin(<inp_module_idx>):cfg?......................................................................................133
4.4.4.6 inp:bin(<inp_module_idx>:<group_idx>):cfg?.................................................................134
4.4.4.7 inp:bin(<inp_module_idx>):get?......................................................................................136
4.4.4.8 inp:bin(<inp_module_idx>):diff?......................................................................................136
4.4.4.9 inp:bin[(<inp_module_idx>)]:diff(reset) ...........................................................................137
4.4.4.10 inp:bin(<inp_module_idx>:<group_idx>):debounce(<deb_time>) ..................................137
4.4.4.11 inp:bin(<inp_module_idx>:<group_idx>):debounce?......................................................138
4.4.4.12 inp:bin(<inp_module_idx>:<group_idx>):deglitch(<degl_time>) .....................................138
4.4.4.13 inp:bin(<inp_module_idx>:<group_idx>):deglitch? .........................................................139

OMICRON electronics Page 6


CM Engine

4.4.4.14 inp:bin(<inp_module_idx>:<group_idx>[:<inp_idx>]):def(pf | <threshold>).....................139


4.4.4.15 inp:bin(<inp_module_idx>:<group_idx>[:<inp_idx>]):def? ..............................................140
4.4.4.16 inp:bin(<inp_module_idx>:<group_idx>):name(<name>) ...............................................140
4.4.4.17 inp:bin(<inp_module_idx>:<group_idx>):name?.............................................................140
4.4.4.18 inp:ana(<input_list>):def(v,<range>) inp:ana(<input_list>):def(i,<range>,
<CTRatio>) .....................................................................................................................141
4.4.4.19 inp:ana(<input_list>):def? ...............................................................................................142
4.4.4.20 inp:ana(<input_list>):range? ...........................................................................................142
4.4.4.21 inp:buf:sam (<source>, <index>) inp:buf:sam (bin, on | off | bin)....................................143
4.4.4.22 inp:buf:sam(ext) ..............................................................................................................144
4.4.4.23 inp:buf:get? .....................................................................................................................144
4.4.4.24 inp:buf:get?(<no_of_entries>).........................................................................................146
4.4.4.25 inp:buf:clr ........................................................................................................................146
4.4.4.26 inp:count:on ....................................................................................................................147
4.4.4.27 inp:count:off ....................................................................................................................147
4.4.4.28 inp:count:clr.....................................................................................................................147
4.4.4.29 inp:count:set(bcount | ecount(<counter>), <count>, +|-) .................................................147
4.4.4.30 inp:count:join(bcount | ecount(<master_counter>),
bcount | ecount(<slave_counter>)) .................................................................................148
4.4.4.31 inp:count:get?(bcount | ecount(<counter>)) ....................................................................148
4.4.4.32 inp:ana:cfg(<srate>,<avrg>)............................................................................................148
4.4.4.33 inp:cfg?[(ecount)] ............................................................................................................149
4.4.4.34 inp:ana:cfg?(srate|avrg|firm|hard) ...................................................................................150
4.4.5 GPS commands..............................................................................................................150
4.4.5.1 gps:status?......................................................................................................................150
4.4.5.2 gps:reset .........................................................................................................................151
4.4.5.3 gps:sigma?......................................................................................................................152
4.4.5.4 gps:pos? .........................................................................................................................152
4.4.5.5 gps:pos(<latitude>, <longitude>, <height>).....................................................................152
4.4.5.6 gps:def? ..........................................................................................................................153
4.4.5.7 gps:time:timemode? .......................................................................................................153
4.4.5.8 gps:time:utc?...................................................................................................................154
4.4.5.9 gps:time:sync(<ch>,<rate>,<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>) ..............................154
4.4.5.10 gps:time:sync?(<ch>)......................................................................................................155
4.4.5.11 gps:time:datetime(<yyyy>, <mm>, <dd>, <hh>, <mm>, <ss>) .......................................155
4.4.5.12 gps:time:datetime?..........................................................................................................155
4.4.5.13 gps:setup:mode? ............................................................................................................156
4.4.5.14 gps:setup:mode(<accuracy_mode>) ..............................................................................156
4.4.5.15 gps:setup:gmt? ...............................................................................................................157
4.4.5.16 gps:setup:gmt(<hh>, <mm>) ..........................................................................................157
4.4.5.17 gps:setup:cfg?(type | ser | firm).......................................................................................158
4.4.5.18 gps:setup:cfg?(addr) .......................................................................................................158
4.4.5.19 gps:setup:pulse(<LED ch>, <sync type>, <edge type0>, <edge type1>) .......................158
4.4.5.20 gps:setup:pulse?.............................................................................................................159
4.4.5.21 gps:setup:cable?.............................................................................................................160
4.4.5.22 gps:setup:cable(<delay>)................................................................................................160
4.4.5.23 gps:setup:save................................................................................................................160
4.4.6 IRIG-B commands ..........................................................................................................161
4.4.6.1 irigb:cfg(<cfg_no>) ..........................................................................................................161
4.4.6.2 irigb:cfg? .........................................................................................................................162
4.4.6.3 irigb:cfg?(<cfg_no>) ........................................................................................................162
4.4.6.4 irigb:def? .........................................................................................................................163
4.4.6.5 irigb:datetime? ................................................................................................................163
4.4.6.6 irigb:enc:cfg(<yyyy>, <mm>, <dd>, <hh>, <mm>, <ss>, <CF>, <parity_mode>,
<mod>, <coded_expr>, <auto_inc>, <write_mode>) irigb:enc:cfg(<yyyy>,
<doy>, <hh>, <mm>, <ss>, <CF>, <parity_mode>, <mod>, <coded_expr>,
<auto_inc>, <write_mode>) ............................................................................................164
4.4.6.7 irigb:enc:cfg?...................................................................................................................165
4.4.6.8 irigb:dec:cfg(<parity_mode>, <mod>, <coded_expr>, <parity_err_status>,
<write_mode>) ................................................................................................................166
4.4.6.9 irigb:dec:cfg?...................................................................................................................167

OMICRON electronics Page 7


CM Engine

4.4.6.10 irigb:dec:scan?................................................................................................................167
4.4.6.11 irigb:dec:reset .................................................................................................................168
4.4.6.12 irigb:dec:sync(<yyyy>, <mm>, <dd>, <hh>, <mm>, <ss>, <rate>, < write_mode>)
irigb:dec:sync(<yyyy>, <doy>, <hh>, <mm>, <ss>, <rate>, < write_mode>) ..................168
4.4.6.13 irigb:dec:sync? ................................................................................................................169
4.4.7 Sequencer commands....................................................................................................169
4.4.7.1 seq:begin ........................................................................................................................170
4.4.7.2 seq:end ...........................................................................................................................170
4.4.7.3 seq:clr .............................................................................................................................171
4.4.7.4 seq:exec..........................................................................................................................172
4.4.7.5 seq:set (loop | count(1) | count(2) | timer | timeout, <value>)..........................................172
4.4.7.6 seq:add (count(1) | count(2), <rel_steps>)......................................................................172
4.4.7.7 seq:status? (step | loop | count(1) | count(2) | mem) ......................................................172
4.4.7.8 seq:stop ..........................................................................................................................173
4.4.7.9 seq:wait ( [<trigger_condition>, <trigger_jump_distance>,] [<timeout_condition>,
<timeout_jump_distance>] ) ...........................................................................................173
4.4.8 Sequencer hints ..............................................................................................................177
4.4.9 Sequencer examples ......................................................................................................177
4.4.10 Measurement commands ...............................................................................................179
4.4.10.1 inp:avail?(scope|multimeter) ...........................................................................................179
4.4.10.2 inp:mode(scope|multimeter) ...........................................................................................180
4.4.11 Multimeter commands ....................................................................................................180
4.4.11.1 inp:ana(<input_list>):rms?(<itime>) ................................................................................181
4.4.11.2 inp:ana(<input_list>):peak?(<rtime>) ..............................................................................182
4.4.11.3 inp:ana(<input_list>):phase?(<itime>) ............................................................................183
4.4.11.4 inp:ana(<input_list>):freq?(<#periods>,<start level>) .....................................................184
4.4.11.5 inp:ana(<input_list>):power?(<itime>) ............................................................................185
4.4.11.6 inp:ana(<input_list>):sum?(<itime>) ...............................................................................186
4.4.11.7 inp:ana(<input_list>):diff?(<itime>) .................................................................................187
4.4.11.8 inp:ana:sync ....................................................................................................................189
4.4.11.9 inp:ana:get?(<command handle>) ..................................................................................189
4.4.11.10 inp:ana:clr(<command handle>) inp:ana:clr(all)..............................................................190
4.4.11.11 inp:ana:dc(on|off) ............................................................................................................191
4.4.11.12 inp:ana:cal(ac|dc)............................................................................................................191
4.4.12 Obsolete commands.......................................................................................................191

5 Appendix ..................................................................................................................193
5.1 Syntax Diagrams.............................................................................................................193
5.1.1 System Commands ........................................................................................................193
5.1.2 Input Commands: Analog ...............................................................................................193
5.1.3 Input Commands: General, Binary, Counter...................................................................194
5.1.4 Output Commands..........................................................................................................195
5.1.5 Sequencer Commands ...................................................................................................196
5.1.6 Amplifier Commands ......................................................................................................196
5.1.7 GPS Commands .............................................................................................................197
5.1.8 IRIG-B Commands .........................................................................................................197
5.2 Block diagram of Generators/Outputs of the CMC 56 ....................................................198
5.3 IEEE C37.118 control function details ............................................................................199
5.4 Contact Information / Technical Support ........................................................................200

Command index.............................................................................................................201

OMICRON electronics Page 8


CM Engine

1 Preface
The CM Engine is a program library that a software developer can use to conveniently control and program
one or more CMC test systems.

The software developer is able to create a program for his special purposes in any of the common
programming languages like "C/C++", Visual Basic, VBA (Visual Basic for Applications), C# etc. In this
application program, he can use the CM Engine library to communicate with one or more CMC test systems
connected to the PC or to the notebook computer.

In other words, the CM Engine furnishes an interface with functions to the application program that can be
used to control one or more CMC devices. With a particular interface function, the Exec() function, the
application program can send string commands to the CMCs, which are then analyzed and executed. There
are string commands to set a CMC to a specific state, e.g. to output a certain voltage, and there are such
commands to get measurement data or other information from a CMC. This kind of command returns
detailed string answers containing the information desired by the programmer. The returned information may
be analyzed and processed further by the application program.

Convention: For the sake of readability, this document uses the abbreviation CMC256 to refer to a
CMC256, CMC256plus or CMC356 test set.

1.1 Which tasks can be performed using the CM Engine?


With the CM Engine 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 CMC’s memory and put them
out.
• Emit additive or multiplicative superposition of predefined and/or user-defined waveforms.
• Measure signals fed into the analog and the binary inputs.
• Set binary outputs.
• Execute fast real-time measurements on the CMC's analog and binary inputs.
• Store command sequences in a CMC for real-time command execution and control these sequences.
• Emit signals through external voltage or current amplifiers (e.g. CMA 56).

1.2 Command overview


There are two types of CM Engine commands:

• The functions of CM Engine's programming interface.


These functions can be imported from the CM Engine library into your program to control the CM
Engine itself. The definition of these functions depends on the programming language and the compiler
or the programming system you use.

• The string commands to control CMC devices connected to the PC.


They make up the essential command set of the CM Engine and are sent to CMCs via the CM Engine
using the Exec() interface function of CM Engine.

Overview of the functions of the CM Engine programming interface:

OMICRON electronics Page 9


CM Engine

CMC Device Access functions


DevScanForNew Scan ports for connected CMCs.
DevLock Lock CMCs to an application program.
DevUnlock Unlock CMCs.
DevGetList Get a list of all connected CMCs.

Execute function
Exec Send commands to one or more CMCs connected to the PC.

Error handling functions


GetError Get numerical error information.
GetErrorText Get textual error information.
GetStatusText Get textual status information from a 32-bit status register.

Log functions
LogNew Open a new log file.
LogAppend Append to a log file.
LogSetLevel Set logging level.
LogWrite Write text to a log file.
LogGetInfo Get logging level and log file name.

Miscellaneous functions
Version Get the CM Engine version number.
OutUserApp Appends samples to a specified user signal.

CM Engine's string commands are organized in groups and every group has a tree structure. So all logically
related string commands form a tree; the command diagrams in the appendix supply an overview of these
command trees. You usually assemble a string command walking along the command tree from its root to
the end of a branch, then you use the interface function Exec() to send the string to a CMC via CM Engine.

System commands "sys:..." Use the system commands to change the system settings of a CMC,
to ask for the CMC’s system status or to get some information about
the CMC’s hardware.

Output commands "out:..." The output commands control everything related to the output of
analog or binary signals. You may also select predefined waveforms or
define your own ones.

Input commands "inp:..." The input commands control everything related to the measurement of
analog or binary signals on the CMC’s inputs. In addition, some
special commands perform real-time measurements.

Amplifier commands "amp:..." The relations between your defined signals and the outputs used for
these signals, i.e., which signal is assigned to which output, are set by
default. Using the amplifier commands, you can change these default
settings according to your needs. Furthermore, you may inform the CM
Engine about an external amplifier's parameters and then use this
external amplifier for current or voltage output.

GPS commands "gps:... " The GPS commands let you configure all aspects of a connect GPS
device, e.g., retrieving time and position, set triggers, etc.
Sequencer commands "seq:..." The sequencer commands control everything related to sequences,
i.e. CMC commands executed in real-time mode. They enable you to
build sequences out of commands (signal output etc.) that you can
load into a CMC and then execute them. That is the way you can start
and control real-time executions of your commands.

OMICRON electronics Page 10


CM Engine

1.3 Operating systems and compilers


The CM Engine uses as well as Windows NT 4.0 and Windows 2000. It 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 servers is done by the installation program. You have to register it at
its new location if you move the OLE Automation server. To re-register the server, start it with the command
line parameter “/register”.

Please tell us if you make your own adaptations for other compiler systems or applications so that we can
include them in future versions of the CM Engine.

For OMICRON technical support, please refer to the appendix on page Error! Bookmark not defined. of this
manual.

1.4 Accessing the CM Engine from your program


Before your application program can use the CM Engine, you have to add to your project a reference to the
OMICRON CM Engine 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 CM Engine anymore, it has to
release the object. This releases all resources the CM Engine reserved for your application program.

1.5 Typical program sequence


A program that controls CMCs via the CM Engine must use at least the following of the CM Engine's interface
functions in logical order. Thus every program that controls CMCs using the CM Engine consists of at least
the following typical command structure.

Example in VBA:
Sub Main()
Dim engine As cmEngine.cmEngine ' Declare engine as object used for OLE Automation
Dim result As String ' Variable for the result string returned by CMExec
On Error GoTo EngineError
' Create OLE Automation object
Set engine = New cmEngine.cmEngine
engine.DevScanForNew (False)
Dim deviceList As String
Dim devId As Integer
deviceList = engine.DevGetList(lsAllAssociatedAny)
If ExtractParameter(3, deviceList) = "0" And ExtractParameter(4, deviceList) = "0" Then 'we
have a net-1 device
devId = Val(ExtractParameter(1, deviceList))
If Not engine.Associated(devId) Then
engine.DevAssociateAppend (devId)
End If
ElseIf deviceList <> "" Then
devId = Val(ExtractParameter(1, deviceList))
Else
GoTo ApplicationEnd
End If
engine.DevLock (devId)
'The CMC can now be used by this application program
result = engine.Exec(devId, "out:ana:on") ' Execute commands on this CMC

engine.DevUnlock (devId) ' Unlock the locked CMC


GoTo ApplicationEnd
EngineError:
MsgBox Err.Description
Err.Clear

OMICRON electronics Page 11


CM Engine

ApplicationEnd:
Set engine = Nothing 'Release the CMEngine
End Sub
Please note:
This script searches for available CMCs and turns the output on. It also searches for net-1 device, so be
careful that there is no net-1 device in your local network before you run this script.

For more information concerning CM Engine programming see chapter 2.

1.6 CM Engine license administration


A CM Engine is licensed to one or more of your CMC devices. Thus your CM Engine can only control the
CMC devices that it is licensed to.

The license number(s) are kept in a license file "OMICRON.LIC". CM Engine needs a specific license number
in this file for every CMC. This license file uses the same syntax as Windows INI files. Each device has its
own section with keys for every application/component. The section name is built from the serial number of
the CMC and the device type (CMC 56, CMC151, CMC156). The name of the key is CMENG for the CM Engine.
The following is an example for the CMC 56 with the serial number DA345D:

; 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.

1.7 Handling special cases


This section explains how some special cases in the interaction between the CM Engine and CMC devices
must be handled by a programmer. If you read this manual for the first time, you may skip this section.

1.7.1 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 CM Engine and CMC is interrupted for more than two seconds
(communication cable disconnected etc.).
b) If there is an overtemperature on one of the built-in power amplifiers.
c) If there is an external infeed (CMC151, CMC156 and e only)

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) In the primary status register
- the bit ST_BIT_COMM (Bit 0),
- the bit ST_BIT_CMC_INTL (Bit 1)
- or both
are set.
case b) In the primary status register
- the bit ST_BIT_OVERTEMP_V (Bit 4),
- the bit ST_BIT_OVERTEMP_I (Bit 5)

OMICRON electronics Page 12


CM Engine

or both
are set.
case c) In the primary status register
- the bit ST_BIT_CMC_INTL (Bit 1)
is set.

Reactivate a CMC with outputs that are already switched OFF (switch outputs ON again) by the following
calls to CM Engine commands:
case a) Get the secondary status registers 0 and 1 using Exec(…"sys:status?(0)"…) and
Exec(…"sys:status?(1)"…) until both registers contain a zero (no bits set any more).
Furthermore call GetError() until zero (= CMERR_OK) is returned.
case b) Get the secondary status registers 4 and 5 using Exec(…"sys:status?(4)"…) and
Exec(…"sys:status?(5)"…) until both registers contain a zero (no bits set any more).
Furthermore call GetError() until zero (= CMERR_OK) is returned.
case c) Remove the cause for the external infeed.
Get the secondary status register 1 using Exec(…"sys:status?(1)"…) until the register
contains a zero (no bits set any more).
Furthermore call GetError() until zero (= CMERR_OK) is returned.

For a sample implementation, refer to the EasyDiff sample program provided with CM Engine.

1.7.2 CMC in use was switched OFF and ON again


After a new and still unknown CMC is connected to a PC with the CM Engine running, you usually will register
and initialize the unknown device by the command DevScanForNew().
The same procedure is necessary if an already known CMC is switched OFF and then ON again. In this
case, the command DevScanForNew() will recognize that this CMC was previously connected and will
assign the previous device ID number to this CMC again.
You should handle the case of a CMC that is known to the CM Engine, but was switched OFF and then ON
again (cable is still connected to the same printer port of the PC):
If there is a communication error after you have sent a string command to CM Engine (function Exec()
returns FALSE and then GetError() returns CMERR_COMM), you should assume that this is the case of a
CMC in use that was switched OFF and then ON again.
Try to reactivate this CMC with the following procedure:
Execute the command Exec("sys:status?") and analyze the register bits. Then get the related
secondary status register for every bit set. Get the same secondary status registers again and again until they
all contain a zero. Furthermore call GetError() repeatedly until zero (= CMERR_OK) is returned. Then a
reset and the re-initialization of the CMC follows. The CMC now gets the same ID number as it had before
but is in the power-on state.

OMICRON electronics Page 13


CM Engine

2 Programming the CM Engine


This section describes how to program the OMICRON test devices by means of the CM Engine programming
interface. It is not intended to describe in detail the CM Engine commands, their syntax or usage, but to help
the programmer in becoming familiar with the CM Engine way of programming. It should serve as an
introduction and companion to the CM Engine 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 CM Engine programming interface allows the use of all the capabilities of the CMC test devices. This
programming interface is implemented in different forms for different programming environments, but in all
cases it provides a set of interface control functions plus a gateway to communicate with the CMC device.
This communication takes place as an exchange of strings, where the system sends a command in string
format and gets back an answer, also in string format. For commands that require no answer, an empty
string is returned. To simplify parsing of the answer strings, the response for a given command has a fixed
format, although this format varies across commands.

To use CM Engine programming from within a given application, it will first be necessary to have the CM
Engine interface available. This can be done either linking statically to the CM Engine library, or loading the
CM Engine dynamic link library at run time, according to the design of the application and to the capabilities
of the programming environment and the operating system. Afterwards, the programmer will use the CM
Engine interface functions to scan the communication ports for connected CMCs and lock those that he
intends to use.

Once the CMCs have been successfully locked, the programmer will send the appropriate commands to
perform the desired operations, and to get back the desired information from the CMC device. Before
finishing, the application must unlock the locked CMCs and release the CM Engine interface.

The easiest way to abstract oneself from these details is to use the “Batcher” application, delivered as a
sample with the CM Engine programming environment. This small application provides in effect a command
line interface to the CMC device. It will automatically load the CM Engine and lock any CMC devices found.
Afterwards, it will take the user input as a command to the CMC, and will display the answer string, if any. In
this way it is possible to concentrate on the control of the CMC. In all the examples in this document it will be
assumed that the CMC is already locked, except where the scanning and locking functions are specifically
discussed.

In normal programming, the application will generate the strings by whatever means are adequate, and will
then parse the answer string to get back the necessary information. This information will in turn enable the
programmer to react to the events going on in the test.

The Exec function is the gateway by which all the strings are sent to the CMC. It is Boolean, returning “true” if
the execution of the command in the CMC device was successfully performed. A return value of “false”
means that the command could not be performed; the results of the command are returned in the return
string, and the possible system errors (overloads, hardware problems, etc.) are found in the status registers.

The PC-CMC protocol is designed as a master-slave communication type. The CMC will never initiate
communication, all data must be extracted by polling.

2.1 System Overview

2.1.1 Internal structure of a CMC device


From the CM Engine programmer’s point of view, a standard CMC device consists of the following parts:

OMICRON electronics Page 14


CM Engine

1. Analog outputs
• A set of signal generators grouped in triples (4 triples = 12 generators in the CMC 156)
• A routing and scaling layer
• A set of amplifiers (voltage or current). These amplifiers can be external or internal.
2. Binary outputs
• Relay outputs (dry contacts)
• Open-collector transistor outputs
3. Analog inputs
• DC-measuring inputs for voltage and for current
4. Binary inputs
• Binary inputs configurable as dry-contact or voltage sensing with programmable thresholds.
5. Event buffer
• The event buffer, or input buffer (both terms will be used in this document), stores all the
relevant events in the system, with a high precision time-tag for each event.
6. Sequencer
• The sequencer allows internal storage of sequences of commands, which are later executed
internally.
7. Supervisory section
• Self-test and system status, system information.

While the configuration of other CMC devices may be more complex, the above elements are found in all of
them and are amply sufficient for the purpose of this document.

The first four parts are used to output analog and binary signals, and to read back analog and binary
information. The event buffer and the sequencer allow the use of the high-precision system timer to control
the input and output sections.

2.1.2 Designing a CM Engine 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 2.2.3. 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 CM Engine programming
interface:

1 The CMC timer is not used:

In this case, the commands to the outputs are given on-line, without the use of the Sequencer, and the state
of the binary and analog inputs are read by polling. This is the simplest way of programming with the CM
Engine, where all the control structures are provided by the language used.
This method cannot provide accurate timing, and is therefore only appropriate for applications where
measurement of operating time or accuracy in the timing of the outputs is not required. For example, to apply
a given voltage and current and check that the device under test closes a contact, as long as the time of
operation is not interesting.

2 Only the Input Buffer is used:

OMICRON electronics Page 15


CM Engine

Here the outputs are still controlled on-line, but the state of the inputs is analyzed by processing the entries in
the event buffer.

This method provides accurate timing of the detected events, but it cannot provide accurate control of the
outputs. It is quite useful for low-complexity applications, where the controlling program can be fully dedicated
to the handling of the CMC. For advanced programs, it has the inconvenience that it shifts the responsibility
for controlling the CMC output to the PC application, and so it requires more complex task handling on the
side of the program.

Both the Sequencer and the Input Buffer are used:

The application downloads a Sequence to the CMC and starts execution. When the Sequence is finished, the
program analyzes the contents of the Input buffer to find out what happened while the Sequence was
running. A complex application may consist of several sequences, which are programmed, executed,
analyzed and then deleted to make room for the next one.

This method is required whenever the state of the outputs must be tightly controlled. For instance, if the
output values must be ramped, this method is the only one that can ensure a precise step time and a linear
ramp.

While the Sequencer can be used without the input buffer, it is very seldom done, since it is not common that
applications requiring a high degree of precision in the control of the outputs do not require the same
precision when it comes to the inputs. Additionally, it is practically impossible to extract information about or
influence the running of the sequence from the outside, as we’ll see when the Sequencer is discussed in
more detail. The Sequencer and the Event Buffer have been designed to work together, and in this way the
full potential of the CMC device can be unleashed.

2.1.3 Debugging a CM Engine application


It is not always easy to determine where and why a CM Engine program is failing to perform as expected.
While the error information provided by the CM Engine environment is complete and detailed, the fact that the
CM Engine instructions have usually to be built before being sent to the CMC, and the building blocks do not
have concrete values until runtime, makes the relationship between the error detected anD the source code
the user is creating something that is not always evident.

The best solution is to create a log file while the development process lasts. To achieve this, we would use
the following commands at the beginning of the code:

LogNew(HEngine, "c:\develop.log")
LogSetLevel(HEngine, 1)

The file name can of course be any valid file name in the host operating system. Such a file will register the
CM Engine commands as were actually received, and the CM Engine’s evaluation of them. This level is
usually more than enough to detect wrongly built commands and out-of-range command arguments. If the
problem is still not clear, this log file or even better, one created with log level 2 will be the best information to
send when you request support from OMICRON.

2.2 Using the analog and binary units


This section describes the handling of the CMC inputs and outputs. Of these, the analog outputs are perhaps
the most powerful, and more space and detail will be dedicated to them.

2.2.1 Analog outputs


As we advanced in section 2.1.1, 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.

OMICRON electronics Page 16


CM Engine

The signal generators are grouped in triples; they perform all the required calculations to produce an analog
voltage signal of the desired characteristics. This signal is emitted between +7.071 Vpeak and –7.071 Vpeak
(±10Vpeak on a CMC256 or newer test set); in the case of a sine wave, this allows for a maximum rms value
of 5V (7.071Vrms on a CMC256 or newer test set). The signal can then be routed to an amplifier, either
external or internal. Only triples can be routed to amplifiers, the routing of individual signals is not possible.
One specialty to note here is that a triple does not necessarily always consist of 3 generators. It rather is a
logical group of generators belonging together (in a CMC151 the triples only contain one generator and the
fourth internal voltage of a CMC256 is also considered a triple).

Before an amplifier can be used, it has to be defined. The system needs to know the amplifier’s limits, time
delays for each channel and amplification factor, so all the necessary scaling calculations can be carried out.
The CM Engine is later programmed in absolute Amps or Volts at the amplifier’s exit, so the programs are
totally portable across hardware as long as the amplifier’s parameters are redefined should the amplifier be
changed.

After definition, the signal path from the signal generators to the physical magnitudes is established. One
additional step is necessary: to allow the CM Engine to address the amplifiers, they must be routed to one of
the logical triples. These triples are i(1), i(2)…. for current signals and v(1), v(2)…… for voltage signals. All
the CM Engine’s commands use the logical triples to set signal parameters. Additionally, it is also possible to
route a triple to a configuration. A configuration is a virtual amplifier, which can involve one or more outputs in
one or more physical amplifiers. The CM Engine will handle all the necessary calculations to make these
outputs behave as a single amplifier. For instance, such a configuration allows using two current outputs of
the CMC connected in series as a single-phase amplifier with double the compliance voltage. The CM Engine
distributes the current between both outputs and takes care of the phase adjustments so the result is as
desired – the user deals simply with a logical amplifier.

All signals in a triple have in common:


1. Being voltage or current signals
2. Being assigned to the same amplifier

All the rest: waveform, frequency, amplitude, phase, etc. can be defined independently for each signal.

2.2.1.1 Definition and routing of amplifiers

As we said in the previous section, before a signal triple can be used it must be routed to a configuration, or
to an amplifier, which must in turn have been properly defined before. This section deals with amplifier
definition, routing to configurations will be described later.

The CM Engine distinguishes between internal and external amplifiers, and between intelligent and standard
amplifiers. An intelligent amplifier is one that can provide its own definition data to the CMC unit; at this
moment, only OMICRON amplifiers are intelligent. Any other amplifiers must be defined by the user before
they can be used.

For each amplifier that is defined, the CMC requires the following information:

1. Voltage or current amplifier


2. 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.
3. 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
CMC256, 7.071Vrms for CMC256 or newer test sets). CM Engine will not allow giving values
higher than the maximum value to any signal routed to the amplifier.
4. 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.
5. Propagation delays for each of the possible phases, in seconds. The CM Engine will use this
information to shift waves so differences between channels are compensated and the phases of
the signals are correct.

OMICRON electronics Page 17


CM Engine

2.2.1.1.1 Handling of internal amplifiers


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 CMC156, this command would return this
string: 1,4,1/3/i,2/3/i,3/3/e,4/3/e;

This tells us that the device has 4 binary relay outputs, amplifiers 1 and 2 are 3-phase and internal, and
amplifiers 3 and 4 are equally 3-phase and external.

Afterwards, we ask how many amplifiers are defined, using the command amp:def? and getting the
following answer: 1,1,2;

We see that amplifiers 1 and 2 are defined; we can then request their definition data, as follows:

amp:def?
1,1,2;
amp:def?(1)
Result : 1,int,v,2.500000E+001,1.250000E+002,0.000000E+000,1.000000E+003,0.000000E+000,
0.000000E+000,0.000000E+000,CMC156,BC284H;
amp:def?(2)
Result : 1,int,i,-2.500000E+000,1.250000E+001,0.000000E+000,1.000000E+003,0.000000E+000,
0.000000E+000,0.000000E+000,CMC156,BB270T;

The internal amplifiers of the CMC156 are routed and defined by the CM Engine upon start-up; usually there
is no need to redefine them, but it is possible to do so if required. Let’s analyze one of the strings, for instance
amplifier 1:

int This amplifier is internal


v Voltage amplifier
- The amplifier is not capable of grouping
2.500000E+001 Amplification factor: 25 V/V applied to the control signal of 5Vrms
1.250000E+002 Maximum output value: 125 V
0.000000E+000 Frequency range: the amplifier is capable of outputting DC voltages, and its maximum
1.000000E+003 frequency is 1 kHz
0.000000E+000 Channel delays
0.000000E+000
0.000000E+000
CMC156 Device type
BC284H Serial number of the amplifier

2.2.1.1.2 Handling of external amplifiers


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.

We’ll look first at the definition of an external amplifier using the CMA156 as example. This amplifier, as it is
known, contains two current triples that can be used independently or grouped to create a single triple with
double the output current as each one of the individual triples. When connected to a CMC device, we must
use first the amp:scan? command to obtain the list of external amplifiers connected to the CM Exif board;
afterwards, we’ll use the amp:param? command for each of the IDs returned:

amp:scan?
Result : 1,1,2;
amp:param?(1)
Result : 1,ext,i,A,5.000000E+000,2.500000E+001,0.000000E+000,1.000000E+003,
0.000000E+000,0.000000E+000,0.000000E+000,CMA156,DL373C;
amp:param?(2)
Result : 1,ext,i,B,5.000000E+000,2.500000E+001,0.000000E+000,1.000000E+003,
0.000000E+000,0.000000E+000,0.000000E+000,CMA156,DL373C;

As we see, external amplifier 1 is triple A of the CMA156, and amplifier 2 is triple B.

OMICRON electronics Page 18


CM Engine

These parameters are read directly from the amplifiers by the amp:param? command. Before they are
available for use, we must define them; in the case of the CMA156, we can choose whether we want to use
the triples independently or coupled. Let’s do it both ways:

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)

We have assigned the two amplifiers available for external use to the triples in the CMA156, and we have
obtained two totally independent current triples, each capable of outputting 25A as the definition command
reports to us. After assignation, we route them to two current logical triples so CM Engine can use them.

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 CMA156 we would use the following
command:

amp:def:(3,ext,i,1.000000E+001,5.000000E+001,0.000000E+000,1.000000E+003,5.944444E-
005,5.944444E-005,5.944444E-005)

2.2.1.2 Amplifier Configurations

As mentioned before, a configuration is a virtual amplifier. Configurations are pre-defined in the amplifier, and
cannot be modified. Only OMICRON amplifiers support configurations.

The main advantage of using configurations is that they allow access to the full power of the hardware. It
allows using more power, or more output, or both in exchange usually for the available number of phases.
For amplifiers that admit paralleling of their outputs, like the CMA156, CMC256-6 or newer test sets, some
configurations will involve outputs in both amplifiers.

The configurations can be queried using the amp:cfg? command. It will return the available number of
configurations, which can then be individually queried by using the second form of the command:
amp:cfg?(n) where n is a number from 1 up to the value returned by the general query. If there are
intelligent amplifiers connected, their configurations follow those of the CMC; please note that an amp:scan?
command must be executed before the external amplifier’s configurations are available.

For a CMC156 with a CMS156 amplifier connected, the commands would be like this:

OMICRON electronics Page 19


CM Engine

amp:cfg?
Result : 1,6;
amp:scan?
Result : 1,1,2;
amp:cfg?
Result : 1,11;
amp:cfg?(1)
Result : 1,9,3,1.275000e+002,5.000000e+001,1.250000e+002,4.000000e-001,std,0,amp_no,1;

The data in the result string that follow the device ID can be decomposed as follows:

9 Routing ID
3 Number of phases
1.275000E+002 Maximum output
5.000000E+001 Maximum power
1.250000E+002 Output at maximum power
4.000000E-001 Source amplitude
std Mode
0 Wiring index
amp_no, 1 List of amplifiers involved in the configuration

2.2.1.2.1 Routing ID
The routing ID is the argument we must pass to the amp:route command to use the given configuration.
The routing IDs from 1 to 8 are reserved for amplifiers defined with the amp:def command. It is very
important to remember that the mechanisms to obtain the parameters for a defined amplifier and for a
configuration are different. In the first case, we directly use the number returned by the amp:route?
command to query the system via amp:def? With configurations, the number returned by the amp:route?
command is the routing ID, not the configuration number. This means that the programmer must maintain the
link between routing IDs and configuration numbers. Alternatively, it is possible to store the parameters of all
configurations indexed by the routing ID. The configuration number is only necessary for the amp:cfg?
command, and can be discarded once all configurations have been queried and all data obtained.

2.2.1.2.2 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.

2.2.1.2.3 Maximum Output


Maximum output value of the configuration.

2.2.1.2.4 Maximum Power


The maximum power in VA that the configuration can reach.

2.2.1.2.5 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.

OMICRON electronics Page 20


CM Engine

2.2.1.2.6 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 device’s manual.

2.2.1.2.7 Mode
String that conveys information about how to perform the external wiring that is required so the configuration
can be used. The possible modes a configuration can be wired are as follows (CMC256 or newer test sets,
CMS251 and CMS252 not included):

Mode Phases Description


std 3 Standard. Each generator is used against N
1 Standard for CMC151
ser12 1 Generator 1 is signal, generator 2 is reference
ser13 1 Generator 1 is signal, generator 3 is reference
ser4 1 Four generators tied together in series. Generator 1 in amplifier 1 is signal, generator
1 in amplifier 2 is reference. Generator 2 in both amplifiers are connected
gen2 1 Generator 2 is signal, N is reference
par1 1 All three generators tied together are signal, N is reference
par3 3 Each generator tied together in parallel with the corresponding generators in all
amplifiers involved; 1 with 1, 2 with 2, etc. Also N with N
parser 1 All generators in amplifier 1 tied together are signal, all generators in amplifier 2 tied
together are reference. Neutrals in both amplifiers are tied together.

For more detailed wiring instructions, and for the cases where the use of adapting resistors is needed, please
consult the hardware manuals.

2.2.1.2.8 Wiring Index


For OMICRON internal use – index of an illustration of the wiring required for the configuration.

Let’s see as an example on how to set the CMC156 current amplifier to get 80VA in single phase mode:

amp:cfg?
Result : 1,6;
……………………………………………………
amp:cfg?(5)
Result: 1,13,1,1.250000e+001,8.000000e+001,1.250000e+001,6.400000e+000, ser12,2,amp_no,2;
amp:route(i(1),clr)
amp:def(2,clr)
amp:route(i(1),13)

After executing this code, only i(1:1) will be available, with the characteristics returned by the
amp:cfg?(5) command. The user would have to wire the CMC as shown in the following graphic:

Please note that the use of adapting resistors is required, for example those in the SPA device.

OMICRON electronics Page 21


CM Engine

2.2.1.2.9 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 amplifier’s 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.1.3 Defining the signal parameters

The signal parameters can be defined independently for each generator of each triple. To facilitate
programming, it is possible to address multiple generators simultaneously. For instance, a command such as
this would program all generators in triple v(1):

out:ana:v(1):…

The next one would program all generators in triples v(1) and v(2):

out:ana:v(1,2):…

Finally, this command would program generators 1 and 2 of triple v(1) and generator 3 of triple v(2):

out:ana:v(1:1,1:2,2:3):…

The changes done to the generators are propagated to the outputs only when an on command is issued. The
on command turns the outputs on if they happened to be off, and reprograms them with the values set for the
generators. Therefore, it is possible to change the signal parameters in any order, knowing that all changes
will be applied simultaneously when the on command is issued. This command accepts a generator list or it
can be applied to all analog signals simultaneously.

2.2.1.3.1 Waveform
Each generator in the CMC can use up to two signal components, named sig(1) and sig(2); each of these
components can be independently programmed, and then be added or multiplied together to form the signal
for that generator. A generator can then use sig(1) only (default), sig(2) only, sig(1) + sig(2), sig(1) * sig(2)
or it can be disabled (set to off). These relationships are programmed using the mix command.

In its turn, each of the signal components can be set to one of the following waveforms:

a Sine (default)
a Square
a Triangle
a DC
a Exponential
a Sum of harmonics
a User defined (sampled)

Please note that the DC wave is an independent waveform, and it is not the same as setting the frequency of
the signal to 0. Setting the frequency to 0 is not permitted, and the CM Engine will issue an error if it is
attempted.

Each of the two signal components can have a different waveform, amplitude, phase and frequency. This
approach provides the user with huge power and flexibility when it is needed, while staying out of the way for
simple cases where only a sine wave is required. By default, all commands apply to sig(1), which is
programmed to be the sole component of the generator’s signal, so outputting a voltage sine wave of 50V
through the internal voltage amplifier (defined and routed to v(1) by default) is as simple as this:

OMICRON electronics Page 22


CM Engine

out:v(1):a(50);f(50)
out:on

The ana qualifier is not required if the command applies to the analog outputs.

A certain amount of care is necessary when using multiplication of signal components to set up the
waveform. Each signal is assigned a “weight” equal to the ratio between the amplifier’s maximum output and
the signal’s amplitude. If the signal is set to the same amplitude as the maximum output value of the
amplifier, its weight is 1; if it is set to half the output value of the amplifier, its weight is 0.5, and so on.

It is extremely important to take into account that the values for the amplifier’s definition are rms values; this
makes the handling of sine waves straightforward, but can bring confusion when DC or square waves are
used. The internal voltage amplifiers of a CMC156, for example, return a maximum output value (rms) of
125V. This means that a sine wave with amplitude of 125V has a weight of 1. However, a DC component with
a weight of 1 would have an amplitude of 125*√2, or 176.775V. It is perfectly legal to assign an amplitude of
176.775V to a DC or square wave signals, since due to their shape no part of the wave would be outside of
the amplifier’s peak limit. The same applies to the triangle wave, as there the amplitude command is taken as
the peak value of the triangle.

A small example will help to clarify matters. Let’s multiply a sine wave by a square wave of the same
frequency and 50% duty cycle so we rectify the sine wave and make all its cycles positive. We program the
square wave’s amplitude to the amplifier’s maximum, so its weight is 1 and it does not modify the sine wave
in any way.

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 CM Engine, that 125 is the maximum amplifier’s output. The output
of this code, though, would be a wave smaller than expected. The correct code would be:

out:v(1):a(50);f(50)
out:v(1):sig(2):wav(square)
out:v(1):sig(2):a(176.775);f(50)
out:v(1):mix(mult)
out:v(1):on

2.2.1.3.2 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

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.

OMICRON electronics Page 23


CM Engine

The system should stay unchanged except for the magnitude and phase of VL3; but with these commands
there will be a phase jump as the other two phasors shift to their original phase angles of 0 and -120 from
whatever phase angle they happened to have when the second out:on was issued. VL3 will also jump to
180 absolute degrees, which is not probably what we intended to achieve – most likely we wanted to reverse
the phase angle the wave had when we issued the on command.

To avoid this, the CM Engine allows setting how the phase parameter should be interpreted. In absolute
phase mode, the phases are applied with each new on command as described above. In differential
mode though the difference between the newly set phase value and the previous phase value is applied to
the phase angle of the wave the instant the on command is issued. Using differential mode for the previous
example would give us the following

out:pmode(abs)
out:v(1):a(50);f(60)
out:v(1:1):p(0)
out:v(1:2):p(-120)
out:v(1:3):p(120)
out:on
out:pmode(diff)
#wait 5
out:v(1:3):a(1);p(180)
out:on

Once set, the phase mode remains until it is changed or the system is reset (phase mode = absolute). It is
necessary that the phase mode is absolute the first time the on command is issued, so the CMC can
compensate for the amplifier’s delays. When the system is set to differential mode, the on command applies
to the analog signals the difference between the new setting and the previous setting. This value is applied to
the signals at whatever status they are when the on command is issued. In this example, VL1 and VL2 will
continue unchanged, and VL3 will be shifted 180° - not set to 180° as before.

There is a third phase mode than can be set, and it is setting the phase mode of the generators relative to
one of them. For that we use the following command:

out:ana:pmode(diff(v|i(<reference_generator>))

where <reference_generator> must be an individual voltage or current generator, not a triple. The main
usefulness of this command is to keep the phase shifts between generators when their frequencies change
independently to each other. Ordinarily, each on command would consider only a given generator’s phase
settings to set the generator’s phase. With the differential mode with reference channel, the on command
applies the differences between the generator’s phase and the reference generator’s phase. This mode can
be considered as an extension of the diff mode for generators with different frequencies. If this mode did
not exist, only the abs mode would keep the phase shifts between generators having different frequencies.
Note that the current implementation of this command requires the phase of the reference generator to be set
to 0° in order to provide correct operation. If it is set to a different value, the behavior is undefined.

There is also a restriction of the phase modes concerning signal generation: when mixing two signals by
either adding (mix(add)) or multiplying (mix(mult)) them, only the absolute phase mode is available.
When using a different phase mode, an error will be issued.

A small example will help to clarify the concepts. Let’s assume that we set two voltage generators with
different frequencies and then we change the amplitude of one of them. The results would be different with
each phase mode, as follows:

out:ana:v(1:1):a(100);f(50);p(0)
out:ana:v(1:2):a(100);f(51);p(-120)
out:on
. . . . . The previous code would be common to all phase modes . . . . .

out:pmode(abs)
out:ana:v(1:1):a(50)
out:ana:v(1:2):a(20);p(0)
out:on

OMICRON electronics Page 24


CM Engine

This code would cause both generators to jump to phase 0, v(1:1) because that was its original setting and
v(1:2) because that is the new set value.
out:pmode(diff)
out:ana:v(1:1):a(50)
out:ana:v(1:2):a(20);p(0)
out:on

This code would leave v(1:1) unchanged and would add 120 degrees to whatever phase the generator
already had. Since both generators have different frequencies, the phase shift between them after the
command could be anything, depending only on the moment the command was issued.

out:pmode(diff(v(1:1)))
out:ana:v(1:1):a(50)
out:ana:v(1:2):a(20);p(0)
out:on

We have now defined v(1:1) as reference. The reference generator behaves in normal diff mode, so this
code would leave v(1:1) unchanged; v(1:2) on the other hand would be set to the phase shift between itself
and v(1:1). With the new settings this shift is 0, so v(1:2) would experiment a phase jump to set it to the same
phase as v(1:1).

An interesting and useful feature that CM Engine provides is the possibility to set a step value for each
magnitude and then apply all steps simultaneously. This allows for easy and convenient variation of
amplitude, phase and/or frequency for each or all signals. All step values will be added simultaneously upon
the execution of the out:step command. Since it is not possible to read back the values that are being
output, the user must keep count of the number of step commands issued. Also, after an off command,
the next on will return the original values set to the generators, losing all the increments applied with the
step command.
It is most likely that you will want to use the differential phase mode (pmode(diff)) when using the stepping
feature since the phase angles of all affected generators would be reset to the originally specified value for
each step. This is because a step command is a variation of the on command and therefore performs the
same calculations which would cause setting the phase angle to what was specified based on the
out:ana:..:p() command.

2.2.2 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 group’s characteristics,
although this is not necessary to handle the outputs from CM Engine (it is useful to know how to wire the
outputs though). If we know that we are addressing only a CMC unit, then we know in advance there will be
one or two output modules, module 1 being the four contact outputs in the front panel and module 2 being the
transistor outputs in the back panel (when available), so there is no need to go through the full process. We

OMICRON electronics Page 25


CM Engine

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).

2.2.3 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 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.2.4 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 CMC156, inputs 1 to 4 would be affected, since the 10 binary
inputs on the front panel are separated in two groups: 1 to 4 and 5 to 10. In a CMC256 or newer test set,
however, only input 1 would be affected, since each input on the front panel has its own group. It is important
therefore to query all the data for the binary inputs before configuring them. For that we would use first the
inp:bin:cfg? command to get the number of modules, and then for each of those modules we would
issue a inp:bin(<out_module_idx>):cfg? command to get information about them, including the
number of groups. Then we would request each group’s characteristics by means of a
out:bin(<out_module_idx>,<group_idx>):cfg? command.

2.3 Using the Input Buffer


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.

OMICRON electronics Page 26


CM Engine

There are two kinds of events: those that are logged expressly and those that are logged automatically. The
latter are only logged if automatic logging is enabled. To log an event in the input buffer expressly, the
inp:buf:sam(<src>,<indx>) command is used. Basically, this command allows recording the status of
one of the analog inputs, or of the binary inputs, and to assign an index to such an event. For analog inputs,
the index is the number of the input to be sampled, while for binary inputs it is an identifier to allow recognition
of the event and facilitate the task of buffer analysis. If automatic logging is enabled, the system automatically
records all changes in the binary inputs, or in both the binary inputs and the analog outputs, depending on the
type of automatic logging selected. The index 0 is automatically entered for changes in the analog outputs,
and the index 1 is also automatically entered for changes to the binary inputs. While it is possible to force a
sampling of the binary inputs and assign index 1 to it, with the command inp:buf:sam(<src>,<indx>),
this will in most cases lead only to confusion. It is better to leave the index 1 for automatic recording of
changes, and use any of the other indexes available to the user (from 2 to 9) to expressly sample the binary
inputs, or just to mark our way through a program (more in section 2.4 - Using the Sequencer).

Perhaps the most common use of the user events is to make sure that the event buffer timer does not
overflow. Times are computed using an internal CMC counter, which overflows every 27 minutes (1677.7216
seconds to be totally precise). CM Engine is capable of handling this overflow by itself, as long as at least one
event is generated within those 27 minutes. Thus you must make sure that no period of 27 minutes can
elapse without event generation. The best form to achieve this is to use a timer in your application, and to
generate a user event every 15 minutes or so. When the buffer is later analyzed, these events are simply
discarded.

The event buffer is the core of CMC programming. Most CM Engine programs work by arranging the output
commands in such a way as to create a certain stream of events in the buffer, and later analyzing the
contents of the buffer to find out what happened and to extract the timings. In general, the more thought over
the output control is, the simpler the buffer analyzer can be built. In general, the buffer is cleared and
automatic logging enabled, if required, just before the events we are interested in take place.

An event stored in the input buffer contains the following fields:

1) Type: String describing what kind of event has been stored. It determines which subsystem in the
test device originated the event or whether it contains buffer-management information (empty,
overrun).
2) Time: Time-tag of the event.
3) Data: Event data, to be interpreted according to the Type.
4) Index: Identifier, to be interpreted according to the Type.
5) Optional: Additional information for some events.

The complete description of the fields and their contents can be found in the CM Engine Reference Manual.

The most common event and probably the most useful too is the one of type bin. When automatic logging is
enabled, these events record any changes in the binary inputs and in the analog outputs. To enable full
automatic logging, the command inp:buf:sam(bin,on) is used. If only the automatic recording of the
changes in the binary inputs is desired, the command inp:buf:sam(bin,bin)is used instead.
inp:buf:sam(bin,off)will turn off automatic event logging. Most times we will want to measure the time
elapsed between a change in the analog outputs and the test object reaction, detected as changes in the
binary inputs. For this, full automatic logging is required.

As an application of all the concepts described this far, the following example, written in VBA (Visual Basic for
Applications) will output a 3-phase overcurrent fault and wait until the relay trips. The trip will be detected by
the activation of the binary input 1. The control of the program flow will be done in the PC, and the contents of
the input buffer will later be analyzed to determine the exact time elapsed between the onset of the fault and
the reaction of the relay.
The VBA auxiliary functions used in this and other VBA programs will be provided in section 2.8.

Declare Sub Sleep Lib "kernel32" (ByVal time As Long)

' Operating Time Version 1


'------------------------------------------------------------------------------

Option Explicit

OMICRON electronics Page 27


CM Engine

Dim result As String


Dim Frequency As Double
Dim IFault As Double
Dim TripTime As Double 'Trip Time = result of the test

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

On Error GoTo EngineError


' Create OLE Automation object
Set engine = New cmEngine.cmEngine

engine.DevScanForNew (False)

deviceList = engine.DevGetList(lsAllAssociatedAny)

If ExtractParameter(3, deviceList) = "0" And ExtractParameter(4, deviceList) = "0" Then 'we have
a net-1 device
devId = Val(ExtractParameter(1, deviceList))
If Not engine.Associated(devId) Then
engine.DevAssociateAppend (devId)
End If
ElseIf deviceList <> "" Then
devId = Val(ExtractParameter(1, deviceList))
Else
GoTo ApplicationEnd
End If

engine.DevLock (devId)

Frequency = 50
IFault = 3

'We look for trip in binary input 1

result = engine.Exec(devId, "inp:buf:clr")


result = engine.Exec(devId, "inp:buf:sam(bin, on)")

result = engine.Exec(devId, "out:i(1):mix(sig(1))")


result = engine.Exec(devId, "out:i(1):sig(1):wav(sin)")
result = engine.Exec(devId, "out:i(1):f(" & Str(Frequency) & ")")
result = engine.Exec(devId, "out:i(1:1):a(" & Str(IFault) & ");p(0)") 'Ia
result = engine.Exec(devId, "out:i(1:2):a(" & Str(IFault) & ");p(-120)") 'Ib
result = engine.Exec(devId, "out:i(1:3):a(" & Str(IFault) & ");p(120)") 'Ic
result = engine.Exec(devId, "out:on") 'outputs on

Dim Inputs As Integer


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 BufType As String


Dim BufData As String
Dim BufIndex As Integer
Dim BufTime As Double
Dim BinaryState As Integer

Dim EndOfBuffer As Boolean


Dim Tripped As Boolean
Dim ReferenceTime As Double

EndOfBuffer = False
Tripped = False
ReferenceTime = 0
TripTime = 0

OMICRON electronics Page 28


CM Engine

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 = 1 Then
BinaryState = Val(BufData)
If (BinaryState And 1) <> 0 Then 'If Binary input 1 was active
TripTime = BufTime - ReferenceTime
Tripped = True
End If
End If

Loop While Tripped = False And EndOfBuffer = False

If Tripped = True Then


MsgBox "Relay tripped with operating time = " & Str(TripTime)
Else
MsgBox "Error - trip not found in the input buffer"
End If

result = engine.DevUnlock(devId)
EngineError:
MsgBox Err.Description
Err.Clear
ApplicationEnd:
Set engine = Nothing
End Sub

It is easy to expand this simple program by providing a pre-fault state to let the relay stabilize before the fault
magnitudes are applied, and especially by defining a maximum fault time to limit the application of the fault
values to the relay: in this example, the values are applied until the binary input goes active. An example with
all these improvements will be provided in section 2.4.

2.4 Using the Sequencer

2.4.1 Description of the Sequencer


The Sequencer allows downloading a series of CM Engine commands into the CMC memory, to be executed
there under the control of the test set. These commands can be almost any of the CMC commands, with a
few exceptions (please consult the Reference Manual to see which commands cannot be executed in
Sequence mode) plus some flow control commands that are specific to the sequence.

The Sequencer allows tight control of the execution times, so it is possible to be sure that the times between
commands will be as we program it, with the same precision and resolution as the internal CMC timer. This is
very important for exact control of the analog outputs in those cases where the waveform and timing of the
applied waves must be carefully controlled.

There can be only one sequence in the CMC at any given time; if a different sequence is desired, the
previous sequence must be cleared and the new one uploaded to the CMC. During the uploading of the
sequence the commands are only stored, not executed. When the sequence is executed, its commands are
processed one by one in the same order as they have been uploaded. A sequence can be executed any
number of times once it is in memory.

OMICRON electronics Page 29


CM Engine

The commands that are specific to the sequence are the following:

¾ seq:clr Deletes the contents of the CMC memory


¾ seq:begin Signals to the CMC that the commands that follow are to be stored as a sequence
¾ seq:end End of the sequence mode – commands following this one will be executed upon reception
¾ seq:set() Sets one of the counters or timers to a value
¾ seq:add Adds a quantity to the value in one of the counters
¾ seq:status? Gets different data about the sequence and the sequence memory
¾ seq:stop Stops the sequence
¾ seq:wait Decision point in the flow of the sequence. In a wait command, different values can be
evaluated and the execution can jump to different steps of the sequence according to
the results of these evaluations

It is important to keep clearly in mind that, aside from the control commands, there is absolutely no difference
between a command issued during a sequence and a command issued outside of a sequence. There are no
special commands or hidden resets either at the beginning or at the end of the execution of a sequence. It is
perfectly possible to divide the work between in-sequence and out-of-sequence commands if required by the
application.

The sequence is executed autonomously in the CMC, so the PC is free to do other tasks. Normally, the main
program waits until the sequence is finished, then it extracts whatever data it needs from the sequence and
continues with the processing. Sometimes, however, it can be useful to leave the sequence running and
extract the data from the input buffer as it is generated. This is usually required only when very complex
trigger conditions are needed that cannot be implemented with the seq:wait() command, or when it is
feared that the input buffer might overflow unless continuously emptied. Using seq:status?(step) we can
find out which sequence block, or step, is being executed (please see section 2.4.2 for the way the sequence
blocks are delimited). When the step is 0, the sequence is stopped and we can proceed.

To get data out of a sequence, the best and practically the only way is to analyze the contents of the input
buffer. There are no variables in which to store results that can be read from outside the sequence, except for
the loop counter; but since this counter is decremented automatically with each seq:wait() command, it
is highly sensitive to changes in the sequence. It is therefore much better to write user-defined events into the
buffer, by means of the inp:buf:sam(bin,<index>) command with indexes from 2 to 9. These events
can be used as markers to know which branch did a sequence actually take, or as counters to know how
many times a given loop was executed, or for any other transfer of information from within the sequence to
the main program.

2.4.2 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:

¾ Status of the sequence counters (count(1), count(2), loop)


¾ Status of the user-defined timer
¾ Status of the binary inputs
¾ Activation of the dedicated, external input (used by the CMGPS device)
¾ Logical (AND/OR/NOT) combinations of the above

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

OMICRON electronics Page 30


CM Engine

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 Frequency As Double


Dim InceptionAngle As Double
Dim PrefaultCycles As Integer
Dim IFault As Double
Dim IPreFault As Double
Dim 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
Dim deviceList As String
Dim devId As Integer

On Error GoTo EngineError


' Create OLE Automation object
Set engine = New cmEngine.cmEngine

engine.DevScanForNew (False)

deviceList = engine.DevGetList(lsAllAssociatedAny)

If ExtractParameter(3, deviceList) = "0" And ExtractParameter(4, deviceList) = "0" Then 'we


have a net-1 device
devId = Val(ExtractParameter(1, deviceList))

If Not engine.Associated(devId) Then


engine.DevAssociateAppend (devId)
End If
ElseIf deviceList <> "" Then
devId = Val(ExtractParameter(1, deviceList))
Else
GoTo ApplicationEnd
End If

engine.DevLock (devId)

Frequency = 50
InceptionAngle = 90 'The fault will strike at 90 degrees
PrefaultCycles = 100
IPreFault = 1
IFault = 5
FaultTime = 1 'We keep the fault for 1 second

Dim DelayTime As Double


Dim Period As Double

OMICRON electronics Page 31


CM Engine

Period = 1 / Frequency
DelayTime = (Period * PrefaultCycles) + (Period * (InceptionAngle / 360))

'The delay time now is equal to an entire number of cycles, plus the part
'of a cycle corresponding to the inception angle. This code assumes that the
'original phase of the wave was 0

result = engine.Exec(devId, "seq:clr")

'STEP 1 of the sequence


result = engine.Exec(devId, "seq:begin")
result = engine.Exec(devId, "out:pmode(abs)")
result = engine.Exec(devId, "out:i(1):mix(sig(1))")
result = engine.Exec(devId, "out:i(1):sig(1):wav(sin)")
result = engine.Exec(devId, "out:i(1):f(" & Str(Frequency) & ")")
result = engine.Exec(devId, "out:i(1:1):a(" & Str(IPreFault) & ");p(0)")
result = engine.Exec(devId, "out:on") 'outputs on - prefault values applied
result = engine.Exec(devId, "out:pmode(diff)")
result = engine.Exec(devId, "out:i(1:1):a(" & Str(IFault) & ");p(0)")
result = engine.Exec(devId, "seq:wait(" & Str(DelayTime) & ",1)")
'STEP 2
result = engine.Exec(devId, "out:on") 'outputs on - fault values applied
result = engine.Exec(devId, "seq:wait(" & Str(FaultTime) & ",1)")
'STEP 3
result = engine.Exec(devId, "out:off")
result = engine.Exec(devId, "seq:end")
result = engine.Exec(devId, "seq:exec")

Dim Step As Integer


Do
Sleep (100) 'Return control to the operating system and suspend task for 100ms
result = engine.Exec(devId, "seq:status?(step)")
Step = Val(ExtractParameter(2, result))
Loop While (Step <> 0) 'Wait for the sequence to end

result = engine.DevUnlock(devId)
GoTo ApplicationEnd
EngineError:
MsgBox Err.Description
Err.Clear
ApplicationEnd:
Set engine = Nothing
End Sub

Declare Sub Sleep Lib "kernel32" (ByVal time As Long)


' Operating Time Version 2
'
' Rewriting of Version 1 using the Sequencer
'------------------------------------------------------------------------------
Option Explicit
Dim Frequency As Double
Dim IFault As Double
Dim MaxTFault As Double
Dim TripTime As Double 'Trip Time = result of the test
Const NoTripEvent As Integer = 9

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

On Error GoTo EngineError


' Create OLE Automation object
Set engine = New cmEngine.cmEngine

engine.DevScanForNew (False)

deviceList = engine.DevGetList(lsAllAssociatedAny)

If ExtractParameter(3, deviceList) = "0" And ExtractParameter(4, deviceList) = "0" Then 'we


have a net-1 device
devId = Val(ExtractParameter(1, deviceList))

If Not engine.Associated(devId) Then

OMICRON electronics Page 32


CM Engine

engine.DevAssociateAppend (devId)
End If
ElseIf deviceList <> "" Then
devId = Val(ExtractParameter(1, deviceList))
Else
GoTo ApplicationEnd
End If

engine.DevLock (devId)

Frequency = 50
IFault = 3
MaxTFault = 5 'Maximum fault time is 5 seconds

'We look for trip in binary input 1

result = engine.Exec(devId, "seq:clr")


result = engine.Exec(devId, "inp:buf:clr")
'STEP 1
result = engine.Exec(devId, "seq:begin")
result = engine.Exec(devId, "inp:buf:sam(bin, on)")
result = engine.Exec(devId, "out:i(1):mix(sig(1))")
result = engine.Exec(devId, "out:i(1):sig(1):wav(sin)")
result = engine.Exec(devId, "out:i(1):f(" & Str(Frequency) & ")")
result = engine.Exec(devId, "out:i(1:1):a(" & Str(IFault) & ");p(0)") 'Ia
result = engine.Exec(devId, "out:i(1:2):a(" & Str(IFault) & ");p(-120)") 'Ib
result = engine.Exec(devId, "out:i(1:3):a(" & Str(IFault) & ");p(120)") 'Ic
result = engine.Exec(devId, "out:on") 'outputs on
result = engine.Exec(devId, "seq:wait(bin(1), 2, " & Str(MaxTFault) & ", 1)")
'STEP 2 - Case when no trip is detected
result = engine.Exec(devId, "inp:buf:sam(bin, " & Str(NoTripEvent) & ")")
result = engine.Exec(devId, "seq:wait(0, 1)")
'STEP 3 - Outputs off
result = engine.Exec(devId, "out:ana:off(zcross)")
result = engine.Exec(devId, "inp:buf:sam(bin, off)")
result = engine.Exec(devId, "seq:end")

result = engine.Exec(devId, "seq:exec")

Dim Step As Integer


Do
Sleep (100) 'Return control to the operating system and suspend task for 100ms
result = engine.Exec(devId, "seq:status?(step)")
Step = Val(ExtractParameter(2, result))
Loop While (Step <> 0) 'Wait for the sequence to end

'Variables for buffer analysis

Dim BufType As String


Dim BufData As String
Dim BufIndex As Integer
Dim BufTime As Double
Dim BinaryState As Integer
Dim EndOfBuffer As Boolean
Dim NoTrip As Boolean
Dim TripDetected As Boolean
Dim 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)

OMICRON electronics Page 33


CM Engine

ReferenceTime = BufTime
ElseIf BufType = "bin" And BufIndex = NoTripEvent Then 'The relay did not trip
NoTrip = True
ElseIf BufType = "bin" And BufIndex = 1 Then
BinaryState = Val(BufData)
If (BinaryState And 1) <> 0 Then 'If Binary input 1 was active
TripTime = BufTime - ReferenceTime
TripDetected = True
End If
End If

Loop While NoTrip = False And TripDetected = False And EndOfBuffer = False

If TripDetected = True Then


MsgBox "Relay tripped with operating time = " & Str(TripTime)
ElseIf NoTrip = True Then
MsgBox "Relay did not trip for the fault magnitudes applied"
Else
MsgBox "ERROR - trip not found in the input buffer"
End If

engine.DevUnlock (devId)
GoTo ApplicationEnd
EngineError:
MsgBox Err.Description
Err.Clear
ApplicationEnd:
Set engine = Nothing
End Sub

2.5 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:

9 A counter cannot be slave and master at the same time.


9 A slave counter must have at least one master.
9 A slave counter may have several masters.
9 A master counter may have several slaves.

For instance, to define the standard counter 3 as an slave of the high-speed counter 1 the following
command would be used: inp:count:join(ecount(1),bcount(3))

When a counter is defined as slave, it generates additional events. As was already mentioned, all counters
generate an overflow event when rolling over from 16777215 to 0. An slave counter will generate two
additional events in the following cases:

9 The slave’s counter first pulse after the master’s first pulse

OMICRON electronics Page 34


CM Engine

9 The slave’s counter first pulse after the master’s overflow

The counter’s overflow is marked by the zcross keyword in the Optional field in the generated event. Any
counter events not so marked are generated by a slave counter, and must be processed together with the
master’s overflow events to determine the exact sequence of events.

The following example will display the functionality of the counter inputs. We will count a fixed number of
pulses in one of the counters, and will determine how many pulses in a second counter are detected during
that time. This configuration is useful when testing energy meters, where a fixed number of pulses
(corresponding to a given energy value) is detected from the meter under test, while pulses detected from a
reference meter during the same period will give us the reference value for evaluation. To count a given
number of pulses, we program the counter with an initial value such that the last of the desired pulses triggers
the overflow event. The initial value to be programmed into the counter would then be: COUNTER_MAX –
DESIRED_PULSES + 1. In the example we will count eight pulses; therefore, the initial value of the counter
will be 16777215 – 8 + 1 = 16777208.

Please note that the counters are not self-reloading, and after the overflow the initial value will be lost and the
counter will continue counting from 1. We will use the CMC’s own voltage outputs to create the pulses.

; OMICRON electronics 1998-10-08

; Script to test the counter functionality


; For use with CM Engine sample program Batcher

; The voltage output 1 has to be connected to binary input 1.


; The voltage output 2 has to be connected to binary input 2.

; Create a log file for easier analysis


#lognew Counter.log

; Set binary input group 1 to potential-sensing


; with a 10V threshold to measure voltages. We assume a CMC156,
; so this will set inputs 1 to 4

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

OMICRON electronics Page 35


CM Engine

#loop 6 inp:buf:get?

The program output should look like this:

(1) Result : 1,16777208;


(2) Result : 1,0;
(3) Waiting 2 seconds ...
(4) Result : 1,bin,0.0000000E+000,0,1,-;
(5) Result : 1,bcount,3.4991632E-003,16777209,1,-;
(6) Result : 1,bcount,1.1797179E-002,1,2,-;
(7) Result : 1,bcount,3.5351546E-001,0,1,zcross;
(8) Result : 1,bcount,3.7181109E-001,19,2,-;
(9) Result : 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:

Line (5) Line (7)

Counter 1 16777209 16777210 16777211 16777212 16777213 16777214 16777215 0

Counter 2 1 2 3 4 5 6 7 8 9 10 11 11 12 13 14 15 16 17 18 19

Line (6) Line (8)

2.6 System control unit


The system control unit allows checking the status of the CMC device, resetting the hardware and obtaining
information about the different elements of the device. The commands and their use are clearly described in
the Reference Manual; in this section we will provide some hints about how to use them in a CM Engine
program.

At the beginning of the program, the sys:test? command may be used to make sure our test device is
operating correctly. It is sufficient to use this command once, when the program starts. The sys:status?
command though will inform us of errors or anomalies that happen during program execution, such as output
overload, output switch-off due to overtemperature, communication errors, etc. Since the CMC will never
initiate transmission, it must be polled by periodically calling this command to make sure that no anomalies
are appearing during test.

The way to implement such a feature depends entirely on the operating system, on which our program is
running, and on the complexity we want to give to the program itself. The cleanest way to implement this
feature is to assign it to a separate process or thread. If this is not convenient, a timer-invoked routine can
also be a good way to poll the CMC. The simplest way is to include the polling in a program loop – if
sequences are used, the loop where we wait for the sequence to end is a very common place to put it.

This last way has the inconvenience that it mixes what are really two independent tasks in the same code,
and it makes the code harder to debug and to understand. On the other hand, it allows knowing exactly in
which part of the test the error condition happened; this information may be very useful to correct the
problem.

The status registers are organized in a two-level structure. The first level is a 32-bit register, called “Primary
Register”, which is returned by a call to sys:status? without parameters. Each bit in this register is the
logic OR of all bits in a second-level (“Secondary”) 32-bit register that holds the actual error codes. The
secondary registers are accessed by passing their number as parameter to the sys:status? command.

OMICRON electronics Page 36


CM Engine

The method of operation is to read the primary status register and check that it is 0. If it is, no errors are
detected anywhere and there is no need to read further. If any bit is 1, then the corresponding secondary
register should be read to find out the exact reason for the error.

For example:

sys:status?
Result : 1,0; ‘No errors
. . . . . . . . . . . . . . . . . . . . . . .
sys:status?
Result : 1,8; ‘Secondary register 3 holds errors
sys:status?(3)
Result : 1,5; ‘i(1:1) and i(1:3) are in overload

In this case, you may choose to cancel the test, since an overload makes the results unreliable, or finish it
and record the overload condition together with the test’s results. Please note that no user action is required
in any of the error conditions; the CMC’s firmware will take appropriate action for all critical conditions. For
example, if overtemperature is detected at the analog outputs, the generators will be turned off automatically
while the condition persists, and restored to operation after the generators have cooled themselves. The user
will know of this condition through the secondary status registers 4 and 5, but should (and in fact can) take no
action.

2.7 The CMC256


The CMC256 offers the user the many additional capabilities respect to the CMC156. The following list
enumerates those most visible to the CM Engine programmer:

9 One fourth voltage output V4


9 One additional current triple (CMC256-6)
9 Auxiliary DC power
9 Analog measurement and recording capabilities added to the front-panel binary inputs.

In this section we will describe the CMC256-6, as the CMC256-3 is less complex due to the lack of the
second current triple.

2.7.1 Amplifiers
It is important to note that, upon start-up, the CMC256 is fully compatible with any software written for the
CMC156. When the CM Engine initializes, all inputs are configured as potential-free binary inputs. The fourth
voltage and the second current triple are left undefined for maximum software compatibility. Therefore,
programs expecting the CMC156 configuration will require no modification. Only when we wish to take
advantage of the CMC256 unique features do we need to modify the existing software.

The first change is noticed when we request the output configuration; in a CMC256-6, the returned string will
look like this: 1,4,1/3/i,2/3/i,3/3/e,4/3/e,5/1/i,6/3/i;
As we see, there are two new internal amplifiers added after the previously existing internal and external
th
amplifiers. The single-phase internal amplifier, number 5, is the 4 voltage output, while number 6 is the
second current triple.

These amplifiers can be defined in the standard way, and used as independent triples; but the full power of
the CMC256 is reached through the use of amplifier configurations. Detailed descriptions about available
amplifier configurations for a test set can be found in the hardware manual.

The following example shows the configurations of a CMC256-6:

amp:cfg?
Result : 1,11;

amp:cfg?(1)
Result : 1,9,3,3.000000e+002,8.500000e+001,8.500000e+001,1.000000e+000,std,0,amp_no,1;

OMICRON electronics Page 37


CM Engine

amp:cfg?(2)
Result : 1,10,1,3.000000e+002,1.500000e+002,7.500000e+001,2.000000e+000,std,14,amp_no,5;
amp:cfg?(3)
Result : 1,11,3,3.000000e+002,5.000000e+001,7.500000e+001,6.600000e-001,zero,13,amp_no,1,amp_no,5;
amp:cfg?(4)
Result : 1,12,1,6.000000e+002,1.500000e+002,1.500000e+002,1.000000e+000,ser13,4,amp_no,1;
amp:cfg?(5)
Result : 1,13,2,6.000000e+002,1.500000e+002,1.500000e+002,1.000000e+000,ser2,17,amp_no,1,amp_no,5;
amp:cfg?(6)
Result : 1,14,3,1.250000e+001,7.000000e+001,7.500000e+000,1.000000e+001,std,18,amp_no,2;
amp:cfg?(7)
Result : 1,15,3,1.250000e+001,7.000000e+001,7.500000e+000,1.000000e+001,std,19,amp_no,6;
amp:cfg?(8)
Result : 1,16,3,2.500000e+001,1.400000e+002,1.500000e+001,1.000000e+001,par3,5,amp_no,2,amp_no,6;
amp:cfg?(9)
Result : 1,17,1,7.500000e+001,4.200000e+002,4.500000e+001,1.000000e+001,par1,7,amp_no,2,amp_no,6;
amp:cfg?(10)
Result : 1,18,1,1.250000e+001,2.800000e+002,7.500000e+000,4.000000e+001,ser4,10,amp_no,2,amp_no,6;
amp:cfg?(11)
Result :
1,19,1,3.750000e+001,4.200000e+002,2.250000e+001,2.000000e+001,parser,11,amp_no,2,amp_no,6;
amp:cfg?(11)
Result :
1,19,1,3.750000e+001,4.200000e+002,2.250000e+001,2.000000e+001,parser,11,amp_no,2,amp_no,6;

where we see the full range of capabilities that the CMC256-6 hardware offers us.

There are some additional connection modes for the CMC256-6, as follows:

Mode Phases Description


zero 3 Three phases plus an automatically calculated
resultant, which is output via an additional generator.
Each phase is active against its corresponding
Neutral.
ser2 2 For phase 1, Generator 1 is active and generator 2 is
reference. For phase 2, generator 3 is active and the
extra generator is reference.
par6 1 Involves two physical amplifiers. Generators 1, 2 and
3 of both amplifiers, tied together (the 6 of them) are
signal. Both Neutrals tied together are reference.

Please note that configuration 8 is the only way to set both current triples in parallel to obtain a three-phase,
25A current triple. The method described for the CMA156 in section 2.2.1.1.2 is not applicable for the
CMC256.

Configuration 3 creates an amplifier with 4 voltages, three of which are accessible to the user while the fourth
outputs the automatically-calculated resultant of the other three. It is worth noting that the resultant is
calculated with instantaneous values, and is therefore accurate for whatever wave form is being output.

2.7.2 The DC auxiliary output


The CMC256 incorporates a DC power source that can be used to power up the equipment under test. Due
to its intended use, this output does not have the same precision as the test outputs, and is therefore not
handled with the standard analog output commands. Instead, the commands to control the DC auxiliary
output all begin with out:aux.

Notice: CMC356 test sets needs the ELT-1 option to have the DC auxiliary output available.

The analog output can be programmed to be active with a preset value when the CMC256 is powered-up.
That value will be output immediately even when no PC is attached to the CMC. To set this value, the user
would use the command out:aux:def(), passing the desired power-on value as an argument. For
instance, to set the CMC so that 48V are output on power-up, we would issue the following command:

OMICRON electronics Page 38


CM Engine

out:aux:def(48). The command has no effect until the CMC is powered off and on again, but we can
query the power-on value with the out:aux:def? command.

At any time we can set the DC value with the out:aux:a() command. This command has immediate effect
and will set the output to the value that we pass as parameter. The complementary command out:aux:a?
queries the status and characteristics of the DC auxiliary output. It returns the current status as a string (“on”
or “off”), plus the value being output and the maximum value that can be output. Both the out:aux:def()
and the out:aux:a() commands will fail if values higher than the maximum possible are passed to them.

For example, assuming we wish to have the CMC256 output 110VDC upon being powered-up, we would
program it like follows:

out:aux:def(110)
out:aux:def?
Result : 1,1.100000E+002;

The next time we power up the CMC, it would immediately output 110VDC through the DC auxiliary output
without the need for intervention from us. We can make sure that it is doing so by querying the status of the
auxiliary output:

out:aux:a?
Result : 1,on,1.099566E+002,2.640000E+002;

We see here that the output is on, outputting the programmed value, and that the maximum value the source
can output is 264V. We can then use the out:aux:a() command to change the value if we want to.

Please note that it is not possible to program negative values in the DC auxiliary output. The acceptable
range is from 0 to the maximum value returned by the out:aux:a()command.

2.7.3 The AC analog inputs


The CMC256 includes ten binary / analog inputs accessible via the front panel. These inputs can be
programmed to perform the same functions as the binary inputs in the CMC156, but they can also be used in
analog mode to perform a wide range of measurements. At present, these are:

a RMS
a Peak values
a Phase
a Frequency
a Power
a Sum

In binary mode, the inputs can work as potential-free or potential-sensing inputs, as described before for the
CMC156. In analog mode, they can be configured as voltage or current inputs. Please note that the hardware
can measure only voltages; in the case of current inputs, the hardware needs a current clamp or a shunt
resistor, whose ratio is used as a configuration parameter of the input.

Notice: CMC356 test sets needs the ELT-1 option to have the AC analog inputs available.

To configure an analog input, we must provide the input type, the desired range and, for current inputs, the
CT ratio in Volts / Amp. For instance, the following commands:

inp:ana(1,3,5):def(v,120)
inp:ana(2,4,6):def(i, 10, 1)

will program inputs 1, 3 and 5 as voltage inputs with a range of 120V, and inputs 2, 4 and 6 as current inputs
with a range of 10V and a transformer ratio of 1V/A (allowing us to measure up to 10A). In fact, in a CMC256
the range set for the voltage inputs will be 650V, but it is still worth the effort to adjust the range to the
expected inputs, to take advantage of future improvements without any changes in the code.

OMICRON electronics Page 39


CM Engine

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 0: Result Already Read


The results of most commands are updated at the end of the integration time. Therefore, it is possible to read
the same result more than once. This flag warns you that you have already read this result.
Bit 1: Not Ready
This means that the command hasn't got any results yet. For example if you ask for the results of a
command that has just been issued, without waiting for the integration time to be finished, you will get this bit
set.
Bit 2: 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.

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.

Bit 4: Real Time Violation


This indicates that the measuring DSP cannot process all the measurement tasks within the sample time.
This may be caused by putting too many tasks on the task vector at a high sampling frequency (e.g. 28 kHz).
Real time violations are also shown using the sys:status? command.

Let’s get all the measurements we can on a V and I 3-phase system:

inp:ana(1,3,5):def(v,120)
inp:ana(2,4,6):def(i,10,1)
inp:ana:cal(ac)
inp:ana(1,2,3,4,5,6):rms?(1.0)
Result : 1,1;
inp:ana(1,2,3,4,5,6):peak?(1.0)
Result : 1,2;
inp:ana(1):freq?(50, 1)
Result : 1,3;
inp:ana(1,2,3,4,5,6):phase?(1.0)
Result : 1,4;
inp:ana(1,2,3,4,5,6):power?(1.0)
Result : 1,5;
inp:ana(1,3,5):sum?(1.0)
Result : 1,6;
inp:ana(1,3,5):diff?(1.0)
Result : 1,7;
inp:ana:sync

We have then defined three voltage and three current inputs, set their parameters, re-calibrated them after
the change in ranges (convenient but not mandatory) and started measuring values in them. Note that one
single command creates one single task, regardless of the number of inputs that form the input list.

After issuing all the commands, we have the following tasks running:

Task Measured quantity


1 RMS value of all signals, with 1 second integration time
2 Peak value of all signals, with 1 second integration time
3 Frequency of the first V signal, with 50 periods detection time and 1 volt trigger level
4 Phase of all signals relative to the first voltage signal
5 Three power measurements, for the three V/I pairs
6 Resultant of the three V inputs (Vo)
7 Line to line voltages

OMICRON electronics Page 40


CM Engine

For a complete description of the commands, including the values that will be returned by inp:ana:get?(),
please look them up in the CM Engine Reference Manual.

The inp:ana:sync command ensures that all measuring tasks with the same integration time are
synchronized so the results are obtained simultaneously and are applicable to the same batch of samples. If
this command is not used, each task begins getting results the moment it is started, and there would be an
unavoidable time shift in the results. In this case, all tasks would be synchronized except the frequency
measurement, which has a number of periods instead of a time as integration parameter.

The tasks remain active until they are removed with the inp:ana:clr() command. The command allows
removal of one task or of all active tasks. If only one task is removed, the rest is not affected.

To finish the example, let’s get the results of some of the measurement tasks we have started:

inp:ana:get?(1)
Result :
1,4.967285e+001,0,1.198608e+000,0,1.319092e+000,0,1.146973e+000,0,4.968555e+001,0,9.019012e-
001,0,4.969406e-001,0,1.006195e+000,0,4.969238e+001,0, 1.081421e+000,0,5.218201e-001,0,9.777374e-
001,0;

This command returns the readings of the RMS measurement task. The readings are in the same order as
the inputs appeared in the input list when the command was issued. For each input in the list, two readings
are provided, each with its validity flags: the first reading is the AC RMS value and the second reading is the
DC component. This way, we see that the first voltage is approximately 50V with 1.19V of DC component; the
first current (input 2) is 1.31A with 1.14A of DC component, and so forth.

2.8 VBA functions


'This function extracts one parameter from a string, and returns it
'Returns a non-empty string if the parameter was found, an empty string if the function could not
extract the parameter

'String format: <parameter1>,<parameter2>,......<parameterN>;


'so there are N-1 commas before the Nth parameter, and a comma or a semicolon after the parameter
'The user will later convert the parameter as required

Function ExtractParameter(ByVal ParNumber As Integer, ByVal CmdResult As String) As String


Dim textpos1 As Integer
Dim textpos2 As Integer
Dim Counter As Integer

ExtractParameter = "" 'We assume no return, for the moment


Counter = 0

If ((ParNumber <= 0) Or (CmdResult = Null)) Then


ExtractParameter = ""
Exit Function
End If

'First, let's find the last comma before the parameter


'For parameter N there are N-1 commas

textpos1 = 0

Counter = 0
While Counter < (ParNumber - 1)
textpos1 = InStr(textpos1 + 1, CmdResult, ",", 0)
If ((textpos1 = 0) Or (textpos1 = Null)) Then 'We cannot find a comma that we need,
ExtractParameter = "" 'so the parameter does not exist in this
string
Exit Function
End If
Counter = Counter + 1
Wend

'If we leave the loop, then the comma is found. Let's find the closing character

OMICRON electronics Page 41


CM Engine

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

'Routine to issue a command and get the return string


Sub Command(ByVal stringCommand As String, ByRef Info As String)
Info = CMEng.Exec(1, stringCommand)
End Sub

'Routine to issue a command when no answer is expected


Sub CommandNoAnswer(ByVal stringCommand As String)
Dim DumpResult As String
DumpResult = CMEng.Exec(1, stringCommand)
End Sub

OMICRON electronics Page 42


CM Engine

3 Interface Functions
As already described in the chapter "Typical program sequence", you can use the CM Engine's interface
functions in your program.

First, the following chapter supplies a quick overview of all error codes that the CM Engine's interface may
cause. This is followed by a detailed description of every interface function, the error codes a specific function
may cause and the reasons are explained in this description. Each function description also contains an entry
called „Compatibility“ which indicates for which platforms the function is available.

Furthermore, you can get a more practical approach to the use of the interface functions if you read the
source code examples like BATCHER!, which are supplied with the CM Engine.

3.1 Overview of error codes


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 CM Engine interface are listed in the following table for an overview:

No Error code mnemonic Group Description


000 CMERR_OK CM_ENG Operation successful
001 CMERR_INIT CM_API Fatal initialization error
002 CMERR_NO_LOCKED_CMC CM_ENG There is no locked CMC
003 CMERR_CMC_NOT_FOUND CM_ENG Selected CMC was not found
004 CMERR_CMC_NOT_LOCKED CM_ENG Selected CMC is not locked
005 CMERR_CMC_ALREADY_LOCKED CM_ENG CMC is already locked
006 CMERR_FILE_LOG CM_FIL I/O error with log file
007 CMERR_BUF_TOO_SMALL CM_ENG Buffer too small
008 CMERR_OUT_OF_RANGE CM_ENG Value out of range
009 CMERR_SYNTAX CM_ENG Syntax error
010 CMERR_PARSER_STACK_OVFL CM_ENG Parser stack overflow
011 CMERR_TOKEN_BUF_OVFL CM_ENG Token buffer overflow
012 CMERR_PUSHBACK_BUF_OVFL CM_ENG Push-back buffer overflow
013 CMERR_INVALID_INT CM_ENG Invalid integer
014 CMERR_INVALID_FLOAT CM_ENG Invalid float
015 CMERR_OUT_OF_MEMORY CM_ENG Out of memory
016 CMERR_DOWNLOAD_FILE CM_FIL File error at download
017 CMERR_DOWNLOAD CM_ENG Download file format error
018 CMERR_TRIPLE_NOT_DEF CM_ENG Triple not defined
019 CMERR_LOCK_UNLOCK_PORT CM_API Could not lock/unlock port
020 CMERR_NO_CMC_CONNECTED CM_ENG No CMC is connected to PC
021 CMERR_COMM_API CM_API Communication error (from API)
022 CMERR_COMM CM_ENG Communication error
023 CMERR_STILL_WORKING CM_ENG Engine is still working

OMICRON electronics Page 43


CM Engine

No Error code mnemonic Group Description


024 CMERR_IN_SEQ_MODE CM_ENG Not allowed in sequence mode
025 CMERR_NOT_IN_SEQ_MODE CM_ENG Not in sequence mode (seq:begin missing)
026 CMERR_NO_AMP_AVAIL CM_ENG No amplifier available with specified number or location
027 CMERR_NOT_SUPPORTED CM_ENG Not supported on this device
028 CMERR_MIN_GT_MAX CM_ENG Min value greater than max value
029 CMERR_AMP_IN_USE CM_ENG Amplifier is in use (routed)
030 CMERR_KINDS_DONT_MATCH CM_ENG Kind of triple doesn't match amplifier
031 CMERR_DOWNLOAD_NO_FW CM_API Firmware not found
032 CMERR_OUT_OF_CMC_MEM CM_ENG Out of CMC memory
033 CMERR_INVALID_USER_SIG CM_ENG Invalid user signal number
034 CMERR_USER_SIG_IN_USE CM_ENG User signal is in use
035 CMERR_INVALID_BOOL CM_ENG Invalid boolean expression in seq:wait
036 CMERR_PROT_FILE CM_FIL Protocol file error
037 CMERR_CALDATA_CHECKSUM CM_ENG Calibration data checksum mismatch
038 CMERR_INCOMPATIBLE_DRIVER CM_ENG Incompatible driver version
039 CMERR_LICENSE_FILE CM_FIL File error reading license file
040 CMERR_LICENSE_FORMAT CM_ENG Invalid license number format
041 CMERR_NO_LICENSE CM_ENG No valid license number available
042 CMERR_PROC_EXHAUST CM_ENG CMC signal processing exhausted
043 CMERR_TIMER CM_ENG Error creating/removing timer
044 CMERR_TIMER_API CM_API Error creating/removing timer (Win32)
045 CMERR_PMODE_DIFF CM_ENG Phase mode diff not possible
046 CMERR_HW_OUT_OF_TOL CM_ENG CMC hardware out of tolerance
047 CMERR_AMP_INCOMP CM_ENG Amplifiers incompatible
048 CMERR_EXT_AMP_COMM CM_ENG External amplifier communication error
049 CMERR_INVALID_HANDLE CM_ENG Invalid engine handle
050 CMERR_CANNOT_GET_ERR CM_ENG Cannot get error code
051 CMERR_PROT_FILE_API CM_API Protocol file error
052 CMERR_SWITCH_RANGE CM_ENG Error when switching amplifier range
053 CMERR_COUNTER_ON CM_ENG Not allowed when counting is on
054 CMERR_COUNTER_NOT_ACTIVE CM_ENG Selected counter(s) not active
055 CMERR_COUNTER_MASTER_SLAVE CM_ENG Slave counter cannot be master
056 CMERR_GPS_NOT_FOUND CM_ENG GPS Device hasn't been found
057 CMERR_INVALID_DATE CM_ENG Invalid date
058 CMERR_GPS_BAD_RESPONSE CM_ENG Invalid response from GPS
059 CMERR_GPS_COMM_ERR CM_ENG Communication error CMC to GPS
060 CMERR_GPS_HW_ERR CM_ENG GPS Hardware error
061 CMERR_GPS_BUSY CM_ENG GPS is busy and cannot process command
062 CMERR_ALREADY_LOGGED CM_ENG Shouldn't get this message
063 CMERR_INIT_MEAS CM_ENG Error initializing the Measuring DSP
064 CMERR_NONEXIST_MEASJOB CM_ENG Specified job does not exist
065 CMERR_TASK_VECTOR_FULL CM_ENG Task vector is full, no more measuring tasks can be issued
066 CMERR_DCTASK_OFF CM_ENG Cannot get results, DC task is switched off
067 CMERR_BIN_INPUT CM_ENG Potential Free channel was used in AC function
068 CMERR_INVALID_NO_INPUTS CM_ENG An invalid number of channels was specified
069 CMERR_INVALID_VI_PAIR CM_ENG The channel list wasn't made up of VI pairs
070 CMERR_256_CMD CM_ENG Command can only be executed on a CMC256 or higher
071 CMERR_RES_NOT_AVAIL CM_ENG The requested resource is not available
072 CMERR_RES_ALREADY_LOCKED CM_ENG The requested resource is already locked
073 CMERR_RES_NOT_LOCKED CM_ENG A necessary resource is not locked
074 CMERR_POWER_SUPPLY CM_ENG Could not activate power supply
075 CMERR_TRANS_START CM_ENG The transfer has already been started
076 CMERR_TRANS_NOT_START CM_ENG The transfer hasn't been started yet
077 CMERR_NO_CHANNELS_SEL CM_ENG At least one channel must be acquired
078 CMERR_GEN_MEAS CM_ENG An error occurred in the measurement DSP
079 CMERR_NOT_MM_MODE CM_ENG This command is only allowed in multi-meter mode
080 CMERR_NOT_SCOPE_MODE CM_ENG This command is only allowed in scope mode
081 CMERR_ANA_OUT_NOT_AVAIL CM_ENG Analog output not available
082 CMERR_ANA_OUT_ALREADY_LOCKED CM_ENG The requested Analog output is being used by another
application
083 CMERR_ANA_OUT_NOT_LOCKED CM_ENG A necessary Analog output is not locked
084 CMERR_AUX_DC_NOT_AVAIL CM_ENG The connected device has no Aux DC
085 CMERR_AUX_DC_ALREADY_LOCKED CM_ENG The Aux DC is being used by another application
086 CMERR_AUX_DC_NOT_LOCKED CM_ENG The Aux DC is not locked
087 CMERR_MPINPUT_NOT_AVAIL CM_ENG Multipurpose input not available
088 CMERR_MPINPUT_ALREADY_LOCKED CM_ENG The requested multipurpose input is being used by another
application
089 CMERR_MPINPUT_NOT_LOCKED CM_ENG A necessary multipurpose input is not locked
090 CMERR_BIN_INP_NOT_AVAIL CM_ENG Binary input not available
091 CMERR_BIN_INP_ALREADY_LOCKED CM_ENG The requested binary input is being used by another
application
092 CMERR_BIN_INP_NOT_LOCKED CM_ENG A necessary binary input is not locked
093 CMERR_BIN_OUT_NOT_AVAIL CM_ENG Binary output not available
094 CMERR_BIN_OUT_ALREADY_LOCKED CM_ENG The requested binary output is being used by another

OMICRON electronics Page 44


CM Engine

No Error code mnemonic Group Description


application
095 CMERR_BIN_OUT_NOT_LOCKED CM_ENG A necessary binary output is not locked
096 CMERR_TRANS_OUT_NOT_AVAIL CM_ENG Transistor output not available
097 CMERR_TRANS_OUT_ALREADY_LOCKED CM_ENG The requested transistor output is being used by another
application
098 CMERR_TRANS_OUT_NOT_LOCKED CM_ENG A necessary transistor output is not locked
099 CMERR_DC_INP_NOT_AVAIL CM_ENG The DC Inputs are not available
100 CMERR_DC_INP_ALREADY_LOCKED CM_ENG The DC Inputs are being used by another application
101 CMERR_DC_INP_NOT_LOCKED CM_ENG The DC Inputs are not locked
102 CMERR_COUNTER_NOT_AVAIL CM_ENG Counter not available
103 CMERR_COUNTER_ALREADY_LOCKED CM_ENG The requested counter is being used by another
application
104 CMERR_COUNTER_NOT_LOCKED CM_ENG A necessary counter is not locked
105 CMERR_GPS_NOT_AVAIL CM_ENG The GPS is not available
106 CMERR_GPS_ALREADY_LOCKED CM_ENG The GPS is being used by another application
107 CMERR_GPS_NOT_LOCKED CM_ENG The GPS is not locked
108 CMERR_SEQ_NOT_AVAIL CM_ENG The sequencer is not available
109 CMERR_SEQ_ALREADY_LOCKED CM_ENG The sequencer is being used by another application
110 CMERR_SEQ_NOT_LOCKED CM_ENG The sequencer is not locked
111 CMERR_SAMPLE_BUFF_NOT_AVAIL CM_ENG The sample buffer is not available
112 CMERR_SAMPLE_BUFF_ALREADY_LOCKED CM_ENG The sample buffer is being used by another application
113 CMERR_SAMPLE_BUFF_NOT_LOCKED CM_ENG The sample buffer is not locked
114 CMERR_MEAS_DSP_NOT_AVAIL CM_ENG The Measuring DSP is not available
115 CMERR_MEAS_DSP_ALREADY_LOCKED CM_ENG The Measuring DSP is being used by another application
116 CMERR_MEAS_DSP_NOT_LOCKED CM_ENG The Measuring DSP is not locked
117 CMERR_ALL_PORTS_LOCKED CM_ENG All parallel ports are locked by other applications
118 CMERR_FLASH_PROG CM_ENG Error in flash programming
119 CMERR_NO_BIN_OUT_TASKS CM_ENG No more binary output tasks available
120 CMERR_EXT_AMP_SHUTDOWN CM_ENG External amplifier has been shut down
121 CMERR_OBSOLETE CM_ENG This command is obsolete
122 CMERR_SYNC_LOST CM_ENG Synchronzation between master and slave lost
123 CMERR_CANNOT_ADD_NEW_SLAVE CM_ENG Cannot add new slave because of multiple clients
accessing the master
124 CMERR_CANNOT_REMOVE_LOST_SLAVE CM_ENG Cannot remove lost slave because of multiple clients
accessing it
125 CMERR_LICENSE_EXPIRED CM_ENG License has expired
126 CMERR_HARM_NOT_RUNNING CM_ENG No harmonic analysis running
127 CMERR_HARM_NOT_RUNNING_CH CM_ENG No harmonic analysis is running on this channel
128 CMERR_INVALID_LOCK_INFO CM_ENG Invalid lock information
129 CMERR_CANNOT_INIT_MIC_FLASH CM_ENG Error initializing MIC flash memory driver
130 CMERR_CANNOT_READ_MIC_FLASH CM_ENG Error reading from MIC flash memory
131 CMERR_CANNOT_WRITE_MIC_FLASH CM_ENG Error writing to MIC flash memory
132 CMERR_MIC_FLASH_WRITE_FAILURE CM_ENG A value cannot be successfully stored in MIC flash
memory (the flash location was probably written to before)
133 CMERR_MIC_FLASH_PROTECTED CM_ENG Error writing to MIC flash memory because the flash sector
that is to be changed is write protected
134 CMERR_REGISTRY_ERROR CM_API Registry access error
135 CMERR_CANNOT_REGISTER_DEVICE CM_ENG Cannot add test set because it is not reachable or there is
already an automatically discovered one with the same IP
address
136 CMERR_CANNOT_GET_IP_CONFIG CM_API Cannot retrieve IP configuration
137 CMERR_CANNOT_SET_IP_CONFIG CM_API Cannot retrieve IP configuration
138 CMERR_CANNOT_GET_OPERATING_INFO CM_API Cannot get operating information
139 CMERR_REMOTE_CMD_EXEC_ERROR CM_API Error executing remote command
140 CMERR_CANNOT_GET_CPU_ID CM_API Cannot get CPU ID
141 CMERR_SET_DATETIME_FAILED CM_API Setting date and time failed
142 CMERR_INVALID_CMC_TYPE CM_ENG CMC type is invalid (value and its complement on two are
not matching)
143 CMERR_INVALID_GZIP_HEADER CM_ENG Invalid GZIP header in flash sector
144 CMERR_NOT_ASSOCIATED CM_ENG Cannot lock device, because it is not associated
145 CMERR_IFC_NOT_INITIALIZED CM_ENG CM Engine interface not properly initialized (call
RegisterClient on the _ITrackClientProcess interface or
provide a process ID when calling CMGetEngineHandle on
IDualCMEngine)
146 CMERR_GET_LPTNAME_ERROR CM_API Retrieving parallel port name failed
147 CMERR_OMFIND_ERROR CM_API Error calling OMFind
148 CMERR_HARM_CORR_ON CM_ENG Not allowed when harmonic correction is on
149 CMERR_HARM_CORR_NOT_SUPPORTED CM_ENG Harmonic correction not supported for this amplifier
150 CMERR_IRIGB_NOT_AVAIL CM_ENG The IRIGB is not available
151 CMERR_IRIGB_ALREADY_LOCKED CM_ENG The IRIGB is being used by another application
152 CMERR_IRIGB_NOT_LOCKED CM_ENG The IRIGB is not locked
153 CMERR_OVERTEMP_RECONN CM_ENG Cooling down - Please try it again in a few minutes
154 CMERR_SV_CFG_NOT_ALLOWED CM_ENG Sampled Values configuration not allowed while analog
outputs are switched on

OMICRON electronics Page 45


CM Engine

No Error code mnemonic Group Description


155 CMERR_GOOSE_CFG_SET_FAILED CM_API Could not set GOOSE configuration
156 CMERR_GOOSE_CFG_GET_FAILED CM_API Could not retrieve GOOSE configuration
157 CMERR_NOT_YET_IMPLEMENTED CM_ENG Command 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_FILE CM Engine cannot find the license file "OMICRON.LIC".
CMERR_LICENSE_FORMAT The Engine found the license file but the required license number has
an invalid format.
CMERR_NO_LICENSE The Engine started up correctly, a CMDevScanForNew() was
executed, but you tried to lock a CMC with no valid license number in
the license file.

OMICRON electronics Page 46


CM Engine

3.2 Which error codes can be caused by a specific function?


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 Communication error during command execution.
CMERR_COMM_API Communication error (detailed information is provided with the
extended API error code).
CMERR_OUT_OF_MEMORY FATAL: RAM memory of personal computer is exhausted!
CMERR_OUT_OF_RANGE A parameter in the function/command is out of range.
CMERR_STILL_WORKING The interface function can't be executed because CM Engine
is busy executing another command.
This error can occur for 16-bit Windows versions of CM
Engine only.
CMERR_HW_OUT_OF_TOL When the hardware check (which is performed when a CMC is
locked for the first time or with the sys:test? command) fails
due to a defect of the internal voltage or current generators all
commands except the sys commands are disabled and return
this error.

The other error codes that may only be caused by specific interface functions are listed with the description of
the function in section "Interface Functions".
The error codes that may be caused by the interface function Exec() depend on the string command that is
executed; thus these error codes are listed with the description of the string commands in chapter "This
section describes the CM Engine command set of string commands. The string commands are listed in
groups of related commands.String command reference".

3.3 Parameter types used in interface functions


For clients using the OLE-Automation interface, only OLE-Automation compatible types are used and no
special declarations are necessary.

3.4 Interface function reference


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.

3.4.1 AddRegDev

Syntax VBA Sub AddRegDev(IPAddress as String)


Description Add device to registry
Parameters IPAddresss
The IP Address of the CMC

3.4.2 Associated

Syntax VBA Property Associated(DevId as Long) as Boolean


Description Returns if a device is associated (only valid for ethernet devices)
Parameters DevId
The device ID of the CMC

OMICRON electronics Page 47


CM Engine

3.4.3 AssociationMode

Syntax VBA Property AssocationMode(DevId as Long) as AssociationModeType


Description Association Mode
Parameters DevId
The device ID of the CMC for which the AssociationMode should be returned or set

3.4.4 DevAssociateAppend

Syntax VBA Sub DevAssociateAppend(DevId as Long)


Description Append association for client
Parameters DevId
The device ID of the CMC to which an associated should be appended

3.4.5 DevAssociateAppendSpecific

Syntax VBA Sub DevAssociateAppendSpecific(DevId as Long, MACAddress as String)


Description Append association for a specific client
Parameters DevId
The device ID of the CMC to which a client should be associated
MACAddress
MAC Address of the client

3.4.6 DevAssociationCount

Syntax VBA Property DevAssociationCount(DevId as Long) as Long


Description Get device association count
Parameter DevId
The device ID of the CMC

3.4.7 DevAssociationInfo

Syntax VBA Property DevAssociationInfo(DevId as Long, Index as Long) as String


Description Get device association information
Parameters DevId
The device ID of the CMC
Index
The association index

3.4.8 DevAssosciationRequest

Syntax VBA Sub DevAssociationRequest(DevId as Long)


Description Request association using the button
Parameters DevId

OMICRON electronics Page 48


CM Engine

The device ID of the CMC

3.4.9 DevAssosiationRequestCancel

Syntax VBA Sub DevAssociationRequestCancel(DevId as Long)


Description Cancel association request
Parameters DevId
The device ID of the CMC

3.4.10 DevAssociationTime

Syntax VBA Property DevAssociationTime(DevId as Long, Index as Long) as Date


Description Get device association time (only valid for ethernet devices)
Parameters DevId
The device ID of the CMC
Index
The association index

3.4.11 DevDisassociate

Syntax VBA Sub DevDisassociate(DevId as Long)


Description DisassociateClient
Parameters DevId
The device ID of the CMC

3.4.12 DevDisassociateSpecific

Syntax VBA Sub DevDisassociateSpecific(DevId as Long, MACAddress as String)


Description Disassociate a specific client
Parameters DevId
The device ID of the CMC
MACAddress
The MAC address of the client which should be dissociated

3.4.13 DeviceAddress

Syntax VBA Property DeviceAddress(DevId as Long) as Integer

3.4.14 DeviceType

Syntax VBA Property DeviceType(DevId as Long) as String


Description Returns the device type of a specific CMC (e.g CMC256)
Parameters DevId
The device ID of the CMC

OMICRON electronics Page 49


CM Engine

3.4.15 FriendlyName

Syntax VBA Property FriendlyName(DevId as Long) as String


Description Friendly name of device
Parameters DevId
The device ID of the CMC

3.4.16 GetDevIDbyIPAddress

Syntax VBA Function GetDevIDbyIPAddress(IPAddress as String) as Long


Description Get device ID for IP address of device (only valid for Ethernet devices)
Parameters IPAddress
The IP Address of the CMC.

3.4.17 GetOfflineCfg

Syntax VBA Function GetOfflineCfg(CmcType as String, AmpList as String) as


String
Description Get output configurations for specified CMC/amplifier(s) combination
Parameters
Return Value

3.4.18 GetOfflineCfg2

Syntax VBA Function GetOfflineCfg2(CmcType as String, AmpList as String, Return


as String) as String
Description Get output configurations for specified CMC/amplifier(s) combination plus trigger on overload
information
Parameters
Return Value

3.4.19 SetLicInfo

Syntax VBA Sub SetLicInfo(DevId as Long, LockInfo)


Description Set license information
Parameters DevId
The device id of the CMC from which you want to set the license information

3.4.20 ResLock

Syntax VBA Sub ResLock(DevId as Long, ResGroup as ResGroupType, ResIndex as


Long)
Description Lock specified resource of a CMC for an application
Parameters DevId
The device ID of the CMC

OMICRON electronics Page 50


CM Engine

ResGroup
ResGroup can have the following values:
rgAnaOut analog outputs
rgAuxDC
rgBinInp
rgBinOut
rgCounter
rgDCInp
rgFirst
rgGPS
rgInternalCmds
rgInvalid
rgJustKeepConn
rgLast
rgMeasDSP
rgMultiInp
rgSampleBuf
rgSeq
rgTransOut
ResIndex

3.4.21 ResUnlock

Syntax VBA Sub ResUnlock(DevId as Long, ResGroup as ResGroupType, ResIndex as


Long)
Description Unlock specified resource of a CMC for an application
Parameters DevId
The device ID of the CMC
ResGroup
see above

3.4.22 ResGetList

Syntax VBA Function ResGetList(ListSelect as ListSelectType, DevId as Long,


ResGroup as ResGroupType) as String
Description Get a list of resources of a CMC
Parameters ListSelect
DevId
The device ID of the CMC
Return Value

3.4.23 LanguageForMessages

Syntax VBA Property LanguageForMessages as Short


Description Language for error and status messages (Win32 LANGID)

OMICRON electronics Page 51


CM Engine

3.4.24 ParalellPort

Syntax VBA Property ParalellPort(DevId as Long) as Short


Description Paralell port number (only valid parallel port devices)
Parameters DevId
The device id of the CMC you are interested.

3.4.25 IPAddress

Syntax VBA Property IPAdress(DevId as Long) as String


Description IP address of device (only valid for Ethernet devices)
Parameters DevId
The device id of the CMC you are interested

3.4.26 SerialNumber

Syntax VBA Property SerialNumber(DevId as Long) as String


Description Serial number
Parameters DevId
The device id of the CMC from which the SerialNumber should be returned

3.4.27 MaxAssociationTime

Syntax VBA Property MaxAssociationTime(DevId as Long,) as Long


Description Max. association time
Parameters DevId
The device id of the CMC from which the MaxAssociationTime should be returned

3.4.28 RegDevCount

Syntax VBA Property RegDevcount as Long


Description Get manually registered device count

3.4.29 RegDevItemIPAddress

Syntax VBA Property RegDevItemIPAddress(Index as Long) as String


Description Get manually registered device IP address
Parameters

3.4.30 RegDevItemIndex

Syntax VBA Sub RegDevItemInfo(Index as Long, By Ref DeviceType as String, By Ref


SerialNumber as String, By Ref FriendlyName as String)
Description Get manually registerd device info
Parameters

OMICRON electronics Page 52


CM Engine

3.4.31 RemoveRegDev

Syntax VBA Sub RemoveRegDev(IPAddress as String)


Description Remove device from registry
Parameters

3.4.32 MinReqImgVersion

Syntax VBA Property MinReqImgVersion(CmcType as String) as Long


Description Get minimum required version of the software image for the specified device type

3.4.33 RemoveDevice

Syntax VBA Sub RemoveDevice(DevId as Long)


Description Remove Device
Parameters

3.4.34 ImgDevTypePrefix

Syntax VBA Property ImgDevTypePrefix(CmcType as String) as String


Description Get software image device type for specified device type
Parameters

3.4.35 DevGetList

Syntax VBA Sub DevGetList(ListSelect As ListSelectType) As String


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 listSelect (VBA: ListSelect):
lsAllAssociated all associated devices
lsUnlockedAssociated only unlocked (but associated) devices
lsLockedAssociated only locked (but associated) devices
lsAllUnassociated all unassociated devices
lsUnlockedUnassociated only unlocked (and unassociated) devices
lsLockedUnassociated only locked (and unassociated) devices
lsAllAssociatedAny all devices (with any association state)
lsUnlockedAssociatedAny only unlocked devices (with any association state)
lsLockedAssociatedAny only locked devices (with any association state)
Return Value A string is returned as an answer: "2,DE349J,1,3;1,JA254S,0,0;"
This means that the CM Engine found 2 CMCs. The return has the following order: DevId,
Serial Number, LPT Port, Device address, DevId 2, Serial Number 2…
The first device has the Device Id 2. The serial number is DE349J and it is connected to the
LPT Port 1 with the device address 3. The second device has the device id 1. The serial
number is JA245S and it is a net-1 device (LPT Port 0 and device address 0).
Note Be careful if you want to use a net-1 device, you have to be sure that it is associated
otherwise you will not be able to lock it.

OMICRON electronics Page 53


CM Engine

3.4.36 DevLock

Syntax VBA Sub DevLock(DevID as Long)


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 CM Engine and that are not locked now
with the function DevGetList(IsUnlocked) (see description of that command).
Parameters DevId
The parameter DevId is long value that contains a device ID number (e.g. 1). To lock all
unlocked CMCs use 0 for DevId.
Please note You must lock a device before you can send string commands to it using Exec() !
When you do not need the communication channel to the CMC anymore, you should release
it with the function DevUnlock() described below.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_CMC_ALREADY_LOCKED The CMC is already locked
CMERR_CMC_NOT_FOUND The CMC was not found
CMERR_FILE_LOG Log file related problem (detailed information is
provided with the extended API error code)
CMERR_INVALID_INT An integer value in device ID list is invalid
CMERR_LOCK_UNLOCK_PORT Port could not be locked
CMERR_NO_LICENSE You tried to lock a CMC without having a CM
Engine license for this CMC

3.4.37 DevScanForNew

Syntax VBA Sub DevScanForNew(ErrorWhenNoDeviceFound as Boolean = False)


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 CM Engine error codes:
Error code Explanation
CMERR_CALDATA_CHECKSUM Calibration data checksum mismatch
CMERR_DOWNLOAD Error downloading data to CMC
CMERR_DOWNLOAD_FILE Problem downloading data from file to CMC
(detailed information is provided with the
extended API error code)
CMERR_DOWNLOAD_NO_FW Problem downloading the firmware (detailed
information is provided with the extended API
error code)
CMERR_FILE_LOG Log file related problem (detailed information is
provided with the extended API error code)
CMERR_INCOMPATIBLE_DRIVER Version numbers of Engine and driver for parallel
interface are not compatible
CMERR_INIT Problem with Engine initialization related to
Windows Registry (the extended API error code
returned with this error says which)
CMERR_LICENSE_FILE Problem with license file (detailed information is
provided with the extended API error code)
CMERR_LICENSE_FORMAT Invalid format of license number
CMERR_LOCK_UNLOCK_PORT A port could not be locked/unlocked

OMICRON electronics Page 54


CM Engine

CMERR_NO_CMC_CONNECTED There is no CMC connected at all

3.4.38 DevUnlock

Syntax VBA Sub DevUnlock(DevId As Long


Description This function is used to release one or more previously locked CMCs.
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 CM Engine error codes:
Error code Explanation
CMERR_CMC_NOT_FOUND The CMC was not found
CMERR_FILE_LOG Log file related problem (detailed information is
provided with the extended API error code)
CMERR_INVALID_INT An integer value in device ID list is invalid
CMERR_LOCK_UNLOCK_PORT Port could not be unlocked

3.4.39 Exec

Syntax VBA Function Exec(DevID As Long, Command As String) As String


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 receivers 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".
Return Value String value that contains the result from the CMC.
Please note Before you can send string commands to a CMC, you must reserve this device for your
application program with the function DevLock() described above!
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_CMC_NOT_FOUND The CMC was not found
CMERR_CMC_NOT_LOCKED The CMC is not locked to the application
CMERR_FILE_LOG Log file related problem (detailed information is
provided with the extended API error code)
CMERR_INVALID_INT The integer value in DevId is invalid
CMERR_NO_LOCKED_CMC When "0" is used as DevId: there is no locked
CMC that can receive commands
CMERR_SYNTAX Syntax error in string Command
CMERR_PARSER_STACK_OVFL or An expression is too complex or too long for the
CMERR_PUSHBACK_BUF_OVFL or parser
CMERR_TOKEN_BUF_OVFL

Example Exec(1,"out:off") ⇒ switch OFF all analog outputs of the CMC with DevId 1.

OMICRON electronics Page 55


CM Engine

Data returned by Exec():

On every string command with a question mark, e.g., "sys:status?", the function Exec() returns an answer
that is a zero terminated string. The answer of a CMC starts with its device number and ends with a
semicolon.

Example 1
Task: Get the number of analog and binary inputs of device 1.
Command: Exec(1,"inp:cfg?")
Answer: "1, 1, 1, 10, 7;"
Device number 1 returns the values 1, 1, 10 and 7. It has one analog voltage input, one
analog current input and 10 binary inputs, and the I/O board’s version is 7.

3.4.40 GetStatusText

Syntax VBA Function GetStatusText(Register As Integer, Mask As Long) As String


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
nd
the related secondary status register(s) (with a 2 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 String value for the status message.

3.4.41 LogAppend

Syntax VBA Sub LogAppend(Filename As String)


Description This functions 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()).
Parameters Filename:
File name of the log file. The file name is a zero terminated string.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_FILE_LOG Log file related problem (detailed information is
provided with the extended API error code)

3.4.42 LogGetInfo

Syntax VBA Sub LogGetInfo(ByRef Level As Integer, ByRef Filename As String)


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.

OMICRON electronics Page 56


CM Engine

Parameters Level:
This buffer returns the current logging level (see CMLogSetLevel()).

Filename:
Buffer for the file name of the log file. The file name is returned as a zero terminated string.

3.4.43 LogNew

Syntax VBA Sub LogNew(Filename As String)


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 CM Engine error codes:
Error code Explanation
CMERR_FILE_LOG Log file related problem (detailed information is
provided with the extended API error code)

3.4.44 LogSetLevel

Syntax VBA Sub LogSetLevel(Level As Integer)


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 CM Engine since it
writes a large amount of data to the hard disk and thus could slow down the working speed of
the application.
Parameters Level:
The new log level to set.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter byLevel is invalid

3.4.45 LogWrite

Syntax VBA Function LogWrite(Text As String)


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 CM Engine error codes:
Error code Explanation
CMERR_FILE_LOG Log file related problem (detailed information is
provided with the extended API error code)

OMICRON electronics Page 57


CM Engine

3.4.46 OutUserApp

Syntax VBA Sub OutUserApp(DevID As Long,


UserSigNo As Long, Samples As String)
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 Error! Reference source not found..
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameters DevId and/or UserSigNo are
invalid
CMERR_IN_SEQ_MODE The CMC is executing a sequence
CMERR_USER_SIG_IN_USE The signal UserSigNo is assigned to a
generator and cannot be changed.

3.4.47 Version

Syntax VBA Function Version(ByRef Version As String) As Long


Description Asks for the version of CM Engine.
The version number is returned as a string in the buffer Version and also as a return value
of the function. If you pass a NULL pointer for Version, the string information is omitted.
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 The return value of the function is a double word (four bytes):
Bits Information
31..24 version number
23..20 revision number of the version
19..16 current error correction revision number
15..04 build number
03..00 beta flag (0 for beta, 1 for release version)

3.4.48 Functions for Real-time Playback of Transient Signals


The CMC has limited memory for the playback of transient signals (CMC156: 98816 samples, CMC256 or
newer test set: 393216 samples). The out:user:… commands are bound to these limitations. If longer

OMICRON electronics Page 58


CM Engine

signals have to be played back they have to be downloaded to the CMC while the playback is running. This
functionality is available through the RealTime… functions of the CM Engine interface. All functions in this
group are declared in CMEngFuncsEx.h.

The basic principle is illustrated by this pseude-code sequence:

Prepare the CMC for real-time playback (RealTimeBegin)


Fill the CMC memory with transient data (RealTimeWrite)
Start playback
loop
if one or more blocks free (RealTimeStatus)
download next block(s) (RealTimeWrite)
endif
until all blocks downloaded
Wait until playback is finished
Bring CMC back to normal operation (RealTimeEnd)

Arrangement of the playback data in CMC memory:


The data has to be arranged in blocks of samples. A sample is a 2-byte (16 bit) signed integer value. A
sample value of 32767 corresponds to the peak amplitude of the generator. This picture shows the
arrangement of the samples for n generators within one data block:

Sample 0 Sample 0 Sample 0 Sample 1 Sample 1 Sample 1 …


… …
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 CMRealTimeBegin, the number of
blocks that fit into the CMC memory is returned in the pnBlocks parameter of this function.
For a CMC156 with 3 voltage and 3 current generators in use you will get 7 blocks with 2048 samples per
generator in one block:
CMC memory
Each block contains
12288 samples
Block Block Block Block Block Block Block (6 generators x 2048
0 1 2 3 4 5 6 samples per generator)

playback pointer

When the playback is started, the playback pointer moves from sample to sample with the specified sampling
rate. When it reaches the end of the CMC memory (in this example the last sample of block 6), it jumps back
to the beginning of the CMC memory again. Until then the application must have replaced the data of block 0
with the data of block 7 (the next one after block 6). Actually block 0 can already be overwritten as soon as
the playback pointer reaches the first sample of block 1:
CMC memory

Block Block Block Block Block Block Block


0 1 2 3 4 5 6

playback pointer

Block Overwrite block 0 with the data for block 7 as


7 soon as block 0 is not needed anymore

The faster the playback pointer moves (= the higher the sampling rate is), the less time is available to provide
the data. The download of a data block of course needs some time (depends on the PC hardware and CMC).
It might be useful to arrange the data in the necessary block structure before the download begins, so that no
data processing during download is needed.

The status of the playback can be queried with CMRealTimeStatus. In plStatus it returns the number of
samples in the CMC memory which are not yet played back. The difference between the maximum number
of samples in the CMC memory and this value is the number of samples, which can be overwritten. If this
number is bigger than the block size, a new block can be downloaded:

**** pseudo code ****


BlockSize = CMRealTimeBegin(…, pnBlocks);

OMICRON electronics Page 59


CM Engine

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.

Arrangement of the playback data in PC memory:


The data blocks can be arranged in various ways. You can have one block for one channel, or several blocks
for several channels in one PC memory block.

BlockSize = RealTimeBegin(…);

one block for one channel


contains BlockSize samples
5 channels with 3 blocks per channel
contains 5 x 3 x BlockSize samples

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:

Data Block in PC memory


0 1 2 3 4 Generator addressing as
specified in the table below
CMC Generators
0 1 2 3 4 5
V1 V2 V3 I1 I2 I3

WORD wBlockSize = RealTimeBegin(…);



const int nChannelCount = 5;
const int nBlocksPerChannel = 3;
short pBlock[wBlockSize * nBlocksPerChannel][nChannelCount]; // in C++ syntax

for (int nBlockNo = 0; nBlockNo < nBlocksPerChannel; nBlockNo++) {
RealTimeWrite(3, nBlockNo, pBlock, 4, nChannelCount, …);
RealTimeWrite(4, nBlockNo, pBlock, 1, nChannelCount, …);
}

Addressing of the generators:


The CMRealTime… functions address the generators via their (hardware-dependent) index:

Generator 0 1 2 3 4 5
CMC 56/156 V1 V2 V3 I1 I2 I3
CMC256/25 V1 V2 V3 I1A I2A I3A
6plus/356

Generator 6 7 8 9 10 11
CMC 56/156 Gen.out 7 Gen.out 8 Gen.out 9 Gen.out 10 Gen.out 11 Gen.out 12
CMC256/25 LL out 1 LL out 2 LL out 3 LL out 4 LL out 5 LL out 6
6plus/356

Generator 12 13 14 15 16 17
CMC 56/156 n/a n/a n/a n/a n/a n/a
CMC256/25 V4 n/a n/a I1B I2B I3B
6plus/356

OMICRON electronics Page 60


CM Engine

Setting the amplitudes:


As already mentioned a sample is a 2-byte (16 bit) signed integer value. A sample value of 32767
corresponds to the peak amplitude of the generator.
The actual amplitude of a sample is:
Sample
AOutput = ⋅A
32767
where Sample is the integer value of the sample and A is the amplitude set with the out: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:

Prepare the CMC for real-time playback (RealTimeBegin)


Fill the CMC memory with transient data (RealTimeWrite)

seq:begin
out:ana:v(…):a(…)
out:ana:i(…):a(…)
out:ana:on
seq:wait(<total playback duration in seconds>, 1)
out:ana:off
seq:end
seq:exec

loop
if one or more blocks free (RealTimeStatus)
download next block(s) (RealTimeWrite)
endif
until all blocks downloaded
Wait until playback is finished (i.e. seq:status?(step) returns 0)
Bring CMC back to normal operation (RealTimeEnd)

Please note that the maximum time for the seq:wait command is 838 seconds. If you have longer signals
you have to use several seq:wait commands or use a loop.

Some additional notes:


For performance reasons the RealTime… functions are implemented on a very low level. They override
settings made with the amp:def and amp:route commands. Furthermore they should not be used together
with out:ana commands other than those needed to set the amplitudes and switch the outputs on and off.

These functions have an experimental status and might change in future releases of CM Engine.

3.4.48.1 RealTimeBegin

Syntax VBA Function RealtimeBegin(DevID as Long, Freq as Double, UseVS as Long,


Usels Is Long, Blocks as Long) as Long
Description Prepares a CMC for real-time playback of transient signals.
Parameters DevId:
Id of the CMC device to be prepared for real-time playback.

dSampleRate:
Sampling rate of the transient signal to be played back (in samples/second). Must be > 0 and
≤ 10000.

nUseVs:
Number of voltage triples to be used.

nUseIs:

OMICRON electronics Page 61


CM Engine

Number of current triples to be used.

pnBlocks:
Pointer to a buffer which receives the number of blocks that fit into CMC memory.
Please note nUseVs and nUseIs do not affect the generator indices in any way. They are only used for
block size calculation.
Return Value The return value is the size of one block (in samples) or zero if the function failed.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_NOT_SUPPORTED The connected CMC does not support this
function.

3.4.48.2 RealTimeEnd

Syntax VBA Sub RealtimeEnd()


Description Ends real-time playback and brings CMC back to normal operation.

3.4.48.3 RealTimeWrite

Syntax VBA Sub RealtimeWrite(ChanNo as Long, BlockNo as Long, Block as String,


Channel As Word, NumChls as Word, By Ref CheckChl as Boolean)
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.
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).

3.4.48.4 RealTimeStatus

Syntax VBA BOOL RealtimeStatus(Channel As Word,


By Ref Status as Long);
Description Read realtime playback status of selected generator
Parameters wGenerator:
Generator number to be checked (must be the last generator in use in the current
implementation).

plStatus:

OMICRON electronics Page 62


CM Engine

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.4.48.5 RealtimeSetCheckChl

Syntax VBA Function RealtimeSetCheck(Channel as Word) as Long


Description Set channel which should be checked for underflow
Parameters Channel
Return Value

OMICRON electronics Page 63


CM Engine

4 String Commands
The following chapter explains everything that is important to assemble string commands for the CM Engine:
syntax rules of the string commands, parameter types used in string commands, symbols used in string
commands and the syntax and the usage of every string command.

4.1 Symbols used in string commands

The following symbols are used for notation purposes only (do not insert them into your string commands):
<...> parameters are enclosed like this, e.g., <filename>.
[ ] the command, parameter or keyword in brackets is optional.
| the "pipe sign" between keywords states that you can either use the keyword to the left or the
keyword to the right of this sign.

The following symbols can be used within CM Engine string commands:


: separates sub-commands, e.g., sys:reset, or
separates triple number and signal number in a <triple_list_type>, e.g., v(1:2) or
in the command out:ana:app:
separates the sample value from the number of its repetitions.
; shortcut symbol that combines multiple sub-commands of the same hierarchy level.
This feature only exists for some special sub-commands described later.
.. symbol to define a range in <enumeration>.
, separator between parameters of a command.

The special symbols used by the CM Engine in the string answers returned for string commands containing a
question mark are explained with the Exec() interface function.

4.2 Syntax rules for string commands


The following section describes the syntax rules needed to assemble the string commands you send to CM
Engine 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.

OMICRON electronics Page 64


CM Engine

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)

• 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.

4.3 Parameter types used in the string commands

Overview of the parameter types for the parameters used in CM Engine string commands:
31 31
<integer> Integer number between -2 and 2 -1 (the precise limits of an integer parameter are
described with each command). This type corresponds to a 32 bit signed integer.
Normally you write the number in decimal notation.
with a prefix "0" (zero) it is octal,
with a prefix "0x" (zero-x) it is hexadecimal and
with a prefix "0b" (zero-b) it is binary.

The hexadecimal numbers are not case sensitive. All numbers can be signed or
unsigned.

Examples for <integer>:


"1456", "0b10010111", "0x1F4C", "0x1f4c", "-22", "-0x1f4c".
<enumeration> Combination of <integer> in the following ways:
<integer> (specifies one item, e.g. a generator)
<integer>,<integer>, ... (specifies a list of items, e.g. of generators)
<triple_list_type> Combination of <integer> in the following ways:
<integer>

OMICRON electronics Page 65


CM Engine

<integer>,<integer>, ...
<integer>:<integer>

You can also assemble such combinations, e.g.:


<integer>:<integer>,<integer>
<integer>:<integer>,<integer>:<integer>

This parameter type is used to define the generators in an out:ana: ... command:
1 first generator triple.
1,2 first and second generator triple.
1:3 third generator of first generator triple.
1:3,2:1 third generator of first generator triple and
first generator of second generator triple.

<float> Whole or real number, with or without exponent, signed or unsigned; range is
±1.7E±308. This type corresponds to an IEEE floating point type with double precision.
Format of real number:
[+-] integer_digits "." fraction_digits [eE [+-] exponent_digits]
[+-] integer_digits "." [fraction_digits] [eE [+-] exponent_digits]
[+-] [integer_digits] "." fraction_digits [eE [+-] exponent_digits]

4.4 String command reference


This section describes the CM Engine command set of string commands. 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.4.1 System commands

4.4.1.1 sys:reset

Function Executes a reset on a CMC device.


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 CM Engine 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

OMICRON electronics Page 66


CM Engine

Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_CALDATA_CHECKSUM Calibration data checksum mismatch
CMERR_DOWNLOAD Error downloading data to CMC
CMERR_DOWNLOAD_FILE Problem downloading data from file to CMC
(detailed information is provided with the
extended API error code)
CMERR_DOWNLOAD_NO_FW Problem downloading the firmware (detailed
information is provided with the extended API
error code)
CMERR_IN_SEQ_MODE Command not allowed within sequence

4.4.1.2 sys:test? [(<filename>)]

Function Starts a self test of a CMC.


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.
Parameter <filename>:
Name of the report file. This parameter is optional.
Please note After a sys:test? a CMC is in the power-on state (same as after sys:reset).
Answer Returns a string which is the shortcut for a diagnostic message:
returned string diagnostic message
ok no errors were detected
v1 voltage at internal voltage generator 1 is outside of tolerance limits
v2 voltage at internal voltage generator 2 is outside of tolerance limits
v3 voltage at internal voltage generator 3 is outside of tolerance limits
vtemp temperature of internal voltage generators is above the limit
i1 current at internal current generator 1 is outside of tolerance limits
i2 current at internal current generator 2 is outside of tolerance limits
i3 current at internal current generator 3 is outside of tolerance limits
itemp temperature of internal current generators is above the limit
ad errors occurred on AD/DA converters or AD/DA board is not present
bin errors occurred on at least one of the binary inputs or an input has
voltage above 250 Volts
The answer string can consist of one or more of the above strings. If any combination of v1,
v2, v3, i1, i2, i3 is returned all commands except the sys commands are disabled and return
CMERR_HW_OUT_OF_TOL.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_PROT_FILE There is a problem with the given report file
(detailed information is provided with the
extended API error code)

Example The string command sys:test? is sent to CMC #1 and the following string is returned:
"1,v2,ad;". This means that in CMC #1 the voltage at internal voltage generator 2 is outside of
tolerance limits and errors occurred on the AD/DA converters.

4.4.1.3 sys:cfg? (type | ser | hard | firm | cal)

Function Get system information of a CMC.


Parameters You must specify one of the keywords type, ser, hard, firm or cal.

OMICRON electronics Page 67


CM Engine

Answer The command causes a string that contains the following data:
Keyword Returned data
type CMC model information string ("CMC 56" or "CMC151") and model number.
Answer is e.g. "1,CMC 56,0;": Device 1 is a CMC 56 with model number 0.
ser Serial number of the device.
Answer is e.g. "1, DA345D; ": Device 1 has the serial number DA345D.
hard Version number and clock frequency of signal processor board.
Answer is e.g. "1, 5, 3.300000000E+007;": Device 1 has a signal processor
board version 5 with a clock frequency of 33 MHz.
firm Version numbers of the firmware (monitor and overlay programs).
Answer is e.g. “1, 4.20, 4.20;“: Device 1 has a monitor program with version
number 4.20 and an overlay program with version number 4.20.
cal Date of last factory calibration.
Answer is e.g. “1,2000,3,4”: Device 1 was last calibrated on March 4, 2000.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence

4.4.1.4 sys:status? [ (<bit_number>) ]

Function Get the status of a CMC device.


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).
Parameter <bit_number>:
This parameter is of type <integer> and is optional. It specifies the number of the secondary
register.
Please note When you get the content of a secondary status register, the register content is deleted.
Answer The content of the register specified is returned in a zero terminated string.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_CALDATA_CHECKSUM Calibration data checksum mismatch
CMERR_DOWNLOAD Error downloading data to CMC
CMERR_DOWNLOAD_FILE Problem downloading data from file to CMC
(detailed information is provided with the
extended API error code)
CMERR_DOWNLOAD_NO_FW Problem downloading the firmware (detailed
information is provided with the extended API
error code)
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT <bit_number> is not a valid integer
See also Chapter "Use of the CM Engine".
Compatibility DOS Win16 Win32
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
9
device contains the decimal number 512. In this register bit, number 9 is set to "1" (2 =512)
and the other bits are "0". With the list of status register bits below you can find out that there
st
is an overload on the 1 generator of voltage generator triple 4.

OMICRON electronics Page 68


CM Engine

4.4.1.5 Organization of the status command register structure:

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
1 Internal error in a CMC
2 Overload at voltage generators
3 Overload at current generators
4 Overtemperature at voltage generators
5 Overtemperature at current generators
6 CMGPS errors
7 Overload at inputs
8 Current amplifier internal errors
9 IRIG-B errors
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

OMICRON electronics Page 69


CM Engine

Secondary status register #0: communication errors


Bit Meaning
0 Initialization failed
1 Wrong version of the signal processor board
2 Overflow in read buffer while reading from a CMC
3 Timeout while writing to a CMC
4 Timeout while reading from a CMC
5 Timeout while executing a command (host vector)
6 Timeout while waiting on a signal processor reset
7 Signal processor confused
8 Communication interrupted
9 Command execution timeout
10 Internal hardware module communication error
11 Measurement module communication error
12 Master-slave synchronization lost
13 Master-slave sequence synchronization lost
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

OMICRON electronics Page 70


CM Engine

Secondary status register #1: CMC-internal errors


Bit Meaning
0 Interrupt not available
1 CMC-internal command code not defined
2 AD/DA board not present
3
4 Timeout of software watchdog (host timeout)
5 Timeout in AD converter
6 Error in shift register
7 License violation 1
8 External infeed current output
9 Ground-wire break
10 Line input power too high
11 Voltage amplifier supply error
12 Error in measurement module
13 Wrong number of command parameters (CMC-internal command)
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

1Should not occur in normal operation mode. If it occurs all commands except sys:status? are disabled. Switch the CMC OFF and ON
again to get back to normal operation mode (a reset with "sys:reset" does not help).

OMICRON electronics Page 71


CM Engine

Secondary status register #2: overload at voltage generators


Bit Meaning
0 Voltage overload triple 1, generator 1
1 Voltage overload triple 1, generator 2
2 Voltage overload triple 1, generator 3
3 Voltage overload triple 2, generator 1
4 Voltage overload triple 2, generator 2
5 Voltage overload triple 2, generator 3
6 Voltage overload triple 3, generator 1
7 Voltage overload triple 3, generator 2
8 Voltage overload triple 3, generator 3
9 Voltage overload triple 4, generator 1
10 Voltage overload triple 4, generator 2
11 Voltage overload triple 4, generator 3
12 Voltage overload triple 5, generator 1
13 Voltage overload triple 5, generator 2
14 Voltage overload triple 5, generator 3
15 Voltage overload triple 6, generator 1
16 Voltage overload triple 6, generator 2
17 Voltage overload triple 6, generator 3
18 Voltage overload triple 7, generator 1
19 Voltage overload triple 7, generator 2
20 Voltage overload triple 7, generator 3
21 Voltage overload triple 8, generator 1
22 Voltage overload triple 8, generator 2
23 Voltage overload triple 8, generator 3
24
25
26
27
28
29
30 Voltage overload Aux DC
31

OMICRON electronics Page 72


CM Engine

Secondary status register #3: overload at current generators


Bit Meaning
0 Current overload triple 1, generator 1
1 Current overload triple 1, generator 2
2 Current overload triple 1, generator 3
3 Current overload triple 2, generator 1
4 Current overload triple 2, generator 2
5 Current overload triple 2, generator 3
6 Current overload triple 3, generator 1
7 Current overload triple 3, generator 2
8 Current overload triple 3, generator 3
9 Current overload triple 4, generator 1
10 Current overload triple 4, generator 2
11 Current overload triple 4, generator 3
12 Current overload triple 5, generator 1
13 Current overload triple 5, generator 2
14 Current overload triple 5, generator 3
15 Current overload triple 6, generator 1
16 Current overload triple 6, generator 2
17 Current overload triple 6, generator 3
18 Current overload triple 7, generator 1
19 Current overload triple 7, generator 2
20 Current overload triple 7, generator 3
21 Current overload triple 8, generator 1
22 Current overload triple 8, generator 2
23 Current overload triple 8, generator 3
24
25
26
27
28
29
30
31

OMICRON electronics Page 73


CM Engine

Secondary status register #4: overtemperature at voltage generators


Bit Meaning
0 Voltage overtemperature: triple 1, generator 1
1 Voltage overtemperature: triple 1, generator 2
2 Voltage overtemperature: triple 1, generator 3
3 Voltage overtemperature: triple 2, generator 1
4 Voltage overtemperature: triple 2, generator 2
5 Voltage overtemperature: triple 2, generator 3
6 Voltage overtemperature: triple 3, generator 1
7 Voltage overtemperature: triple 3, generator 2
8 Voltage overtemperature: triple 3, generator 3
9 Voltage overtemperature: triple 4, generator 1
10 Voltage overtemperature: triple 4, generator 2
11 Voltage overtemperature: triple 4, generator 3
12 Voltage overtemperature: triple 5, generator 1
13 Voltage overtemperature: triple 5, generator 2
14 Voltage overtemperature: triple 5, generator 3
15 Voltage overtemperature: triple 6, generator 1
16 Voltage overtemperature: triple 6, generator 2
17 Voltage overtemperature: triple 6, generator 3
18 Voltage overtemperature: triple 7, generator 1
19 Voltage overtemperature: triple 7, generator 2
20 Voltage overtemperature: triple 7, generator 3
21 Voltage overtemperature: triple 8, generator 1
22 Voltage overtemperature: triple 8, generator 2
23 Voltage overtemperature: triple 8, generator 3
24
25
26
27
28
29
30 Voltage overtemperature Aux DC
31

OMICRON electronics Page 74


CM Engine

Secondary status register #5: overtemperature at current generators


Bit Meaning
0 Current overtemperature: triple 1, generator 1
1 Current overtemperature: triple 1, generator 2
2 Current overtemperature: triple 1, generator 3
3 Current overtemperature: triple 2, generator 1
4 Current overtemperature: triple 2, generator 2
5 Current overtemperature: triple 2, generator 3
6 Current overtemperature: triple 3, generator 1
7 Current overtemperature: triple 3, generator 2
8 Current overtemperature: triple 3, generator 3
9 Current overtemperature: triple 4, generator 1
10 Current overtemperature: triple 4, generator 2
11 Current overtemperature: triple 4, generator 3
12 Current overtemperature: triple 5, generator 1
13 Current overtemperature: triple 5, generator 2
14 Current overtemperature: triple 5, generator 3
15 Current overtemperature: triple 6, generator 1
16 Current overtemperature: triple 6, generator 2
17 Current overtemperature: triple 6, generator 3
18 Current overtemperature: triple 7, generator 1
19 Current overtemperature: triple 7, generator 2
20 Current overtemperature: triple 7, generator 3
21 Current overtemperature: triple 8, generator 1
22 Current overtemperature: triple 8, generator 2
23 Current overtemperature: triple 8, generator 3
24
25
26
27
28
29
30
31

OMICRON electronics Page 75


CM Engine

Secondary status register #6: CMGPS errors


Bit Meaning
0 Hardware failure
1 Internal Communications Error
2 Initialization error
3 Trigger fail channel 0
4 Trigger fail channel 1
5 GPS communications error
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

OMICRON electronics Page 76


CM Engine

Secondary status register #7: overload at inputs


Bit Meaning
0 Overload input 1
1 Overload input 2
2 Overload input 3
3 Overload input 4
4 Overload input 5
5 Overload input 6
6 Overload input 7
7 Overload input 8
8 Overload input 9
9 Overload input 10
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

OMICRON electronics Page 77


CM Engine

Secondary status register #8: current amplifier internal errors


Bit Meaning
0 A: Supply error
1 A: Range error
2 A: Power supply shutdown
3 A: Fuse protection error
4 A: Controller stack error
5 A: Offset error
6
7
8
9
10
11
12
13
14
15
16 B: Supply error
17 B: Range error
18 B: Power supply shutdown
19 B: Fuse protection error
20 B: Controller stack error
21 B: Offset error
22
23
24
25
26
27
28
29
30
31

OMICRON electronics Page 78


CM Engine

Secondary status register #9: IRIG-B error


Bit Meaning
0 Decoder State 0: Wait for IRIG-B reference marker (no signal)
1 Decoder State 2: Frame or bit error
2 Decoder: High pulse length was wrong
3 Decoder: Bit period length was wrong
4 Decoder: Frame error
5 Decoder: Parity error
6
7
8
9
10
11
12
13
14
15
16 Encoder: No valid pulse per second (PPS)
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 CMIRIG-B device not connected to CMC

4.4.1.6 sys:goose:cfg(<filename>)

Function Configures the GOOSE settings of a CMC.


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.
Parameter <filename>:
Name of the file holding the new GOOSE configuration.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_NOT_SUPPORTED Command is not supported on this device
CMERR_GOOSE_CFG_SET_FAILED Could not set GOOSE configuration

See also command sys:goose:cfg?(<filename>)

4.4.1.7 sys:goose:cfg?(<filename>)

Function Retrieve GOOSE configuration of a CMC.


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.

OMICRON electronics Page 79


CM Engine

Parameter <filename>:
Name of the file where the current GOOSE configuration will be stored.
Answer Returns a string which is the shortcut for a diagnostic message:
returned string diagnostic message
ok The CMC contained a GOOSE configuration which was stored in
<filename>.
noconfigfile The CMC did not contain a GOOSE configuration file, thus no file could
be retrieved.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_NOT_SUPPORTED Command is not supported on this device
CMERR_GOOSE_CFG_GET_FAILED Could not retrieve GOOSE configuration

See also command sys:goose:cfg(<filename>)

4.4.2 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 module) and the output modules of the CMB.
This makes these new/modified commands a complete replacement for the original commands thus allowing
the handling of all outputs by a single command set.

For the analog outputs, the CM Engine uses an output concept that maps logical generators to physical
outputs. A logical generator outputs a signal, which can consist of two signal components. Three logical
generators are combined to a generator triple (or just triple), which is mapped (or routed) to a physical
amplifier with three outputs. With the output commands out:... you can specify all parameters for the logical
generators (amplitude, phase, frequency, waveform of signal components and the mix-mode that defines the
way the signal components are superimposed).

In the output command tree the parameter type <triple_list_type> specifies the logical generator(s) or triple(s)
the sub-commands are applied.

Examples:
Command Applies to the following generators:
as parameter in words
st
out:ana:v(1): ... v(1) 1 generator triple v(1), i.e. the voltage generators v(1:1), v(1:2)
and v(1:3)
st nd
out:ana:v(2:1): ... v(2:1) 1 generator in 2 voltage triple
st rd
out:ana:v(1,3): ... v(1,3) 1 and 3 triple of the voltage generators
nd st rd rd
out:ana:i(1:2,3:3): ... i(1:2, 3:3) 2 generator in the 1 triple and 3 generator in 3 triple of the
current generators

With the amplifier commands amp:... you can specify the amplifier parameters and the routing of the logical
generators to the physical outputs (= amplifiers). Because there is a predefined routing of the logical
generators to the physical outputs, in most cases you don't need to use amp:... commands. After startup of
the CM Engine the following amplifier routings are predefined:

Logical generator triple Generators in this triple Predefined routing to outputs ...
v(1) v(1:1), v(1:2), v(1:3) outputs "Voltage 1,2,3" on front panel of CMC
i(1) i(1:1), i(1:2), i(1:3) outputs "Current 1,2,3" on front panel of CMC

OMICRON electronics Page 80


CM Engine

An analog voltage signal or an analog current signal consists of either one signal component or a
superposition of two signal components. The way of superposition can be defined with the mix-command
(see below). After the startup of CM Engine the mix-mode is set to sig(1) (signal component 1 only). In the
following description of output string commands the sub-command sig(<no>) selects either the first signal
component sig(1) or the second signal component sig(1) of the generator(s) defined in parameter
<generator_list>.

In CM Engine there are two different ways to calculate new values for amplitude, frequency and phase. Every
parameter amplitude, frequency and phase has two related buffers; a buffer stores absolute values and the
other stores step values (6 buffers). If you use the commands to set amplitude, frequency and phase without
the keyword step the new values are interpreted as absolute values and written directly into the parameter's
absolute buffer. When you add the optional keyword step to the command the new values are written into the
parameter's step buffer. Then the command out:ana:step adds the step buffer's value to the absolute buffer.
The next on command takes the values in the absolute buffers for the new output signal.

You can also write a negative value into the step buffer for stepwise subtractions with step. The initial value
in all step buffers is zero.

When you assemble your own string commands, you can omit the sub-commands ana and sig(1) used in
the following command descriptions, because they are default sub-commands as described earlier.

4.4.2.1 out:[ana:]v (<generator_list>):[sig(<no>):]a (<amplitude> [, step ] )


out:[ana:]i (<generator_list>):[sig(<no>):]a (<amplitude> [, step ] )

Function This command defines the amplitude for the selected signal component of all generators in
<generator_list>.
Description Whether the parameter <amplitude> is interpreted as RMS value or as peak value of the
amplitude depends on the current waveform of this signal component. This is specified with
the waveform (see wav-command).
You can define a negative amplitude to mirror the current waveform at the time axis.

Use the command amp:def?(<amp_no>) to get the highest possible value of the amplitude.
The command returns a value <max_out> that is the highest possible value you can define
as amplitude. The returned amplitude represents the RMS value of a sine wave.

You can add the optional keyword step after the amplitude value. Then the amplitude value
is not interpreted as the new amplitude to be set, but is written into the step buffer for the
amplitude.

The default value is zero for the voltage amplitude and (for command out:ana:i()... ) zero for
the current amplitude.
Parameters <generator_list>:
This parameter is of type <triple_list_type>.

<no>:
This parameter is 1 or 2 and selects either signal component 1 or component 2.

<amplitude>:
This parameter is of type <float>.

The keyword step is optional.


Please note! The new amplitude 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 CM Engine error codes:
Error code Explanation
CMERR_INVALID_FLOAT Parameter of type <float> has errors

OMICRON electronics Page 81


CM Engine

Error code Explanation


CMERR_INVALID_INT Parameter <generator_list> contains a number
that is not of type integer
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined
See also command out:ana:v(...):[sig(<no>):]wav(...).
command out:ana:on

4.4.2.2 out:[ana:]v (<generator_list>): [sig(<no>):]f (<frequency> [, step ] )


out:[ana:]i (<generator_list>):[sig(<no>):]f (<frequency> [, step ] )

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.


Please note! 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 CM Engine error codes:
Error code Explanation
CMERR_INVALID_FLOAT Parameter of type <float> has errors
CMERR_INVALID_INT Parameter <generator_list> contains a number
that is not of type integer
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined
See also command out:ana:on
command out:ana:v():[sig(<no>):]wav()

4.4.2.3 out:[ana:]v (<generator_list>):[sig(<no>):]t (<period_time>)


out:[ana:]i (<generator_list>):[sig(<no>):]t (<period_time>)

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>:

OMICRON electronics Page 82


CM Engine

This parameter is 1 or 2 and selects either signal component 1 or component 2.

<period_time>:
This parameter is of type <float>.
Please note! #1:
The new period time is defined with this command but is not set until the next on command
(e.g. out:ana:on).

#2:
With a wav(exp) command this command does not define the period time but the time
constant of the exponential decay
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_FLOAT Parameter of type <float> has errors
CMERR_INVALID_INT Parameter <generator_list> contains number that
is not an integer
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined
See also command out:ana:on
command out:ana:v():[sig(<no>):]wav()

4.4.2.4 out:[ana:]v (<generator_list>):[sig(<no>):]p (<phase> [, step ] )


out:[ana:]i (<generator_list>):[sig(<no>):]p (<phase> [, step ] )

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.


Please note The new phase 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 CM Engine error codes:
Error code Explanation
CMERR_INVALID_FLOAT Parameter of type <float> has errors
CMERR_INVALID_INT Parameter <generator_list> contains a number
that is not of type integer
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined
See also command out:ana:on
command out:ana:pmode
command out:ana:v():[sig(<no>):]wav()

OMICRON electronics Page 83


CM Engine

4.4.2.5 out:[ana:]v (<generator_list>):[sig(<no>):]wav (<waveform>, ...)


out:[ana:]i (<generator_list>):[sig(<no>):]wav (<waveform>, ...)

Function This command defines the waveform <waveform> for the selected signal component of all
generators in <generator_list>.
Description After the startup of CM Engine the signal components of all generators are set to a sine
wave.

Every waveform you can choose has its own set of parameters. Therefore every selectable
waveform is described below as a different command.
Please note! After a new waveform is set, the signal parameters amplitude, frequency and phase are reset
to zero. You must set new values for the amplitude, phase and frequency when you have
changed the waveform, because amplitude, frequency and phase are interpreted in different
ways for every waveform. Therefore it is not possible to take the values from a previous
waveform for a new waveform.
When you use the ‘;’ to connect multiple commands like a(), f(), p() and wav(), the wav
command is always executed first, so any order of the commands is correct to define a new
waveform and its parameters amplitude, frequency and phase.

4.4.2.6 out:[ana:]v (<generator_list>):[sig(<no>):]wav (sin)


out:[ana:]i (<generator_list>):[sig(<no>):]wav (sin)

Function This defines a sine as new waveform for the selected signal component of the generators in
<generator_list>.
Description The amplitude value you define after the waveform has been changed is interpreted
according to the waveform defined.

After the waveform has been changed to sine the signal parameters are set to zero, as
described above. Please note that 0 is a valid value for the amplitude and the phase, but not
for the frequency. The frequency must be expressly set for all waveforms except DC, where it
cannot be set.
Parameters <generator_list>:
This parameter is of type <triple_list_type>.

<no>:
This parameter is 1 or 2 and selects either signal component 1 or component 2.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter <generator_list> contains a number
that is not of type integer
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined
See also command out:ana:v(...):[sig(<no>):]a(...)

4.4.2.7 out:[ana:]v (<generator_list>):[sig(<no>):]wav (sum,<amplitude_factor1>


,<harmonic2>,<amplitude_factor2>,<phase2>
[,<harmonic3>,<amplitude_factor3>,<phase3>]
[, ... ] )
out:[ana:]i (<generator_list>):[sig(<no>):]wav (sum,<amplitude_factor1>
,<harmonic2>,<amplitude_factor2>,<phase2>
[,<harmonic3>,<amplitude_factor3>,<phase3>]
[, ... ] )

Function Defines a signal that is a sum of a sine (the fundamental) and its harmonics for the selected
signal component of the generators in <generator_list>.

OMICRON electronics Page 84


CM Engine

Description The frequency and phase of the fundamental is to be defined by the commands f() and p().
The first parameter <amplitude_factor1> after wav(sum, ...) sets the amplitude of the
fundamental relative to the setting of the a() command. The following parameters define the
harmonics.
A harmonic is defined by the three parameters <harmonicX>,<amplitude_factorX> and
<phaseX>. They define the order of the harmonic, its amplitude relative to the setting of the
a() command and its phase relative to the fundamental. For the definition of every harmonic
you must define its three parameters <harmonicX>, <amplitude_factorX> and <phaseX>.
The parameter <harmonicX> defines the order of a harmonic. If e.g. the fundamental has a
frequency of 50 Hz, then <harmonic2> = 2 defines a second harmonic of 100 Hz.
The parameter <amplitude_factorX> (for the fundamental and the harmonics) defines the
amplitude in the following way:
The amplitude set with the a() command is multiplied with <amplitude_factorX> to obtain the
amplitude of the fundamental or harmonic respectively.
For a sum signal, an amplitude value you define with the a() command is interpreted as the
RMS value of the fundamental with <amplitude_factor1> = 1.
The parameter <phase> defines the phase of the harmonic.
You can obtain a sum signal without fundamental by setting the <amplitude_factor1> to zero.
Parameters The related parameters <harmonic>, <magnitude> and <phase> must be defined once for
every harmonic.
<generator_list>:
This parameter is of type <triple_list_type>.
<no>:
This parameter is 1 or 2 and selects either signal component 1 or component 2.
<harmonicX>:
These parameters are of type <integer> and have to be greater or equal to 2.
<amplitude_factorX>:
6
These parameters are of type <float> and are valid in the interval [0, 10 ].
<phaseX>:
These parameters are of type <float> and are valid in the interval [-360, 360].
Please note The amplitude sum of fundamental and harmonics can exceed 1. This reduces the maximum
amplitude which can be set with the a() command.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_FLOAT Parameter of type<float> has errors.
CMERR_INVALID_INT Parameter <generator_list> or <harmonicX>
contains a number that is not of type integer
CMERR_OUT_OF_CMC_MEM Internal CMC memory exhausted; cannot
download and use this waveform
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined
Example The command string out:ana:v(1):sig(1):wav(sum,1,3,0.33,0);a(20);f(50) defines the
following signal for (the first signal component of) the first triple of voltage generators:
A sum signal that consists of a fundamental wave with 50Hz and the amplitude
1 × 20Vrms = 20Vrms and its third harmonic with the amplitude 0.33 × 20Vrms = 6.6Vrms.

OMICRON electronics Page 85


CM Engine

See also command out:ana:v(...):[sig(<no>):]a(...)

4.4.2.8 out:[ana:]v (<generator_list>):[sig(<no>):]wav (sumcorr,<fund_frequency>,


<amplitude_factor1>,<harmonic2>,<amplitude_factor2>,<phase2>
[,<harmonic3>,<amplitude_factor3>,<phase3>]
[, ... ] )
out:[ana:]i (<generator_list>):[sig(<no>):]wav (sumcorr,<fund_frequency>,
<amplitude_factor1>,<harmonic2>,<amplitude_factor2>,<phase2>
[,<harmonic3>,<amplitude_factor3>,<phase3>]
[, ... ] )

Function Defines a signal that is a sum of a sine (the fundamental) and its harmonics for the selected
signal component of the generators in <generator_list>. This command allows to output
signals with harmonics up to 3 kHz.
Description The phase of the fundamental is to be defined by the command p(). The first parameter
<fund_frequency> after wav(sumcorr, ...) sets the frequency of the fundamental. Notice that
the frequency of the fundamental can NOT be changed afterwards. This command can only
be used for static output of a harmonic signal.
The parameter <amplitude_factor1> sets the amplitude of the fundamental relative to the
setting of the a() command. The following parameters define the harmonics.
A harmonic is defined by the three parameters <harmonicX>, <amplitude_factorX> and
<phaseX>. They define the order of the harmonic, its amplitude relative to the setting of the
a() command and its phase relative to the fundamental. For the definition of every harmonic
you must define its three parameters <harmonicX>, <amplitude_factorX> and <phaseX>.
The parameter <harmonicX> defines the order of a harmonic. If e.g.: the fundamental has a
frequency of 50 Hz, then <harmonic2> = 2 define a second harmonic of 100 Hz.
The parameter <amplitude_factorX> (for the fundamental and the harmonics) defines the
amplitude in the following way:
The amplitude set with the a() command is multiplied with <amplitude_factorX> to obtain the
amplitude of the fundamental or harmonic respectively.
For frequencies higher than 1.5 kHz there is a limitation of the amplitude to 150V for each
harmonic.

OMICRON electronics Page 86


CM Engine

max-Ampl (Vrms)

350

300

Output voltage 250

200

150

100

50

0
0 500 1000 1500 2000 2500 3000 3500
frequency in Hz

For a sumcorr signal, an amplitude value you define with the a() command is interpreted as
the RMS value of the fundamental with <amplitude_factor1> = 1.
The parameter <phase> defines the phase of the harmonic relativ to the fundamental.
You can obtain a sumcorr signal without fundamental by setting the <amplitude_factor1> to
zero.
Parameters The related parameters <harmonicX>, <amplitude_factorX> and <phaseX> must be defined
once for every harmonic.
<generator_list>:
This parameter is of type <triple_list_type>.
<no>:
This parameter is 1 or 2 and selects either signal component 1 or component 2.
<fund_frequency>:
This parameter is of type <float> and specifies the frequency of the fundamental.
<harmonicX>:
These parameters are of type <integer> and have to be greater or equal to 2.
<amplitude_factorX>:
6
These parameters are of type <float> and are valid in the interval [0, 10 ].
<phaseX>:
These parameters are of type <float> and are valid in the interval [-360, 360].
Please note The amplitude sum of fundamental and harmonics can exceed 1. This reduces the maximum
amplitude which can be set with the a() command.
This command is only supported on a CMC256 or newer test sets with a 3 kHz calibration. It
is not allowed for external OMICRON amplifiers and the current amplifier of the CMC356.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_FLOAT Parameter of type<float> has errors.
CMERR_INVALID_INT Parameter <generator_list> or
<harmonicX> contains a number that is not
of type integer
CMERR_OUT_OF_CMC_MEM Internal CMC memory exhausted; cannot
download and use this waveform
CMERR_HARM_CORR_NOT_SUPPORTED Harmonic correction not supported for this
amplifier
CMERR_OUT_OF_RANGE The specified fundamental frequency or a
harmonic frequency is out of range.
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined

OMICRON electronics Page 87


CM Engine

See also command out:ana:v(...):[sig(<no>):]a(...)


command amp:def?(<amp_no>,harm)

4.4.2.9 out:[ana:]v (<generator_list>):[sig(<no>):]wav (tri [ ,<duty_cycle>] )


out:[ana:]i (<generator_list>):[sig(<no>):]wav (tri [ ,<duty_cycle>] )

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:

A <duty_cycle> of zero causes the following waveform:

A <duty_cycle> of 1 causes the following waveform:

This command interprets the amplitude value defined with the a() command as peak value of
the amplitude.

OMICRON electronics Page 88


CM Engine

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>.

OMICRON electronics Page 89


CM Engine

Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
(see section "Error! Reference source not
CMERR_INVALID_FLOAT found.")
CMERR_INVALID_INT Parameter of type <float> has errors.
Parameter <generator_list> contains a number
CMERR_OUT_OF_CMC_MEM that is not of type integer
Internal CMC memory exhausted, cannot
CMERR_TRIPLE_NOT_DEF download and use this waveform
A triple in <generator_list> is not defined
See also command out:ana:v(...):[sig(<no>):]a(...)

4.4.2.10 out:[ana:]v (<generator_list>):[sig(<no>):]wav (square [ ,<duty_cycle>] )


out:[ana:]i (<generator_list>):[sig(<no>):]wav (square [ ,<duty_cycle>] )

Function Defines a square signal as waveform for the selected signal component of the generators in
<generator_list>.
Description This waveform is a square waveform with symmetric positive and the negative amplitudes.
The parameter <duty_cycle> can be used to change the duty factor of the waveform. The
default value for the duty factor is 0.5 (time of positive and time of negative signal are equal)
but you can change this when you specify the parameter <duty_cycle>:

The amplitude value defined with the a() command is interpreted here as the peak value of
the amplitude.

The default <duty_cycle> of 0.5 generates the following waveform:

A <duty_cycle> of 1 generates a positive DC signal and a <duty_cycle> of 0 generates a


negative 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.

<duty_cycle>:
The parameter is of type <float>.

OMICRON electronics Page 90


CM Engine

Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_FLOAT Parameter of type <float> has errors.
CMERR_INVALID_INT Parameter <generator_list> contains a number
that is not of type integer
CMERR_OUT_OF_CMC_MEM Internal CMC memory exhausted; cannot
download and use this waveform
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined
See also command out:ana:v(...):[sig(<no>):]a(...)

4.4.2.11 out:[ana:]v (<generator_list>):[sig(<no>):]wav (user, <user_sig_no> [,single] )


out:[ana:]i (<generator_list>):[sig(<no>):]wav (user, <user_sig_no> [,single] )

Function Defines a user-defined waveform as waveform for the selected signal component of the
generators in <generator_list>.
Description Before you can use a user-defined waveform you must define it with the commands
out:ana:user:...: use the command out:ana:user:alloc? to reserve memory for the new
waveform. The command out:ana:user:alloc? returns a number for the user-defined
waveform that you need to specify this waveform. Store the amplitude samples for this
waveform into the previously allocated memory using the command out:ana:user:app.
Finally pass the number of the user-defined waveform to this command as <user_sig_no> to
use the new waveform as a generator's signal.
A user waveform is replayed periodically with the frequency set by the f() command, but you
can use the optional keyword single to define a non repetitive playback of the user
waveform. In this case the f() command sets the sampling frequency.
Parameters <generator_list>:
The parameter <generator_list> is of type <triple_list_type>.

<no>:
This parameter is 1 or 2 and selects either signal component 1 or component 2.

<user_sig_no>:
The parameter is of type <integer>.

The keyword single is optional.


Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter <generator_list> or <user_sig_no>
contain number that is not of type integer
CMERR_INVALID_USER_SIG Parameter <user_sig_no> is not a valid user
signal
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined
See also command out:ana:user:alloc?
command out:ana:user:app

4.4.2.12 out:[ana:]v (<generator_list>):[sig(<no>):]wav (dc)


out:[ana:]i (<generator_list>):[sig(<no>):]wav (dc)

Function Defines a DC signal as waveform for the selected signal component of the generators in
<generator_list>.
Description The amplitude value defined with the a() command is interpreted as the value of the DC
signal.
Parameters <generator_list>:
This parameter is of type <triple_list_type>.

OMICRON electronics Page 91


CM Engine

<no>:
This parameter is 1 or 2 and selects either signal component 1 or component 2.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter <generator_list> contains number that
is not of type integer
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined

4.4.2.13 out:[ana:]v (<generator_list>):[sig(<no>):]wav (exp)


out:[ana:]i (<generator_list>):[sig(<no>):]wav (exp)

Function Defines a decaying exponential function as waveform for the selected signal component of
the generators in <generator_list>.
Description The following formula illustrates the relation between the time constant, the amplitude factor
and the instantaneous value of the amplitude.

Amplitude(t)=

A is the peak value of the exponential signal defined with the a() command and T is the time
constant of the exponential function defined by a t() command.

This waveform is not periodical, i.e. when you define this waveform for a signal only one
exponential decay is put out after the on command.
Parameters <generator_list>:
This parameter is of type <triple_list_type>.

<no>:
This parameter is 1 or 2 and selects either signal component 1 or component 2.

<timeconstant>:
This parameter is of type <float>.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_FLOAT Parameter of type <float> has errors
CMERR_INVALID_INT Parameter <generator_list> contains a number
that is not of type integer
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined
Example The following commands
out:ana:i(1):sig(1):wav(sin)
out:ana:i(1):sig(1):a(1)
out:ana:i(1):sig(1):f(50)
out:ana:i(1):sig(2):wav(exp)
out:ana:i(1):sig(2):a(0.5)
out:ana:i(1):sig(2):t(0.5)
out:ana:mix:i(1, add)
define a sine waveform with an amplitude of 1A and a frequency of 50 Hz for the first current
generator triple with a decaying displacement (time constant 0.5 s).

4.4.2.14 out:[ana:]v (<generator_list>):on


out:[ana:]i (<generator_list>):on

Function Switches ON the generators or generator triples enumerated in <generator_list>.


Description Use this command to switch ON your already defined output signals.

OMICRON electronics Page 92


CM Engine

Parameters <generator_list>:
This parameter is of type <triple_list_type>.
Please note After you have defined your signals you must execute an on command to switch ON the
defined signals. This method enables you to set or change multiple generators
simultaneously.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter <generator_list> contains a number
that is not of type integer
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined
CMERR_OUT_OF_RANGE A generator has wrong signal parameter
definitions. Typically, the amplitude has been set
but the frequency has been left as 0.
See also command amp:route
For another version of this command see out:ana:on
Example out:ana:v(2):on
nd
All 3 generators of the 2 voltage generator triple are switched ON.

4.4.2.15 out:[ana:]v (<generator_list>):off


out:[ana:]i (<generator_list>):off

Function Switches OFF the generators or generator triples enumerated in <generator_list>.


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 CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter <generator_list> contains a number
that is not of type integer
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined
See also For another version of the off command see out:ana:off
Example out:ana:v(2):off
nd
Switches OFF the 3 generators of the 2 voltage generator triple of a CMC.

4.4.2.16 out:[ana:]v (<generator_list>):clr


out:[ana:]i (<generator_list>):clr

Function Switches OFF the generators or generator triples enumerated in <generator_list> and clears
all signal definitions.
Description This command sets all signal component amplitudes, frequencies and phases of the selected
generators to zero. The waveform of all signal components is set to sine. The mix-mode for
all selected generators is set to the initial values (sig(1) or off, see table with
out:ana:v():mix(sig(<no>) | add | mult | off)).
Parameters <generator_list>:
This parameter is of type <triple_list_type>.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined
See also For another version of the clr command see out:ana:clr

OMICRON electronics Page 93


CM Engine

Example out:ana:v(2):clr
nd
Switches OFF the 3 generators of the 2 voltage generator triple of a CMC and clears all
signal definitions for these generators.

4.4.2.17 out:[ana:]v (<generator_list>):mix (sig(<no>) | add | mult | off)


out:[ana:]i (<generator_list>):mix (sig(<no>) | add | mult | off)

Function Defines how the two signal components sig(1) and sig(2) of every generator are mixed
together.
Description The setting sig(1) defines that the output signal of this generator only consists of signal
component 1 and signal component 2 is ignored. The setting sig(2) defines that the output
signal of this generator only consists of signal component 2 and signal component 1 is
ignored.

The keyword add defines that the output signal of the generator consists of the sum of the
two signal components.

When two signal components are mixed with mult, the amplitude of the resulting signal is
calculated in relation to the scaling amplitude of the signal components. The scaling
amplitude is the maximum amplitude calculated from the amplification specified in the
amp:def command (instantaneous, not rms). When you overlay two signal components that
have this maximum scaling amplitude, the resulting signal has the same maximum scaling
amplitude too. A signal component that has an amplitude less than the maximum scaling
amplitude reduces the amplitude of the resulting signal in direct proportion.

The option off allows to switch off the signal generation for the generators named in the
generator list. When the error code CMERR_PROC_EXHAUST indicates that the number of
signals to calculate exceeds the capacity of the CMC's signal generation unit, this feature has
to be used to switch off some of the signals you have defined. The calculation capacity
depends on the DSP board version of the CMC.

The default settings for the signal component mixers of the generators are:
Triple Generators Default
v(1) v(1:1), v(1:2), v(1:3) sig(1)
i(1) i(1:1), i(1:2), i(1:3) sig(1)
generators v(2), v(3) etc. ... off
generators i(2), i(3) etc. ... off
Overview of keywords:
Keyword Explanation
sig(1) Use only the first signal component to get the signal.
sig(2) Use only the second signal component to get the signal.
add Add both signal components to get the signal.
mult Multiply both signal components to get the signal.
off Switch off signal generation for the generators in list.
Please note The settings sig(2), add and mult can only be used when the phase mode is set to abs (see
command out:ana:pmode).
The setting mult is not supported in the following cases:

- for CMC151 devices


- for series configuration of voltage amplifiers
- for parallel configuration of current amplifiers

therefore, all voltage amplifiers configurations with the “ser” string in their mode parameter,
and all current amplifiers configurations with the “par” string in their mode parameter, cannot
use signal multiplication. Please see the amp:cfg?() command for details.

OMICRON electronics Page 94


CM Engine

Parameters <generator_list>:
This parameter is of type <triple_list_type>.

<no>:
This parameter is 1 or 2 and selects either signal component 1 or component 2.
Thus you must specify one of the keywords sig(1), sig(2), add, mult or off here.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter <generator_list> contains number that
is not of type integer
CMERR_ TRIPLE_NOT_DEF A triple in <generator_list> is not defined
CMERR_PROC_EXHAUST Signal calculation capacity of CMC exhausted
(too many signals defined)
CMERR_PMODE_DIFF Operation not possible in diff mode (see "Please
note!" above)
CMERR_NOT_SUPPORTED Command is not supported on this device
See also command out:ana:pmode
command amp:cfg?()

4.4.2.18 out:[ana:]save

Function Saves signal parameters for all generators.


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.
See also out:ana:restore
out:ana:clr
out:ana:off

4.4.2.19 out:[ana:]restore

Function Restores signal parameters for all generators.


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.
Please note! 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 out:ana:save
out:ana:clr
out:ana:off

OMICRON electronics Page 95


CM Engine

4.4.2.20 out:[ana:]v (<triple_no>):zero(<zero_factor>)


out:[ana:]i (<triple_no>):zero(<zero_factor>)

Function Sets the zero component factor.


Description When a triple is routed to an amplifier configuration that supports automatic calculation of the
zero component, this command allows setting a factor that will be multiplied by the resultant
of the three phase magnitudes before it is output. The command must refer to a triple,
attempts to apply it to individual generators will have no effect.
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 CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter <generator_list> contains a number
that is not of type integer
CMERR_INVALID_FLOAT The <zero_factor> parameter is not of type float
CMERR_ TRIPLE_NOT_DEF A triple in <generator_list> is not defined
CMERR_NOT_SUPPORTED A triple in <generator_list> is not routed to a
configuration with automatic calculation of the
zero component
CMERR_OUT_OF_RANGE The zero factor is out of range

See also amp:cfg?[(<cfg_no>)]


Example Assuming v(1) is correctly routed:
out:ana:v(1):a(30);f(50)
out:ana:on the zero component is output with a = 90V and phase = 0
out:ana:v(1):zero(0.5) the zero component is output with a = 45V and phase = 0
out:ana:v(1):zero(-1.5) the zero component is output with a = 135V and phase = 180

4.4.2.21 out:[ana:]on

Function Switches ON all generators with defined signals.


Description Use this command to switch ON all generators with previously specified voltage or current
signals, or to apply all changes done to the generator’s parameters since the last
out:[ana:]on command.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_OUT_OF_RANGE A generator has wrong signal parameter
definitions. Typically, the amplitude has been set
but the frequency has been left as 0.
Please note After you have defined your signals you must execute an on command to switch ON these
defined signals. This method enables you to set or change multiple generators
simultaneously.
See also For another version of this command see out:ana:<generator_list>:on

4.4.2.22 out:[ana:]off[(zcross[,<off_generator_list>])]

Function Switches OFF all the generators, but leaves their signal parameters defined.

OMICRON electronics Page 96


CM Engine

Description The generators are switched OFF, but their signal parameters are still defined. For CMC 151
and CMC 156 the power supplies are additionally switched to stand-by mode (see amp:ctrl).
You can use an on command to switch them ON again.

You can use the optional keyword zcross (derived from zero crossing) to simulate the
behavior of a power switch, i.e. to switch off signals in their zero crossing. When you specify
zcross without a generator list, all the signals of the active generators are switched OFF at
their next zero crossing. The out:ana:off command with the zcross keyword is not
supported for the CMC151.

When you specify zcross with a <off_generator_list>, only the generators selected in the list
are switched off at their next zero crossing.

When you want to switch some signals OFF simultaneously with other signals, you can
specify these signals in the parameter <off_generator_list> in the following way:

First specify the generator (or generator triple) that is to be switched off in its zero crossing,
then add "&" then and specify one or more generators (or generator triples) that are to be
switched off simultaneously.

When the parameter before "&" is a single generator, the parameters after "&" must be single
generators too:

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
generators v(1:3) and v(2:3) are switched off with the generator i(2:3).
Parameters The keyword zcross is optional.

<off_generator_list>:
This parameter is optional and can only be used when zcross is specified first. Its structure
is a comma-separated list of generator triples, generators and combinations of generators or
generator triples connected using "&" (see examples). The list would look like this:
v|i(int)&v|i(int)... , v|i(int)&v|i(int)..., ...
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter <off_generator_list> contains a
number that is not of type integer
CMERR_TRIPLE_NOT_DEF A triple in <generator_list> is not defined
CMERR_PROC_EXHAUST Not enough calculation capacity left for zcross
CMERR_NOT_SUPPORTED Command is not supported on this device
See also For another version of this command where you can specify generators or generator triples to
be switched OFF see out:ana:v():off
Examples out:ana:off
Switches OFF all generators of a CMC immediately.

OMICRON electronics Page 97


CM Engine

out:ana:off (zcross)
Switches OFF all generators of a CMC at their next zero crossing.

out:ana:off (zcross, v(1))


st
Switches OFF the 3 generators of the 1 voltage generator triple of a CMC at their next zero
crossing.

out:ana:off (zcross, v(1), i(3))


Switches OFF the 3 generators of the voltage triple 1 and the 3 generators of current triple 3
of a CMC at their next zero crossing.

out:ana:off (zcross, v(1:2) & i(1:2) & i(2:2))


nd st
Switches OFF the 2 generator of the 1 voltage generator triple at its next zero crossing.
nd st
Simultaneously switches OFF the 2 current generator of the 1 current generator triple and
nd nd
the 2 generator of the 2 current generator triple.

out:ana:off (zcross, v(1:2) & i(1:2), v(1:3) & i(1:3), i(2))


Switches OFF v(1:2) at its zero crossing and i(1:2) with it. Switches OFF v(1:3) at its zero
nd
crossing and i(1:3) with it. Switches OFF the generators of the 2 current generator triple in
their next zero crossing.

4.4.2.23 out:[ana:]clr

Function Switches OFF all generators and clears all signal definitions.
Description This command sets all signal component amplitudes, frequencies and phases to zero. The
waveform of all signal components is set to sine. The mix-mode for all generator triples is set
to the initial values (sig(1) or off, see table with out:ana:v():mix(sig(<no>) | add | mult |
off)). For CMC 151 and CMC 156 the power supplies are switched to stand-by mode
additionally (see amp:ctrl).
See also command out:ana:off

4.4.2.24 out:[ana:]step [(load | exec)]

Function After you have set the step buffers of amplitude, frequency and phase you can use this
command to add the contents of the three step buffers to the current values of amplitude,
frequency and phase.
Description You have to use the amplitude, frequency or phase commands a(), f() or p() with the
additional keyword step to store values into the step buffers before you execute the
out:ana:step command.

The execution of out:ana:step adds the values of all amplitude step buffers to the current
amplitudes, the values of all frequency step buffers to the current frequencies and the values
of all phase step buffers to the current phases.

All step values are buffered twice, in the CM Engine and in the CMC. A step command
downloads the current step values into the CMC and executes a step operation. With the two
optional parameters load and exec you can perform a separate download of the new step
values or perform a separate step operation using the CMC's current step value.
Please note Through the execution of multiple out:ana:step commands an overflow (greater than the
maximum) or underflow (smaller than the minimum) of the amplitude and frequency values
can occur. The resulting output values are not predictable. So take care that out:ana:step
does not produce any overflows (e.g. using a timeout condition within seq:wait).
Parameters You can use the command without additional keywords, with the keyword load or with the
keyword exec.

OMICRON electronics Page 98


CM Engine

See also command out:ana:v():[sig(<no>):]a()


command out:ana:v():[sig(<no>):]f()
command out:ana:v():[sig(<no>):]p()

4.4.2.25 out:[ana:]pmode (abs | diff[(v|i(<reference_generator>)])

Function Set the phase mode. The phase mode defines the way the CM Engine interprets the phase
parameter of the command out:ana:v():[sig(<no>):]p().
Description The phase value you send with a p() command to a CMC can be interpreted in three ways
explained below.

Variable names used in the following formulas:

x voltage or current signal e.g. i(1:2)


ϕ x (k ) instantaneous phase belonging to sample k of signal x
ϕ x ( k + 1) instantaneous phase belonging to the following sample k + 1 of signal x
ϕ x,old old phase pointer

ϕ x, new new phase pointer set with the command out:v():p().


Δϕ phase difference between two samples k and k + 1

keyword phase interpretation


abs ϕ x (k + 1) = ϕ x, new
the new instantaneous phase belonging to the sample (k+1) is determined
by setting the new phase pointer in the command out:v():p() in absolute
relation to the zero phase of this signal.
At the moment of the on command the signal phase is set to the start
phase p() of the new signal, no matter which phase the old signal has at
that moment.

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 ϕ x (k + 1) = ϕ x ( k ) + (ϕ x, new − ϕ x,old ) + Δϕ


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):

OMICRON electronics Page 99


CM Engine

keyword phase interpretation

diff(v|i()) This mode allows defining one single voltage or current generator as
reference. In this case, when the on command is issued, the generator
selected as reference operates in diff mode, as described in the previous
paragraph. All other generators are shifted so the original phase differences
between them and the reference generator are reapplied, whatever the
frequency of each generator may be. In the image, we can see a reference
generator (in red) and a second generator (green). Both have phase 0, but
generator 2 has a higher frequency than the reference generator. At a given
moment (vertical line) the frequency of generator 2 is made equal to that of
the reference generator; the phases are not changed. We see in the
diagram how the phase of the reference generator does not change, while
the second generator is shifted so the original phase shift between it and
the reference generator is restored. This shift was equal to zero, so both
generators are in phase after the change.

The default phase mode is abs.

The option diff should only be activated for the execution of a specific on or off command
and then should be set back to abs.
Please note The option diff can only be activated when all generator(s) run in sig(1) mode (or are off).
If a reference generator is used, the phase for that particular generator must always be 0.
The results if the reference generator’s phase is not set to 0 are undefined.
Parameters You must specify one of the keywords abs or diff as command parameter. When specifying
a reference generator, only single generators can be used, not triples.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_PMODE_NOT_ALLOWED cannot switch to diff mode (see above)

4.4.2.26 out:[ana:]pmode?

Function Get the phase mode currently set.


Answer Returns a string that contains the device number and the keyword corresponding to the
phase mode set.

For example:

OMICRON electronics Page 100


CM Engine

out:pmode(abs)
out:pmode?
Return: 1,abs;
out:pmode(diff)
out:pmode?
Return: 1,diff;
out:pmode(diff(v(1:1)))
out:pmode?
Return: 1,diff(v(1:1));
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
See also Phase mode definition see command out:ana:pmode.

4.4.2.27 out:[ana:]resetopt

Function The amount of data sent to the CMC is optimized automatically. With this command you can
reset this optimization. This command is related to the string commands for the sequencer
and is only useful in conjunction with these commands.
Description To minimize the communication between PC and CMC, the amount of data is optimized
automatically. When you execute an on command, only the signal parameters that have
changed since the last on command are sent to the CMC. The resetopt command
inactivates this optimization and, when the next on command is executed, all parameters are
sent to the CMC. This feature is useful when you work with sequencer commands.
Example: The following sequence does not work properly because of this data optimization:

seq:begin
seq:wait(bin(1),2,1,1) ⇐ begin and end of sequence step #1
out:v(1):a(100) ⇐ beginning of step #2
out:on
seq:wait(1,1) ⇐ end of step #2
out:i(1):a(100) ⇐ beginning of step #3
out:v(1):a(100)
out:on
seq:end
Due to data optimization the second out:v(1):a(100) command is not downloaded into the
sequence buffer, because this command seems to be redundant.

seq:begin
seq:wait(bin(1),2,1,1)
out:v(1):a(100)
out:on
seq:wait(1,1)
out:i(1):a(100)
-
out:on
seq:end

OMICRON electronics Page 101


CM Engine

But when the trigger condition bin(1) in the seq:wait(bin(1),2,1,1) command becomes true,
rd
a forward jump to the 3 sequence step is executed.

seq:begin
seq:wait(bin(1),2,1,1)
out:v(1):a(100)
out:on if bin(2) is true jump forward 2 steps
seq:wait(1,1)
out:i(1):a(100)
-
out:on
seq:end
After this jump the omitted command out:v(1):a(100) is needed and not redundant any more.
Thus the sequence only works properly when you insert an out:resetopt at the beginning of
the second sequence step. The full sequence including the second out:v(1):a(100) is
downloaded then:

seq:begin
seq:wait(bin(1),2,1,1)
out:v(1):a(100)
out:on
seq:wait(1,1)
out:resetopt
out:i(1):a(100)
out:v(1):a(100)
out:on
seq:end

4.4.2.28 out:[ana:]buf:sam[(lock | free)]

Function Sample all signal settings of all generators.


Description This command performs a “snapshot” of the instantaneous signal settings of all routed
generators. It stores amplitude, phase and frequency of each signal component of every
generator, together with a time tag that allows synchronization of the output and input buffers,
if the automatic recording is activated (see inp:buf:sam(bin, on)). The values are the ones
being output when the command was processed, not the ones originally programmed in the
generators.
There is room in the CMC memory for just one set of data. Each new sampling overwrites the
previously stored data.
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.
Please note The command does not store wave form, mix mode or range information. It is the user’s
responsibility to make sure that the recorded values are meaningful when they are read.
See also out:ana:buf:get?

OMICRON electronics Page 102


CM Engine

4.4.2.29 out:[ana:]buf:get? (v | i (<triple>:<gen>) [:sig (<sig_no>))

Function Read sampled signal settings of specified generator/signal.


Description Reads the signal parameters stored by out:ana:buf:sam.
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).
Please note The time tags will remain 0 until the command inp:buf:get? is executed at least once.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_TRIPLE_NOT_DEF Triple is not defined (routed)
See also out:[ana:]buf:sam[(lock | free)]
inp:buf:sam(bin, on|off|bin)
inp:buf:get?
Example: The following example uses a sequence to generate a ramp, in order to determine the value
for which a trigger (bin(1) in this case) becomes active. While the sequence is running, the
PC program samples the analog outputs to update the user interface with the signal values.
When the sequence detects the trigger, it samples the values and locks the buffer so the PC
task does not overwrite the readings at the operating point. To simplify the code, no check is
done to limit the number of ramp steps if no trip is detected.
The ramp step time is 0.5s

seq:begin
out:v(1:1):a(50);f(50);p(0)
out:v(1:1):a(1,step)
out:on
out:ana:buf:sam(free) ;Makes sure the buffer is unlocked
seq:wait(bin(1),2,0.5,1)
out:step
seq:wait(bin(1), 1, 0.5,0)
out:ana:buf:sam(lock) ;Sample and protect the operating point
out:off
seq:end
..................

The PC program would run like this:

seq:exec ;The sequence begins executing

DO WHILE NOT SequenceEnded


out:ana:buf:sam ;Sample to refresh the UI
out:ana:buf:get?(v(1:1)) ;Get the values and display them

. . . . . . . . . . . . . . . . . . ;When convenient, use seq:status?(step)


;to set SequenceEnded
END DO

OMICRON electronics Page 103


CM Engine

out:ana:buf:get?(v(1:1)) ;Get the values written and locked by the sequence


Result : 1,0.000000E+000, 1.200000E+002, -3.321039E+001, 5.000000E+001;

As we see, the trigger was detected at an amplitude of 120V and a phase of -33.21°. The
frequency was unchanged and equal to 50Hz. The phase indicates the angle of the v(1:1)
phasor at the moment the sample was taken, not the original setting, which was 0°.

Please note that it is possible that some of the last readings within the DO loop may have
already gotten the locked values, due to the asynchronous way both loops are executed.
However, the one reading after the DO loop exits is guaranteed to have the operating point
values, while all the others may have been taken at any time during the execution of the
sequence.

4.4.2.30 out:[ana:]sync(ext, +|-)

Function Synchronizes the frequency of all analog outputs to an external signal.


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.
Note This command is only supported on a CMC256 or newer test set.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_NOT_SUPPORTED Command not supported in this device
CMERR_ TRIPLE_NOT_DEF A triple in <generator_list> is not defined
CMERR_IN_SEQ_MODE Command not allowed within sequence
See also command out:[ana:]sync(off)

4.4.2.31 out:[ana:]sync(off)

Function Turns the frequency synchronization to an external signal off.


Description The synchronization to an external signal is switched off and the frequency of the analog
outputs will stay on the last measured frequency.
Note This command is only supported on a CMC256 or newer test set.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_NOT_SUPPORTED Command not supported in this device
CMERR_IN_SEQ_MODE Command not allowed within sequence
See also command out:[ana:]sync(ext, +|-)

4.4.2.32 out:[ana:]user:...

Description The following commands out:ana:user ... are used to work with user-defined waveforms. A
user-defined waveform is sent to the CMC as a sequence of samples. When you have
defined a new waveform, you can assign this waveform to one or more signal components of
voltage or current signals with wav(user,...).

OMICRON electronics Page 104


CM Engine

4.4.2.33 out:[ana:]user:alloc? (<no_of_samples>)

Function Use this command to prepare a CMC for the definition of a new waveform.
Description A CMC device has a memory for all waveforms. The alloc? command allocates memory in
the CMC for a user-defined signal that is made up of the number of samples specified in
<no_of_samples>. Then this allocated memory segment is prepared for the download of
samples that is done with the command out:ana:user:app.
Parameter <no_of_samples>:
This parameter is of type <integer>.
Answer The command returns an answer string that contains the device number of the CMC and the
user signal number (type <integer>) assigned to the allocated memory. Use the waveform
command wav() to define your new waveform as output signal for a generator.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT Parameter <no_of_samples> is not an integer
CMERR_OUT_OF_CMC_MEM No internal CMC memory for new user-defined
signals any more
See also command out:ana:v(...):[sig(<no>):]wav
Example: Use the alloc?(1024) command to allocate memory for 1024 samples; the user signal
number returned is 1. Then download 1024 samples into the CMC using the
out:ana:user:app command. Use out:ana:v(1):sig1:wav(user,1) to set signal component 1
of all 3 generators of voltage triple 1 (these are v(1:1), v(1:2) and v(1:3)) to your user-defined
waveform 1.

4.4.2.34 out:[ana:]user:app (<user_sig_no>, <user_data>)

Function Defines samples for a user-defined signal initialized with out:ana:user:alloc?.


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:
Sample
AOutput = ⋅A
32767
where Sample is the integer value of the sample and A is the amplitude set with the out:...:a()
command.
The resulting signal is calculated through linear interpolation between two consecutive
sample values. This effect is seen most obvious if you use only a small number of sample
values.
Parameters <user_sig_no>:
This parameter is of type <integer>.

<user_data>:
This parameter is a list of comma-separated samples of type <integer>.

OMICRON electronics Page 105


CM Engine

Please note #1:


An out:ana:user:alloc? command must be successfully executed before you can use the
out:ana:user:app command.

#2:
The user signal you append data to must not be in use!
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT Parameters <user_sig_no> or <user_data>
contain a number that is not a valid integer
CMERR_INVALID_USER_SIG Parameter <user_sig_no> is not a valid user
signal
CMERR_OUT_OF_CMC_MEM Internal CMC memory for this user-defined signal
is full; no free samples left
CMERR_USER_SIG_IN_USE The user signal <user_sig_no> is in use. Thus
appending samples is not possible
See also command out:ana:user:alloc?
command out:ana:user:status?
interface function CMOutUserApp

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.

4.4.2.35 out:[ana:]user:free [(<user_sig_no>)]

Function Frees the memory of a specific user-defined waveform or frees the memory used by all user-
defined waveforms.
Description This command clears all samples in the memory segment of the waveform with number
<user_sig_no>. When you don't specify a user signal number <user_sig_no> the memory
sections of all user-defined waveforms are freed.
Parameter <user_sig_no>:
This parameter is of type <integer> and is optional.
Please note The user signal of the memory you want to free must not be in use!
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT Parameter <user_sig_no> is not an integer
CMERR_INVALID_USER_SIG Parameter <user_sig_no> is not a valid user
signal
CMERR_USER_SIG_IN_USE The user signal <user_sig_no> is in use. Thus
freeing this user signal is not possible
See also command out:ana:user:alloc?
command out:ana:user:app
interface function CMOutUserApp

OMICRON electronics Page 106


CM Engine

4.4.2.36 out:[ana:]user:status? [(<user_sig_no>)]

Function Gets status and memory information for a specific user waveform or for all user waveforms
together.
Parameter <user_sig_no>:
This parameter is of type <integer> and is optional.
Answer Without parameter the command returns the number of user signals defined, the maximum
number of samples that can be stored in the CMC's memory, the number of samples that are
still free (not allocated) and the number of samples that can be stored in the largest block of
free memory.

When you specify a user-defined waveform by its <user_sig_no>, the command returns the
number of samples allocated for this waveform and the amount of free samples in this
allocated memory segment.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT Parameter <user_sig_no> is not an integer
CMERR_INVALID_USER_SIG Parameter <user_sig_no> is not a valid user
signal

4.4.2.37 out:[ana:]sv:cfg(<#blocks>, <nom_freq>, <fact_i>, <fact_v>, <adapter>,


<dest_mac_adr>, <eth_type>, <app_id>, <vlan_tag>, <quality>, <svId_name>)

Function Configures the sampled value settings and turn the generation on.
Description This command configures the sampled value generation and turns it on.
Please note! The range switching is turned off for the amplifiers and the phase correction is set to zero.
Thus the generator outputs are not corrected.
Parameters <#blocks>:
Number of blocks per transfer: 1, 2, or 4. This setting determines the amount of sampled
value network packets being sent together as well as the frequency of sending them. Full
sampling frequency is 80 times the nominal frequency. When #blocks equals 2 the actual
frequency is only half and when #blocks equals 4 it’s only a quarter of the full frequency.
<nom_freq>:
Nominal frequency for sampled value generation as double. Only the values 50Hz and 60Hz
are supported.
<fact_i>:
Scaling factor for current sampled values as double. This factor is calculated with the
following formula:
I nom, prim
fact _ i =
I nom ,sec
<fact_v>:
Scaling factor for voltage sampled values as double. This factor is calculated with the
following formula:
Vnom , prim
fact _ v =
Vnom,sec
<adapter>:
Ethernet adapter number as integer. 0 corresponds to ETH1 and 1 corresponds to ETH2.
<dest_mac_adr>:
Destination MAC address as string without '-'. The allowed range is 010CCD040000 to
010CCD0401FF.

OMICRON electronics Page 107


CM Engine

<eth_type>:
Type of Ethernet frame as 16bit integer. The default value is 0x88BA.
<app_id>:
Application ID for Ethernet frame. The default value is 0x4000. The allowed range is 0x4000
to 0x7FFF.
<vlan_tag>:
16 bit integer value.
Bit 0 to 11 define the VLAN ID.
Bit 12 defines CFI (usually 0).
Bit 13 to 15 define VLAN Priority.
<quality>:
The value given here specifies the 13 quality bits as defined in IEC 61850-7-3. The default
value is 0. The 14th bit (derived) is always set according to the context by the firmware.
<svId_name>:
The sample value ID name as string with a minimum length of 10 and a maximum length of
34 characters. The allowed character set is ISO 646 (also called IA5 IRV International
Alphabet No. 5), which is essentially 7-bit ASCII with some exceptions. In Windows it is
represented by code page 20105.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_NOT_SUPPORTED Command not supported on this device
CMERR_SV_CFG_SET_FAILED Could not set Sampled Values configuration
CMERR_SV_CFG_NOT_ALLOWED Sampled Values configuration not allowed while
analog outputs are switched on
CMERR_OUT_OF_RANGE One of the parameter value is out of range
See also command out:ana:sv:cfg?

4.4.2.38 out:[ana:]sv:cfg?

Function Gets the current sampled value configuration settings of the device.
Description This command reads the current sampled value configuration settings of the device.
Answer The command returns 12 values:
<on_off>,<#blocks>,<nom_freq>,<fact_i>,<fact_v>,<adapter>,<dest_mac_
adr>,<eth_type>,<app_id>,<vlan_tag>,<quality>,<svId_name>
<on_off>:
Is sampled value generation turned on or off.
<#blocks>:
Number of blocks per transfer: 1, 2, or 4. This setting determines the amount of sampled
value network packets being sent together as well as the frequency of sending them. Full
sampling frequency is 80 times the nominal frequency. When #blocks equals 2 the actual
frequency is only half and when #blocks equals 4 it’s only a quarter of the full frequency.
<nom_freq>:
Nominal frequency for sampled value generation as double.
<fact_i>:
Scaling factor for current sampled values as double.
<fact_v>:
Scaling factor for voltage sampled values as double.
<adapter>:
Ethernet adapter number as integer. 0 corresponds to ETH1 and 1 corresponds to ETH2.
<dest_mac_adr>:
Destination MAC address as string without '-'.
<eth_type>:
Type of Ethernet frame as 16bit integer.

OMICRON electronics Page 108


CM Engine

<app_id>:
Application ID for Ethernet frame.
<vlan_tag>:
16bit integer value.
Bit 0 to 11 represents the VLAN ID.
Bit 12 represents CFI (usually 0).
Bit 13 to 15 represents VLAN Priority.
<quality>:
13 quality bits. Integer value between 0 and 0x1FFF.
<svId_name>:
Name of the sampled value ID as string.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_SV_CFG_GET_FAILED Could not retrieve Sampled Values configuration
CMERR_NOT_SUPPORTED Command not supported on this device
See also command out:ana:sv:cfg(…)

4.4.2.39 out:[ana:]sv:off

Function Turns generation of samples values off.


Description This command turns the generation of sampled values off.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_SV_CFG_SET_FAILED Could not set Sampled Values configuration
CMERR_NOT_SUPPORTED Command not supported on this device
See also command out:ana:sv:cfg(…)
command out:ana:sv:cfg?

4.4.2.40 out:bin:cfg?

Function Get the number of available output modules.


Description Use this command to get the number of output modules available in a device.
Answer An integer number is returned that represents the number of output modules available in the
addressed device.
See also out:bin(<out_module_idx>):cfg?
out:bin(<out_module_idx>:<group_idx>):cfg?
Example Command: out:bin:cfg?
Answer: "1,2;"
Device 1 has 2 binary output modules.

4.4.2.41 out:bin(<out_module_idx>):cfg?

Function Get configuration information for the selected output module.


Description Use this command to get a complete description of each output module in the addressed
device.
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.
Answer <dev_id>,<#groups>,<loc>,<loc_idx><mod_type>,<mod_ser_no>,<hard_ver>,
<dev_type>,<dev_ser_no>;

OMICRON electronics Page 109


CM Engine

The return string contains the CMC’s device number, plus the following data for the selected
output module:

Number of Groups
The binary outputs are divided in groups. All outputs in a group share location and output
type.

Location of Outputs
String describing the location of the outputs in the device. The following values can be
returned:
front Outputs situated in the front panel of the device
back EXIF/EXTOP board on the back of the device
slot Outputs mounted in a backplane slot

Location Index
1 for “front” and “back”, mounting slot number for “slot”. The slots are numbered starting at 1.
Module Type
The kind of module where the outputs are located. For instance: OUT1-16R…

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
Type of device in which the outputs are included. For instance, CMC256-6, CMB IO-7, etc.

Device Serial Number


The serial number of the host device.

See also out:bin:cfg?


out:bin(<out_module_idx>:<group_idx>):cfg?
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.

4.4.2.42 out:bin(<out_module_idx>:<group_idx>):cfg?

Function Get configuration information for the selected output group.


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 CMC’s device number, plus the following data for the selected
output group:

Number of Outputs

OMICRON electronics Page 110


CM Engine

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.

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 group’s resource group.

See also out:bin:cfg?


out:bin(<out_module_idx>):cfg?
Example 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 module’s type and serial number are the same as the CMC’s.

Command: out:bin(2):cfg?
Answer: " 1,1,back,1,CMC156-EP,DB011D,0,CMC156-EP,DB011D;"
Module 2 has 1 output group and is located in the back of the device.

Command: out:bin(1:1):cfg?
Answer: "1,1,relay,single,binout,1;"

Group 1 in module 1 has 1 output, of relay type, with independent signal reference
connection. The answer for the other three groups would be the same.

Command: out:bin(2:1):cfg?
Answer: " 1,4,transistor,group,transout,1;"

OMICRON electronics Page 111


CM Engine

Group 1 in module 2 has 4 outputs of transistor type, with one ground connection for the
complete group.

4.4.2.43 out:bin(<out_module_idx>):on(<output_list>)

Function Set binary outputs within a given module to "1".


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 CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter in <output_list> is not an integer
Example Command: out:bin(1):on(1,2,3)
Sets outputs 1, 2 and 3 in output module 1. Relays are closed and transistor outputs are set
to 5V.

4.4.2.44 out:bin(<out_module_idx>):off (<output_list>)

Function Set binary outputs to "0".


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 CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter in <output_list> is not an integer
Example Command: out:bin(1):clr(1,2,3)
Clears outputs 1, 2 and 3 in output module 1. Relays are open and transistor outputs are set
to 0V.

OMICRON electronics Page 112


CM Engine

4.4.2.45 out:bin(<out_module_idx>):set (<data>)

Function Simultaneously set and/or clear multiple binary outputs in an output module.
Description The desired states are specified in a number of parameter type <integer>. In this number bit
0 defines the desired state of the binary output 1, bit 1 the state of output 2 etc. (see table):
Bit … 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Output - - - - - - - - - - - - 4 3 2 1

Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter <data> is not an integer
Example: The command out:bin(1):set(0b01) sets output 1 in module 1 and clears all the rest.

4.4.2.46 out:bin(<out_module_idx>):get?

Function Get the states of the selected module’s binary outputs.


Description Use this command to get the states of all binary outputs in a module.
Parameters <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 non-existing 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 CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
Example Command: out:bin(1):get?
Answer: "1,1;"
Output 1 in module 1 is “off”, all the rest are “on”.

4.4.2.47 out:bin(<out_module_idx>:<group_idx>):name(<name>)

Function Set the group name.


Description This command allows setting a label to a group, to be retrieved later.
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?

OMICRON electronics Page 113


CM Engine

4.4.2.48 out:bin(<out_module_idx>:<group_idx>):name?

Function Queries the group name.


Description Use this command to retrieve a group’s name.
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 CMC’s device number, plus the name assigned to the group
enclosed in quotes. If no name has been set for the group, then the command returns an
empty string.
See also out:bin(<out_module_idx>:<group_idx>):name(name)
Examples out:bin(1:1):name?
Result: 1,””; // Group 1 in module 1 has no name assigned
out:bin(1:1):name(”Output block 1”)
out:bin(1:1):name?
Result: 1,”Output block 1”;

4.4.2.49 out:aux:cfg?

Function Get the number of available auxiliary VDC outputs.


Description Use this command to get the number of auxiliary VDC outputs in a device.
Answer An integer number is returned that represents the number of auxiliary outputs available in the
addressed device.
Example Command: out:aux:cfg?
Answer: "1,1;"
Device 1 has 1 auxiliary output.

4.4.2.50 out:aux(<idx>):cfg?

Function Get information about an auxiliary VDC output.


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 CMC’s 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 CMC256 with serial number AG153F and the addressed auxiliary VDC output
has index 1.

4.4.2.51 out:aux(<idx>):on | off

Function Turns on / off an auxiliary VDC output


Description This command switches the targeted auxiliary VDC output on or off, according to the keyword
used.

OMICRON electronics Page 114


CM Engine

Parameters <idx>
Integer id of the auxiliary output that is being addressed. This value must be greater than 0,
and smaller or equal than the value returned by the out:aux:cfg? command.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_AUX_DC_NOT_LOCKED The auxiliary output DC is not locked and cannot
be accessed
CMERR_NOT_SUPPORTED Command not supported in this device
CMERR_OUT_OF_RANGE VDC value or <idx> out of range
Please note Unlike other outputs, the auxiliary DC output does not turn itself off automatically upon being
unlocked. Therefore, if we actually desire to turn it off, it must be expressly done before
exiting the software.
See also out:aux(<idx>):a()
out:aux(<idx>):a?

4.4.2.52 out:aux(<idx>):a(<v_dc>)

Function Sets the output value of an auxiliary VDC output.


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.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_AUX_DC_NOT_LOCKED The VDC auxiliary output is not locked and cannot
be accessed
CMERR_INVALID_FLOAT Parameter <v_dc> is not a double
CMERR_NOT_SUPPORTED Command not supported in this device
CMERR_OUT_OF_RANGE VDC value out of range
Please note 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.
See also out:aux(<idx>):a?
out:aux(<idx>):def()

4.4.2.53 out:aux(<idx>):a?

Function Queries the parameters of a VDC auxiliary output.


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.
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.
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()
out:aux(<idx>):def()

OMICRON electronics Page 115


CM Engine

Example out:aux(1):a(25)
out:aux(1):on
out:aux(1):a?
Return: 1,on,2.500000E+001,2.640000E+002;

4.4.2.54 out:aux(<idx>):def(<pwr_on_v>)

Function Set the power-on value of a VDC auxiliary output


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 CM Engine error codes:
Error code Explanation
CMERR_AUX_DC_NOT_LOCKED The VDC auxiliary output is not locked and cannot
be accessed
CMERR_INVALID_FLOAT Parameter <pwr_on_v> is not a double
CMERR_NOT_SUPPORTED Command not supported in this device
CMERR_OUT_OF_RANGE VDC value out of range
See also out:aux(<idx>):a?
Example out:aux(1):def(110)

Power-down a CMC256, then power it up again; the VDC output will go on automatically.
Please note that you must restart “Batcher” at this point, or you will get cached results.

out:aux(1):a?
Return: 1,on,1.100000E+002,2.640000E+002;

4.4.2.55 out:aux(<idx>):def?

Function Queries the power-on value of a given VDC auxiliary output.


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.
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.
Answer String containing the device number and the power-on value of the auxiliary VDC (<float>).
See also out:aux(<idx>):def()
out:aux(<idx>):a?

4.4.2.56 out:cfg?

Function Get information about the analog and binary outputs of a CMC.
Description This command returns the number of binary outputs in the CMC and a list of all available
amplifier numbers, consisting of the following information:

OMICRON electronics Page 116


CM Engine

- 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.4.3 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 CM Engine 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 CM Engine the following default settings are defined:

Logical generator triple Generators in this triple Predefined routing to the following outputs
v(1) v(1:1), v(1:2), v(1:3) outputs "Voltage 1,2,3" on front panel of CMC.
i(1) i(1:1), i(1:2), i(1:3) outputs "Current 1,2,3" on front panel of CMC.

4.4.3.1 amp:cfg?[(<cfg_no>)]

Function Queries the number of possible amplifier configurations that the device plus all its attached
intelligent amplifiers allow, or the characteristics of one of them if the optional <cfg_no>
parameter is provided.
Description An amplifier configuration is a virtual amplifier that is obtained by wiring together outputs from
one or more physical amplifiers in a given configuration. Such a virtual amplifier serves two
purposes:

1) To allow access to special capabilities of the software that are not available for all the
elements of a triple. For instance, the output V2 of the CMC156 is capable of outputting more
power than V1 and V3. If the three are assigned to the same voltage triple, this capability is
lost, since only the power of the weaker outputs can be guaranteed. A virtual single-phase
amplifier connected only to V2-N can be used where higher power is needed.

2) To simplify rearranging the physical amplifiers into logical amplifiers more adapted to our
requirements. In a CMC256, for instance, the four voltages V1, V2, V3 and V4 are part of two
separate physical amplifiers, one of them 3-phase and the other single-phase. The use of the
amp:def command would allow us only to route one voltage triple to each of these amplifiers.
There is a configuration, however, where the four outputs are considered as 3-phase
amplifiers, while V4 outputs the resultant of the three phase voltages. When we route a triple
to this configuration, we address only the three phase voltages, and the CMC internal DSP
calculates the resultant. V4 is no longer directly addressable.
It must be noted that this functionality could be achieved in some (but not all) cases by
assigning two triples to the amplifiers with the amp:def command and calculating the
resultant vector in the program. The design of the out:on command ensures that the four
voltages would be in sync. This command saves the user a lot of effort and the possibility of
calculation or synchronization errors, and also ensures that the resultant is correct in all
possible cases, even when some of the signals have harmonic content, exponential decay
component, etc.

OMICRON electronics Page 117


CM Engine

Parameters The optional <cfg_no> parameter is of type int.


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:
<dev_ID>, <config_ID>, <phase_count>, <max_out>, <max_power>,
<max_out_at_max_power>, <src_amp>, <mode>, <wiring_ID>, {type (amp_no /
amp_id), no.};

The type and meaning of these return fields are:

<dev_id>
The CMC’s device number – integer

<config_ID>
ID of the configuration to be used in the amp:route command, if we want to route a triple to
this configuration. It is completely independent of the configuration number, which is the
parameter that we have passed to the amp:cfg? command. This is a number of type
integer.
Please note that the configuration ID is not guaranteed to be the same in all cases; it may
change if the hardware is different or the CM Engine version has changed.

<phase_count>
Number of phases of the virtual amplifier. It is the number of phases that can be
independently addressed and set with the out:ana commands. The number of phases that
are actually output may be different (for instance, when Vo is automatically calculated from
the three phase voltages in the CMC256 or newer test set). This is a number of type integer.

<max_out>
Maximum output value of the configuration. It may be in V or A, depending on the type of the
amplifier. Number of type double.

<max_power>
Maximum output power of the configuration (approximate – please refer to the HW manual
for exact data), in VA. Number of type double.

<max_out_at_max_power>
Output value for which the maximum power is reached (approximate – please refer to the
HW manual for exact data). Number of type double.

<src_amp>
Maximum complementary magnitude (that is, V for I amplifiers and I for V amplifiers) that the
configuration can reach. If the amplifier power curves were linear, it would happen that
<src_amp> * <max_out_at_max_power> = <max_power>
This value is a double.

<mode>
Value of type string. It encodes the way the different outputs of the physical amplifiers
involved in the configuration are to be tied together to achieve the configuration’s
characteristics.

<wiring_id>
Internal OMICRON identifier. It refers to a connection diagram depicting the connections
encoded in <mode>. This field is of integer type.

The correspondence between the <mode> strings and the wiring_id is not 1:1 – one string
may correspond to several ids if the involved amplifiers change. The following table provides

OMICRON electronics Page 118


CM Engine

an example of connection diagram for each of the mode strings:

String Phases Description Example connection diagram


std 3 Standard. Each generator is used against N

ser12 1 Generator 1 is signal, generator 2 is


reference.

ser13 1 Generator 1 is signal, generator 3 is


reference.

ser4 1 Four generators tied together in series.


Generator 1 in amplifier 1 is signal,
generator 1 in amplifier 2 is reference.
Generators 2 in both amplifiers are
connected.

gen2 1 Generator 2 is signal, N is reference.

par1 1 All three generators tied together are signal,


N is reference.

par3 3 Each generator tied together in parallel with


the corresponding generators in all
amplifiers involved; 1 with 1, 2 with 2, etc.
Also N with N

parser 1 All generators in amplifier 1 tied together


are signal, all generators in amplifier 2 tied
together are reference. Neutrals in both
amplifiers are tied together.

zero 3 Three phases plus an automatically


calculated resultant, which is output via an
additional generator. Each phase is active
against its corresponding Neutral.

ser2 2 For phase 1, Generator 1 is active and


generator 2 is reference. For phase 2,
generator 3 is active and the extra
generator is reference.

OMICRON electronics Page 119


CM Engine

String Phases Description Example connection diagram


par6 1 Involves two physical amplifiers. Generators
1, 2 and 3 of both amplifiers, tied together
(the 6 of them) are signal. Both Neutrals
tied together are reference.

ser21 1 Two single-phase amplifiers (in a CMS251


for instance) set in series. Generator 1 in
amplifier 1 is active, Generator 1 in amplifier
2 is reference, and both Neutrals are
connected.
par31 1 Three single-phase amplifiers (in a CMS252
for instance) set in parallel. Generators in
amplifiers 1, 2 and 3 are tied together and
provide the signal. All three Neutrals are
connected and provide the reference.
par61 1 Six single-phase amplifiers (in a CMS252
for instance) set in parallel. Generators in
amplifiers 1, 2 and 3 of both amplifier banks
are tied together and provide the signal. All
six Neutrals are connected and provide the
reference.

std31 3 Three single-phase amplifiers (in a CMS252


for instance) set as a three-phase system.
Generators in amplifiers 1, 2 and 3 are the
three signals. All three Neutrals are
connected and provide the reference.

{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.

Example How to parallel the two current triples of a CMA156 intelligent current amplifier, to obtain a
three-phase amplifier that can output 50A per phase.

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

OMICRON electronics Page 120


CM Engine

interested in. In this case, we have gone directly to #11, which is a 3-phase amplifier with
maximum output of 50 that involves external amplifiers 1 and 2 (see the list of amplifiers at
the end of the result string) in wiring configuration par3. Then we route i(2) to <config_ID>

Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_OUT_OF_RANGE The int parameter supplied does not correspond
to an existing configuration
CMERR_COMM Communication error during command execution.
Please note The configuration(s) of the amplifiers, if any, will not be available until an amp:scan?
command is performed.
See also amp:scan? amp:def amp:route out:cfg?

4.4.3.2 amp:cfg?(<amp_id>,firm)

Function Returns the firmware versions (boot and main) for the specified amplifier.
Description This command reads the firmware versions from the specified amplifier and returns them as
a string.
Parameters <amp_id>:
This parameter is of type <integer>.
Answer The command returns a string that contains the main firmware version and the boot firmware
version.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_OUT_OF_RANGE There is no amplifier with the specified ID
CMERR_COMM Communication error during command execution.
See also command amp:cfg?(<amp_id>,addr)
command gps:setup:cfg?(firm)
Examples Suppose you have connected a CMA156 to the CMC you would get an answer like this to the
command amp:cfg?(1,firm): “1,V1.05,V1.01;”. This means that the intelligent external
amplifier with ID 1 has a boot firmware of version 1.01 and a main firmware of version 1.05.

4.4.3.3 amp:def (<amp_no>, ...)

Function Use this command to provide the parameters of an external amplifier or change the
predefined parameters of an internal amplifier. You can also auto-define an „intelligent“
amplifier (not available in the DOS version of CM Engine) or undefine an amplifier. Because
of the significant differences across the four variations of this command, each variation is
described separately.

4.4.3.4 amp:def (<amp_no>, int | ext , v | i, <amplification>, <max_out>, <f_min>, <f_max>,


<t_corr1>, <t_corr2>, <t_corr3>)

Function Use this command to provide the parameters of an external amplifier or change the
predefined parameters of an internal amplifier.
Description The command uses the following parameters:
- The parameter <amp_no> is the number of the amplifier whose parameters are specified.

OMICRON electronics Page 121


CM Engine

- The keywords int or ext define if the amplifier is one of the CMC-internal ones with output
at the front panel or an external one which is connected at the back of the CMC (socket
"Gen. Out X").
- The keywords v or i specify if the amplifier is to be defined is a current or a voltage
amplifier.
- The parameter <amplification> is the voltage or current amplification of the amplifier.
The voltage amplification of a voltage amplifier is calculated as follows:
max .VoltageOutput[Volt ]
amplification =
max .VoltageInput[Volt ]

The current amplification of a current amplifier is calculated as follows:


max .CurrentOutput[ Ampere]
amplification =
max .VoltageInput[Volt ]

The maximum input voltage is 5Vrms. Through the amplification the scaling amplitude for
the signals is defined which is used with out:ana:mix(mult).
- The parameter <max_out> defines the maximum output voltage of the voltage amplifier (in
Volt) or the maximum output current of a current amplifier (in Ampere) as RMS value of a
sine wave. This value is used to limit the possible amplitude values set by out:ana:a() and
has to be smaller than or equal the scaling amplitude.
- The parameters <f_min> and <f_max> define the minimum and maximum output frequency
of the amplifier (in Hz). A minimum frequency of zero Hertz enables DC for this amplifier.
- The parameters <t_corr1>, <t_corr2> and <t_corr3> define the three corrective propagation
delays for the three amplifiers (in seconds).
The internal amplifiers of the CMC and their parameters are already predefined, but you can
change their parameters. This can be useful if you connect a voltage or current transformer
to a CMC-internal amplifier.
Parameters <amp_no>:
This parameter is of type <integer>.

<int|ext>:
Here you must specify one of the keywords int or ext.

<v|i>:
Here you must specify one of the keywords v or i.

<amplification>:
This parameter is of type <float>.

<max_out>:
This parameter is of type <float>.

<f_min>, <f_max>:
These parameters are of type <float>.

<t_corr1>, <t_corr2>, <t_corr3>:


These parameters are of type <float>.
Please note The parameters of the internal amplifiers of the CMC are already predefined.
Before you can use an external amplifier, you must define the amplifier with amp:def.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_AMP_IN_USE Amplifier is in use (routed)
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_FLOAT Parameter of type <float> has errors
CMERR_INVALID_INT Parameter <amp_no> is not an integer
CMERR_MIN_GT_MAX Min. value of frequency greater than max. value

OMICRON electronics Page 122


CM Engine

CMERR_NO_AMP_AVAIL No amplifier available with specified number or


location

4.4.3.5 amp:def (<amp_no>, int)


amp:def (<amp_no>, ext, <id_list>)

Function Use this command to auto-define an „intelligent“ amplifier. An intelligent amplifier is an


amplifier that is able to communicate with the CMC and to tell its parameters to the CMC.
Description The command uses the following parameters:
- The parameter <amp_no> is the number of the amplifier to be defined.
- 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 CM Engine.

When you want to auto-define an intelligent external amplifier you have to provide a list of
amplifier IDs. Currently only OMICRON amplifiers connected to the CM Exif board (see also
the amp:route command) are considered intelligent. If <id_list> contains more than one ID,
CM Engine tries to „combine“ the amplifiers. This means that CM Engine assumes an
amplifier with cumulated parameters:
Suppose you have connected a CMA156 to the CMC which consists of two amplifiers with
25A output current. The amp:scan? command would report two IDs, 1 and 2. If you define
an external amplifier with amp:def (3, ext, 1, 2), CM Engine assumes that you have an
amplifier with 50A output current. The only thing you would have to do is to connect the
corresponding outputs of the amplifier (L1 of current output A with L1 of current output B and
the same for L2, L3 and N).
The combination is performed successfully when all amplifiers are of the same type (voltage
or current) and have the same amplification.

The other parameters are merged in the following way: output values are summed up, the
minimum frequency is set to the highest of a values, the maximum frequency is set to the
lowest of all values and the corrective propagation delays are set to the average value of all
amplifiers.
Parameters <amp_no>:
This parameter is of type <integer>.

<int|ext>:
Here you must specify one of the keywords int or ext.

<id_list>:
This parameter is of type <enumeration>.
Please note The parameters of the internal amplifiers of the CMC are already predefined.
Before you can use an external amplifier, you must define the amplifier with amp:def.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_AMP_IN_USE Amplifier is in use (routed)
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT Parameter <amp_no> is not an integer

OMICRON electronics Page 123


CM Engine

CMERR_NO_AMP_AVAIL No amplifier available with specified number or


location

4.4.3.6 amp:def ([<amp_no>,] clr | clrnooff)

Function Use this command to undefine an amplifier.


Description The command uses the following parameters:
- The parameter <amp_no> is the number of the amplifier you want to undefine.
The result of this command is that an amplifier with number <amp_no> is not available for an
amp:route command. If this amplifier is currently routed, the clear does not take place and
the error code CMERR_AMP_IN_USE is returned. To make an amplifier with number
<amp_no> available again use the amp:def command as described above.

If the keyword clrnooff is specified, the amplifier parameters are cleared, but the amplifier
itself is not turned off. This reduces the wear of the equipment due to on/off cycles.
Please note that the output signals are removed with both keywords, it is only the amplifier’s
power supply that is turned off (clr) or not (clrnooff).

If no amplifier number is provided, the clr or clrnooff keyword applies to all amplifiers.
Parameters <amp_no>:
This optional parameter is of type <integer>.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_OUT_OF_RANGE The desired amplifier is not defined
CMERR_AMP_IN_USE Amplifier is in use (routed)
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT Parameter <amp_no> is not an integer

4.4.3.7 amp:def(off)

Function Turns off unused external amplifiers


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 CM Engine error codes:
Error code Explanation
CMERR_EXT_AMP_COMM Communication error with an external amplifier.

4.4.3.8 amp:def? [(<amp_no>[,harm])]

Function Returns the parameters of an amplifier or a list of all defined amplifiers.


Description The number of the desired amplifier can be specified as parameter <amp_no>. The
command then returns the amplifier's parameters.

When no amplifier number is specified, a list of all defined amplifiers (predefined or user-
defined with amp:def) is returned. After startup of the CM Engine the amplifier list only
contains the internal amplifiers of the CMC.
Parameter <amp_no>:
This parameter is of type <integer> and is optional.
Answer When an amplifier number is specified, the command returns a string that contains the CMC
device number and the following information (the parameters and their types are explained
with the amp:def command):
<int | ext>, Internal or external amplifier.
<v | i>, Type of amplifier (voltage or current).

OMICRON electronics Page 124


CM Engine

<- | 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 (OMICRON amplifiers only).
<ser_no> Serial number (OMICRON amplifiers only).

The amplifier output group refers to the output sockets of the amplifier: All amplifiers that do
not have more than one amplifier of the same type in the same case return „-“. The others
return „A“ for output group A and „B“ for output group B.

With the harm keyword, the command returns the maximum frequency for harmonic signals
of the specified amplifier.

When no amplifier number is specified the command returns a string that contains the CMC
device number and a list of all defined amplifiers in or connected to a CMC. For every
amplifier the following information is returned:
<amp_no> Amplifier number
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_OUT_OF_RANGE The desired amplifier is not defined
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT Parameter <amp_no> is not an integer
See also command amp:def
Examples The command amp:def? returns the string “1,1,2;”. This means that the CMC with device
number 1 contains the definitions of an amplifier 1 and an amplifier 2. You can thus route
generator triples to the amplifiers 1 or 2.

The command amp:def?(1) returns


“1,int,v,-,2.5000E+001,1.2500E+002,0,1.000E+003,0,0,0,CMC 56,DA345D;”. This means
that in CMC #1 the amplifier #1 is a voltage amplifier with an amplification factor of 25, its
maximum output voltage is 125V, the frequency range is from 0 to 1000 Hz and the
corrective propagation delays are all zero.

The command amp:def?(1,harm) returns the string “1,3.000000E+003;”. This means that
the amplifier 1 in the CMC with device number 1 can output harmonic signals up to 3 kHz.

4.4.3.9 amp:scan?

Function Searches for intelligent external amplifiers and returns a list of IDs.
Description This command searches for connected intelligent external amplifiers. Currently only
OMICRON amplifiers connected to the CM Exif board (see also the amp:route command)
are considered intelligent. Each amplifier found is assigned an ID for further reference.

These IDs are integer values and are not necessarily consecutive. If the optional parameter
list is specified the scan is only done at the first call. Further calls will only return the ID list.
Answer The command returns a string that contains the IDs for all amplifiers found.
Please note This command performs a lengthy operation. It typically lasts more than 10 seconds.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_AMP_IN_USE Amplifier is in use. This error code is returned if
any intelligent amplifier is defined using the

OMICRON electronics Page 125


CM Engine

Error code Explanation


amp:def command.
See also command amp:param?
command amp:def
Examples Suppose you have connected a CMA156 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.

4.4.3.10 amp:param? (<id> [,cal])

Function Returns the parameters of an intelligent external amplifier.


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.

The amplifier output group refers to the output sockets of the amplifier: All amplifiers that do
not have more than one amplifier of the same type in the same case return „-“. The others
return „A“ for output group A and „B“ for output group B.

With the cal keyword, the command returns a string that contains the CMC device number,
followed by the year, month and day of the last factory calibration, separated by commas.
The three numbers are of type <int>.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_OUT_OF_RANGE There is no amplifier with the specified ID
CMERR_IN_SEQ_MODE Command not allowed within sequence
See also command amp:scan?
command amp:def
Examples Suppose you have connected a CMA156 to the CMC, which consists of two amplifiers with
25A output current, you would get the following answer to the command amp:param?(1):
“1,ext,i,A,1.000E+1,2.500E+1,0.000E+0,1.000E+3,5.944E-5, 5.944E-5,
5.944E-5,CMA156,BF176A;”. This means that the amplifier with ID 1 is a current amplifier
CMA156 with serial number BF176A and output on the output group A. The amplification
factor is 10, its maximum output current is 25A, the frequency range is from 0 to 1000 Hz, the
corrective propagation delay is 59.44µs.

4.4.3.11 amp:route(clr | clrnooff)

Function Clears the routings of all triples.

OMICRON electronics Page 126


CM Engine

Description With this command it is possible to clear the routings of all triples, whether they are routed to
amplifiers or to amplifier configurations.
You can replace the keyword clr by clrnooff; in this case, if the triple was routed to an
amplifier configuration, the physical amplifier(s) are not turned off when the virtual amplifier’s
definition is cleared. Please note that the output signals are removed with both keywords, it is
only the amplifier’s power supply that is turned off (clr) or not (clrnooff).
Parameters Keyword clr or clrnooff.
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
See also amp:route (v | i (<triple_no>), <amp_no> | clr | clrnooff)

4.4.3.12 amp:route (v | i (<triple_no>), <amp_no> | clr | clrnooff)

Function With this command you can define which generator triple <triple_no> (voltage or current
triple) is logically connected to which amplifier <amp_no>, i.e. to which outputs.
Description This command connects the three logical generators of a generator triple (voltage or current
triple) to an amplifier, i.e. to three outputs of the CMC or of an external amplifier.

The following table shows the relationship between the amplifier number <amp_no> and the
outputs for the three generators (see also chapter „Block diagram of Generators/Outputs of
the CMC 56“ in the appendix):

Amplifier Name of the related outputs in case of an


number internal amplifier external amplifier
1 Banana sockets "Voltage 1-3" or Socket "Gen. Out 1-6" (contacts 4, 5 and 6).
big, black socket (Neutrik
socket)
2 Banana sockets "Current 1-3" or Socket "Gen. Out 1-6" (contacts 1, 2 and 3).
big, black socket (Neutrik
socket)
3 Socket "Gen. Out 7-12" (contacts 7, 8 and 9).
(Only available with CM Exif board installed!)
4 Socket "Gen. Out 7-12" (contacts 10, 11 and
12). (Only available with CM Exif board
installed!)
You can replace the parameter <amp_no> by the keyword clr to clear the connection
between the generator triple <triple_no> and its currently routed amplifier or amplifier
configuration. This generator triple's routing is explicitly set to "undefined". If the triple was
routed to an amplifier configuration, the corresponding virtual amplifier’s definition is also
cleared.

You can replace the parameter <amp_no> by the keyword clrnooff; in this case, if the triple
was routed to an amplifier configuration, the physical amplifier(s) are not turned off when the
virtual amplifier’s definition is cleared. Please note that the output signals are removed with
both keywords, it is only the amplifier’s power supply that is turned off (clr) or not (clrnooff).
Parameters <v|i>:
For this parameter you must specify one of the keywords v or i.

<triple_no>:
This parameter is of type <integer>.

<amp_no>:
This parameter is of type <integer>; it can be replaced by the keywords clr and clrnooff.
Please note #1:
Before you can use the amp:route command to route a generator triple to an external
amplifier, you must use the amp:def command to define the parameters of this external
amplifier. This does not apply to amplifier configurations (see amp:cfg?[(cfg_no)]

OMICRON electronics Page 127


CM Engine

command).

#2:
Due to the hardware architecture of a CMC, there are two restrictions for the routing (see
also chapter „Block diagram of Generators/Outputs of the CMC 56“ in the appendix):

The outputs "Voltage 1-3" (front panel) and the outputs for external amplifiers "Gen.Out 4-6"
(back panel) are mutual exclusive, i.e. you can only use one of these output groups at the
same time.

The same is valid for the outputs "Current 1-3" (front panel) and the outputs for external
amplifiers "Gen.Out 1-3" (back panel).
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_AMP_IN_USE The amplifier is already routed to a different triple
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT Parameter <triple_no> or <amp_no> is not an
integer
CMERR_KINDS_DONT_MATCH The parameters <triple_no> and <amp_no> are
not of the same generator type (voltage gen./
current gen.)
See also command amp:def
command amp:cfg? [(<cfg_no>)]
Example: amp:route (i(1), 2)
This command routes the generator triple 1 for current output to amplifier number 2. This
means that the generators i(1:1), i(1:2) and i(1:3) are routed to the outputs "Current 1-3" on
the front panel of the CMC or to the outputs "Gen.Out 1-3" at the back panel of the CMC.

4.4.3.13 amp:route? ( v | i (<triple_no>))

Function Use this command to get the current route settings of a voltage or current triple (predefined
settings or settings set with amp:route).
Description The type of the triple (voltage or current triple) is specified with the keywords v or i and the
number of the generator triple is passed to CM Engine as parameter <triple_no>.
The command returns the number of the amplifier the logical generator triple is routed to.
Parameters <v|i>:
Here you must specify one of the keywords v or i.

<triple_no>:
This parameter is of type <integer>.
Answer The command returns a string that contains the CMC's device number and the generator
triple of type <integer>.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT Parameter <triple_no> is not an integer
See also command amp:route

Example The command amp:route?(v(1)) returns the string “1,1;”. This means that in CMC #1 the
voltage generator triple 1 is routed to amplifier 1.

4.4.3.14 amp:range(v|i(<triple_no>), <range>)

Function This command selects an amplifier range in the CMC.

OMICRON electronics Page 128


CM Engine

Description Use this command to tell the CMC which maximum amplitude (rms) is needed. The CMC
automatically selects the appropriate range.
This command internally executes the out:ana:<triple_no>:clr command. The keywords v or i
specify the type of the amplifier (voltage or current amplifier). The parameter <triple_no>
specifies the number of the generator triple. The parameter <range> specifies the maximum
rms value that is needed on this amplifier output. The CMC will select the smallest range that
fits the specified value.

If the user knows the maximum value that will be output during usage, the use of this
command allows the amplifier to operate optimally for the set range, usually increasing the
output power and the
Parameters <v|i>:
Here specify one of the keywords v or i.

<triple_no>:
This parameter is of type <integer>.

<range>:
This parameter is of type <float>.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_FLOAT Parameter <range> has errors
CMERR_INVALID_INT Parameter <triple_no> is not an integer
See also command amp:range?
Compatibility Win32

4.4.3.15 amp:range?(v|i(<triple_no>))

Function Returns the currently selected amplifier range and a list of possible ranges.
Description Parameters:
The keywords v or i specify the type of the amplifier (voltage or current amplifier). The
parameter <triple_no> specifies the number of the generator triple.

Parameters <v|i>:
Here specify one of the keywords v or i.

<triple_no>:
This parameter is of type <integer>.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_FLOAT Parameter of type <float> has errors
CMERR_INVALID_INT Parameter <triple_no> is not an integer
See also command amp:range
Compatibility Win32
Example The command amp:range?(i(1)) returns the string
“1,1.250000E+001,1.250000E+000,1.250000E+001;” when executen on a CMC156EP. This
means that the currently selected range is 12.5A and that there are 2 ranges, one 1.25A and
one 12.5A.

OMICRON electronics Page 129


CM Engine

4.4.3.16 amp:ctrl (i (<triple_no>), <v_ctrl>)

Function This command executes a power optimization of an amplifier for a specific CMC application.
Description The command optimizes the output power of the three generators of a voltage or current
triple for a specific application. Use this command to tell the CMC which maximum voltage
you need for your application and the CMC automatically optimizes the power output for this
case.

Parameters:
- The keyword i specifies the current amplifier (this command is not supported for voltage
amplifiers).
- The parameter <triple_no> specifies the number of the generator triple.
- The parameter <v_ctrl> specifies the peak no-load output voltage (in V) of the amplifier
outputs.
Parameters <i>:
Here you must specify the keyword i.

<triple_no>:
This parameter is of type <integer>.

<v_ctrl>:
This parameter is of type <float>.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_FLOAT Parameter of type <float> has errors
CMERR_INVALID_INT Parameter <triple_no> is not an integer
CMERR_NOT_SUPPORTED Command is not supported on this device
CMERR_NO_YET_IMPLEMENTED Command is not yet implemented
This error code is returned only when the triple is
routed to an intelligent external amplifier.

4.4.3.17 amp:ctrl? (v | i (<triple_no>))

Function Gets the settings specified with the amp:ctrl command.


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 CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT Parameter <triple_no> is not an integer
See also command amp:ctrl

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

OMICRON electronics Page 130


CM Engine

voltage of 5.6V. The valid range is 3V to 6V. If the same command is executed on an CMC
56, the answer would be „1,0.000E+000,0.000E+000,0.000E+000;“. This means that power
control is not supported.

4.4.3.18 amp:reset(<amp_id>)

Function Performs a reset on an external amplifier.


Description This command performs a reset on the specified intelligent external amplifier.
Parameters <amp_id>:
This parameter is of type <integer>.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_OUT_OF_RANGE There is no amplifier with the specified ID
CMERR_COMM Communication error during command execution.

See also command gps:reset


Examples Suppose you have connected a CMA156 to the CMC then the command amp:reset(1) will
perform a reset on the amplifier with the ID 1.

4.4.4 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.

4.4.4.1 inp:[ana:]v(<input_list>):get?[(all)]
inp:[ana:]i(<input_list>):get?[(all)]

Function Measure the voltage/current in one or more DC analog inputs and return the results.
Description This command measures the voltage/current at one or more analog DC inputs. The inputs for
which the measurement is to be performed are specified in <input_list>.

The number of existing DC analog voltage and current inputs can be queried with the
inp:cfg? command.

Parameter <input_list>:
This parameter is of type <enumeration>

all:
causes the validity of the measurement to be returned after the actual measurement. See
command inp:ana:get?(<command handle>) for the meaning of the validity flags.
Answer Returns the measurement data as one or more values of type <float>. When a voltage
measurement was executed, the return value is in Volts and when a current measurement
was executed the return value is in Amperes. If the parameter all has been specified, each
measurement is followed by an <integer> with the validity flags.

OMICRON electronics Page 131


CM Engine

Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT Parameter <input_list> contains a number that is
not an int
CMERR_DCTASK_OFF The DC task has been turned off – no
measurement is possible

Please note If the DC task is turned off in a CMC256 or newer test set, the command will fail. In a
CMC156, it is not possible to turn off the DC task, even if the inp:ana:dc(off) command will
be accepted.
See also inp:cfg?
inp:ana:dc(on|off)
Example inp:i(1):get?
Answer: "1, 0.145E-001;"
The DC current input 1 returned a current of 14.5 mA.

inp:v(1):get?(all)
Answer: "1, 1.000E+001,0;"
The DC voltage input 1 measured 10V. The measurement is valid.

4.4.4.2 inp:[ana:]v|i(<input_list>):range?

Function Return the selected and possible ranges of one or more DC analog inputs.
Description This command replaces inp:[ana:]v|i (<input_list>):param?, which is now obsolete. It
returns the currently selected range followed by the list of available ranges.

Parameters <input_list>:
Comma separated list of the DC analog inputs on which the command applies. The
maximum number for the analog voltage and current input can be queried by the inp:cfg?
command.
v:
means the analog DC voltage inputs are read. Results are returned as a floating point
number in Volts.
i:
means the analog DC current inputs are read. Results are returned as a floating point
number in Amps.
Answer The returned string contains the device number, followed by a series of floating point
numbers. The first number is the selected range, and the numbers that follow are the
available ranges. All DC inputs are symmetrical, and can measure from -<range> to
+<range>.
See also inp:[ana:]v|i(<input_list>):range(<range>)

Example inp:ana:i(1):range?
Result : 1,2.000000e-002,1.000000e-003,2.000000e-002;
The example shows that the currently selected range is 20 mA and the available ranges are
1 mA and 20 mA. This is the case for a CMC256.

4.4.4.3 inp:[ana:]v|i(<input_list>):range(<range>)

Description Sets the range of the current or voltage analog DC input. Some CMCs only have one range
(in which case this command will have no effect). You can use the
inp:[ana:]v|i(<input_list>):range? command to see how many ranges are supported
beforehand.

OMICRON electronics Page 132


CM Engine

Parameters <input_list>
Comma separated list of the DC analog inputs on which the command applies. The
maximum number for the analog voltage and current input can be queried by the inp:cfg?
command.

v:
means the analog DC voltage input is read. Results are returned as a floating-point number
in volts.

i:
means the analog DC current input is to be read. Results are returned as a floating-point
number in amps.

<range>
floating point number. Specifies the range. The next equal or higher range is selected. If it is
above the maximum then and error will be returned.

See also inp:[ana:]v|i(<input_list>):range?

Example inp:ana:i(1):range(0.001)
Sets the range of the DC current input to 1mA.

4.4.4.4 inp:bin:cfg?

Function Get the number of available input modules.


Description Use this command to get the number of input modules available in a device.
Answer An integer number is returned that represents the number of input modules available in the
addressed device.
See also inp:bin(<inp_module_idx>):cfg?
inp:bin(<inp_module_idx>:<group_idx>):cfg?
Example Command: inp:bin:cfg?
Answer: "1,1;"
Device 1 has 1 binary input module.

4.4.4.5 inp:bin(<inp_module_idx>):cfg?

Function Get configuration information for the selected input module.


Description Use this command to get a complete description of each input module in the addressed
device.
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.
Answer <dev_id>,<#groups>,<loc>,<loc_idx><mod_type>,<mod_ser_no>,<hard_ver>,
<dev_type>,<dev_ser_no>;

The return string contains the CMC’s device number, plus the following data for the selected
input module:

Number of Groups

OMICRON electronics Page 133


CM Engine

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
Type of device in which the inputs are included. For instance, CMC256-6, CMB IO-7, etc.

Device Serial Number


The serial number of the host device.

See also inp:bin:cfg?


inp:bin(<inp_module_idx>:<group_idx>):cfg?
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 CMC256.

4.4.4.6 inp:bin(<inp_module_idx>:<group_idx>):cfg?

Function Get configuration information for the selected input group.


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_gran>,
<gnd_conn>,<common>,<res_group_type>,<res_group_idx>,<func>[,…];

The return string contains the CMC’s device number, plus the following data for the selected
input group:

Number of Inputs
Number of binary inputs in this group (integer).

Minimum Nominal Value


Floating point value representing the minimum value the input can accept (in VDC)

OMICRON electronics Page 134


CM Engine

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:
group The threshold setting is common for all inputs in the group.
single The threshold can be set independently for each input in the group.

Ground Connector
String indicating the configuration of the ground connector. The following values can be
returned:
group There is one single ground connector for the whole group.
single Each input has its own ground connector.

Please note that in the single case, the existence of a separate ground connector for each
input does not necessarily mean that such grounds are electrically independent too. The
CMC256, for instance, has a separate ground connector for each input, but each two inputs
share a common ground.

Common
String indicating the polarity of the common ground connector. It must be one of the following
values:
neutral Common ground connector is neutral.
plus Common ground connector is positive.
Resource group type
String indicating the resource group of this input group. It must be one of the following values:
bininp Resource group rgtBinInp.
multiinp Resource group rgtMultiInp.
Resource group index
Integer value of the index for this group’s resource group.

Input functions
Comma-separated list of the functions that the inputs in the group support. The list will
include one or more of the following strings:
bin Binary input function (including voltage-sensing).
count Pulse counter function.
v Voltage measuring function.
i Current measuring function.
See also inp:bin:cfg?
inp:bin(<inp_module_idx>):cfg?
Example Command: inp:bin:cfg?
Answer: "1,1;"
The device (a CMC156 in this case) has 1 input module.

Command: inp:bin(1):cfg?
Answer: "1,2,front,1,CMC156-EP,DB011D,0,CMC156-EP,DB011D;"
The module has 2 input groups and is located in the front of the device. As is the case with
CMC devices, the module’s type and serial number are the same as the CMC’s.

OMICRON electronics Page 135


CM Engine

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 CMC256 turned out to have 10 groups,
each comprising just one input. Therefore, in the CMC256 each input must be individually
configured, while in the CMC156 it is possible (but not compulsory) to assign values to
several inputs at the same time.

4.4.4.7 inp:bin(<inp_module_idx>):get?

Function Get the states of the selected module’s binary inputs.


Description Use this command to get the states of all binary inputs in a module.
Parameters <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:

Bit … 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Input … 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
See also inp:bin[(<inp_module_idx>)]:diff(reset)
inp:bin(<inp_module_idx>):diff?
Example Command: inp:bin(1):get?
Answer: "1,44;"
The inputs 3,4 and 6 in module 1 are set and the others are cleared.

4.4.4.8 inp:bin(<inp_module_idx>):diff?

Function Get the change mask of the selected module’s binary inputs.
Description Use this command to get a bit-mask representing the binary inputs that have changed states
since the last inp:bin[(<inp_module_idx>)]:diff(reset) command.
Parameters <inp_module_idx>
Integer id of the input module for which the bit mask is requested. This value must be greater
than 0, and smaller or equal than the value returned by the inp:bin:cfg? command.
Answer A decimal number is returned that represents a 32 bit integer value. Bit 0 (LSB) represents
binary input 1; the bit is set if the input’s state has changed since the last
inp:bin[(<inp_module_idx>)]:diff(reset) command, cleared otherwise.

OMICRON electronics Page 136


CM Engine

Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_NOT_SUPPORTED Command not supported in this device
Please note This command is not currently supported in CMC devices.
See also inp:bin[(<inp_module_idx>)]:diff(reset)
Example Command: inp:bin(1):diff?
Answer: "1,1;"
Only binary input 1 changed state since the last inp:bin[(<inp_module_idx>)]:diff(reset)
command was issued.

4.4.4.9 inp:bin[(<inp_module_idx>)]:diff(reset)

Function Clear the change mask of the selected module’s binary inputs.
Description Use this command to reset the state-change memory for a given module, or for all modules
in a device.
Parameters <inp_module_idx>
The integer id of the input module for which the change memory must be cleared. This value
must be greater than 0, and smaller or equal than the value returned by the inp:bin:cfg?
command. If the parameter is omitted then all input modules in the addressed device are
reset.

Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_NOT_SUPPORTED Command not supported in this device
Please note This command is not currently supported in CMC devices, only in CMB.
See also inp:bin(<inp_module_idx>):diff?

4.4.4.10 inp:bin(<inp_module_idx>:<group_idx>):debounce(<deb_time>)

Function Set the debounce time for all inputs in the selected group.
Description After a change in a given binary input, the device starts counting the debounce time for that
input. During that time, all changes in the input are ignored.
Parameters <inp_module_idx>
Integer id of the targeted input module. This value must be greater than 0, and smaller or
equal than the value returned by the inp:bin:cfg? command.
<group_idx>
Integer id of the input group within the input module for which we want to set the debounce
time. This value must be greater than 0, and smaller or equal than the value returned by the
inp:bin(<inp_module_idx>):cfg? command (return field <#groups>).
<deb_time>
This floating point parameter represents the debounce time in seconds. A value of 0 disables
the feature. The maximum debounce time is 25.6ms (higher values can be set without
receiving an error message but are internally cut down do 25.6ms). Setting the debounce
time changes the time resolution of the binary inputs:

Debounce time Time resolution


0 - 3.2 ms 100 µs
3.2 - 6.4 ms 200 µs
6.4 - 12.8 ms 400 µs
12.8 - 25.6 ms 800 µs

OMICRON electronics Page 137


CM Engine

Please note This command is not supported in CMC156 and CMC56 devices. The command will be
accepted for these devices, but it will have no effect.
See also inp:bin(<inp_module_idx>:<group_idx>):debounce?

4.4.4.11 inp:bin(<inp_module_idx>:<group_idx>):debounce?

Function Request debounce information for the selected group.


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 CMC’s device number, plus the following data for the selected
input group:

Debounce Time
Debounce time in seconds (floating point).

Debounce Resolution
Floating point value representing the debounce resolution in seconds.

Please note In CMC156 and CMC56 devices, the command will return 100e-6 seconds, which is the
sampling rate of the binary inputs.
See also inp:bin(<inp_module_idx>:<group_idx>):debounce(<deb_time>)

4.4.4.12 inp:bin(<inp_module_idx>:<group_idx>):deglitch(<degl_time>)

Function Set the deglitch time for all inputs in the selected group.
Description After a change in a given binary input, the device starts counting the deglitch time for that
input. During that time, the input must not change again. Pulses with width shorter than the
deglitch time are not considered. When the deglitch feature is active, changes in all binary
inputs are recorded with a delay equal to the deglitch time. This affects all information and
operations involving binary inputs, including trigger conditions.
Parameters <inp_module_idx>
Integer id of the targeted input module. This value must be greater than 0, and smaller or
equal than the value returned by the inp:bin:cfg? command.
<group_idx>
Integer id of the input group within the input module for which we want to set the deglitch
time. This value must be greater than 0, and smaller or equal than the value returned by the
inp:bin(<inp_module_idx>):cfg? command (return field <#groups>).
<degl_time>
This floating point parameter represents the deglitch time in seconds. A value of 0 disables
the feature.
Please note This command is not supported in CMC156 and CMC56 devices. The command will be
accepted for these devices, but it will have no effect.
See also inp:bin(<inp_module_idx>:<group_idx>):deglitch?

OMICRON electronics Page 138


CM Engine

4.4.4.13 inp:bin(<inp_module_idx>:<group_idx>):deglitch?

Function Request deglitch information for the selected group.


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 CMC’s device number, plus the following data for the selected
input group:

Deglitch Time
Deglitch time in seconds (floating point).

Deglitch Resolution
Floating point value representing the deglitch resolution in seconds.

Please note In CMC156 and CMC56 devices, the command will return 0, since the feature is not
available.
See also inp:bin(<inp_module_idx>:<group_idx>):deglitch(<degl_time>)

4.4.4.14 inp:bin(<inp_module_idx>:<group_idx>[:<inp_idx>]):def(pf | <threshold>)

Function Configure the sensing mode of the binary inputs.


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.

Please Note In a CMC256 or newer test set, a potential-sensing input can be used as an analog input, and
the measurement tasks can be started on it. Trying to start a measurement task in a
potential-free input will cause an error.
Parameters <inp_module_idx>
Integer id of the targeted input module. This value must be greater than 0, and smaller or
equal than the value returned by the inp:bin:cfg? command.
<group_idx>
Integer id of the input group within the input module whose inputs we want to configure. This
value must be greater than 0, and smaller or equal than the value returned by the
inp:bin(<inp_module_idx>):cfg? command (return field <#groups>).
<inp_idx>
Integer id of the individual input to configure. This optional parameter is only allowed for
setting thresholds, and then only if the inputs can be individually programmed (see the return
string for the inp:bin(<inp_module_idx>:<group_idx>):cfg? command), return field
<thres_gran>.
<threshold>:
Floating point number in volts. Specifies the binary threshold. A DC voltage on this input
greater than or equal to the threshold will be taken to be a '1', a voltage less than the
threshold will be taken to be a '0'.
pf:
By specifying the keyword pf the input is configured as “potential free”.

OMICRON electronics Page 139


CM Engine

See also inp:bin(<inp_module_idx>:<group_idx>[:<inp_idx>]):def?


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

4.4.4.15 inp:bin(<inp_module_idx>:<group_idx>[:<inp_idx>]):def?

Function Query the sensing mode of the binary inputs.


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 CMC’s device number, plus the setting value for the input or
the group. This setting can be the string “pf” if the setting is potential-free sensing, or a
floating point value containing the threshold value for the input or the group. If the setting
value is requested for a group whose inputs have been individually programmed, the
command will return a threshold of 0.
See also inp:bin(<inp_module_idx>:<group_idx>[:<inp_idx>]):def(pf|<threshold>)

4.4.4.16 inp:bin(<inp_module_idx>:<group_idx>):name(<name>)

Function Set the group name.


Description This command allows setting a label to a group, which is to be retrieved later.
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?

4.4.4.17 inp:bin(<inp_module_idx>:<group_idx>):name?

Function Queries the group name.


Description Use this command to retrieve a group’s name.

OMICRON electronics Page 140


CM Engine

Parameters <inp_module_idx>
Integer id of the input module that the information is desired. This value must be greater than
0, and smaller or equal than the value returned by the inp:bin:cfg? command.
<group_idx>
Integer id of the input group within the input module that the information is desired. This value
must be greater than 0, and smaller or equal than the value returned by the
inp:bin(<inp_module_idx>):cfg? command (return field <#groups>).
Answer <dev_id>,<name>;
The return string contains the CMC’s device number, plus the name assigned to the group
enclosed in quotes. If no name has been set for the group, then the command returns an
empty string.
See also inp:bin(<inp_module_idx>:<group_idx>):name(name)
Examples inp:bin(1:1):name?
Result: 1,””; // Group 1 in module 1 has no name assigned
inp:bin(1:1):name(”Input block 1”)
inp:bin(1:1):name?
Result: 1,”Input block 1”;

4.4.4.18 inp:ana(<input_list>):def(v,<range>)
inp:ana(<input_list>):def(i,<range>,<CTRatio>)

Function Configure the measuring mode of the AC analog inputs.


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 CMC256 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 CMC256 or newer test set: 100mV, 1V, 10V, 100V
and 600V. From these available ranges, the closest that is equal to or greater than the
provided <range> parameter is selected.

<CTRatio>:
Floating point number in V/A. This is the ratio of volts per amp of the current clamp or current
shunt being used.

Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_256_CMD Command requires CMC256 or greater

Examples inp:ana(4,2,5):def(v,5.0)
Configures inputs 4,2 & 5 as voltage inputs with 10V range.

OMICRON electronics Page 141


CM Engine

inp:ana(6,10,8):def(i,1.0,0.1)
Configures inputs 6,10 & 8 as current inputs with a 1V range and a CT ratio of 100 mV/A.
inp:ana(1):def(i,0.1,0.01)
Configures input 1 as a current input with a 100 mV range and a CT ratio of 10 mV/A.

4.4.4.19 inp:ana(<input_list>):def?

Function Display the input’s configuration.


Description Displays the configuration of each analog input in the list.

Parameters <input_list>:
Comma separated list of the analog inputs whose configuration is to be displayed.

Answer The return string contains the CMC’s device number, plus one set of data for each input in
the list, as follows:

Input number
An integer with the input to which the following data refers.

Function
String: “v” for voltage inputs, “i” for current inputs, “pf” for potential-free inputs and “ps” for
potential-sensing inputs.

range
A floating point number containing the input’s range.

binary threshold
Floating point; for binary inputs in potential-sensing mode, value that the sensed voltage must
reach in order to be read as “active”

CT ratio
Floating point; current clamp or shunt ratio in V/A

Some of these values are of no relevance for a particular input (for instance the CT ratio for a
voltage input or the binary threshold for an analog input). In this case the user should simply
ignore them.
Examples inp:ana(1,2,3):def?
Result : “1,1,i,1.000000e-001,2.500000e+000,1.000000e-002,
2,ps,1.000000e+002,1.200000e+002,1.000000e+000,3,i,1.000000e-
001,2.500000e+000,2.000000e-001;”

Where:
input#1 is an analog current input with 100mV range, 2.5v binary threshold and 0.01 V/A CT
ratio
input#2 is a potential-sensing binary input with 100 V range and 2.5v binary threshold and 1
V/A CT ratio
input#3 is a current input with 100 mV range, 2.5v binary threshold and 0.2 V/A CT ratio

4.4.4.20 inp:ana(<input_list>):range?

Function Display the list of available ranges of each analog input.


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

OMICRON electronics Page 142


CM Engine

amplitudes. The ranges are applicable whether the input is being set as voltage or current
input.
Parameters <input_list>
Comma separated list of the binary/analog inputs whose ranges are to be displayed.
Answer The return string contains the CMC’s device number, plus one set of range data for each
input in the list. The range data are a list of floating point numbers sorted from lowest to
highest, each of which represents one measuring range in RMS. Please note that no
indication of the input to which the values belong is provided; it is therefore recommended to
issue this command once for each input whose ranges we wish to obtain.
See also inp:ana(<input_list>):def(v,<range>)
inp:ana(<input_list>):def(i,<range>,<CTRatio>)
Examples inp:ana(1):range?
Result : “1,1.000000e-
001,1.000000e+000,1.000000e+001,1.000000e+002,6.000000e+002;”
This shows that input 1 has 4 possible ranges: 100mV, 1V, 10V, 100V & 600V.

4.4.4.21 inp:buf:sam (<source>, <index>)


inp:buf:sam (bin, on | off | bin)

Function Executes a measurement (selectable source) and stores the result into the measurement
buffer in the CMC.
Description Measures the voltage on the analog voltage input or the current on the analog current input
or the states of all binary inputs. The second version of this command is used to enable or
disable automatic sampling of all binary inputs on every change on a binary input and all
nominal change events in a signal output caused by the execution of any on or off command
(see inp:buf:get?). The results are not returned but stored into the CMC-internal
measurement buffer. You can get the samples in this buffer using the inp:buf:get?
command.

The buffer has a length of 2048 samples and it has a ring architecture. Thus if you make
more than 2048 samples without getting a sample, the samples 2049 and higher overwrite
the samples at the beginning of the buffer. When this overrun occurs, the next inp:buf:get?
command returns the keyword overrun (see description of inp:buf:get?).

The parameter <index> has different meanings for the different sources (<source>):

parameter measurement source interpretation of <index>


<source>
dcv analog voltage input (origin "DC voltage") number of analog voltage input
dci analog current input (origin "DC current") number of analog current input
bin all binary inputs (origin "binary inputs") signature (see below)
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>.

OMICRON electronics Page 143


CM Engine

<index>:
This parameter is of type <integer>. Its valid range depends on the source.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter <index > is not an integer
See also inp:buf:sam(ext)
inp:buf:get?

4.4.4.22 inp:buf:sam(ext)

Function Enable extended mode for the sample buffer entries.


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?

4.4.4.23 inp:buf:get?

Function Get the next value of all the measurements generated by inp:buf:sam commands and stored
in the buffer.
Description The first invocation of this command returns the first entry of the measurement buffer,
subsequent invocations return the following entries.
Answer Every measurement result returned consists of five pieces of information:
a type information, a time information, measurement data, an index and an optional
information.

Type information:
The type information is one of the keywords bin, dcv, dci, bcount, ecount, zcross, empty,
overrun or switchoff:
• The keywords dcv, dci, bin denote that the measurement data returned is a valid
sample from the source DC voltage inputs, DC current inputs or binary inputs made
with inp:buf:sam.
• The keyword zcross denotes that this entry was generated by a zero cross event on
any signal which was activated by a out:ana:off(zcross) command.
• The keyword empty is returned as type information when there are no entries in the
measurement buffer.
• The keywords bcount and ecount denote entries from counters.
• The keyword overrun is returned when a buffer overrun happened (The measurement
buffer in the CMC is a ring buffer. If data are fetched too slowly, values that have not
been read yet are overwritten with new ones). In both cases all other parameters
returned are 0.
• When the CMC discovers an overtemperature on one of the amplifiers the CMC's
outputs are switched OFF and the entry "switchoff" is placed into the measurement
buffer. In this case the keyword switchoff is returned with inp:buf:get?.

If the extended mode is selected (inp:buf:sam(ext) command has been issued) then the bin
type information is followed by the index of the input module for which the inputs have been
sampled. The type then is bin(<inp_module_idx>) where <inp_module_idx> is an integer
from 1 to the value returned by the inp:bin:cfg? command.

Time information:
The time information represents the content of a counter in the CMC that is converted into
seconds. The difference between the time information of two measurements represents the

OMICRON electronics Page 144


CM Engine

time between these measurements. The first entry always contains a time information of 0.
The counter for the time information is a 24-bit counter that is incremented every 0.1ms; it
therefore overflows every 27 minutes approximately. CM Engine is capable of handling this
overflow by itself and provide accurate times, as long as at least one event is generated
within those 27 minutes. Thus you must make sure that no period of 27 minutes can elapse
without event generation, and manually generate events if needed.

Measurement data:
• If the type information is dcv or dci, a value of type <float> is returned representing the
voltage or current measured.
• If the type information is bin, an <integer> number is returned containing the states of
the binary inputs as bits set or cleared. Bit 0 represents the state of binary input 1, bit 1
represents the state of binary input 2, etc.
• If the type information is zcross an information is returned that denotes the voltage or
current generator that was switched off in its zero crossing. This information contains
kind of generator (voltage/current), the generator triple number and the generator
number.
Thus it either has the format v(<triple_no>:<gen>) or i(<triple_no>:<gen>). For
every single signal switched off in its zero crossing there is a separate entry although
they probably have been initiated together as a triple . Signals specified to be switched
off simultaneously with a signal in its zero crossing do not create an entry (see
out:ana:off(zcross)).
• If the type information is bcount or ecount an <integer> number is returned
• If the type information is overrun or empty, no valid data is returned.

Index:
If the type information keyword is dcv or dci the index information is the number of the analog
input.
• If the type information keyword is bin the index is a signature with the following meaning:
Signature Explanation
0 Nominal Change (automatically inserted with every out:ana:on or
out:ana:v():on or out:ana:i():on if automatic logging of binary inputs
changes is enabled – see inp:buf:sam(bin, on))
1 Entry produced by automatic logging or by inp:buf:sam(bin, 1) or by
inp:buf:sam(bin, on)
2 User-defined signature
3 User-defined signature
4 User-defined signature
5 User-defined signature
6 User-defined signature
7 User-defined signature
8 User-defined signature
9 User-defined signature
Optional information:
The optional information is only for entries of type bcount and ecount. All other entries
return - as optional information. For the counter entries the optional information is zcross if a
zero crossing of the counter produced the entry. Otherwise it is -.

Summary:
The following table is a summary of all type information and their measurement data returned
in the answer string:
Type information Measurement data Index Optional info
dcv measured voltage on voltage Number of voltage input -
input in Volts
type <float>
dci measured current on current Number of current input -
input in Amps
type <float>
bin measured binary inputs Signature -
type <integer>

OMICRON electronics Page 145


CM Engine

Type information Measurement data Index Optional info


zcross v(<triple_no>:<gen>) or -
i(<triple_no>:<gen>)
bount or ecount count; type <integer> counter number zcross or -
empty always 0 always 0 -
overrun always 0 always 0 -
switchoff always 0 always 0 -
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
Example The command inp:buf:sam (bin, 1) has been executed once.
Then inp:buf:get? returns e.g.: "1,bin,0,708,1,-;".
This means that device 1 measured the following states of the binary inputs at 0 seconds:
2 6 7 9
708 = 0b1011000100 = 2 +2 +2 +2
⇒ The binary inputs 3, 7, 8 and 10 were set. The signature is 1, no optional information.
If extended mode had been set, the return would have been: "1,bin(1),0,708,1,-;" with the
input module 1 identified as the location of the inputs that changed.

4.4.4.24 inp:buf:get?(<no_of_entries>)

Function Get one or more of the next entries in the input buffer.
Description Get a certain number of entries in the input buffer. If there are fewer entries in the buffer, then
all entries are returned.
Parameters <no_of_entries>
Integer number representing the number of entries that are requested from the buffer. It must
be greater than 0.
Answer <dev_id>,<entries_read>{,<type_info>,<time_info>,<meas_data>,<index>,<optional>}…;

The returned string contains the device number, the number of entries actually read from the
buffer (integer value from 0 if the buffer was empty to <no_of_entries> if all requested entries
were successfully read) plus as many measured buffer entries as returned in the
<entries_read> parameter; each entry has the same format as those returned by the
inp:buf:get? command.
See also inp:buf:get?
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
Example We want to get the next 5 entries in the input buffer.
Command: inp:buf:get?(5)
Return : "1,3,bin(1),0,708,1,-,bin(1),0,708,9,-,bin(1),0,708,9,-;"
This means that only three entries were available in the buffer, the data for which follows. All
entries are binary, the second and third with index 9 meaning that they are the result of a
inp:buf:sam(bin,9) command. The extended mode is active, and all inputs have been
sampled in input module 2 of the targeted device.

4.4.4.25 inp:buf:clr

Function Clear the buffer for measurement data.


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 CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence

OMICRON electronics Page 146


CM Engine

4.4.4.26 inp:count:on

Function Start counting with all activated counters.


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 CM Engine error codes:

Error code Explanation

Error code Explanation


CMERR_COUNTER_NOT_ACTIVE No counter activated
CMERR_COUNTER_ON Counting is already on
See also inp:count:set, inp:count:off, inp:count:clr

4.4.4.27 inp:count:off

Function Stop counting of all counters.


Description This command stops the counting of all counters that were started with inp:count:on.
See also inp:count:on, inp:count:set, inp:count:clr

4.4.4.28 inp:count:clr

Function Clear all counter settings.


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, inp:count:set, inp:count:join

4.4.4.29 inp:count:set(bcount | ecount(<counter>), <count>, +|-)

Function Sets up a binary input or a extended counter input as counter.


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 CM Engine error codes:
Error code Explanation
CM_ERR_COUNTER_ON Counting is already on

OMICRON electronics Page 147


CM Engine

Error code Explanation


CMERR_INVALID_INT Parameter <count> is not an integer
See also inp:count:join, inp:count:on, inp:count:clr, inp:buf:get?
Example Starting with inp:count:set(bcount(1),16777212,+) the counting sequence looks as follows:
16777212 => 16777213 => 16777214 => 16777215 => 0 => 1 => 2.

4.4.4.30 inp:count:join(bcount | ecount(<master_counter>), bcount |


ecount(<slave_counter>))

Function Joins two counters for synchronized operation.


Description This command defines a master-slave relationship between two counters. There can be
several master counters. A master counter can have several slave counters. A slave counter
cannot be a master counter at the same time but a slave counter can have several master
counters.
The first edge on a master counter and whenever a master counter goes through zero all its
slave counters make an entry in the measurement buffer with their next edge.
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 CM Engine error codes:
Error code Explanation
CMERR_NOT_ACTIVE Selected counter(s) are not active
CMERR_COUNTER_ON Counting is already on
CMERR_COUNTER_MASTER_SLAVE A slave counter cannot be a master counter at
the same time
See also inp:count:on

4.4.4.31 inp:count:get?(bcount | ecount(<counter>))

Function Gets the count of a counter.


Description This command reads the current count of the selected counter.
Parameters <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 CM Engine error codes:

Error code Explanation


CMERR_INVALID_INT Parameter <count> is not an integer
See also inp:count:on, inp:buf:get?

4.4.4.32 inp:ana:cfg(<srate>,<avrg>)

Function Set the samplig frequency and averaging factor of the measuring DSP.
Description The sampling rate is the rate at which time measuring DSP makes measurements (e.g. a
sampling rate of 3.16 kHz means measurements are made 3160 times every second).
Higher sampling frequencies mean a finer resolution of the sampled wave; this is useful for
applications such as power-quality analysis and fault-recording. On the other hand, it
increases the load in the DSP and may cause a “Real Time Violation” error (see

OMICRON electronics Page 148


CM Engine

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 CMC256 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 CMC256 or newer test set the ranges are 3.16, 9.48 & 28.444 kHz.

<avrg>:
Floating point number. Is the averaging factor for all the multimeter commands.

The averaging factor is a value equal or less than 1 and greater than 0. It causes the results
of the multimeter commands to be averaged over a period of time. An averaging factor of 1
means no averaging. A factor close to zero means a high amount of averaging (0 is illegal).
This affects the rms, phase, frequency and power commands and is configured globally for
all of them.

By default averaging is switched off (<avrg> set to one), however if you are measuring a
steady state signal and you need extra accuracy, setting an averaging factor less than 1 will
increase the accuracy by effectively "smoothing" out any noise. (If the signal is varying quickly
it's better to have no averaging).

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

Examples inp:ana:cfg(9000,0.5)
Sets the 9.48 kHz sampling rate and an averaging factor of 0.5

inp:ana:cfg(28444,1.0)
Sets the 28.44 kHz sampling rate with no averaging

4.4.4.33 inp:cfg?[(ecount)]

Function Get information about the hardware configuration of the analog and binary inputs.
Description This command gets the following information about the CMC:
- number of analog inputs for DC voltage measurement
- number of analog inputs for DC current measurement
- number of binary inputs
- version number of the input/output board
or
- number of 100 kHz counter inputs
Parameters ecount (optional):
When this parameter is specified the command returns the number of 100 kHz counter
inputs.
Answer The version without parameter of the command returns a string that contains the CMC's
device number, a sequence of four comma separated <integer> values and a trailing ";".The
version with ecount returns a string that contains the CMC's device number, an <integer>
value and a trailing ";".
Possible Errors This command may cause the following CM Engine error codes:

OMICRON electronics Page 149


CM Engine

Error code Explanation


CMERR_IN_SEQ_MODE Command not allowed within sequence

See also inp:ana:cfg?(srate|avrg|firm|hard)


Example The command inp:cfg? returns the string "1,1,1,10,7;". Thus CMC #1 has one analog input
for voltage measurement, one analog input for current measurement, 10 binary inputs and
the input/output board has the version number 7.

4.4.4.34 inp:ana:cfg?(srate|avrg|firm|hard)

Function Get information about the configuration of the analog inputs.


Description This command will only work on a CMC256 or newer test set.

Parameters See below

Answer The returned values depend on which option you supply as a parameter.
srate:
Returns the sample rate.
avrg:
Returns the averaging factor.
firm:
Returns the firmware version of the Measuring DSP.
hard:
Returns the hardware version of the Measuring DSP.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence

See also inp:cfg?[(ecount]]

Examples inp:ana:cfg?(srate)
Result : “1,2.844444e+004;”
inp:ana:cfg?(avrg)
Result : “1,1.000000e+000;”
inp:ana:cfg?(firm)
Result : “1,1.0.0;”
inp:ana:cfg?(hard)
Result : “1,1.0;”

4.4.5 GPS commands


These commands are used to control the CMGPS device. 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.

4.4.5.1 gps:status?

Function Gets the current status of the CMGPS.


Description This informs the application what information the CMGPS has obtained from the satellites
and if any special conditions have occurred.

OMICRON electronics Page 150


CM Engine

Answer The command returns 2 values of type <integer>: <Status Register>,<Satellites>


<Status Register>:
16 bit word. Each bit represents the status of a certain aspect of the CMGPS.

Bit Meaning when set


0 Initializing
1 Time available
2 Latitude & Longitude available
3 Height available
4 Pulse available (CMGPS in locked state)
5 UTC changed
6 Almanac Saving
7 Almanac Error
8 Antenna Open
9 Antenna Short
10 not used
11 not used
12 not used
13 not used
14 not used
15 not used
<Satellites>:
Number of satellites tracked (0-8 satellites possible).

Possible Errors This command may cause the following CM Engine error codes:

Error code Explanation


CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_GPS_BUSY The command was issued when the CMGPS was
still initializing, or processing the previous
command.
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.
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.

4.4.5.2 gps:reset

Function Performs a reset on the GPS device.


Description This command performs a reset on the GPS device.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.

OMICRON electronics Page 151


CM Engine

See also command amp:reset(<amp_id>)


Examples Suppose you have connected a CMGPS to the CMC then the command gps:reset will
perform a reset on the GPS device.

4.4.5.3 gps:sigma?

Function Gets the Sigma deviation (trigger-impulse deviation).


Description This is a value that indicates how accurate the time pulses are. Normally the application will
not need this information.
Answer integer between 0-0xFFFF
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_GPS_BUSY The command was issued when the CMGPS was
still initializing, or processing the previous
command.
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.

4.4.5.4 gps:pos?

Function Gets the current GPS position.


Answer The command returns 4 values of type <float>: <latitude>,<longitude>,<height>, <DOP>

<latitude>:
Latitude in degrees.

<longitude>:
Longitude in degrees.

<height>:
Height in meters.

<DOP>:
The DOP (ranges between 0 and 99.9) is an indication of the quality of the results that can be
expected from a GPS point position.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_GPS_BUSY The command was issued when the CMGPS was
still initializing, or processing the previous
command.
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.

4.4.5.5 gps:pos(<latitude>, <longitude>, <height>)

Function Sets the GPS position.


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..

OMICRON electronics Page 152


CM Engine

Parameters All three parameters are of type <float>


<latitude>:
Latitude in degrees. Valid range from -90 to 90.

<longitude>:
Longitude in degrees. Valid range from -180 to 180.

<height>:
Height in meters. Valid range from -1000.00 to 18000.00

Possible Errors This command may cause the following CM Engine error codes:

Error code Explanation


CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_OUT_OF_RANGE Channel or rate parameters are out of range
CMERR_GPS_BUSY The command was issued when the CMGPS was
still initializing, or processing the previous
command.
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.

Example gps:pos(63.2359,-100.3321,423.44)
Sets a position of 63.2359° latitude, -100.3321° longitude, 423.44 meters

4.4.5.6 gps:def?

Function Indicates that a CMGPS device has been found on the specified CMC.
Description It is useful to issue this command first to see if any CMGPS devices have been detected
before issuing any other GPS commands.
Answer 1 = CMGPS device has been found
0 = no CMGPS exists
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_GPS_BUSY The command was issued when the CMGPS was
still initializing, or processing the previous
command.
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.

4.4.5.7 gps:time:timemode?

Function Get the time mode of CMGPS.


Description This function returns the time mode which the CMGPS is operating under.
Answer sat or utc (sat = satellite time, utc = universal time)
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.

OMICRON electronics Page 153


CM Engine

4.4.5.8 gps:time:utc?

Function Get the time difference between UTC and GPS time.
Description This function returns the time difference between UTC and satellite time. This time difference
has to be added to the satellite time to get UTC.
Answer returns two integers: <UTC diff>,<valid>
<UTC diff>:
time difference in seconds
<valid>:
0 = the time difference is not valid (i.e. not available yet), 1 = time difference is valid
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_GPS_BUSY The command was issued when the CMGPS was
still initializing, or processing the previous
command.
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.

4.4.5.9 gps:time:sync(<ch>,<rate>,<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>)

Function Sets the synchronization rate and time for synchronization pulses on the specified channel.
Description The CMGPS has two "trigger" channels. The start date and time and the rate of pulses on
both channels can configured using this command.
Parameters All 8 parameters are of type <integer>
<ch>:
channel (0 or 1)
<rate>:
synchronization rate in seconds, allowed values (0..65535). Note: a value of 0 means only a
single pulse will be triggered.
<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>:
starting time and date of the synchronization pulses
Please note Do not use leading zeroes in any of the parameters.
Possible Errors This command may cause the following CM Engine error codes:

Error code Explanation


CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_DATE Date/time is not valid
CMERR_GPS_BUSY The command was issued when the CMGPS was
still initializing, or processing the previous
command.
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.
CMERR_OUT_OF_RANGE Channel or rate parameters are 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
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

OMICRON electronics Page 154


CM Engine

4.4.5.10 gps:time:sync?(<ch>)

Function Gets the synchronization rate and time for specified channel.
Description The CMGPS has two "trigger" channels. The configured start date and time and the rate of
pulses on either channels can be returned using this command.
Parameters <ch>:
channel (0 or 1)
Answer The command returns 7 values of type <integer>:
<rate>,<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>.
<rate>:
synchronization rate in seconds, allowed values (0..65535). A value of 0 means only a single
pulse is triggered.
<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>:
starting time and date of synchronization pulses
Possible Errors This command may cause the following CM Engine error codes:

Error code Explanation


CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_DATE Date/time is not valid
CMERR_OUT_OF_RANGE Channel or rate parameters are out of range
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.
CMERR_GPS_BUSY The command was issued when the CMGPS was
still initializing, or processing the previous
command.
Examples gps:sync?(0) - Gets the synchronization rate and time for channel 0

4.4.5.11 gps:time:datetime(<yyyy>, <mm>, <dd>, <hh>, <mm>, <ss>)

Function Sets the date and time of the CMGPS.


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.
Please note Do not use leading zeros in any of the parameters.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_DATE Date/time is not valid
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.
CMERR_GPS_BUSY The command was issued when the CMGPS was
still initializing, or processing the previous
command.
Example: gps:time:datetime(1998,10,23,18,20,0)

4.4.5.12 gps:time:datetime?

Function Gets the date and time from the CMGPS.

OMICRON electronics Page 155


CM Engine

Description This always returns satellite time + the GMT offset, but not including seasonal offset (i.e.
Winter saving time). If the status is queried, it can be seen if the time received from the
satellites is available. If the satellite time is not available, then this command will return the
time from the internal CMGPS clock.
Answer The command returns date and time as six values of type <integer>:
<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.
CMERR_GPS_BUSY The command was issued when the CMGPS was
still initializing, or processing the previous
command.
Example The command gps:time:datetime? returns e.g. the string "1,1998,10,12,11,54,34;". This
stands for October 12, 1998, 11:54:34 am.

4.4.5.13 gps:setup:mode?

Function Returns the accuracy mode of the device.


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 CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.
CMERR_GPS_BUSY The command was issued when the CMGPS was
still initializing, or processing the previous
command.

4.4.5.14 gps:setup:mode(<accuracy_mode>)

Function Sets the accuracy mode of the CMGPS.


Description There are four different accuracy modes: 0-3 (see below)
Please Note 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 doesn’t 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.

OMICRON electronics Page 156


CM Engine

Possible Errors This command may cause the following CM Engine error codes:

Error code Explanation


CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_OUT_OF_RANGE Channel or rate parameters are out of range
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.
CMERR_GPS_BUSY The command was issued when the CMGPS was
still initializing, or processing the previous
command.

Example gps:setup:mode(0) - sets accuracy mode 0.

4.4.5.15 gps:setup:gmt?

Function Gets the offset between GMT and local time


Description This offset is added to the satellite time when the user issues the gps:time:datetime?
command.
Answer The command returns 2 values of type <int>:
<hh>: Hours.
<mm>: Minutes.
Possible Errors This command may cause the following CM Engine error codes:

Error code Explanation


CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.
CMERR_GPS_BUSY The command was issued when the CMGPS was
still initializing, or processing the previous
command.

4.4.5.16 gps:setup:gmt(<hh>, <mm>)

Function Sets the offset between GMT and local time


Description This offset is added to the satellite time when the user issues the gps:time:datetime?
command.

Parameters All both parameters are of type <integer>


<hh>:
Hours. Valid range from -23 to 23.

<mm>:
Minutes. Valid range from 0 to 59.

Possible Errors This command may cause the following CM Engine error codes:

Error code Explanation


CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_OUT_OF_RANGE Channel or rate parameters are out of range
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.

OMICRON electronics Page 157


CM Engine

Error code Explanation


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

4.4.5.17 gps:setup:cfg?(type | ser | firm)

Function Get system information of the CMGPS.


Parameters One of the keywords type, ser, hard, cal or firm must be specified.
Answer The command returns a string that contains the following data:
type GPS model information string (e.g. "CMGPS")
ser Serial number of the CMGPS. (e.g. "AI150A")
firm firm - Version numbers of the firmware (e.g. "V1.00")
Possible Errors This command may cause the following CM Engine error codes:

Error code Explanation


CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.

4.4.5.18 gps:setup:cfg?(addr)

Function Returns the device address for serial communication for the GPS device.
Description This command returns the address for serial communication as a string. This address can be
used to communicate with the device over the RS485 interface.
Answer The command returns a string that contains the GPS device address.
Possible Errors This command may cause the following CM Engine error codes:

Error code Explanation


CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.
See also command amp:cfg?(<amp_id>,addr)

Examples Suppose you have connected a CMGPS to the CMC you would get an answer like this to the
command gps:setup:cfg?(addr): “1,3;”. This means that the device address of the GPS
device is 0x03.

4.4.5.19 gps:setup:pulse(<LED ch>, <sync type>, <edge type0>, <edge type1>)

Function Configures the synchronization channels.


Description It is possible to set with this command:
a) which channel the LED on the CMGPS is monitoring.
b) if channel 0 & 1 are connected together.
c) the edge type of the trigger for both channels.
Please Note If the channels are connected together then edge type0 is used and edge type1 will be
ignored.

OMICRON electronics Page 158


CM Engine

If the edge type is changed, the change only takes effect the next time the user configures
the pulse using the gps:time:sync command.
Parameters All 4 parameters are of type <integer>

<LED ch>:
channel that the LED is connected to (0 or 1).

<sync type>:
0 = channels operate separately, 1 = channels connected together (i.e. they operate in sync)

<edge type0>:
edge type for channel 0, 0 = negative, 1 = positive

<edge type1>:
edge type for channel 1, 0 = negative, 1 = positive
Possible Errors This command may cause the following CM Engine error codes:

Error code Explanation


CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_OUT_OF_RANGE Channel or rate parameters are out of range
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.
CMERR_GPS_BUSY The command was issued when the CMGPS was
still initializing, or processing the previous
command.

Example gps:setup:pulse(1,0,1,1)
means that the LED reflects status of channel 1, the channels are separate and the edge
type is positive for both channels

gps:setup:pulse(0,1,0,0)
means that the LED reflects status of channel 0, both channels are in sync and the edge type
is negative

4.4.5.20 gps:setup:pulse?

Function Gets the configuration of the synchronization channels.


Description This command returns:
a) Which channel the LED on the CMGPS is monitoring.
b) If channel 0 & 1 are connected together
c) The edge type of the trigger for both channels
Answer The command returns 4 values of type <int>:

<LED ch>:
channel that the LED is connected to (0 or 1).

<sync type>:
0 = channels operate separately, 1 = channels connected together (i.e. they operate in sync)

<edge type0>:
edge type for channel 0, 0 = negative, 1 = positive

<edge type1>:
edge type for channel 1, 0 = negative, 1 = positive
Possible Errors This command may cause the following CM Engine error codes:

OMICRON electronics Page 159


CM Engine

Error code Explanation


CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.
CMERR_GPS_BUSY The command was issued when the CMGPS was
still initializing, or processing the previous
command.

4.4.5.21 gps:setup:cable?

Function Gets the cable delay time


Answer Returns a single integer
<nsec>:
Specifies the time in nanoseconds.
Possible Errors This command may cause the following CM Engine error codes:

Error code Explanation


CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.

4.4.5.22 gps:setup:cable(<delay>)

Function Sets the cable delay time


Please Note This command is only needed if using a different length antenna cable than the one supplied
with the CMGPS device.
Parameter <delay>:
Specifies the time in nanoseconds. Integer between 0 and 999999
Possible Errors This command may cause the following CM Engine error codes:

Error code Explanation


CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.
CMERR_OUT_OF_RANGE Channel or rate parameters are out of range

4.4.5.23 gps:setup:save

Function Saves the current settings to flash memory.


Description This command saves the current settings in memory to (permanent) flash memory, so the
next time the CMGPS is powered up it will automatically default to these values.

The following settings are saved:


• Accuracy mode
• time-zone (GMT offset)
• cable delay
• initial position (latitude/longitude/height; not initialized by default)
• startup synchronization time & date and rates for channels 0 & 1
• startup trigger polarity

OMICRON electronics Page 160


CM Engine

• LED setting/channel sync.


It takes approximately 2 seconds to execute this command.
Possible Errors This command may cause the following CM Engine error codes:

Error code Explanation


CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_GPS_NOT_FOUND No CMGPS present or amp:scan? not yet
executed
CMERR_COMM Communication error during command execution.
CMERR_GPS_BUSY The command was issued when the CMGPS was
still in initialization, or processing the previous
command.

4.4.6 IRIG-B commands


These commands are used to control the IRIG-B functionality of a device. These commands work on each
network-based CMC device. On other devices the commands return a "CMERR_IRIGB_NOT_AVAIL" error.

It is possible to write a configuration synchronously or asynchronously to the encoder/decoder. The


synchronous write ensures that the configuration is not written while a new frame is created. The
configuration is accepted after the next pulse per second (PPS) and a frame later the first frame with that
configuration is created.
With an asynchronous write the configuration is accepted immediately and the next frame contains the
configuration. The user has to ensure that it is written outside the forbidden time frame, e.g., immediately
after a pulse per second (PPS). This could be useful in a sequence immediately after a successful trigger.

4.4.6.1 irigb:cfg(<cfg_no>)

Function Set the specified IRIG-B configuration on the device.


Description This command configures the device with the specified IRIG-B configuration. The following
table describes all available configurations.

Cfg. Nr. Description Example connection diagram


0 IRIG-B not configured
2 Trigger via IRIG-B
Triggers derived from the received IRIG-B time
telegrams. PPX Out pulse sequence in sync with
CMIRIG-B input.

3 IRIG-B Generator Master


CMC generates IRIG-B time telegrams and PPX
Out pulse sequence (1 pps) via CMIRIG-B
output in sync with CMC internal timebase (CMC
= Master clock).

4 IRIG-B Generator following PPS


CMC generates IRIG-B time telegrams and PPX
Out pulse sequence (1 pps) via CMIRIG-B
output in sync with external pulse sequence (1
pps).

OMICRON electronics Page 161


CM Engine

Cfg. Nr. Description Example connection diagram


5 IRIG-B Generator following CMGPS
CMC generates IRIG-B time telegrams and PPX
Out pulse sequence (1 pps) via CMIRIG-B
output in sync with CMGPS pulse sequence (1
pps).

Parameters <cfg_no>:
The number of the IRIG-B configuration that should be applied.
Please note! If a configuration activates the IRIG-B decoder it could be possible that a reset of the decoder
is needed after the configuration.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IRIGB_NOT_LOCKED Communication error during command execution.
CMERR_IRIGB_NOT_AVAIL IRIG-B functionality is not available on this device
CMERR_OUT_OF_RANGE IRIG-B configuration number is out of range.

4.4.6.2 irigb:cfg?

Function Returns all available IRIG-B configurations in a list.


Description This command updates the list of available IRIG-B configurations and returns it as comma
separated string. The configuration 0 (no configuration selected) is always included in the
returned list.
Answer The command returns a string
<cfg_no>[,<cfg_no>]
A string containing all available IRIG-B configuration numbers, e.g., "1,4,2,0".
Please note! This command detects hardware changes (removal of connected CMGPS) and updates the
available configurations. If the currently selected configuration is not included any more it
selects configuration 0.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_IRIGB_NOT_AVAIL IRIG-B functionality is not available on this device

4.4.6.3 irigb:cfg?(<cfg_no>)

Function Returns information about the IRIG-B configuration.


Description This command returns additional information about the IRIG-B configuration.
Answer The command returns one value:
<irigb_source>
<irigb_source>:
enc = IRIG-B encoder is the active source.
dec = IRIG-B decoder is the active source.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_IRIGB_NOT_AVAIL IRIG-B functionality is not available on this device

OMICRON electronics Page 162


CM Engine

4.4.6.4 irigb:def?

Function Indicates whether a CMIRIG-B device has been found on the specified CMC and returns the
selected IRIG-B configuration.
Description With this command it is possible to determine if a CMIRIG-B device is connected to the CMC
and to read the selected IRIG-B configuration from the device. If a CMIRIG-B device is
detected an additional value indicates whether an external device (e.g., CMGPS) is
connected to the CMIRIG-B device.
Please note! IRIG-B functionality is available on each network-based CMC device. The CMIRIG-B device
is not necessary to use IRIG-B.
Answer The command returns three values:
<cfg_no>,<dev_conn>,<ext_dev_conn>
<cfg_no>:
Configuration number of the selected IRIG-B configuration. 0 means that IRIG-B is not
configured. In this case the two following values are 0.
<dev_conn>:
1 = CMIRIG-B device has been found
0 = no CMIRIG-B device connected
<ext_dev_conn>:
1 = external device is connected to the CMIRIG-B device
0 = no external device is connected to the CMIRIG-B device
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence

4.4.6.5 irigb:datetime?

Function Gets the current date and time of the active IRIG-B source depending on the selected IRIG-B
configuration.
Description This command returns the current date and time of the active IRIG-B source. The selected
IRIG-B configuration defines where the date/time is taken from. If no configuration is set the
command returns zero for each value.
The received IEEE C37.118 control function (CF) value and the straight binary seconds
(SBS) value are returned as well. The IEEE C37.118 control function (CF) value contains the
parity bit. With the SBS value it is possible to check the received time.
Answer The command returns 9 values:
<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>,<doy>,<SBS>,<CF>
<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>,<doy>:
Current date and time of the IRIG-B decoder. <doy> is the day of the year.
<SBS>:
Straight binary seconds. Seconds of the day. This is redundant information to the time.
<CF>:
The CF value is of type <int>. The IEEE C37.118 control function (CF) assignment can be
found in the following table:
Bit Description IRIG-B Comment
Pos. ID
0 LSP P60 Leap Second Pending (LSP)
Becomes 1s up to 59s before
leap second insert
1 LS P61 Leap Second (LS)
0 = add LS / 1 = delete LS
2 DSP P62 Daylight Saving Pending (DSP)
Becomes 1s up to 59s before
DST change
3 DST P63 Daylight Savings Time (DST)
Becomes 1 during DST

OMICRON electronics Page 163


CM Engine

4 Time Offset 1 P65 Time Offset binary


5 Time Offset 2 P66 Offset from coded IRIG-B time
6 Time Offset 4 P67 to UTC time
7 Time Offset 8 P68
8 Time Offset sign P64 Time offset sign
0 = +, 1 = -
9 Time Offset-0.5h P70 0.5h Time Offset
0 = none, 1 = additional 0.5h
time offset
10 Parity received parity bit
11 0
12 TimeQuality P71 Time Quality
13 TimeQuality P72 4-bit code representing
14 TimeQuality P73 approx. clock time error
15 TimeQuality P74 (details in Error! Reference
source not found.)
16 unused Irig bit P76 unused
17 unused Irig bit P77 unused
18 unused Irig bit P78 unused
19 unused Irig bit P54 unused
20 0
21 0
22 0
23 0

Please note! If a coded expression is selected which doesn't contain the year information the returned
values <yyyy>,<mm>,<dd> are calculated based on the year 2000.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_IRIGB_NOT_AVAIL IRIG-B functionality is not available on this device

4.4.6.6 irigb:enc:cfg(<yyyy>, <mm>, <dd>, <hh>, <mm>, <ss>, <CF>, <parity_mode>,


<mod>, <coded_expr>, <auto_inc>, <write_mode>)
irigb:enc:cfg(<yyyy>, <doy>, <hh>, <mm>, <ss>, <CF>, <parity_mode>, <mod>,
<coded_expr>, <auto_inc>, <write_mode>)

Function Configures the IRIG-B encoder format and sets the date and time.
Description This command configures the signal format of the IRIG-B encoder and sets the date and
time.
The <CF> parameter specifies the following IEEE C37.118 control function (CF) bits:
Bit Description IRIG-B Comment
Pos. ID
0 LSP P60 Leap Second Pending (LSP)
Becomes 1s up to 59s before
leap second insert
1 LS P61 Leap Second (LS)
0 = add LS / 1 = delete LS
2 DSP P62 Daylight Saving Pending (DSP)
Becomes 1s up to 59s before
DST change
3 DST P63 Daylight Savings Time (DST)
Becomes 1 during DST
4 Time Offset 1 P65 Time Offset binary
5 Time Offset 2 P66 Offset from coded IRIG-B time
6 Time Offset 4 P67 to UTC time
7 Time Offset 8 P68
8 Time Offset sign P64 Time offset sign
0 = +, 1 = -
9 Time Offset-0.5h P70 0.5h Time Offset
0 = none, 1 = additional 0.5h
time offset
10 0
11 0
12 TimeQuality P71 Time Quality
13 TimeQuality P72 4-bit code representing
14 TimeQuality P73 approx. clock time error
15 TimeQuality P74 (details in Error! Reference
source not found.)

OMICRON electronics Page 164


CM Engine

16 0
17 0
18 0
19 0
20 0
21 0
22 0
23 0

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 at the beginning of chapter 4.4.6.
Please note! 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).
<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.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IRIGB_NOT_LOCKED Communication error during command execution.
CMERR_INVALID_DATE The date and time is not valid
CMERR_IRIGB_NOT_AVAIL IRIG-B functionality is not available on this device
See also command irigb:enc:cfg?

4.4.6.7 irigb:enc:cfg?

Function Gets the current configuration of the IRIG-B encoder.


Description This command reads out the current configuration of the IRIG-B encoder.

OMICRON electronics Page 165


CM Engine

Answer The command returns 5 values:


<CF>,<parity_mode>,<mod>,<coded_expr>,<auto_inc>
<CF>:
The value is of type <int>. The IEEE C37.118 control function (CF) assignment can be found
in the following table:
Bit Description IRIG-B Comment
Pos. ID
0 LSP P60 Leap Second Pending (LSP)
Becomes 1s up to 59s before
leap second insert
1 LS P61 Leap Second (LS)
0 = add LS / 1 = delete LS
2 DSP P62 Daylight Saving Pending (DSP)
Becomes 1s up to 59s before
DST change
3 DST P63 Daylight Savings Time (DST)
Becomes 1 during DST
4 Time Offset 1 P65 Time Offset binary
5 Time Offset 2 P66 Offset from coded IRIG-B time
6 Time Offset 4 P67 to UTC time
7 Time Offset 8 P68
8 Time Offset sign P64 Time offset sign
0 = +, 1 = -
9 Time Offset-0.5h P70 0.5h Time Offset
0 = none, 1 = additional 0.5h
time offset
10 0
11 0
12 TimeQuality P71 Time Quality
13 TimeQuality P72 4-bit code representing
14 TimeQuality P73 approx. clock time error
15 TimeQuality P74 (details in Error! Reference
source not found.)
16 0
17 0
18 0
19 0
20 0
21 0
22 0
23 0
<parity_mode>:
odd or even parity calculation.
<mod>:
This value is of type <int> and can have the value 0 for PWM or 2 Manchester modulation.
<coded_expr>:
This value is of type <int> and can have a value between 0 and 7. Details can be found in the
IRIG-B specification.
<auto_inc>:
Auto increment on or off.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_IRIGB_NOT_AVAIL IRIG-B functionality is not available on this device

4.4.6.8 irigb:dec:cfg(<parity_mode>, <mod>, <coded_expr>, <parity_err_status>,


<write_mode>)

Function Configures the expected IRIG-B decoder format.


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

OMICRON electronics Page 166


CM Engine

parity errors in the general status register. A parity error is always reported in the IRIG-B
status register.
It is possible to write the new configuration to the encoder in two ways: synchronously (sync)
and synchronously (async). Which one should be used can be defined with the
<write_mode> parameter. Details can be found at the beginning of chapter 4.4.6.
Please note! In worst case it can take up to two seconds until the new configuration takes effect.
Parameters <parity_mode>:
Here you must specify one of the keywords odd or even.
<mod>:
This parameter is of type <int>. Only Value 0=PWM is allowed.
<coded_expr>:
This parameter is of type <int>. Values from 0 to 7 are allowed. Details can be found in the
IRIG-B specification.
<parity_err_status>:
Here you must specify one of the keywords on or off.
<write_mode>:
Here you must specify one of the keywords sync or async.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IRIGB_NOT_LOCKED Communication error during command execution.
CMERR_IRIGB_NOT_AVAIL IRIG-B functionality is not available on this device
See also command irigb:dec:cfg?

4.4.6.9 irigb:dec:cfg?

Function Gets the current configuration of the IRIG-B decoder.


Description This command reads out the current configuration of the IRIG-B decoder.
Answer The command returns 4 values:
<parity_mode>,<mod>,<coded_expr>,<parity_err_status>
<parity_mode>:
odd or even parity calculation.
<mod>:
This value is of type <int> and can have the value 0 for PWM or 2 Manchester modulation.
<coded_expr>:
This value is of type <int> and can have a value between 0 and 7. Details can be found in the
IRIG-B specification.
<parity_err_status>:
Parity error reporting in general status register on or off.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_IRIGB_NOT_AVAIL IRIG-B functionality is not available on this device

4.4.6.10 irigb:dec:scan?

Function Starts an auto detection of the IRIG-B decoder signal parameters.


Description This command executes a detection of the IRIG-B decoder signal parameters:
- parity mode
- modulation
- coded expression

OMICRON electronics Page 167


CM Engine

The <successful> value shows if the detection was successful or not. After a successful
detection the IRIG-B decoder is configured with the detected parameter values and a reset of
the IRIG-B decoder is performed. In case of an unsuccessful detection the configuration of
the IRIG-B decoder is left unchanged.
If control function (CF) bits are detected the reporting of parity errors in the general status
register is turned on otherwise off.
If you use this command to detect the IRIG-B decoder signal parameters check always the
IRIG-B status register afterwards.
Answer The command returns 5 values:
<successful>,<parity_mode>,<mod>,<coded_expr>,<parity_err_status>
<successful>:
This value is of type <int>. Value 0="No successful detection" or 1="Detection was
successful".
<parity_mode>:
odd or even parity calculation.
<mod>:
This value is of type <int> and can have the value 0 for PWM or 2 Manchester modulation.
<coded_expr>:
This value is of type <int> and can have a value between 0 and 7. Details can be found in the
IRIG-B specification.
<parity_err_status>:
Parity error reporting in general status register on or off.
Please note! This command can take up to five seconds.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_IRIGB_NOT_LOCKED Communication error during command execution.
CMERR_IRIGB_NOT_AVAIL IRIG-B functionality is not available on this device

4.4.6.11 irigb:dec:reset

Function Reset the IRIG-B decoder.


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 CM Engine error codes:
Error code Explanation
CMERR_IRIGB_NOT_LOCKED Communication error during command execution.
CMERR_IRIGB_NOT_AVAIL IRIG-B functionality is not available on this device
See also command irigb:enc:reset
command sys:status?

4.4.6.12 irigb:dec:sync(<yyyy>, <mm>, <dd>, <hh>, <mm>, <ss>, <rate>, < write_mode>)
irigb:dec:sync(<yyyy>, <doy>, <hh>, <mm>, <ss>, <rate>, < write_mode>)

Function Sets the trigger date, time and pulse rate for the IRIG-B decoder.
Description This command defines a trigger time for the IRIG-B decoder at which it should start to send
the programmable pulse (PPX) defined with the pulse rate.
The <rate> parameter defines the pulse rate in seconds.
It is possible to write the new configuration to the decoder in two ways: synchronously (sync)
and synchronously (async). Which one should be used can be defined with the
<write_mode> parameter. Details can be found at the beginning of chapter 4.4.6.

OMICRON electronics Page 168


CM Engine

Parameters <yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>:
Time and date to be set for the trigger. If the configured coded expression for the decoder
does not contain the year information (0-3) it is ignored for the trigger. The year parameter is
only used to calculate the day of the year.
<yyyy>,<doy>,<hh>,<mm>,<ss>:
Time and day of the year to be set for the trigger. Values between 1 to 366 allowed (leap
year). If the configured coded expression for the decoder does not contain the year
information (0-3) it is ignored for the trigger.
<rate>:
This parameter is of type <int>. Pulse rate in seconds for the programmable pulse (PPX).
<write_mode>:
Here you must specify one of the keywords sync or async.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IRIGB_NOT_LOCKED Communication error during command execution.
CMERR_INVALID_DATE The date and time is not valid
CMERR_IRIGB_NOT_AVAIL IRIG-B functionality is not available on this device

4.4.6.13 irigb:dec:sync?

Function Gets the current configured trigger start time and the pulse rate.
Description This command returns the configured start time and pulse rate of the IRIG-B decoder trigger.

Answer The command returns 8 values:


<yyyy>,<mm>,<dd>,<doy>,<hh>,<mm>,<ss>,<rate>
<yyyy>,<mm>,<dd>,<doy>,<hh>,<mm>,<ss>:
Current start date and time of the IRIG-B decoder trigger. <doy> is the day of the year.
<rate>:
Pulse rate in seconds of the programmable pulse (PPX).
Please note! If a coded expression is selected which doesn't contain the year information the returned
values <yyyy>,<mm>,<dd> are calculated.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_DATE The date and time is not valid
CMERR_IRIGB_NOT_AVAIL IRIG-B functionality is not available on this device

4.4.7 Sequencer commands


You can use most of the string commands in sequences of commands and store them in the sequence buffer
in the CMC for later execution. The following command group contains all commands for handling and control
of sequences.

A sequence consists of one or more steps. Every step consists of an execution part with one or more string
commands and a terminating seq:wait command. The string commands in the execution part are common
string commands (e.g. out:v(1):a(20);f(50)) or a string command to control the sequence (e.g. seq:set or
seq:add). Note: not all string commands are allowed in sequences, the commands that are not allowed are
listed below.

The following counters are available for sequence programming:

• loop loop counter

This counter is decremented by 1 with every seq:wait. Its default content is 0.

OMICRON electronics Page 169


CM Engine

You can set this counter to a value in the 0 - 65535 range using the seq:set command.

• count(1) user definable counter 1


count(2) user definable counter 2

Use the command seq:set(count(..),...) to set the counters to a value.


Use the command seq:add(count(..),...) to increment or decrement one of these counters.

You can set these two counters to a value in the following range using the seq:set or seq:add
commands:
24
0 ≤ count(n) ≤ 2 -1

• timer

This is a user definable timer that you can modify via the seq:set and seq:add commands.
You can set it to a value in seconds in the following range:
0 ≤ timer ≤ approx. 838 seconds

• timeout

Normally this counter is set and used in a seq:wait command only, but you can also modify it via the
seq:set and seq:add commands in the same range as the timer counter.

In a seq:wait command the values of all counters except timeout can be compared to zero; i.e. you can ask
if a specific counter equals zero or not. The timeout counter is tested in the timeout condition of the seq:wait
statement, not in the trigger condition (see seq:wait command).

4.4.7.1 seq:begin

Function see command seq:end


Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN SEQ_MODE Command not allowed within sequence

4.4.7.2 seq:end

Function Use the commands seq:begin and seq:end to mark the beginning and the end of a string
command sequence that can be executed by a CMC in real-time.
Description All commands you send to the CM Engine between the commands seq:begin and seq:end
are not executed immediately but are interpreted as parts of a sequence and thus are stored
in the sequence buffer in the CMC.

The seq:begin command implies the execution of an out:resetopt and a seq:clr, i.e. all
signal settings are written to the sequence buffer and the sequence buffer is cleared.

After you have stored a complete sequence in the buffer, you can start it with the seq:exec
command.

The string commands that you can't use in a sequence, i.e. that you can't send between a
seq:begin and a seq:end, are as follows:

sys:reset
sys:cfg?
sys:status?

OMICRON electronics Page 170


CM Engine

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
seq:status?
seq:stop

out:pmode?
out:user:alloc?
out:user:app
out:user:status?
out:user:free
out:cfg?

The string commands that you can't use outside a sequence, i.e. that you can't execute
outside a seq:begin and a seq:end, are as follows:

seq:set(count(n), )
seq:set(timer, )
seq:add(count(n), )
Please note The command seq:begin clears the sequence buffer and thus erases all sequence data of a
previous sequence!
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_NOT_IN_SEQ_MODE Command can only be used after seq:begin
See also command seq:exec

4.4.7.3 seq:clr

Function Clear the sequence buffer and all sequence data stored there.
Description Use this command to erase all your previous sequence definitions from the sequence buffer.
This command implies out:resetopt.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence

OMICRON electronics Page 171


CM Engine

4.4.7.4 seq:exec

Function Start the sequence stored in the CMC's sequence buffer. This command implies
out:resetopt.
Description If there is no sequence stored in the CMC's sequence buffer nothing happens.
See also command seq:stop
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence

4.4.7.5 seq:set (loop | count(1) | count(2) | timer | timeout, <value>)

Function With this command you can set one of the user modifiable counters to a value.
Description All keywords specify user-modifiable counters except the timeout keyword. If this is used,
the timeout of the currently executing sequence statement is set to the provided <value>. The
sequence must be waiting as a seq:wait() statement whith a timeout, otherwise the
command is disregarded. If the timeout value is set to 0, the execution of the sequence
continues immediately, jumping to the jump distance defined for the case of timeout elapsed.
In this way, the time delay hard-coded in the sequence programming can be modified at run-
time.
Parameters You must specify one of the keywords loop, count(1), count(2), timer or timeout.

<value>:
The parameter <value> is of type <integer> for loop and count and of type <float> for timer
and timeout.
The possible range for every counter is described above with the description of the counters.
It is possible to set the loop counter outside of sequence programming either before starting
a sequence with seq:exec or during a running sequence.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
CMERR_INVALID_INT Parameter <value> has to be <integer>
CMERR_INVALID_FLOAT Parameter <value> has to be <float>
CMERR_NOT_IN_SEQ_MODE Command can only be used after seq:begin

4.4.7.6 seq:add (count(1) | count(2), <rel_steps>)

Function With this command you can add a number to the content of one of the user modifiable
counters.
Parameters You must specify one of the keywords count(1) or count(2)

<rel_steps>:
This parameter is of type <integer>. The possible range for the two counters count(n) is
described above with the description of these counters.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_INT Parameter <rel_steps> is not an integer
CMERR_NOT_IN_SEQ_MODE Command can only be used after seq:begin

4.4.7.7 seq:status? (step | loop | count(1) | count(2) | mem)

Function This command gets different information related to sequences.

OMICRON electronics Page 172


CM Engine

Description When a sequence is running, you can use the keyword step (command seq:status?(step))
to get the number of the sequence step that is currently executed. The sequence steps in the
sequence memory are numbered from 1 to n. When the command returns a zero, there is no
sequence in the buffer or the sequence in the buffer is not running.

When a sequence is running, or after the sequence is finished, you can use the keyword
loop (command seq:status?(loop)) to get the content of the loop counter described above.

You can equally use the keywords count(1) (command seq:status?(count(1))) and
count(2) (command seq:status?(count(2))) to read the values in these user-modifiable
counters.

With the keyword mem (command seq:status?(mem)) you can get the amount of free
memory in the sequence buffer. While storing a sequence into the CMC's sequence buffer
you can use this command to look up the amount of memory that is still free. When you use
this command before you have stored any commands into the sequence buffer (or after a
seq:clr) it returns the total amount of memory of the sequence buffer. The number returned
is in units of memory words. But the amount of memory consumed by different commands
stored within a sequence depends on the complexity and the number of parameters and can
not be exactly specified.
Parameters You must specify one of the keywords step, loop, count(1), count(2) or mem.
Answer The answer string contains the device number and a value of type <integer>.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence

4.4.7.8 seq:stop

Function Stops a currently running sequence. Implies the command out:resetopt.


Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_IN_SEQ_MODE Command not allowed within sequence
See also command seq:exec

4.4.7.9 seq:wait ( [<trigger_condition>, <trigger_jump_distance>,]


[<timeout_condition>, <timeout_jump_distance>] )

Function Mark the end of a sequence step. The command contains one of the following conditions
- A trigger condition that halts the execution of the sequence and waits until the trigger
condition is fulfilled. When the trigger condition is fulfilled, the sequencer jumps to a
sequence step defined by <trigger_jump_distance> and continues the execution there.
- A time limit in seconds. The sequencer halts the execution of the sequence until this
timeout condition is reached. When this timeout condition is fulfilled, the sequencer jumps
to a sequence step defined by <timeout_jump_distance> and continues the execution
there.
- When you specify both a trigger condition and a timeout condition in this command, the
commands waits until the trigger condition is fulfilled or until the timeout condition is fulfilled.
Description The end of a sequence step is always marked by a seq:wait command.

As already described there are three possible combinations of wait conditions that can be
specified in this command:
- A <trigger_condition> together with its related parameter <trigger_jump_distance>.

OMICRON electronics Page 173


CM Engine

- A <timeout_condition> together with its related parameter <timeout_jump_distance>.


- A <trigger_condition> with its <trigger_jump_distance> and
a <timeout_condition> with its <timeout_jump_distance>.

For all three possible combinations the following applies:


When the trigger condition is fulfilled, the sequencer performs a relative jump with the
distance <trigger_jump_distance>. When the timeout condition is fulfilled, the sequencer
performs a relative jump with the distance <timeout_jump_distance>. The jump distance is
expressed in sequence steps.

One sequence step consists of all statements between two seq:wait commands and
between the seq:begin and the first seq:wait or the last seq:wait and the seq:end
command respectively.

Parameters <trigger_jump_distance> and<timeout_jump_distance>:


The relative jump distances <trigger_jump_distance> and<timeout_jump_distance>
have the following effects:
<timeout_jump_distance> Jump target
or
<trigger_jump_distance>
-1 Jump 1 sequence step back:
The sequencer jumps to the first command of the
sequence step before the sequence step that is currently
executed.
0 Restart the current sequence step:
The sequencer jumps to the first command of the currently
executed sequence step.
1 Jump 1 sequence step ahead:
The sequencer jumps to the first command of the next
sequence step after the current sequence step.
2 Jump 2 sequence steps ahead:
The sequencer jumps to the first command of the next step
but one.
jump backwards to a non- return to beginning of sequence and continue execution at
existent sequence step before first command of first sequence step.
the beginning of the sequence
jump ahead to a non-existent end the sequence execution
sequence step past the end of
the sequence
The following picture illustrates the effects of the jump distances described above:

seq:begin
out:...
out:... jump_distance=0
seq:wait
jump_distance=1 jump_distance=-1
out:...
out:... jump_distance=2
seq:wait
out:...
jump_distance>1
out:...
seq:end

The two jump distances have the following limits:


-127 steps ≤ trigger_jump_distance ≤ 127 steps
-127 steps ≤ timeout_jump_distance ≤ 127 steps

OMICRON electronics Page 174


CM Engine

Parameter <timeout_condition>:
A timeout condition is a number of type <float> that defines the length of the time interval in
seconds, e.g.: 0.34 defines a timeout condition of 340 milliseconds. The timeout value has
the following limits:
0 ≤ timeout ≤ approx. 838 seconds

Parameter <trigger_condition>:
In a trigger condition you can use the following expressions:
- to name a specific binary input:
bin(<integer>) binary input number <integer>, e.g. bin(1).
⇒ The condition is TRUE, when this input is active ("1").

- to test the global timer: timer


- to use the external trigger line: ext.
- to test a counter:
loop=0
loop<>0

count(1)=0
count(1)<>0

count(2)=0
count(2)<>0
- as boolean operators:
not(<bin(X)>) negation of a binary input
and logical AND of 2 expressions
or logical OR of 2 expressions

Use the following rules to assemble the above expressions:


- At first DeMorgan's theorem is applied to the expression <trigger_condition>
It transforms e.g.
not(bin(1) or bin(2)) and bin(3)
into the valid trigger condition
not(bin(1)) and not(bin(2)) and bin(3).

The expression
not(bin(1) and bin(2)) or bin(3) and bin(4)
is transformed into the valid trigger condition
not(bin(1)) or not(bin(2)) or bin(3) and bin(4).
- The resulting expression must comply with the following rules:
A binary input can either be used negated or not negated and every or expression can
only have one and expression as argument.

Examples for valid trigger conditions:


bin(1) and bin(2)
not(bin(1)) and not(bin(2))
bin(1) and bin(2) or bin(3)
bin(1) and bin(2) and not(bin(3))
bin(1) or bin(2)
not(bin(1)) or not(bin(2))
not(bin(1) or bin(2)) and bin(3) = not(bin(1)) and not(bin(2)) and bin(3)
not(bin(1) and bin(2)) or bin(3) and bin(4) = not(bin(1)) or not(bin(2)) or bin(3) and
bin(4)

OMICRON electronics Page 175


CM Engine

Examples for invalid trigger conditions: Error(s):


not(bin(1)) or bin(2) or bin(1) binary input 1 used negated and not
negated.
bin(1) and (bin(2) or bin(3)) equal to bin(1) and bin(3) or bin(2) and bin(3)
⇒ 2 and expressions at the or expression

An invalid expression as trigger condition causes the error CMERR_INVALID_BOOL.


- IRIG-B Time
If no IRIG-B configuration was selected before an "CMERR_INVALID_BOOL" error is
raised.
irigb(<yyyy>, <mm>, <dd>, <hh>, <mm>, <ss>)
irigb(<yyyy>, <doy>, <hh>, <mm>, <ss>)

This trigger condition allows to trigger on an absolute date and time.


<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>:
Time and date to be set for the trigger. If the configured coded expression for the
encoder/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 encoder/decoder does not contain the
year information (0-3) it is ignored for the trigger.
Please note! If the trigger date and time is in the past the trigger will never happen.

irigb(PPS | PPX, <#pulse>)


With this trigger condition it is possible to trigger on each pulse per second (PPS) or on a
programmable pulse (PPX). The programmable pulse (PPX) trigger is only available for
the decoder. The pulse rate for the programmable pulse (PPX) has to be defined with the
"irigb:dec:sync" command.
<#pulse>:
Amount of pulses to next trigger.

Parameters <trigger_condition>:
This parameter is assembled as described above.

<trigger_jump_distance>:
This parameter is a number of type <integer>.

<timeout_condition>:
This parameter is a value of type <float>.

<timeout_jump_distance>:
This parameter is a number of type <integer>.

Three combinations of these parameters are possible:


1) <trigger_condition>, <trigger_jump_distance>
2) <timeout_condition>, <timeout_jump_distance>
3) <trigger_condition>, <trigger_jump_distance>, <timeout_condition>,
<timeout_jump_distance>
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_INVALID_BOOL Boolean expression is invalid
CMERR_INVALID_FLOAT Parameter of type <float> has errors
CMERR_INVALID_INT Parameter <trigger_jump_distance> or
<timeout_jump_distance> is not of type integer
CMERR_NOT_IN_SEQ_MODE Command can only be used after seq:begin

Example seq:wait(bin(2),2,0.5,1)
This wait-command waits until the binary input 2 is "1" or until 0.5 seconds have passed. The

OMICRON electronics Page 176


CM Engine

event that occurs first determines which jump distance is taken:


If the binary input is "1" before 0.5 seconds have passed, a jump of 2 sequence steps ahead
is executed, i.e. the next sequence step but one is executed. If the 0.5 seconds are run down
first, a jump of 1 sequence step ahead is executed, i.e. the next sequence step is executed.

4.4.8 Sequencer hints

If you want to use the waveforms tri, square, sum, user in a sequence, please use the following method.
Normally you would define a waveform in a sequence like this:

seq:begin
out:ana:v(1:3):wav(sum, 1, 3, 0.33, 0)
seq:end

To use the above waveforms in a sequence you have to assign this waveform to the desired signal before the
beginning of the sequence:

out:ana:v(1:3):wav(sum, 1, 3, 0.33, 0)
seq:begin
out:ana:v(1:3):wav(sum, 1, 3, 0.33, 0)
seq:end

The reason is that sample values used within a sequence must be downloaded before the execution of the
sequence.

4.4.9 Sequencer examples

• The following example outputs a sine signal of 100V and 100Hz on voltage output 1 with a duration of 5
seconds:

seq:begin
out:ana:v(1:1):a(100);f(100)
out:ana:v(1:1):on
seq:wait(5, 1)
out:ana:v(1:1):off
seq:end

seq:exec

• The following example outputs a sine signal of 100V and 100Hz on voltage output 1 until digital input 1 is
active (HIGH):

seq:begin
out:ana:v(1:1):a(100);f(100)
out:ana:v(1:1):on
seq:wait(bin(1), 1)
out:ana:v(1:1):off
seq:end

seq:exec

OMICRON electronics Page 177


CM Engine

• The following example outputs a sine signal of 100V and 100Hz on voltage output 1 until digital inputs 1 or
2 are active (HIGH):

seq:begin
out:ana:v(1:1):a(100);f(100)
out:ana:v(1:1):on
seq:wait(bin(1) or bin(2), 1)
out:ana:v(1:1):off
seq:end

seq:exec

• The following example outputs a sine signal of 100V and 100Hz on voltage output 1 until digital inputs 2
and 3 are active (HIGH):

seq:begin
out:ana:v(1:1):a(100);f(100)
out:ana:v(1:1):on
seq:wait(bin(2) and bin(3), 1)
out:ana:v(1:1):off
seq:end

seq:exec

• The following example outputs a sine signal of 100V and 100Hz on voltage output 1 until digital input 3 is
HIGH or digital input 5 is LOW:

seq:begin
out:ana:v(1:1):a(100);f(100)
out:ana:v(1:1):on
seq:wait(bin(3) or not(bin(5)), 1)
out:ana:v(1:1):off
seq:end

seq:exec

• The following example outputs a sine signal of 100V and 100Hz on voltage output 1 and decrements it by
10V every second. A HIGH on digital input 1 switches off this signal.

seq:begin
out:ana:v(1:1):a(100);f(100)
out:ana:v(1:1):on
out:ana:v(1:1):a(-10, step)
seq:wait(0, 1)
out:ana:step
seq:wait(bin(1), 1, 1, 0)
out:ana:v(1:1):off
seq:end

seq:exec

• The following example outputs a sine signal of 100V and 100Hz on voltage output 1 with a duration of 3
seconds. In this example the timer is used to set the time limit.

OMICRON electronics Page 178


CM Engine

seq:begin
out:ana:v(1:1):a(100);f(100)
out:ana:v(1:1):on
seq:set(timer, 3)
seq:wait(timer, 1)
out:ana:v(1:1):off
seq:end

seq:exec

• The following example outputs a sine signal of 100V and 100Hz on voltage output 1 that is decremented 5
times by 10V every 1 second.

seq:begin
out:ana:v(1:1):a(100);f(100)
out:ana:v(1:1):on
out:ana:v(1:1):a(-10, step)
seq:set(loop, 6)
seq:wait(1, 1)
out:ana:step
seq:wait(loop = 0, 1, 1, 0)
seq:wait(1,1)
out:ana:v(1:1):off
seq:end

seq:exec

• The following example outputs a sine signal of 100V and 100Hz on voltage output 1 that switched on for a
second and then switched off for a second. If digital input 1 is HIGH this loop is ended and the output is
switched off immediately.

seq:begin
out:ana:v(1:1):a(100);f(100)
seq:wait(0, 1)
out:ana:v(1:1):on
seq:wait(bin(2), 2, 1, 1)
out:ana:v(1:1):off
seq:wait(bin(1), 1, 1, -1)
out:ana:resetopt
out:ana:v(1:1):off
seq:end

seq:exec

4.4.10 Measurement commands

4.4.10.1 inp:avail?(scope|multimeter)

Function Check availability of measuring functions.


Description Checks whether metering or scope functions are available in the addressed device. The
multimeter function allows measurement of RMS values, while the scope commands allow
sampling and recording of signals.
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.
Examples inp:avail(multimeter)
Result : “1,1;” Multimeter functionality is available

OMICRON electronics Page 179


CM Engine

4.4.10.2 inp:mode(scope|multimeter)

Function Set scope/multimeter mode for the analog inputs.


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.

4.4.11 Multimeter commands


All multimeter commands are available only for CMC256 or newer test set. Measurements are carried out in
the CMC256 in a two-stage process. First, the user issues a multimeter command and one, or more
measurement tasks are put on the task vector.

The Measurement DSP (digital signaling processor) then processes each task on the task vector once every
sample period. In order to get a more accurate reading the measuring DSP does not return the results of
these individual samples immediately, but takes a number of samples over the integration time, and then
returns an average result of all the samples.

Integration time for next sample


Average taken of all samples
and returned as result

Integration time 1st result is


ready at this
point

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Samples

In the above example the integration time is 10 samples, which would be 3.16 ms if the sampling frequency
were on the 3.16 kHz range.

To calculate the maximum amount of commands that can be issued simultaneously requires considering how
the measurement workload is assigned to the Measurement DSP.
Each multimeter command that the user issues, causes a certain amount of "measurement tasks" to be
issued on the task vector of the Measurement DSP. Only 15 measurement tasks are allowed on the task
vector at any one time. The DC input handling counts as one measurement task.

Each command creates measurement tasks as follows:

RMS command:
N = RoundUp(Inp / 3)

Phase:

OMICRON electronics Page 180


CM Engine

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.

Note:
If you issue two of the same commands the formulas have to be applied separately for each of them, for
example:
inp:ana(1):rms?(1.0)
inp:ana(2):rms?(1.0)
...uses 2 tasks, while
inp:ana(1,2):rms?(1.0)
...uses only one.
For this reason you should try to group all inputs into one command.

4.4.11.1 inp:ana(<input_list>):rms?(<itime>)

Function Start measurement of the RMS value.


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:

OMICRON electronics Page 181


CM Engine

<RMS_AC >
Floating point value containing the RMS value of the AC component of the measured signal.

<rms_validity>
Integer containing the validity flags of the <RMS_AC> measurement.

<DC_value>
Floating point value containing the DC component of the measured signal.

<dc_validity>
Integer containing the validity flags of the <DC_value> measurement.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_BIN_INPUT Some of the inputs in the input list was configured
as binary input.
CMERR_TASK_VECTOR_FULL The DSP cannot accept more tasks
CMERR_NOT_MM_MODE This command is only allowed in multimeter
mode
See also inp:mode(multimeter|scope)
inp:avail?(multimeter|scope)
inp:ana:get?
Examples inp:ana(4,5,6):rms?(1.0)
Result : “1,1;”

inp:ana:get?(1)
Result : “1,2.733320e-004,0,-2.831995e-003,0,5.412996e-004,0,-2.797413e-
002,0,2.704000e-002,0,-2.498741e-001,0;”

In this example inputs 4, 5 & 6 are being measured. The integration time is 1 second.
For each input a AC and a DC result is returned (6 results for the given example), each with
its applicable validity flags.

4.4.11.2 inp:ana(<input_list>):peak?(<rtime>)

Function Start measurement of the peak value.


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.

<rtime>
Time interval for the detection of the peak values in seconds.

Answer The return value contains the device number and the command handle that will be later
passed as parameter to inp:ana:get?

When invoked later, inp:ana:get? will return a string containing the device number followed
by one set of data per input in <input_list>, as follows:

<Peak_max>
Floating point value containing the maximum peak value detected during <rtime>.

<max_validity>
Integer containing the validity flags of the < Peak_max > measurement.

OMICRON electronics Page 182


CM Engine

<Peak_min>
Floating point value containing the minimum peak value detected during <rtime>.

<min_validity>
Integer containing the validity flags of the < Peak_min > measurement.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_BIN_INPUT Some of the inputs in the input list was configured
as binary input.
CMERR_TASK_VECTOR_FULL The DSP cannot accept more tasks
CMERR_NOT_MM_MODE This command is only allowed in multimeter
mode
See also inp:mode(multimeter|scope)
inp:avail?(multimeter|scope)
inp:ana:get?
Examples inp:ana(4):peak?(10)
Result : “1,1;”

inp:ana:get?(1)
Result : “1,3.55423e+001,0,-3.55312e+001,0;”

In this example input 4 is set to detect the peak values of the signal during time intervals of
10s. For each input a maximum and minimum peak are returned, each with its applicable
validity flags.

4.4.11.3 inp:ana(<input_list>):phase?(<itime>)

Function Start measurement of the phase


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 CM Engine error codes:
Error code Explanation
CMERR_BIN_INPUT Some of the inputs in the input list were
configured as binary input.
CMERR_TASK_VECTOR_FULL The DSP cannot accept more tasks

OMICRON electronics Page 183


CM Engine

Error code Explanation


CMERR_NOT_MM_MODE This command is only allowed in multimeter
mode
See also inp:mode(multimeter|scope)
inp:avail?(multimeter|scope)
inp:ana:get?

Examples inp:ana(4,5,6):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.

4.4.11.4 inp:ana(<input_list>):freq?(<#periods>,<start level>)

Function Start measurement of the frequency


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:

OMICRON electronics Page 184


CM Engine

Answer The return value contains the device number and the command handle that will be later
passed as parameter to inp:ana:get?

When invoked later, inp:ana:get? will return a string containing the device number followed
by one set of data per input in <input_list>, as follows:

<Frequency >
Floating point value containing the frequency of the measured signal.

<freq_validity>
Integer containing the validity flags of the <Frequency> measurement.

Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_BIN_INPUT Some of the inputs in the input list were
configured as binary input.
CMERR_TASK_VECTOR_FULL The DSP cannot accept more tasks
CMERR_NOT_MM_MODE This command is only allowed in multimeter
mode
See also inp:mode(multimeter|scope)
inp:avail?(multimeter|scope)
inp:ana:get?

Examples inp:ana(4):freq?(25,0.0)
Result : “1,1;”
inp:ana:get?(1)
Result : “1,5.012000e+001,0;”

This shows the frequency being measured on inputs 4,5 & 6 over 25 periods, starting at a
level of 0V.

4.4.11.5 inp:ana(<input_list>):power?(<itime>)

Function Start measurement of the power


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?

OMICRON electronics Page 185


CM Engine

When invoked later, inp:ana:get? will return a string containing the device number followed
by one set of data per v/i pair in <input_list>, as follows:

<Active_power>
Floating point value containing the measured active power, in Watts

<W_validity>
Integer containing the validity flags of the <Active_power> measurement.

<Apparent_power>
Floating point value containing the measured apparent power, in VA

<va_validity>
Integer containing the validity flags of the <Apparent_power> measurement.

<Reactive_power>
Floating point value containing the measured reactive power, in var

<var_validity>
Integer containing the validity flags of the <Reactive_power> measurement.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_BIN_INPUT Some of the inputs in the input list were
configured as binary input.
CMERR_TASK_VECTOR_FULL The DSP cannot accept more tasks
CMERR_NOT_MM_MODE This command is only allowed in multimeter
mode
CMERR_INVALID_NO_INPUTS The input list does not contain a valid (even)
number of inputs
CMERR_INVALID_VI_PAIR The inputs in the input list are not correctly
arranged in v/i pairs
See also inp:mode(multimeter|scope)
inp:avail?(multimeter|scope)
inp:ana:get?
Examples inp:ana(2,1):power?(1.0)
Result : “1,1;”

inp:ana:get?(1)
Result : “1,3.662120e-006,0,3.483803e-005,0,3.464501e-005,0,1.051185e-001,0;”

In this example input 2 is configured as voltage and input 1 as current. The integration time is
1 second. The results returned are: Active Power = 3.662120e-006 W, Apparent Power =
3.483803e-005 VA, Reactive Power = 3.464501e-005 var, cos ϕ = 1.051185e-001

4.4.11.6 inp:ana(<input_list>):sum?(<itime>)

Function Start measurement of the sum of a three-phase system.


Description This function measures the resultant of three analog inputs considered as a three-phase
system. The number of inputs specified in the list must be a multiple of 3.
The results are later retrieved using the inp:ana:get? command. See the inp:ana:get?
command for the explanation of the validity codes.
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.

OMICRON electronics Page 186


CM Engine

Answer The return value contains the device number and the command handle that will be later
passed as parameter to inp:ana:get?

When invoked later, inp:ana:get? will return a string containing the device number followed
by one set of data per input triple in <input_list>, as follows:

<RMS_SUM >
Floating point value containing the RMS value of the AC component of the calculated
resultant.

<rms_validity>
Integer containing the validity flags of the <RMS_SUM> measurement.

<DC_SUM>
Floating point value containing the DC component of the calculated resultant.

<dc_validity>
Integer containing the validity flags of the <DC_SUM> measurement.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_BIN_INPUT Some of the inputs in the input list were
configured as binary input.
CMERR_TASK_VECTOR_FULL The DSP cannot accept more tasks
CMERR_NOT_MM_MODE This command is only allowed in multimeter
mode
CMERR_INVALID_NO_INPUTS The input list does not contain a valid (multiple of
three) number of inputs
See also inp:mode(multimeter|scope)
inp:avail?(multimeter|scope)
inp:ana:get?
Examples inp:ana(1,2,3):sum?(1.0)
Result : “1,1;”

inp:ana:get?(1)
Result : “1,3.662120e-006,0,3.483803e-005,0,3.464501e-005,0,1.051185e-001,0;”

In this example input 2 is configured as voltage and input 1 as current. The integration time is 1 second. The
results returned are: Effective = 3.662120e-006, Apparent = 3.483803e-005, Reactive = 3.464501e-005,
cos ϕ =1.051185e-001

4.4.11.7 inp:ana(<input_list>):diff?(<itime>)

Function Start measurement of the line-to-line magnitudes of a three-phase system.


Description This function measures the line-to-line magnitudes of three analog inputs considered as a
three-phase system. The number of inputs specified in the list must be a multiple of 3.
The results are later retrieved using the inp:ana:get? command. See the inp:ana:get?
command for the explanation of the validity codes. While it is possible to mix v and i inputs,
the command only makes sense when applied to a 3-phase voltage system. The first input in
each triple in the list is considered VA, the second VB and the third VC.
B

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.

OMICRON electronics Page 187


CM Engine

Answer The return value contains the device number and the command handle that will be later
passed as parameter to inp:ana:get?

When invoked later, inp:ana:get? will return a string containing the device number followed
by one set of data per input triple in <input_list>, as follows:

<RMS_VAB >
Floating point value containing the RMS value of the AC component of VAB.

<vab_validity>
Integer containing the validity flags of the <RMS_VAB> measurement.

<DC_VAB>
Floating point value containing the DC component of VAB.

<dcab_validity>
Integer containing the validity flags of the <DC_VAB> measurement.

<RMS_VBC >
Floating point value containing the RMS value of the AC component of VBC.

<vbc_validity>
Integer containing the validity flags of the <RMS_VBC> measurement.

<DC_VBC>
Floating point value containing the DC component of VBC.

<dcbc_validity>
Integer containing the validity flags of the <DC_VBC> measurement.

<RMS_VCA >
Floating point value containing the RMS value of the AC component of VCA.

<vca_validity>
Integer containing the validity flags of the <RMS_VCA> measurement.

<DC_VCA>
Floating point value containing the DC component of VCA.

<dcca_validity>
Integer containing the validity flags of the <DC_VCA> measurement.
Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_BIN_INPUT Some of the inputs in the input list were
configured as binary input.
CMERR_TASK_VECTOR_FULL The DSP cannot accept more tasks
CMERR_NOT_MM_MODE This command is only allowed in multimeter
mode
CMERR_INVALID_NO_INPUTS The input list does not contain a valid (multiple of
three) number of inputs
See also inp:mode(multimeter|scope)
inp:avail?(multimeter|scope)
inp:ana:get?
Examples inp:ana(1,2,3):sum?(1.0)
Result : “1,1;”

inp:ana:get?(1)
Result : “1,3.662120e-006,0,3.483803e-005,0,3.464501e-005,0,1.051185e-001,0;”

OMICRON electronics Page 188


CM Engine

In this example input 2 is configured as voltage and input 1 as current. The integration time is 1 second. The
results returned are: Effective = 3.662120e-006, Apparent = 3.483803e-005, Reactive = 3.464501e-005,
cos ϕ =1.051185e-001

4.4.11.8 inp:ana:sync

Function Synchronization of multimeter commands.


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 CM Engine error codes:
Error code Explanation
CMERR_NOT_MM_MODE This command is only allowed in multimeter
mode
Examples inp:ana(4,5,6):phase?(1.0)
Result : “1,1;”

inp:ana(4,5,6):rms?(1.0)
Result : “1,2;”

inp:ana(4):freq?(25,0.0)
Result : “1,3;”

inp:ana:sync

The phase and rms commands will be restarted by the sync command. The freq command is
unaffected, as it has no integration time. If you had not used the sync command, the phase
and rms commands would have slightly different starting times, because of the inherent
delays in executing the commands.

4.4.11.9 inp:ana:get?(<command handle>)

Description Measurements are performed in two stages. First the particular multimeter command is
issued (e.g. inp:ana(1):phase?(1.0)). This puts the command on the task vector of the
measurement DSP and returns a command handle. This command handle is then used to
retrieve the results of the multimeter command.

Parameters <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


real time violation overload weak signal not ready already read

OMICRON electronics Page 189


CM Engine

Already Read
This is not an error. The results of most commands are updated at the end of the integration
time. If you read the result a second time before it has time to update, you will get this flag
set.
Not Ready
This means that the command hasn't got any results yet. For example if you ask for the
results of a command that has just been issued, without waiting for the integration time to be
finished, you will get this validity code.
Weak Signal
This only occurs for the results of the frequency command. It means that there are valid
results, but the signal is too weak to measure the frequency accurately.

Overload
This means that the signal at the input is higher than maximum for the current range and, as
a result, the readings will be wrong.

Real Time Violation


This indicates that the measuring DSP cannot process all the measurement tasks within the
sample time. This may be caused by putting too many tasks on the task vector at a high
sampling frequency (e.g. 28 kHz). Real time violations are also shown using the sys:status?
command.

A combination of these validity codes can be set, for example, a validity of 0 means the result
is okay, 3 means that the result is not ready & this is the second time it has already been
read.

Possible Errors This command may cause the following CM Engine error codes:
Error code Explanation
CMERR_NONEXIST_MEASJOB Measurement job does not exist
Examples inp:ana(4,5,6):rms?(1.0)
Result : "1,2;”
(This means 2 is the command handle assigned to this command)

inp:ana:get?(2)
Result : “1,1.233320e+001,8,2.831995e-003,8,5.412996e-004,0,-2.797413e-002,0
,2.704000e-002,0 ,-2.498741e-001,0;”

This shows the first 2 results have an overload, but the last 4 are okay.

4.4.11.10 inp:ana:clr(<command handle>)


inp:ana:clr(all)

Function Cancel one or all measurement tasks.


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 CM Engine error codes:
Error code Explanation
CMERR_NONEXIST_MEASJOB Measurement job does not exist

OMICRON electronics Page 190


CM Engine

Examples inp:ana(4,5,6):phase?(1.0)
Result : “1,1;”

inp:ana(4,5,6):rms?(1.0)
Result : “1,2;”

inp:ana:clr(2)
The rms measurement is cleared, phase measurement continues unaffected.

4.4.11.11 inp:ana:dc(on|off)

Function Turn the DC measuring task on/off


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 CMC156 or CMC56.
Please note If you switch off the DC task and you try to read the DC analog inputs you will get an error.
Parameters on|off
The keyword on switches the dc measurement on, while off switches it off.
Examples inp:ana:dc(off)
inp:ana:dc(on)

4.4.11.12 inp:ana:cal(ac|dc)

Function Calibrate the analog inputs


Description This command calibrates the specified inputs. It is necessary to carry out an AC calibration at
the start of your code and after you have changed the range of the analog inputs. It is equally
necessary to carry out a DC at the start of your code and after you have changed the range
of the DC analog inputs.

Parameters dc|ac
If this command is used with the dc keyword the DC analog inputs are calibrated, if it is used
with the ac keyword the binary/analog inputs are calibrated.
Note: This command can cause a real time violation if any other multimeter commands
running. You should clear the any errors set in the system status register afterwards using
the sys:status? command.
Please note Calibration of the inputs, especially of the DC inputs, make take some seconds to complete;
in any case, all ongoing measurement tasks will be restarted.
Examples inp:ana:i(1):range(0.001)
inp:ana:cal(dc)
inp:ana(4,2,5):def(v,10.0)
inp:ana:cal(ac)
sys:status?(1)

Both an AC and a DC calibration are performed after the range for the DC analog current and
the range for inputs 4, 2 & 5 has been changed. The status of the Measurement DSP is then
checked to clear any real time violations that may have occurred.

4.4.12 Obsolete commands

This section contains those commands that have been rendered obsolete by the development of CM Engine.
All of them remain operational for code compatibility, but they have been replaced by other commands that

OMICRON electronics Page 191


CM Engine

are better, more flexible or more general than they were. The user should avoid using these commands in
new code, and should try to replace them in the existing code whenever possible.

Obsolete Command 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?
out:bin(<out_mod_idx>):cfg?
out:bin(<out_mod_idx>,<group_idx>):cfg?

OMICRON electronics Page 192


CM Engine

5 Appendix

5.1 Syntax Diagrams

5.1.1 System Commands


sys: reset

test? [(<filename>)] Ö <dev_id>,ok | [v<idx>] [,vtemp] [,vovld] [,i<idx>] [,itemp] [,iref] [,ad] [,bin] [,mea] ;

[ ext (<idx>): ] cfg? (type) Ö <dev_id>,<dev_type>,<model>;


(ser) Ö <dev_id>,<ser_no>;
(hard) Ö <dev_id>,<dsp_ver>,<clock_f>;
(firm) Ö <dev_id>,<moni_ver>,<ovl0_ver>;
(cal) Ö <dev_id>,<year>,<month>,<day>;
(ext) Ö <dev_id>,<#ext_devs>;
status? [(<register>)] Ö <dev_id>,<status>;

5.1.2 Input Commands: Analog


inp: mode (scope | multimeter)

avail? (scope | multimeter)

ana :cfg (<srate>,<avrg>)


Ö <dev_id>,<mea_ver>;
:cfg? (srate) Ö <dev_id>,<firm_ver>;
<dev_id>,<srate>;
(avrg) Ö <dev_id>,<avrg>;
(hard)
(firm) Ö <dev_id>,0 | 1;

:sync

(<input_list>): def (v,<range>)


(i,<range>,<CT_ratio>)

def? Ö <dev_id>{,<inp_no>,v | i | pf | ps,<range>,<thres>,<CT_ratio>} ...;

range? Ö <dev_id>{,<range>[, …]} ...;

rms? (<i_time>) Ö <dev_id>,<cmd_handle>;

peak? (<i_time>) Ö <dev_id>,<cmd_handle>;

phase? (<i_time>) Ö <dev_id>,<cmd_handle>;

freq? (<#periods>,<start_level>) Ö <dev_id>,<cmd_handle>;

rms? (<i_time>) Ö <dev_id>,<cmd_handle>;

power? (<i_time>) Ö <dev_id>,<cmd_handle>;

sum? (<i_time>) Ö <dev_id>,<cmd_handle>;

diff? (<i_time>) Ö <dev_id>,<cmd_handle>;

:get? (<cmd_handle>) Ö <dev_id>{,<result>,<valid>} ...;

:clr (<cmd_handle> | all)

:dc (on | off)

:cal (ac | dc)

:v | i (<input_list>): get? [(all)] Ö <dev_id>,<measured_value>[,<valid>];

range (<range>)

range? Ö <dev_id>,<sel_range>,<range>[, …];

OMICRON electronics Page 193


CM Engine

5.1.3 Input Commands: General, Binary, Counter


inp: cfg? Ö <dev_id>,<#dc_volt_inp>,<#dc_curr_inp>,<#bin_inp>,<io_ver>;

cfg? (ecount) Ö <dev_id>,<#ecount>;

bin :cfg? Ö <dev_id>,<#bin_inp_modules>;

diff (reset)

(<inp_mod_idx>) : cfg? Ö <dev_id>,<#groups>,<loc>,<loc_idx><mod_type>,<mod_ser_no>,<hard_ver>,


<dev_type>,<dev_ser_no>;

get? Ö <dev_id>,<binary_inputs>;

diff? Ö <dev_id>,<binary_inputs_changes>;

diff (reset)

(<inp_mod_idx>:<group_idx>): cfg? Ö <dev_id>,<#bin_inps>,<nom_min>,<nom_max>,<thres_min>,


<thres_max>,<thres_gran>,<gnd_conn>,<common>,
<res_group_type>,<res_group_idx>,<func>[,…];
debounce (<deb_time>)

debounce? Ö <dev_id>,<deb_time>;

deglitch (<degl_time>)

deglitch? Ö <dev_id>,<degl_time>;

name (<name>)

name? Ö <dev_id>,<name>;

(<inp_mod_idx>:<group_idx>[:<inp_idx>]): def (pf | <thres>)

def? Ö <dev_id>,pf | <thres>;

buf: sam (<source>, <index>)


(bin, on | off | bin)
(ext)

get? Ö <dev_id>,dcv | dci | bin | bcount | ecount | zcross | empty | overrun | switchoff,
<time>,<measured_value>,<index>,- | zcross;

get? (<no_of_entries>) Ö <dev_id>,<#entries_read>{,dcv | dci | bin | bcount | ecount | zcross | empty | overrun | switchoff,
<time>,<measured_value>,<index>,- | zcross} ...;
clr

count: on

off

clr

set (bcount | ecount(<counter>),<count>,+ | -)

join (bcount | ecount(<master_counter>),bcount | ecount(<slave_counter>))

get? (bcount | ecount(<counter>)) Ö <dev_id>,<count>;

OMICRON electronics Page 194


CM Engine

5.1.4 Output Commands


out: cfg? Ö <dev_id>,<#bin_outp>,<amp_no>/<#generators>/i | e | b | n[, ...];

[ana:] v|i (<generator_list>): [ sig (<sig>): ] a (<amplitude> [,step])

f (<frequency> [,step])

t (<period_time>)

p (<phase> [,step])

wav (sin)
(dc)
(exp)
(sum,<harmonic_list>)
on
(tri [,<duty_cycle>])
off (square [,<duty_cycle])
(user,<user_sig_no> [,single])
clr

mix (sig(<sig>) | add | mult | off)

v|i (<triple_no>): zero (<zero_factor>)

on

off [(zcross [,<off_generator_list>)]

clr

step [(load | exec)]

save

restore

pmode (abs | diff [(v | i (<triple>:<ref_gen>))])

pmode? Ö <dev_id>,abs | diff [(v | i (<triple>:<ref_gen>))];

sync (ext,+ | -)

sync (off)

resetopt

user: alloc? (<no_of_samples>) Ö <dev_id>,<user_sig_no>;

app (<user_sig_no>,<user_data>)

free [(<user_sig_no>)]

status? (<user_sig_no>) Ö <dev_id>,<samples_alloc>,<samples_free>;

status? Ö <dev_id>,<#user_sig>,<samples_max>,<samples_free>,<samples_free_block>;

trans: add (v | i (<triple>:<gen>)

f (<sampling_freq>)

clr

status? (setup) Ö <dev_id>,<samples_per_chunk>,<chunks_per_chl>,<#active_gens>,<list_of_active_gens>;

status? Ö <dev_id>,<playing_chunk>,<free_chunks>,<underflow>;

start

stop

buf: sam (lock | free) Ö <dev_id>,<user_sig_no>;

get? (v | i (<triple>:<gen>) [ :sig (<sig>) ] Ö <dev_id>,<time>,<ampl>,<phase>,<freq>;

aux :cfg? Ö <dev_id>,<#aux>;

(<idx>): cfg? Ö <dev_id>,<dev_type>,<ser_no>,<idx_on_dev>;


on

off

a (<v_dc>)

a? Ö <dev_id>,<v_dc>;
(<pwr_on_v>
def
)
def? Ö <dev_id>,<pwr_on_v>;

bin :cfg? Ö <dev_id>,<#bin_out_modules>;

(<out_mod_idx>): cfg? Ö <dev_id>,<#groups>,<loc>,<loc_idx><mod_type>,


<mod_ser_no>,<hard_ver>, <dev_type>,<dev_ser_no>;
on (<output_list>)

off (<output_list>)

set (<data>)

get? Ö <dev_id>,<binary_outputs>;
(<out_mod_idx>:<group_idx)): cfg? Ö <dev_id>,<#bin_outs>,<type>,<gnd_conn>,<common>,
<res_group_type>,<res_group_idx>;
name (<name>)

name? Ö <dev_id>,<name>;

OMICRON electronics Page 195


CM Engine

5.1.5 Sequencer Commands


seq: begin

end

clr

set (loop | count(1) | count(2) | timer | timeout,<value>)

add (count(1) | count(2),<rel_steps>)

wait (<trigger_condition>,<trigger_jump_distance>)
(<timeout_condition>,<timeout_jump_distance>)
(<trigger_condition>,<trigger_jump_distance>,<timeout_condition>,<timeout_jump_distance>)
status? (step) Ö <dev_id>,<step_no>;
(loop) Ö <dev_id>,<loop>;
(count(1) | count(2)) Ö <dev_id>,<count(1) | count(2)>;
(mem) Ö <dev_id>,<free_mem>;

exec

stop

5.1.6 Amplifier Commands


amp: def (<amp_no>,int | ext ,v | i,<amplification>,<max_out>,<f_min>,<f_max>,<t_corr1>,<t_corr2>,<t_corr3>)
(<amp_no>,int)
(<amp_no>,ext,<id_list>)
([<amp_no>,] clr | clrnooff)
(off)
def? Ö <dev_id>,<amp_no>[, ...];

def? (<amp_no>) Ö <dev_id>,int | ext ,v | i,- | A | B,<amplification>,<max_out>,<f_min>,<f_max>,


<t_corr1>,<t_corr2>,<t_corr3>,<dev_type>,<ser_no>;

scan? [(<list>)] Ö <dev_id>,<id>[, ...];

param? (<amp_id>) Ö <dev_id>,ext ,v | i,- | A | B,<amplification>,<max_out>,<f_min>,<f_max>,


<t_corr1>,<t_corr2>,<t_corr3>,<dev_type>,<ser_no>;

param? (<id>,cal) Ö <dev_id>,<year>,<month>,<day>;

cfg? Ö <dev_id>,<#cfgs>;

cfg? (<cfg_no>) Ö <dev_ID>,<config_ID>,<phase_count>,<max_out>,<max_power>,


<max_out_at_max_power>,<src_amp>,<mode>,<wiring_ID>,
{type (amp_no / amp_id),no.};
cfg? (<amp_id>,firm) Ö <dev_ID>,<main_ver>,<boot_ver>;
cfg? (<amp_id>,addr) Ö <dev_ID>,<bus_addr>,<subdev_id>;

route (clr | clrnooff)

route (v | i (<triple_no>),<amp_no> | clr | clrnooff)

route? (v | i (<triple_no>)) Ö <dev_id>,<amp_no>;

range (v | i (<triple_no>),<range>)

range? (v | i (<triple_no>)) Ö <dev_id>,<range>[, …];

ctrl (i (<triple_no>),<v_ctrl>)

ctrl (<amp_no>,<v_ctrl>)

ctrl? (v | i (<triple_no>)) Ö <dev_id>,<v_ctrl>,<v_ctrl_min>,<v_ctrl_max>;

ctrl? (<amp_no>) Ö <dev_id>,<v_ctrl>,<v_ctrl_min>,<v_ctrl_max>;

ctrl? (amp(<amp_id>)) Ö <dev_id>,<v_ctrl>,<v_ctrl_min>,<v_ctrl_max>;

OMICRON electronics Page 196


CM Engine

5.1.7 GPS Commands


gps: reset

def? Ö <dev_id>,0 | 1;

pos (<latitude>,<longitude>,<height>)

pos? Ö <dev_id>,<latitude>,<longitude>,<height>,<dop> ;

sigma? Ö <dev_id>,<sigma>;

status? Ö <dev_id>,<status>,<#satellites>;

time: timemode? Ö <dev_id>,sat | utc;

utc? Ö <dev_id>,<uts_diff>,<valid>;

datetime (<yyyy>,<mm>,<dd>)

datetime? Ö <dev_id>,<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>;

sync (<ch>,<rate>,<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>)

sync? (<ch>) Ö <dev_id>,<rate>,<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>;

setup: cfg? (type) Ö <dev_id>,<dev_type>;


(ser) Ö <dev_id>,<ser_no>;
(firm) Ö <dev_id>,<firm_ver>;
(addr) Ö <dev_id>,<bus_addr>;

mode (<accuracy_mode>)

mode? Ö <dev_id>,<accuracy_mode>;

gmt (<hh>,<mm>)

gmt? Ö <dev_id>,<hh>,<mm>;

pulse (<LED_ch>,<sync_type>,<edge_type0>,<edge_type1>)

pulse? Ö <dev_id>,<LED_ch>,<sync_type>,<edge_type0>,<edge_type1>;

cable (<delay>)

cable? Ö <dev_id>,<delay>;

save

5.1.8 IRIG-B Commands


irigb: cfg? Ö <dev_id>,<cfg_no>[,<cfg_no>, …];

cfg? (<cfg_no>) Ö <dev_id>,<irigb_source>;

cfg (<cfg_no>)

def? Ö <dev_id>,<cfg_no>,<dev_conn>,<ext_dev_conn>;

datetime? Ö <dev_id>,<yyyy>,<mm>,<dd>,<doy>,<hh>,<mm>,<ss>,<SBS>,<CF>;

enc: cfg (<yyyy>,<doy>,<hh>,<mm>,<ss>,<CF>,<parity_mode>,<mod>,<coded_expr>,<auto_inc>,<write_mode>)

cfg (<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>,<CF>,<parity_mode>,<mod>,<coded_expr>,<auto_inc>,<write_mode>)

cfg? Ö <dev_id>,<CF>,<parity_mode>,<mod>,<coded_expr>,<auto_inc>;

dec: scan? Ö <dev_id>,<successful>,<parity_mode>,<mod>,<coded_expr>,<parity_err_status>;

cfg (<parity_mode>,<mod>,<coded_expr>,<parity_err_status>,<write_mode>)

cfg? Ö <dev_id>,<parity_mode>,<mod>,<coded_expr>,<parity_err_status>;
reset

sync (<yyyy>,<doy>,<hh>,<mm>,<ss>,<rate>,<write_mode>)

sync (<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>,<rate>,<write_mode>)

sync? Ö <dev_id>,<yyyy>,<mm>,<dd>,<doy>,<hh>,<mm>,<ss>,<rate>;

OMICRON electronics Page 197


CM Engine

5.2 Block diagram of Generators/Outputs of the CMC 56

Amplifier number Physical amplifiers

Internal 3 0 ... 125 Vrms


1 voltage
"Voltage 1-3"
amplifier

Internal 3 0 ... 12,5 Arms


2 current
"Current 1-3"
amplifier

0 ... 5 Vrms
Gen. out 4-6 External 3
software controlled amplifier
muting of outputs
for digital input
board version 7 0 ... 5 Vrms
and newer. Gen. out 1-3 External 3
amplifier

0 ... 5 Vrms
Gen. out 7-9 External 3
3 amplifier

Option: CM Exif board with socket


"Gen. out 7-12" available for CMC
with serial numbers DAxxxx and
0 ... 5 Vrms
Gen. out 10-12 External 3
4 amplifier

Inside CMC Outside CMC

OMICRON electronics Page 198


CM Engine

5.3 IEEE C37.118 control function details


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 Value (worst case accuracy)
1111 F Fault – clock failure, time not reliable
1011 B 10s
1010 A 1s
1001 9 100ms (time within 0.1s)
1000 8 10ms (time within 0.01s)
0111 7 1ms (time within 0.001s)
0110 6 100µs (time within 10-4s)
0101 5 10µs (time within 10-5s)
0100 4 1µs (time within 10-6s)
0011 3 100ns (time within 10-7s)
0010 2 10ns (time within 10-8s)
0001 1 1ns (time within 10-9s)
0000 0 Normal operation, clock locked

OMICRON electronics Page 199


CM Engine

5.4 Contact Information / Technical Support

To contact OMICRON's technical support service, please use one of the following ways:

Europe, Africa, Middle East


OMICRON electronics GmbH
Phone: +43 5523 507-333
E-Mail: support@omicron.at
Web: www.omicron.at

Asia, Pacific
OMICRON electronics Asia Ltd. Hong Kong
Phone: +852 2634 0377
E-Mail: support@asia.omicron.at
Web: www.omicron.at

North and South America


OMICRON electronics Corp. USA
Phone: +1 713 830-4660 or 1 800 OMICRON
E-Mail: techsupport@omicronusa.com
Web: www.omicronusa.com

For addresses of OMICRON offices with customer service centers, regional sales offices or offices for
training, consulting and commissioning please see our website.

OMICRON electronics Page 200


CM Engine

Command index
Alphabetical index of all CM Engine commands (interface functions and string commands):

amp: def (<amp_no>, ...), 116 inp:ana:cal(ac|dc), 179


amp:cfg?(<amp_id>,firm), 116 inp:ana:clr(<command handle>), 178
amp:cfg?[(<cfg_no>)], 112 inp:ana:clr(all), 178
amp:ctrl (i, <triple_no>, <v_max>), 125 inp:ana:dc(on|off), 179
amp:ctrl? (v | i , <triple_no>), 125 inp:ana:get?(<command handle>), 177
amp:def ([<amp_no>,] clr | clrnooff), 119 inp:ana:sync, 176
amp:def (<amp_no>, ext, <id_list>), 118 inp:avail?(scope|multimeter), 167
amp:def (<amp_no>, int), 118 inp:bin(<inp_module_idx>):cfg?, 128
amp:def (<amp_no>, int|ext , v|i, <amplification>, <max_out>, inp:bin(<inp_module_idx>):diff?, 132
<f_min>, <f_max>, ...), 117 inp:bin(<inp_module_idx>):get?, 131
amp:def(off), 119 inp:bin(<inp_module_idx>:<group_idx>): deglitch
amp:def? [(<amp_no>)], 119 (<degl_time>), 133
amp:param? (<id>[,cal]), 121 inp:bin(<inp_module_idx>:<group_idx>):cfg?, 129
amp:route (clr | clrnooff), 122 inp:bin(<inp_module_idx>:<group_idx>):debounce(<deb_time
amp:route (v | i, <triple_no>, <amp_no> | clr | clrnooff), 122 >), 132
amp:route? ( v | i, <triple_no>), 123 inp:bin(<inp_module_idx>:<group_idx>):debounce?, 133
amp:scan?, 116, 120 inp:bin(<inp_module_idx>:<group_idx>):deglitch?, 134
CMDevGetList, 48 inp:bin(<inp_module_idx>:<group_idx>):name(<name>), 136
CMDevLock, 49 inp:bin(<inp_module_idx>:<group_idx>):name?, 136
CMDevScanForNew, 50 inp:bin(<inp_module_idx>:<group_idx>[:<inp_idx>]):def(pf |
CMDevUnlock, 51 <threshold>), 134
CMExec, 51 inp:bin(<inp_module_idx>:<group_idx>[:<inp_idx>]):def?, 135
CMFreeEngineHandle, 53 inp:bin:cfg?, 128
CMGetEngineHandle, 53 inp:bin[(<inp_module_idx>)]:diff(reset), 132
CMGetError, 53 inp:buf:clr, 142
CMGetErrorText, 54 inp:buf:sam (<source>, <index>), 138
CMGetStatusText, 54 inp:buf:sam (bin, on | off | bin), 138
CMLogAppend, 55 inp:cfg(<srate>,<avrg>), 144
CMLogGetInfo, 56 inp:cfg? [(ecount)], 145
CMLogNew, 56 inp:cfg?(srate|avrg|firm|hard), 145
CMLogSetLevel, 56 inp:count: get?(bcount | ecount(<counter>)), 144
CMLogWrite, 57 inp:count:join(bcount | ecount(<master_counter>), bcount |
CMOutUserApp, 57 ecount(<slave_counter>)), 143
CMRealTimeBegin, 63 inp:mode(scope|multimeter), 167
CMRealTimeEnd, 63 out:[ana:]buf:get?, 100
CMRealTimeStatus, 64 out:[ana:]buf:sam[(lock | free)], 99
CMRealTimeWrite, 64 out:[ana:]clr, 95
CMSetDebug, 58 out:[ana:]i (<generator_list>):[sig(<no>):]a (<amplitude> [, step
CMVersion, 59 ] ), 80
gps:def?, 149 out:[ana:]i (<generator_list>):[sig(<no>):]f (<frequency> [, step
gps:pos(<latitude>, <longitude>, <height>), 148 ] ), 81
gps:pos?, 148 out:[ana:]i (<generator_list>):[sig(<no>):]p (<phase> [, step ] ),
gps:reset, 147 82
gps:setup:gmt(<hh>, <mm>), 153 out:[ana:]i (<generator_list>):[sig(<no>):]t (<period_time>), 82
gps:setup:gmt?, 153 out:[ana:]i (<generator_list>):[sig(<no>):]wav (dc), 88
gps:setup:mode(<accuracy_mode>), 152 out:[ana:]i (<generator_list>):[sig(<no>):]wav (exp), 89
gps:setup:mode?, 152 out:[ana:]i (<generator_list>):[sig(<no>):]wav (sin), 83
gps:sigma?, 147 out:[ana:]i (<generator_list>):[sig(<no>):]wav (square [
gps:status?, 146 ,<duty_cycle>] ), 87
gps:time:datetime(<yyyy>, <mm>, <dd>, <hh>, <mm>, <ss >), out:[ana:]i (<generator_list>):[sig(<no>):]wav
151 (sum,<amplitude_factor1>, ...), 84
gps:time:datetime?, 151 out:[ana:]i (<generator_list>):[sig(<no>):]wav (tri [
gps:time:sync(<yyyy>,<mm>,<dd>,<hh>,<mm>,<ss>), 150 ,<duty_cycle>] ), 85
gps:time:sync?(<ch>), 150 out:[ana:]i (<generator_list>):[sig(<no>):]wav (user,
gps:time:timemode?, 149 <user_sig_no> [,single] ), 88
gps:time:utc?, 149 out:[ana:]i (<generator_list>):clr, 90
inp:[ana:]i(<input_list>):get?, 126 out:[ana:]i (<generator_list>):mix (sig(<no>) | add | mult), 91
inp:[ana:]v(<input_list>):get?, 126 out:[ana:]i (<generator_list>):off, 90
inp:ana(<input_list>):def(i,<range>,<CTRatio>), 136 out:[ana:]i (<generator_list>):on, 89
inp:ana(<input_list>):def(v,<range>), 136 out:[ana:]i (<triple_no>):zero(<zero_factor>), 93
inp:ana(<input_list>):def?, 137 out:[ana:]off [(zcross [,<off_generator_list>])], 94
inp:ana(<input_list>):diff? (<itime>), 175 out:[ana:]on, 93
inp:ana(<input_list>):freq? (<#periods>,<start level>), 172 out:[ana:]pmode (abs | diff), 96
inp:ana(<input_list>):peak?(<itime>), 170 out:[ana:]pmode?, 98
inp:ana(<input_list>):phase?(<itime>), 171 out:[ana:]resetopt, 98
inp:ana(<input_list>):power? (<itime>), 173 out:[ana:]save, 92
inp:ana(<input_list>):range?, 138 out:[ana:]step [(load | exec)], 95
inp:ana(<input_list>):rms?(<itime>), 169 out:[ana:]sync (ext, +|-), 101
inp:ana(<input_list>):sum? (<itime>), 174 out:[ana:]sync (off), 101

OMICRON electronics Page 201


CM Engine

out:[ana:]user:alloc? (<no_of _samples>), 102 out:aux(<idx>):def?, 111


out:[ana:]user:app (<user_sig_no>, <user_data>), 102 out:aux(<idx>):on | off, 109
out:[ana:]user:free [(<user_sig_no>)], 103 out:aux:cfg?, 109
out:[ana:]user:status? [(<user_sig_no>)], 104 out:bin(<out_module_idx>):cfg?, 104
out:[ana:]v (<generator_list>):[sig(<no>):]a (<amplitude> [, out:bin(<out_module_idx>):get?, 108
step ] ), 80 out:bin(<out_module_idx>):off (<output_list>), 107
out:[ana:]v (<generator_list>):[sig(<no>):]f (<frequency> [, step out:bin(<out_module_idx>):on (<output_list>), 107
] ), 81 out:bin(<out_module_idx>):set (<data>), 107
out:[ana:]v (<generator_list>):[sig(<no>):]p (<phase> [, step ] ), out:bin(<out_module_idx>:<group_idx>):cfg?, 105
82 out:bin(<out_module_idx>:<group_idx>):name(<name>), 108
out:[ana:]v (<generator_list>):[sig(<no>):]t (<period_time>), 82 out:bin(<out_module_idx>:<group_idx>):name?, 108
out:[ana:]v (<generator_list>):[sig(<no>):]wav (dc), 88 out:bin:cfg?, 104
out:[ana:]v (<generator_list>):[sig(<no>):]wav (exp), 89 out:cfg?, 111
out:[ana:]v (<generator_list>):[sig(<no>):]wav (sin), 83 Real-time Playback, 60
out:[ana:]v (<generator_list>):[sig(<no>):]wav (square [ seq:add (count(1) | count(2), <rel_steps>), 160
,<duty_cycle>] ), 87 seq:begin, 158
out:[ana:]v (<generator_list>):[sig(<no>):]wav seq:clr, 159
(sum,<amplitude_factor1>, ...), 84 seq:end, 158
out:[ana:]v (<generator_list>):[sig(<no>):]wav (tri [ seq:exec, 159
,<duty_cycle>] ), 85 seq:set (loop | count(1) | count(2) | timer | timeout, <value>),
out:[ana:]v (<generator_list>):[sig(<no>):]wav (user, 159
<user_sig_no> [,single] ), 88 seq:status? (step | loop | count(1) | count(2) | mem), 160
out:[ana:]v (<generator_list>):clr, 90 seq:stop, 161
out:[ana:]v (<generator_list>):mix (sig(<no>) | add | mult), 91 seq:wait ([<trigger_condition>, <trigger_jump_distance>,] ...),
out:[ana:]v (<generator_list>):off, 90 161
out:[ana:]v (<generator_list>):on, 89 sys:cfg? (type | ser | hard | firm), 68
out:[ana:]v (<triple_no>):zero(<zero_factor>), 93 sys:reset, 67
out:aux(<idx>):a(<v_dc>), 110 sys:status? [ (<bit_number>) ], 69
out:aux(<idx>):a?, 110 sys:test?[(<filename>)], 68
out:aux(<idx>):cfg?, 109 Validity conditions, 177
out:aux(<idx>):def(<pwr_on_v>), 111

OMICRON electronics Page 202

You might also like