cm engine

492
OMICRON CMEngine User Manual

Upload: zinab90

Post on 03-Sep-2015

451 views

Category:

Documents


78 download

DESCRIPTION

GG

TRANSCRIPT

  • OMICRON CMEngineUser Manual

  • Version CMEngine.ENU.9 Year: 2014

    OMICRON electronics. All rights reserved.

    This manual is a publication of OMICRON electronics.

    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 explicitconsent of OMICRON electronics.

    Reprinting, wholly or in part, is not permitted. The product information, specifications, and technicaldata embodied in this manual represent the technical status at the time of writing and are subject tochange without prior notice.

    We have done our best to ensure that the information given in this manual is useful, accurate andentirely reliable. However, OMICRON electronics does not assume responsibility for any inaccuracieswhich may be present.

    The user is responsible for every application that makes use of an OMICRON product.

    OMICRON CMEngine

    2

  • Contents1 Preface ......................................................................................................... 17

    1.1 What tasks can be performed using CMEngine? ................................ 18

    1.2 Command overview ............................................................................. 18

    1.3 Operating systems and compilers ....................................................... 21

    1.4 Accessing the CMEngine from your program ...................................... 21

    1.5 Typical program sequence .................................................................. 21

    1.6 CMEngine license administration ........................................................ 24

    1.7 Handling special cases ........................................................................ 25

    2 Programming the CMEngine ...................................................................... 292.1 System Overview ................................................................................. 30

    2.2 Analog outputs ..................................................................................... 33

    2.2.1 Definition and routing of amplifiers ........................................... 34

    2.2.2 Amplifier Configurations ............................................................ 37

    2.2.3 Defining the signal parameters ................................................. 41

    2.3 Binary outputs ...................................................................................... 46

    2.4 Analog inputs ....................................................................................... 47

    2.5 Binary inputs ........................................................................................ 47

    2.6 Using the Input Buffer .......................................................................... 48

    2.7 Using the Sequencer ........................................................................... 53

    2.8 Counter inputs ..................................................................................... 61

    2.9 Circuit Breaker Simulation ................................................................... 65

    2.10 System control unit .............................................................................. 68

    2.11 The CMC 256 ...................................................................................... 69

    2.11.1 Amplifiers .................................................................................. 69

    2.11.2 The DC auxiliary output ............................................................ 71

    OMICRON CMEngine

    3

  • 2.11.3 The AC analog inputs ............................................................... 72

    2.12 How to extract a parameter from a result string ................................... 75

    3 Interface Functions ..................................................................................... 793.1 Error Codes Overview ........................................................................ 79

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

    3.3 Interface function reference ................................................................. 91

    3.3.1 AddRegDev .............................................................................. 93

    3.3.2 Associated ................................................................................ 93

    3.3.3 AssociationMode ...................................................................... 93

    3.3.4 DevAssociateAppend ............................................................... 93

    3.3.5 DevAssociateAppendSpecific ................................................... 94

    3.3.6 DevAssociationCount ............................................................... 94

    3.3.7 DevAssociationInfo ................................................................... 94

    3.3.8 DevAssociationTime ................................................................. 95

    3.3.9 DevAssociationRequest ............................................................ 95

    3.3.10 DevAssosiationRequestCancel ................................................ 95

    3.3.11 DevDisassociate ....................................................................... 95

    3.3.12 DevDisassociateSpecific .......................................................... 96

    3.3.13 DevGetList ................................................................................ 96

    3.3.14 DeviceAddress .......................................................................... 97

    3.3.15 DeviceType ............................................................................... 97

    3.3.16 DevLock .................................................................................... 97

    3.3.17 DevScanForNew ....................................................................... 98

    3.3.18 DevUnlock ................................................................................ 99

    3.3.19 Exec .......................................................................................... 100

    3.3.20 FriendlyName ........................................................................... 101

    OMICRON CMEngine

    4

  • 3.3.21 GetDevIDbyIPAddress .............................................................. 101

    3.3.22 GetOfflineCfg ............................................................................ 101

    3.3.23 GetOfflineCfg2 .......................................................................... 102

    3.3.24 GetStatusText ........................................................................... 102

    3.3.25 ImgDevTypePrefix .................................................................... 102

    3.3.26 IPAddress ................................................................................. 103

    3.3.27 LanguageForMessages ............................................................ 103

    3.3.28 LogAppend ............................................................................... 103

    3.3.29 LogGetInfo ................................................................................ 104

    3.3.30 LogNew ..................................................................................... 104

    3.3.31 LogS etLevel ............................................................................. 105

    3.3.32 LogWrite ................................................................................... 105

    3.3.33 MaxAssociationTime ................................................................. 106

    3.3.34 MinReqImgVersion ................................................................... 106

    3.3.35 OutUserApp .............................................................................. 106

    3.3.36 ParallelPort ............................................................................... 107

    3.3.37 RegDevCount ........................................................................... 107

    3.3.38 RegDevItemInfo ........................................................................ 107

    3.3.39 RegDevItemIPAddress ............................................................. 107

    3.3.40 RemoveDevice ......................................................................... 108

    3.3.41 RemoveRegDev ....................................................................... 108

    3.3.42 ResGetList ................................................................................ 108

    3.3.43 ResLock .................................................................................... 108

    3.3.44 ResUnlock ................................................................................ 109

    3.3.45 SerialNumber ............................................................................ 109

    3.3.46 SetLicInfo .................................................................................. 110

    OMICRON CMEngine

    5

  • 3.3.47 Version ...................................................................................... 110

    3.3.48 Functions for Real-time Playback of Transient Signals ............ 111

    4 String Commands ....................................................................................... 1194.1 Symbols used in string commands ...................................................... 119

    4.2 Syntax rules for string commands ....................................................... 120

    4.3 Parameter types used in the string commands ................................... 122

    4.4 System Commands ............................................................................. 123

    4.4.1 sys:reset ................................................................................... 124

    4.4.2 sys:test? [()] ............................................................ 125

    4.4.3 sys:cfg? (type|ser|hard|firm|cal) ................................................ 127

    4.4.4 sys:status? [ () ] .................................................. 128

    4.4.5 Organization of the Status Command Register Structure ......... 129

    4.4.6 sys:goose:cfg() ........................................................ 146

    4.4.7 sys:goose:cfg?() ...................................................... 147

    4.5 Output Commands ............................................................................... 147

    4.5.1 out:[ana:]v|i ():[sig():]a ( [,step ] ) ....................................................................................... 150

    4.5.2 out:[ana:]v|i ():[sig():]f ( [,step ] ) ...................................................................................... 152

    4.5.3 out:[ana:]v|i ():[sig():]t () ... 153

    4.5.4 out:[ana:]v|i ():[sig():]p ( [,step ] ) ....................................................................................... 154

    4.5.5 out:[ana:]v|i ():[sig():]wav(, ...) ....................................................................... 155

    4.5.6 out:[ana:]v|i ():[sig():]wav (sin) ................ 156

    4.5.7 out:[ana:]v|i ():[sig():]wav(sum,, ...) .................................................. 157

    OMICRON CMEngine

    6

  • 4.5.8 out:[ana:]v|i ():[sig():]wav (sumcorr,,, ...) ............................. 160

    4.5.9 out:[ana:]v|i ():[sig():]wav (tri[ ,] ) ...................................................................... 163

    4.5.10 out:[ana:]v|i ():[sig():]wav (square[ ,] ) ...................................................................... 165

    4.5.11 out:[ana:]v|i ():[sig():]wav (user, [,single] ) .......................................................... 167

    4.5.12 out:[ana:]v|i ():[sig():]wav (dc) ................. 169

    4.5.13 out:[ana:]v|i ():[sig():]wav (exp) ............... 170

    4.5.14 out:[ana:]v|i ():on ............................................. 172

    4.5.15 out:[ana:]v|i ():off ............................................. 173

    4.5.16 out:[ana:]v|i ():clr ............................................. 174

    4.5.17 out:[ana:]v|i ():mix (sig()|add|mult|off) ..... 175

    4.5.18 out:[ana:]save ........................................................................... 178

    4.5.19 out:[ana:]restore ........................................................................ 179

    4.5.20 out:[ana:]v|i ():zero() ......................... 180

    4.5.21 out:[ana:]on ............................................................................... 181

    4.5.22 out:[ana:]off [(zcross [,])] ........................... 182

    4.5.23 out:[ana:]clr ............................................................................... 185

    4.5.24 out:[ana:]step [(load|exec)] ....................................................... 186

    4.5.25 out:[ana:]pmode (abs|diff[(v|i()]) ........... 187

    4.5.26 out:[ana:]pmode? ...................................................................... 190

    4.5.27 out:[ana:]resetopt ...................................................................... 191

    4.5.28 out:[ana:]buf:sam[(lock|free)] .................................................... 194

    4.5.29 out:[ana:]buf:get? (v|i (:) [:sig ()]) ......... 195

    4.5.30 out:[ana:]sync(ext, +|-) .............................................................. 198

    OMICRON CMEngine

    7

  • 4.5.31 out:[ana:]sync(off) ..................................................................... 199

    4.5.32 out:[ana:]user:... ........................................................................ 200

    4.5.33 out:[ana:]user:alloc? () ................................. 201

    4.5.34 out:[ana:]user:app (, ) .................. 202

    4.5.35 out:[ana:]user:free [()] ....................................... 204

    4.5.36 out:[ana:]user:status? [()] .................................. 205

    4.5.37 out:bin:cfg? ............................................................................... 206

    4.5.38 out:bin():cfg? ............................................... 207

    4.5.39 out:bin(:):cfg? .......................... 209

    4.5.40 out:bin():on() ........................... 212

    4.5.41 out:bin():off () .......................... 213

    4.5.42 out:bin():set () ................................... 214

    4.5.43 out:bin():get? ............................................... 216

    4.5.44 out:bin(:):name() ........ 217

    4.5.45 out:bin(:):name? ...................... 218

    4.5.46 out:aux:cfg? .............................................................................. 219

    4.5.47 out:aux():cfg? ................................................................... 220

    4.5.48 out:aux():on|off ................................................................. 221

    4.5.49 out:aux():a() .......................................................... 222

    4.5.50 out:aux():a? ...................................................................... 223

    4.5.51 out:aux():def() ............................................... 224

    4.5.52 out:aux():def? ................................................................... 225

    4.5.53 out:cfg? ..................................................................................... 226

    4.6 Sampled Values Commands ............................................................... 226

    4.6.1 out:[ana:]sv:def(, ) ................................ 228

    4.6.2 out:[ana:]sv:def? ....................................................................... 229

    OMICRON CMEngine

    8

  • 4.6.3 out:[ana:]sv:cfg(, , , ,, , , ,, [,]) ..................................... 230

    4.6.4 out:[ana:]sv:cfg?() ....................................................... 233

    4.6.5 out:[ana:]sv:off() ......................................................... 235

    4.6.6 out:[ana:]sv:status?() .................................................. 236

    4.7 Amplifier Commands ........................................................................... 238

    4.7.1 amp:cfg?[()] ................................................................ 239

    4.7.2 amp:cfg?(,firm) .......................................................... 245

    4.7.3 amp:def (, ...) ........................................................... 246

    4.7.4 amp:def (, int|ext , v|i, , ,, , , , ) ............... 247

    4.7.5 amp:def (, int) / amp:def (, ext, ) 249

    4.7.6 amp:def ([,] clr|clrnooff) ........................................... 251

    4.7.7 amp:def(off) .............................................................................. 252

    4.7.8 amp:def? [([,harm])] ................................................. 253

    4.7.9 amp:scan? ................................................................................ 255

    4.7.10 amp:param? ( [,cal]) ........................................................... 256

    4.7.11 amp:route(clr|clrnooff) ............................................................... 258

    4.7.12 amp:route (v|i (), |clr|clrnooff) ................ 259

    4.7.13 amp:route? ( v|i, ) .................................................... 262

    4.7.14 amp:range(v|i(), ) ....................................... 263

    4.7.15 amp:range?(v|i()) .................................................... 265

    4.7.16 amp:ctrl (i (), ) ............................................. 266

    4.7.17 amp:ctrl? (v|i , ) ....................................................... 267

    4.7.18 amp:reset() ............................................................... 268

    4.8 Input Commands ................................................................................. 269

    OMICRON CMEngine

    9

  • 4.8.1 inp:[ana:]v|i():get?[(all)] ........................................... 270

    4.8.2 inp:[ana:]v|i():range? .............................................. 272

    4.8.3 inp:[ana:]v|i():range() ................................. 273

    4.8.4 inp:bin:cfg? ............................................................................... 274

    4.8.5 inp:bin():cfg? ................................................ 275

    4.8.6 inp:bin(:):cfg? ........................... 277

    4.8.7 inp:bin():get? ............................................... 280

    4.8.8 inp:bin():diff? ................................................ 281

    4.8.9 inp:bin[()]:diff(reset) ..................................... 282

    4.8.10 inp:bin(:):debounce() .............................................................................................. 283

    4.8.11 inp:bin(:):debounce? ................ 284

    4.8.12 inp:bin(:): deglitch() ............................................................................ 285

    4.8.13 inp:bin(:):deglitch? ................... 286

    4.8.14 inp:bin(:[:]):def(pf|) .............................................................................. 287

    4.8.15 inp:bin(:[:]):def? ........ 289

    4.8.16 inp:bin(:):name() ......... 290

    4.8.17 inp:bin(:):name? ...................... 291

    4.8.18 inp:ana():def(v,) /inp:ana():def(i,,) ....................... 292

    4.8.19 inp:ana():def? ......................................................... 294

    4.8.20 inp:ana():range? ..................................................... 295

    4.8.21 inp:ana:cal(ac|dc) ..................................................................... 296

    4.8.22 inp:ana:cfg?(srate|avrg|firm|hard) ............................................. 297

    4.8.23 inp:ana:dc(on|off) ...................................................................... 298

    OMICRON CMEngine

    10

  • 4.8.24 inp:buf:sam (, ) / inp:buf:sam (bin, on|off|bin) .................................................................................................. 299

    4.8.25 inp:buf:sam(ext) ........................................................................ 301

    4.8.26 inp:buf:get? ............................................................................... 302

    4.8.27 inp:buf:get?() ................................................... 306

    4.8.28 inp:buf:clr .................................................................................. 307

    4.8.29 inp:count:on .............................................................................. 308

    4.8.30 inp:count:off .............................................................................. 309

    4.8.31 inp:count:clr .............................................................................. 310

    4.8.32 inp:count:set(bcount|ecount(), , +|-) ............. 311

    4.8.33 inp:count:join(bcount|ecount(), bcount|ecount()) ......................................................... 313

    4.8.34 inp:count:get?(bcount|ecount()) ................................ 314

    4.8.35 inp:ana:cfg(,) ..................................................... 315

    4.8.36 inp:cfg?[(ecount)] ...................................................................... 317

    4.9 GPS Commands .................................................................................. 318

    4.9.1 gps:status? ............................................................................... 319

    4.9.2 gps:reset ................................................................................... 321

    4.9.3 gps:sigma? ............................................................................... 322

    4.9.4 gps:pos? ................................................................................... 323

    4.9.5 gps:pos(, , ) .............................. 324

    4.9.6 gps:def? .................................................................................... 326

    4.9.7 gps:time:timemode? ................................................................. 327

    4.9.8 gps:time:utc? ............................................................................ 328

    4.9.9 gps:time:sync(,,,,,,,) ........................................................................................... 329

    4.9.10 gps:time:sync?() ............................................................... 331

    OMICRON CMEngine

    11

  • 4.9.11 gps:time:datetime(, , , , , ) 332

    4.9.12 gps:time:datetime? ................................................................... 333

    4.9.13 gps:setup:mode? ...................................................................... 334

    4.9.14 gps:setup:mode() ........................................ 335

    4.9.15 gps:setup:gmt? ......................................................................... 337

    4.9.16 gps:setup:gmt(, ) .................................................... 338

    4.9.17 gps:setup:cfg?(type|ser|firm) .................................................... 339

    4.9.18 gps:setup:cfg?(addr) ................................................................. 340

    4.9.19 gps:setup:pulse(, , , ) ...................................................................................... 341

    4.9.20 gps:setup:pulse? ....................................................................... 343

    4.9.21 gps:setup:cable? ....................................................................... 344

    4.9.22 gps:setup:cable() ......................................................... 345

    4.9.23 gps:setup:save .......................................................................... 346

    4.10 Sequencer Commands ........................................................................ 347

    4.10.1 seq:begin .................................................................................. 349

    4.10.2 seq:end ..................................................................................... 350

    4.10.3 seq:clr ....................................................................................... 352

    4.10.4 seq:exec ................................................................................... 353

    4.10.5 seq:set (loop|count(1)|count(2)|timer|timeout, ) ........... 354

    4.10.6 seq:add (count(1) > count(2), ) .............................. 355

    4.10.7 seq:status? (step|loop|count(1)|count(2)|mem) ........................ 356

    4.10.8 seq:stop .................................................................................... 357

    4.10.9 seq:wait ( [, ,][, ] ) .................. 358

    4.10.10seq:set(exttime(id),,,,,,) .............. 364

    OMICRON CMEngine

    12

  • 4.10.11seq:set(exttime(id),,,,,) ............................. 365

    4.10.12Sequencer hints ........................................................................ 366

    4.10.13Sequencer examples ................................................................ 367

    4.11 Multimeter Commands ......................................................................... 371

    4.11.1 inp:ana():rms?() .......................................... 374

    4.11.2 inp:ana():peak?() ........................................ 376

    4.11.3 inp:ana():phase?() ..................................... 378

    4.11.4 inp:ana():freq?(,) ............... 380

    4.11.5 inp:ana():power?() ...................................... 382

    4.11.6 inp:ana():sum?() ......................................... 384

    4.11.7 inp:ana():diff?() ........................................... 386

    4.11.8 inp:ana:sync .............................................................................. 389

    4.11.9 inp:ana:get?() ............................................ 390

    4.11.10inp:ana:clr() / inp:ana:clr(all) ..................... 392

    4.12 Scope Mode Commands ..................................................................... 393

    4.12.1 Configuration and Status Commands ....................................... 394

    4.12.2 Trigger Commands ................................................................... 401

    4.12.3 Block Transfer Commands ....................................................... 409

    4.12.4 Harmonic Commands ............................................................... 415

    4.13 CB Simulation Commands ................................................................... 422

    4.13.1 cb:time(,,,,,,

  • 4.13.4 cb:def? (trip[()]|close|cb52a[()]|cb52b[()]|cb52aor|cb52b or|cb52a and|cb52b and) ........................................... 426

    4.13.5 cb:def(clr) .................................................................................. 427

    4.13.6 cb:start(on|off) ........................................................................... 428

    4.13.7 cb:stop ...................................................................................... 429

    4.13.8 cb:lock ....................................................................................... 430

    4.13.9 cb:free ....................................................................................... 431

    4.13.10cb:status? ................................................................................. 432

    4.14 Time Synchronization Commands ....................................................... 433

    4.14.1 sys:time:cfg() ............................................ 437

    4.14.2 sys:time:cfg? ............................................................................. 438

    4.14.3 sys:time:cfg?() .......................................... 439

    4.14.4 sys:time:def? ............................................................................. 440

    4.14.5 sys:time:datetime? .................................................................... 441

    4.14.6 IRIG-B Commands ................................................................... 443

    4.14.7 PTP Commands ....................................................................... 463

    4.14.8 NTP Commands ....................................................................... 469

    4.15 Obsolete Commands ........................................................................... 475

    5 Appendix ...................................................................................................... 4775.1 Syntax Diagrams ................................................................................. 477

    5.1.1 System Commands .................................................................. 478

    5.1.2 Input Commands: Analog ......................................................... 479

    5.1.3 Input Commands: General, Binary, Counter ............................. 480

    5.1.4 Output Commands .................................................................... 481

    5.1.5 Sequencer Commands ............................................................. 483

    5.1.6 Amplifier Commands ................................................................ 484

    OMICRON CMEngine

    14

  • 5.1.7 GPS Commands ....................................................................... 485

    5.1.8 IRIG-B Commands ................................................................... 486

    5.2 Block diagram of Generators/Outputs of a CMC Test Set ................... 487

    5.3 IEEE C37.118 control function details ................................................. 488

    6 Support ........................................................................................................ 489

    Index .............................................................................................................. 491

    OMICRON CMEngine

    15

  • OMICRON CMEngine

    16

  • 1 PrefaceNote: The CMEngine documentation was initially conceived to be a software-accompanying Help. Youcan launch the Help from anywhere in Test Universe, either by clicking the Help Topics... commandon the Help pull-down menu or the respective Help Topics toolbar icon, by clicking available Helpbuttons or via the context-sensitive Help feature at the toolbar. Pressing the key does the same.

    However, to offer you the possibility of reading the CMEngine documentation without the necessity ofhaving to sit in front of a computer, and in order to ease the printing, we additionally provide theCMEngine documentation as a user manual the one you are currently reading. This manual isstored as CMEngine.pdf on your hard disk at installation folder\Test Universe\Doc. However, youwont have to access this folder to view the manual. You find a direct hyperlink for the PDF manual inthe CMEngine Help topic Preface.

    Contents of CMEngine Help and manual are identical.

    This user manual is derived from the same source as the Help. The Help is regarded the referenceCMEngine documentation, and while we focussed on a correct formatting of the Help, the manual'slook and feel derives widely from stylesheet-controlled automatisms. We ask for your kindunderstanding if you should come across page breaks, table or image dimensions that may not alwaysappear ideal to you. If you particularly dislike something and expect us to improve it, please contact us( Support on page 489).

    About CMEngine

    The CMEngine is a program library for software developers to conveniently control and program oneor more CMC test sets.

    The software developer is able to create a program for his special purposes in any of the commonprogramming languages like "C/C++", Visual Basic, VBA (Visual Basic for Applications), C# etc. In thisapplication program, he can use the CMEngine library to communicate with one or more CMC testsystems connected to the PC or to the notebook computer. The CMEngine provides an interface withfunctions 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 stringcommands to the CMCs, which are then analyzed and executed. There are string commands to set aCMC to a specific state, e.g. to output a certain voltage, and there are such commands to getmeasurement data or other information from a CMC. This kind of command returns detailed stringanswers containing the information desired by the programmer. The returned information may beanalyzed and processed further by the application program.

    More:

    Which tasks can be performed using the CMEngine? on page 18

    Command overview on page 18

    Operating systems and compilers on page 21

    Preface

    17

  • Accessing the CMEngine from your program on page 21

    Typical program sequence on page 21

    CMEngine license administration on page 24

    Handling special cases on page 25

    1.1 What tasks can be performed using CMEngine?With the CMEngine command set, all functions of one or more CMCs connected to the PC can becontrolled:

    Emit voltages or currents with selectable waveforms and waveform parameters. You may selectone of any predefined waveforms like sine, exponential function, square etc.

    Load transient or periodic signals as user-defined waveforms into the CMCs memory and put themout.

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

    Emit signals through external voltage or current amplifiers (e.g. CMA 56).

    1.2 Command overviewThere are two types of CMEngine commands:

    The functions of CMEngine's programming interface.These functions can be imported from the CMEngine library into your program to control theCMEngine itself. The definition of these functions depends on the programming language and thecompiler 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 CMEngine and are sent to CMCs via theCMEngine using the Exec() interface function of CMEngine.

    OMICRON CMEngine

    18

  • Overview of the functions of the CMEngine programming interface:

    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 CMEngine version number.

    OutUserApp Appends samples to a specified user signal.

    Preface

    19

  • String commands

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

    System commands "sys:..." Use the system commands to change the system settings of aCMC, to ask for the CMCs system status or to get someinformation about the CMCs hardware.

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

    Input commands "inp:..." The input commands control everything related to themeasurement of analog or binary signals on the CMCs inputs. Inaddition, some special commands perform real-timemeasurements.

    Amplifier commands "amp:..." The relations between your defined signals and the outputs usedfor these signals, i.e., which signal is assigned to which output, areset by default. Using the amplifier commands, you can changethese default settings according to your needs. Furthermore, youmay inform the CMEngine about an external amplifier'sparameters and then use this external amplifier for current orvoltage output.

    GPS commands "gps:... " The GPS commands let you configure all aspects of a connectGPS device, e.g., retrieving time and position, set triggers, etc.

    Sequencer commands "seq:..." The sequencer commands control everything related tosequences, i.e. CMC commands executed in real-time mode.They enable you to build sequences out of commands (signaloutput etc.) that you can load into a CMC and then execute them.That is the way you can start and control real-time executions ofyour commands.

    OMICRON CMEngine

    20

  • 1.3 Operating systems and compilers

    Operating systems

    CMEngine is tested to be compliant with the same versions of Microsoft Windows operating systemsas the Test Universe version it is working with. Detailed up-to-date information about the operatingsystem and PC hardware requirements necessary to run CMEngine and Test Universe can be foundin a file named Requirements.txt on the Test Universe installation DVD.

    Compilers

    CMEngine is developed and tested with the compiler system Microsoft Visual C++. Nevertheless youcan 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 registeredappropriately, which the installation program does.

    The registration for the OLE Automation server (CMEngAL.exe) is done by the installation program. Ifyou move the OLE Automation server, you have to register it at its new location. To re-register theserver, start it with the command line parameter "/register" ("CMEngAL.exe /register").

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

    If you want to contact the OMICRON Technical Support, visit our website www.omicron.at for theOMICRON Service Center address of your region, please.

    1.4 Accessing the CMEngine from your programBefore your application program can use the CMEngine, you have to add to your project a referenceto the OMICRON CMEngine Adapter Layer 2.0. Then your application program has to create ancmEngine object (e.g CreateObject("cmEngine.cmEngine")). When it does not need access toCMEngine anymore, it has to release the object. This releases all resources the CMEngine reservedfor your application program.

    1.5 Typical program sequenceA program that controls CMCs via the CMEngine must use at least the following of the CMEngine'sinterface functions in logical order. Thus every program that controls CMCs using the CMEngineconsists of at least the following typical command structure.

    Preface

    21

  • Example in VBA:

    Sub Main() Dim engine As cmEngine.cmEngine ' Declare engine as object used for OLEAutomation Dim result As String ' Variable for the result string returned byCMExec On Error GoTo EngineError ' Create OLE Automation object Set engine = New cmEngine.cmEngine engine.DevScanForNew (False) Dim deviceList As String Dim devId As Integer deviceList = engine.DevGetList(lsAllAssociatedAny) If ExtractParameter(3, deviceList) = "0" And ExtractParameter(4,deviceList) = "0" Then ' We have a net-1 device devId = Val(ExtractParameter(1, deviceList)) If Not engine.Associated(devId) Then engine.DevAssociateAppend (devId) End If ElseIf deviceList "" Then devId = Val(ExtractParameter(1, deviceList)) Else GoTo ApplicationEnd End If engine.DevLock (devId) ' The CMC can now be used by this application program result = engine.Exec(devId, "sys:cfg?(cal)") ' Execute commands on thisCMC engine.DevUnlock (devId) ' Unlock the locked CMC GoTo ApplicationEndEngineError: MsgBox Err.Description Err.Clear

    OMICRON CMEngine

    22

  • ApplicationEnd: Set engine = Nothing ' Release the CMEngineEnd Sub Function ExtractParameter(ByVal ParNumber As Integer, ByVal CmdResult AsString) As String Dim textpos1 As Integer Dim textpos2 As Integer Dim Counter As Integer ExtractParameter = "" ' For the moment we assume no return Counter = 0 If ((ParNumber
  • ExtractParameter = "" Exit Function End If End If ExtractParameter = Mid$(CmdResult, textpos1 + 1, textpos2 - textpos1 - 1)End Function

    This script searches for available CMC test sets and turns their outputs on. It will furthermorefind NET-1 test sets. So make sure that there is no NET-1 test set in your local networkbefore you run this script.

    Before compiling this script, make sure to add the Omicron CM Engine Adapter Layer 2.0Type Library at Tools > Preferences in MS Excel or Script > References inControl Center, respectively. Else you will get a compilation error.

    For more information about CMEngine programming, see Programming the CMEngine on page 29.

    1.6 CMEngine license administrationA CMEngine is licensed to one or more of your CMC devices. Thus your CMEngine can only controlthe CMC devices that it is licensed to.

    The license number(s) are kept in a license file "OMICRON.LIC". CMEngine needs a specific licensenumber in this file for every CMC. This license file uses the same syntax as Windows INI files. Eachdevice has its own section with keys for every application/component. The section name is built fromthe serial number of the CMC and the device type (CMC 56, CMC 151, CMC 156). The name of thekey is CMENG for the CMEngine. The following is an example for the CMC 56 with the serial numberDA345D:

    ; 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 ona letter you can use the "Add License" Windows program to enter them. For a description on how touse this program, just start it without any parameters. The license file has to be in the directory ...\Program Files\Common Files\OMICRON.

    OMICRON CMEngine

    24

  • 1.7 Handling special casesThis section explains how some special cases in the interaction between the CMEngine and CMCdevices must be handled by a programmer. If you read this manual for the first time, you may skip thissection.

    More:

    Automatic output switch off on page 25

    CMC in use was switched OFF and ON again on page 27

    Automatic output switch off

    Under some special circumstances, the power outputs of a CMC are disconnected for the security ofthe CMC and its user, which can occur for three different reasons:

    a. If the communication between CMEngine and CMC is interrupted for more than two seconds(communication cable disconnected etc.).

    b. If there is an overtemperature on one of the built-in power amplifiers.

    c. If there is an external infeed (CMC 151, CMC 156 and e only)

    These special cases are to be handled accordingly.

    Detect these cases by getting the contents of the primary status register with Exec ("sys:status?"):

    case a) In the primary status register

    - the bit ST_BIT_COMM (Bit 0),

    - the bit ST_BIT_CMC_INTL (Bit 1)

    - or both

    are set.

    case b) In the primary status register

    - the bit ST_BIT_OVERTEMP_V (Bit 4),

    - the bit ST_BIT_OVERTEMP_I (Bit 5)

    - or both

    are set.

    Preface

    25

  • 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 thefollowing calls to CMEngine commands:

    case a)

    Get the secondary status registers 0 and 1 using Exec("sys:status?(0)") andExec("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)") andExec("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 containsa zero (no bits set any more).

    Furthermore call GetError() until zero (= CMERR_OK) is returned.

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

    OMICRON CMEngine

    26

  • CMC in use was switched OFF and ON again

    After a new and still unknown CMC is connected to a PC with the CMEngine running, you usually willregister 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. Inthis case, the command DevScanForNew() will recognize that this CMC was previously connected andwill assign the previous device ID number to this CMC again.

    You should handle the case of a CMC that is known to the CMEngine, but was switched OFF and thenON 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 CMEngine (function Exec()returns FALSE and then GetError() returns CMERR_COMM), you should assume that this is the caseof 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 relatedsecondary status register for every bit set. Get the same secondary status registers again and againuntil they all contain a zero. Furthermore call GetError() repeatedly until zero (= CMERR_OK) isreturned. Then a reset and the re-initialization of the CMC follows. The CMC now gets the same IDnumber as it had before but is in the power-on state.

    Preface

    27

  • OMICRON CMEngine

    28

  • 2 Programming the CMEngineThis section describes how to program the OMICRON test devices by means of the CMEngineprogramming interface. It is not intended to describe in detail the CMEngine commands, their syntaxor usage, but to help the programmer in becoming familiar with the CMEngine way of programming. Itshould serve as an introduction and companion to the CMEngine documentation, and should help theprogrammer to make the most out of it. Therefore, the document is written in descriptive style, and fewdetailed examples are included since what we want to show here is the global picture.

    The CMEngine programming interface allows the use of all the capabilities of the CMC test devices.This programming interface is implemented in different forms for different programming environments,but in all cases it provides a set of interface control functions plus a gateway to communicate with theCMC device. This communication takes place as an exchange of strings, where the system sends acommand in string format and gets back an answer, also in string format. For commands that requireno answer, an empty string is returned. To simplify parsing of the answer strings, the response for agiven command has a fixed format, although this format varies across commands.

    To use CMEngine programming from within a given application, it will first be necessary to have theCMEngine interface available. This can be done either linking statically to the CMEngine library, orloading the CMEngine dynamic link library at run time, according to the design of the application andto the capabilities of the programming environment and the operating system. Afterwards, theprogrammer will use the CMEngine interface functions to scan the communication ports for connectedCMCs and lock those that he intends to use.

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

    The easiest way to abstract oneself from these details is to use the "Batcher" application, delivered asa sample with the CMEngine programming environment. This small application provides in effect acommand line interface to the CMC device. It will automatically load the CMEngine and lock any CMCdevices found. Afterwards, it will take the user input as a command to the CMC, and will display theanswer string, if any. In this way it is possible to concentrate on the control of the CMC. In all theexamples in this document it will be assumed that the CMC is already locked, except where thescanning 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 inturn 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 valueof "false" means that the command could not be performed; the results of the command are returnedin the return string, and the possible system errors (overloads, hardware problems, etc.) are found inthe status registers.

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

    Programming the CMEngine

    29

  • More:

    System Overview on page 30Analog outputs on page 33Using the Input Buffer on page 48Using the Sequencer on page 53Counter inputs on page 61System control unit on page 68The CMC 256 on page 69VBA functions on page 75

    2.1 System Overview

    Internal structure of a CMC device

    From the CMEngine programmers point of view, a standard CMC test set consists of the followingcomponents:

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

    OMICRON CMEngine

    30

  • 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 inall 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 binaryinformation. The event buffer and the sequencer allow the use of the high-precision system timer tocontrol the input and output sections.

    Designing a CMEngine application

    Before writing the first line of code, it is necessary to decide how the timing will be controlled. TheCMC timer is much more sophisticated than a normal timer device that is controlled by the closing of acontact. Rather, the CMC timer can be said to have multiple virtual inputs, supervising changes in theanalog outputs and analog and binary inputs. These changes are then stored in the input buffer, aswill be described in detail in section Analog inputs on page 47. This gives the CMC device a veryhigh power and flexibility, at the cost of an increase in complexity since the contents of the input buffermust be analyzed to extract the desired times.

    The timer can also be used to control the analog outputs, thus allowing extremely sensible tuning ofthe generated signals. Again, this comes at the cost of a certain added complexity, as the only way totake advantage of the system timer to control the outputs is programming the Sequencer andexecuting the test sequence from within the CMC. Programs in the CMC are harder to program anddebug than those in standard high-level programming languages, since the need for exact timing andlow memory usage does not allow for a high number of variables or complex flow-control structures.

    There are three main ways to use the CMC from an application through the CMEngine programminginterface:

    The CMC timer is not used:

    In this case, the commands to the outputs are given on-line, without the use of the Sequencer, andthe state of the binary and analog inputs are read by polling. This is the simplest way ofprogramming with the CMEngine, where all the control structures are provided by the languageused.

    This method cannot provide accurate timing, and is therefore only appropriate for applicationswhere measurement of operating time or accuracy in the timing of the outputs is not required. Forexample, to apply a given voltage and current and check that the device under test closes acontact, as long as the time of operation is not interesting.

    Programming the CMEngine

    31

  • Only the Input Buffer is used:

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

    This method provides accurate timing of the detected events, but it cannot provide accurate controlof the outputs. It is quite useful for low-complexity applications, where the controlling program canbe fully dedicated to the handling of the CMC. For advanced programs, it has the inconveniencethat it shifts the responsibility for controlling the CMC output to the PC application, and so itrequires 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 isfinished, the program analyzes the contents of the Input buffer to find out what happened while theSequence was running. A complex application may consist of several sequences, which areprogrammed, 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 steptime and a linear ramp.

    While the Sequencer can be used without the input buffer, it is very seldom done, since it is notcommon that applications requiring a high degree of precision in the control of the outputs do notrequire the same precision when it comes to the inputs. Additionally, it is practically impossible toextract information about or influence the running of the sequence from the outside, as well seewhen the Sequencer is discussed in more detail. The Sequencer and the Event Buffer have beendesigned to work together, and in this way the full potential of the CMC device can be unleashed.

    Debugging a CMEngine application

    It is not always easy to determine where and why a CMEngine program is failing to perform asexpected. While the error information provided by the CMEngine environment is complete anddetailed, the fact that the CMEngine 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 theerror 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 woulduse the following commands at the beginning of the code:

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

    OMICRON CMEngine

    32

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

    2.2 Analog outputsAs we advanced in section Internal structure of a CMC device on page 30, the analog output sectioncan be separated in three components: The signal generators, the routing and scaling layer and thevoltage and current amplifiers. This separation is only important when the system must be configured.Otherwise, the programmer addresses only a voltage or current output, and cares not what is behind.

    The signal generators are grouped in triples; they perform all the required calculations to produce ananalog voltage signal of the desired characteristics. This signal is emitted between +7.071 Vpeak and-7.071 Vpeak (10Vpeak on a CMC 256 or newer test set); in the case of a sine wave, this allows for amaximum rms value of 5V (7.071Vrms on a CMC 256 or newer test set). The signal can then berouted to an amplifier, either external or internal. Only triples can be routed to amplifiers, the routing ofindividual signals is not possible. One specialty to note here is that a triple does not necessarilyalways consist of 3 generators. It rather is a logical group of generators belonging together (in aCMC 151 the triples only contain one generator and the fourth internal voltage of a CMC 256 is alsoconsidered a triple).

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

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

    All signals in a triple have in common:

    Being voltage or current signals

    Being assigned to the same amplifier

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

    Programming the CMEngine

    33

  • More:

    Definition and routing of amplifiers on page 34Amplifier Configurations on page 37Defining the signal parameters on page 41

    2.2.1 Definition and routing of amplifiersAs we said in the previous section, before a signal triple can be used it must be routed to aconfiguration, or to an amplifier, which must in turn have been properly defined before. This sectiondeals with amplifier definition, routing to configurations will be described later.

    The CMEngine distinguishes between internal and external amplifiers, and between intelligent andstandard amplifiers. An intelligent amplifier is one that can provide its own definition data to the CMCunit; at this moment, only OMICRON amplifiers are intelligent. Any other amplifiers must be defined bythe user before they can be used.

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

    Voltage or current amplifier

    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 theamplification factor by dividing the maximum rms output value of the amplifier by 5Vrms.

    Maximum rms output of the amplifier, in A or V. Must be equal to or smaller than the amplificationfactor times the maximum low level output voltage of the CMC (5Vrms for CMCs prior to CMC 256,7.071Vrms for CMC 256 or newer test sets). CMEngine will not allow giving values higher than themaximum value to any signal routed to the amplifier.

    Minimum and maximum frequency, in Hz. This defines the frequency range for which the amplifieroperates. If the amplifier is capable of outputting DC values, the minimum frequency should be setto 0.

    Propagation delays for each of the possible phases, in seconds. The CMEngine will use thisinformation to shift waves so differences between channels are compensated and the phases ofthe signals are correct.

    More:

    Handling of internal amplifiers on page 34Handling of external amplifiers on page 36

    2.2.1.1 Handling of internal amplifiersTo know the number and nature of internal amplifiers, we use the out:cfg? command. This commandwill return the analog and binary outputs of the CMC. For a standard CMC 156, this command wouldreturn this string: 1,4,1/3/i,2/3/i,3/3/e,4/3/e;

    OMICRON CMEngine

    34

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

    Afterwards, we ask how many amplifiers are defined, using the command amp:def? and getting thefollowing 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?(1Result:1,int,v,2.500000E+001,1.250000E+002,0.000000E+000,1.000000E+003,0.000000E+000,0.000000E+000,0.000000E+000,CMC156,BC284H;amp:def?(2)Result:1,int,i,-2.500000E+000,1.250000E+001,0.000000E+000,1.000000E+003,0.000000E+000,0.000000E+000,0.000000E+000,CMC156,BB270T;

    The internal amplifiers of the CMC 156 are routed and defined by the CMEngine upon start-up; usuallythere is no need to redefine them, but it is possible to do so if required. Lets analyze one of thestrings, 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+0001.000000E+003

    Frequency range: the amplifier is capable of outputting DC voltages, and itsmaximum frequency is 1 kHz

    0.000000E+0000.000000E+0000.000000E+000

    Channel delays

    CMC 156 Device type

    BC284H Serial number of the amplifier

    Programming the CMEngine

    35

  • 2.2.1.2 Handling of external amplifiersExternal amplifiers are connected to the CMC via the CM Exif board. Intelligent amplifiers not onlyprovide their definition data to the CMC, but also can be turned off by the software when they have notbeen defined. In this way, intelligent amplifiers can be daisy-chained and controlled by software.

    Well look first at the definition of an external amplifier using the CMA 156 as example. This amplifier,as it is known, contains two current triples that can be used independently or grouped to create asingle triple with double the output current as each one of the individual triples. When connected to aCMC device, we must use first the amp:scan? command to obtain the list of external amplifiersconnected to the CM Exif board; afterwards, well use the amp:param? command for each of the IDsreturned:

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

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

    These parameters are read directly from the amplifiers by the amp:param? command. Before theyare available for use, we must define them; in the case of the CMA 156, we can choose whether wewant to use the triples independently or coupled. Lets do it both ways:

    1) Two independent triples

    amp:def(3,ext,1)amp:def(4,ext,2)amp:def?(3)Result : 1,ext,i,A,5.000000E+000,2.500000E+001,0.000000E+000,1.000000E+003,5.944444E-005,5.944444E-005,5.944444E-005,CMA156,DL373C;amp:def?(4) Result : 1,ext,i,B,5.000000E+000,2.500000E+001,0.000000E+000,1.000000E+003,5.944444E-005,5.944444E-005,5.944444E-005,CMA156,DL373C;amp:route(i(2),3)amp:route(i(3),4)

    OMICRON CMEngine

    36

  • We have assigned the two amplifiers available for external use to the triples in the CMA 156, and wehave obtained two totally independent current triples, each capable of outputting 25A as the definitioncommand reports to us. After assignation, we route them to two current logical triples so CMEnginecan 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 isrouted. Afterwards, we use the amp:def command with a list of external amplifiers; the softwarecouples them if possible, otherwise the command fails. After definition, we are left with a singleamplifier capable of outputting 50A. The software takes care of all details, and the user must only wireboth amplifiers in parallel and use them as one.

    For non-intelligent amplifiers, we must provide all the required parameters. The system cannot checktheir presence in the bus or whether they are turned on; this is the responsibility of the user. Forexample, to define an amplifier with the same characteristics as the triple A in the CMA 156 we woulduse the following command:

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

    2.2.2 Amplifier ConfigurationsAs mentioned before, a configuration is a virtual amplifier. Configurations are pre-defined in theamplifier, 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 ofphases. For amplifiers that admit paralleling of their outputs, like the CMA 156, CMC 256-6 or newertest 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 ofconfigurations, 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 areintelligent amplifiers connected, their configurations follow those of the CMC; please note that anamp:scan? command must be executed before the external amplifiers configurations are available.

    Programming the CMEngine

    37

  • For a CMC 156 with a CMS 156 amplifier connected, the commands would be like this:

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

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

    931.275000E+0025.000000E+0011.250000E+0024.000000E-001std0amp_no, 1

    Routing ID on page 38Number of Phases on page 38Maximum Output on page 39Maximum Power on page 39Output at Maximum Power on page 39Source Amplitude on page 39Mode on page 39Wiring Index on page 40List of amplifiers involved in the configuration on page 41

    Routing ID

    The routing ID is the argument we must pass to the amp:route command to use the givenconfiguration. The routing IDs from 1 to 8 are reserved for amplifiers defined with the amp:defcommand.

    It is very important to remember that the mechanisms to obtain the parameters for a defined amplifierand for a configuration are different. In the first case, we directly use the number returned by theamp:route? command to query the system via amp:def?.With configurations, the number returned by the amp:route? command is the routing ID, not theconfiguration number. This means that the programmer must maintain the link between routing IDsand configuration numbers.

    Alternatively, it is possible to store the parameters of all configurations indexed by the routing ID. Theconfiguration number is only necessary for the amp:cfg? command, and can be discarded once allconfigurations have been queried and all data obtained.

    Number of Phases

    This value represents the number of independent phases of the configuration. It is the number ofphases that will be addressable in the logical triple.

    OMICRON CMEngine

    38

  • Maximum Output

    Maximum output value of the configuration.

    Maximum Power

    The maximum power in VA that the configuration can reach.

    Output at Maximum Power

    This field represents the output value for which the maximum power is reached. It is not necessarilyequal to the maximum output.

    Source Amplitude

    Value of the maximum voltage (in current amplifiers) or current (in voltage amplifiers) that the systemcan output. Please note that these values are just an indication the power curves of the amplifiersare not linear, and their representation is to be found in the devices manual.

    Mode

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

    Mode Phases Description

    std 3 Standard. Each generator isused against N

    1 Standard for CMS 151

    ser12 1 Generator 1 is signal, generator2 is reference

    ser13 1 Generator 1 is signal, generator3 is reference

    ser4 1 Four generators tied together inseries. Generator 1 in amplifier1 is signal, generator 1 inamplifier 2 is reference.Generator 2 in both amplifiersare connected

    Programming the CMEngine

    39

  • Mode Phases Description

    gen2 1 Generator 2 is signal, N isreference

    par1 1 All three generators tiedtogether are signal, N isreference

    par3 3 Each generator tied together inparallel with the correspondinggenerators in all amplifiersinvolved; 1 with 1, 2 with 2, etc.Also N with N

    parser 1 All generators in amplifier 1 tiedtogether are signal, allgenerators in amplifier 2 tiedtogether are reference. Neutralsin both amplifiers are tiedtogether.

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

    Wiring Index

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

    Lets see as an example on how to set the CMC 156 current amplifier to get 80VA in single phasemode:

    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 theamp:cfg?(5) command. Connect the CMC test set as shown in the following illustration:

    OMICRON CMEngine

    40

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

    List of amplifiers involved in the configuration

    This is an enumeration of the amplifiers that are required to form the configuration. Each entry in thelist 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 (externalamplifiers). In both cases, the amplifier number follows, with type integer.For amp_no amplifiers, the number allows finding the amplifiers description in the return string of theamp: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 theamp:param? command.

    2.2.3 Defining the signal parametersThe signal parameters can be defined independently for each generator of each triple. To facilitateprogramming, it is possible to address multiple generators simultaneously. For instance, a commandsuch 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 isissued. The on command turns the outputs on if they happened to be off, and reprograms them withthe values set for the generators. Therefore, it is possible to change the signal parameters in anyorder, knowing that all changes will be applied simultaneously when the on command is issued. Thiscommand accepts a generator list or it can be applied to all analog signals simultaneously.

    More:

    Waveform on page 42Amplitude, phase and frequency on page 43

    Programming the CMEngine

    41

  • Waveform

    Each generator in the CMC can use up to two signal components, named sig(1) and sig(2); each ofthese components can be independently programmed, and then be added or multiplied together toform 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 themix command.

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

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

    Please note that the DC wave is an independent waveform, and it is not the same as settingthe frequency of the signal to 0. Setting the frequency to 0 is not permitted, and theCMEngine 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 ofthe way for simple cases where only a sine wave is required. By default, all commands apply to sig(1),which is programmed to be the sole component of the generators signal, so outputting a voltage sinewave of 50V through the internal voltage amplifier (defined and routed to v(1) by default) is as simpleas this:

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

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

    A certain amount of care is necessary when using multiplication of signal components to set up thewaveform. Each signal is assigned a "weight" equal to the ratio between the amplifiers maximumoutput and the signals amplitude. If the signal is set to the same amplitude as the maximum outputvalue of the amplifier, its weight is 1; if it is set to half the output value of the amplifier, its weight is 0.5,and so on.

    It is extremely important to take into account that the values for the amplifiers definition are rmsvalues; this makes the handling of sine waves straightforward, but can bring confusion when DC orsquare waves are used. The internal voltage amplifiers of a CMC 156, for example, return a maximumoutput value (rms) of 125V. This means that a sine wave with amplitude of 125V has a weight of 1.However, a DC component with a weight of 1 would have an amplitude of 125*2, or 176.775V. It is all

    OMICRON CMEngine

    42

  • right to assign an amplitude of 176.775V to a DC or square wave signals, since due to their shape nopart of the wave would be outside of the amplifiers peak limit. The same applies to the triangle wave,as there the amplitude command is taken as the peak value of the triangle.

    A small example will help to clarify matters. Lets multiply a sine wave by a square wave of the samefrequency and 50% duty cycle so we rectify the sine wave and make all its cycles positive. Weprogram the square waves amplitude to the amplifiers maximum, so its weight is 1 and it does notmodify the sine wave in any way.

    Our first instinct would be to write the code like this:

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

    Since we know, or have obtained from the CMEngine, that 125 is the maximum amplifiers output. Theoutput of this code, though, would be a wave smaller than expected. The correct code would be:

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

    Amplitude, phase and frequency

    By default, these values are set to 0. It must be noted that 0 is a valid value for amplitude and phase,but not for frequency. Therefore, it must be set to a value within the CMC range before issuing the oncommand.

    When the values for a generator have not been modified, and we issue an on command that affectsthat generator, the amplitude and frequency are not altered. The phase however is set to the originalvalue, which may cause an unintended phase jump. For example, if we execute the following set ofcommands:

    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 5out:v(1:3):a(1);p(180)out:on

    Programming the CMEngine

    43

  • It is obvious that we want to output a balanced three-phase voltage system, with amplitude 50V andfrequency 60Hz, and after 5 seconds to set the voltage in L3 to 1V.

    The system should stay unchanged except for the magnitude and phase of VL3; but with thesecommands there will be a phase jump as the other two phasors shift to their original phase angles of 0and -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 mostlikely we wanted to reverse the phase angle the wave had when we issued the on command.

    To avoid this, the CMEngine allows setting how the phase parameter should be interpreted. Inabsolute phase mode, the phases are applied with each new on command as described above. Indifferential mode though the difference between the newly set phase value and the previous phasevalue is applied to the phase angle of the wave the instant the on command is issued. Usingdifferential 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 5out: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 CMCcan compensate for the amplifiers delays. When the system is set to differential mode, the oncommand applies to the analog signals the difference between the new setting and the previoussetting. This value is applied to the signals at whatever status they are when the on command isissued. In this example, VL1 and VL2 will continue unchanged, and VL3 will be shifted 180 - not setto 180 as before.

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

    out:ana:pmode(diff(v|i())

    where must be an individual voltage or current generator, not a triple. Themain usefulness of this command is to keep the phase shifts between generators when theirfrequencies change independently to each other. Ordinarily, each on command would consider only agiven generators phase settings to set the generators phase. With the differential mode withreference channel, the on command applies the differences between the generators phase and thereference generators phase. This mode can be considered as an extension of the diff mode forgenerators with different frequencies. If this mode did not exist, only the abs mode would keep thephase shifts between generators having different frequencies.

    OMICRON CMEngine

    44

  • Note that the current implementation of this command requires the phase of the referencegenerator 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 signalsby either adding (mix(add)) or multiplying (mix(mult)) them, only the absolute phase mode isavailable. When using a different phase mode, an error will be issued.

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

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

    This code would cause both generators to jump to phase 0, v(1:1) because that was its original settingand 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 generatoralready had. Since both generators have different frequencies, the phase shift between them after thecommand 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, sothis code would leave v(1:1) unchanged; v(1:2) on the other hand would be set to the phase shiftbetween itself and v(1:1). With the new settings this shift is 0, so v(1:2) would experiment a phasejump to set it to the same phase as v(1:1).

    An interesting and useful feature that CMEngine provides is the possibility to set a step value for eachmagnitude and then apply all steps simultaneously. This allows for easy and convenient variation ofamplitude, phase and/or frequency for each or all signals. All step values will be added simultaneouslyupon the execution of the out:step command. Since it is not possible to read back the values that are

    Programming the CMEngine

    45

  • being output, the user must keep count of the number of step commands issued. Also, after an offcommand, the next on will return the original values set to the generators, losing all the incrementsapplied with the step command.

    It is most likely that you will want to use the differential phase mode (pmode(diff)) when using thestepping feature since the phase angles of all affected generators would be reset to the originallyspecified value for each step. This is because a step command is a variation of the on command andtherefore performs the same calculations which would cause setting the phase angle to what wasspecified based on the out:ana:..:p() command.

    2.3 Binary outputsThe 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 turnthem 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 alloutput 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 outputmodule located in an external IO expansion device (like CMB IO). The exact details about this virtualmodule can be retrieved by using the out:bin():cfg? command. Whenever there isa CMC with a connected CMB the available virtual output modules consist of the CMC internal relayoutputs (accounting for one virtual module), the CMC internal transistor outputs when available (asecond virtual module) and the output modules of the CMB, if any. Within a module, the outputs aredivided 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 thenumber of modules, and then issue a out:bin():cfg? for each of those modules toget information about them, including the number of groups. Then for each group we may issue aout:bin(,):cfg? command to get the groups characteristics, althoughthis is not necessary to handle the outputs from CMEngine (it is useful to know how to wire the outputsthough). If we know that we are addressing only a CMC unit, then we know in advance there will beone or two output modules, module 1 being the four contact outputs in the front panel and module 2being the transistor outputs in the back panel (when available), so there is no need to go through thefull process. We must be aware though that, by hard-coding the module numbers in our program, weare 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 theothers, we would issue this command: out:bin(1):on(1,3). If we had wanted to close those two and atthe same time make sure that contacts 2 and 4 are open, we would have issued (since we know weaddress virtual module 1) the command out:bin(1):set(0b0101). The equivalent commands operatingon the transistor outputs would be out:bin(2):on(1,3) and out:bin(2):set(0b0101).

    OMICRON CMEngine

    46

  • 2.4 Analog inputsThe analog inputs can be used both by polling their status and by recording their changes as eventsinto 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? andinp:ana:v(1):get? will read the DC inputs of a CMC 56CMC 56/151/156 and will return the readings inA and V respectively. At present all CMC devices having analog DC inputs have one DC Voltage inputand one DC current input, so there are no indexes above 1 for these commands.

    2.5 Binary inputsThe binary inputs can be used both by polling their status and by recording their changes as eventsinto the input buffer. This latter method is far more pow