Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Reference

The crucible command

$ crucible --help
Crucible — simulador de bancos de instrumentos SCPI por red

USO
  crucible                         arranca el banco por defecto (ver abajo)
  crucible <banco.yaml>            arranca todos los instrumentos del banco
  crucible <perfil.yaml> [puerto]  arranca un solo instrumento (puerto 5025)
  crucible --validar <fichero>     comprueba un banco o perfil sin arrancarlo
  crucible --version

BANCO POR DEFECTO (sin argumentos), el primero que exista de:
  1. banco.yaml en el directorio actual
  2. banco/banco.yaml junto al ejecutable            (instalación Windows)
  3. ../share/crucible/banco/banco.yaml               (instalación Linux)

Cada instrumento tiene su dirección. Desde VISA:
  TCPIP0::127.0.0.1::<puerto>::SOCKET  (transporte tcp)
  TCPIP0::127.0.0.2::inst0::INSTR      (transporte vxi11)

Como en un banco real, cada instrumento puede tener su propia IP: en Linux
todo 127.x.x.x es local y no hay que configurar nada; en Windows solo
responde 127.0.0.1, y ahí se distinguen por el puerto.

Los instrumentos vxi11 necesitan además el portmapper en UDP 111 de su IP,
que es un puerto privilegiado: en Linux hace falta sudo o setcap.

Manual: https://anlaco.github.io/Crucible/
FormWhat it does
crucibleStarts the first bench it finds: banco.yaml in the current folder, then next to the executable, then the installed one.
crucible <banco.yaml>Starts every instrument on the bench.
crucible <profile.yaml> [port]Starts a single instrument, without a bench. Port 5025 if not given.
crucible --validar <file>Checks a bench or a profile without opening ports. Exits with code 1 on errors.
crucible --versionThe version.
crucible --helpThe help. Also -h and --ayuda.

Whether the file is a bench or a profile is decided by its content, not by an option: it has banco: or it has dispositivo:.

Any error makes crucible exit with code 1. With no arguments —usually a double-click on Windows— it also waits for you to press Enter, so the window does not close before you can read why.

banco.yaml

banco:
  nombre: <text>                    # optional
  dispositivos:
    - id: <text>                    # required
      perfil: <path>                # required; relative to banco.yaml
      transporte:
        tipo: tcp                   # required; today only tcp
        puerto: <number>            # required; different for each device
        host: <address>             # optional; 127.0.0.1 by default
      estado_inicial:               # optional
        <variable>: <value>

host decides which interface the device listens on. By default 127.0.0.1, this computer only. With host: 0.0.0.0 it listens on all of them, and another computer on the network can connect; in that case the start-up table shows TCPIP0::0.0.0.0::…, which is not an address you can connect to: use the IP of the computer running Crucible. Access from another computer is not verified in this manual.

Profile

dispositivo:
  modelo: <text>                    # required
  idn: <text>                       # answer to *IDN?
protocolo: scpi                     # required

estado:
  <variable>: <number | true | false | text>

comandos:
  - patron: <header>                # required; no '?', no arguments, no '*'
    query: <true | false>           # false by default
    args: [<name>, ...]
    muta: { <variable>: <value | "<arg>"> }
    respuesta: <text with {variable} and <arg>>   # queries
    modelo: <model name>                          # queries

modelos:
  <name>:
    tipo: formula                   # required
    expr: <formula>                 # required
    cuando: { <variable>: <value> }
    fallback: <number | text>       # 0.0 by default
    formato: <entero | fijo:N | cientifico:N>

Formulas

ElementExamples
Variablestension, carga_ohm
Numbers10, 0.5, 1e-3, 2.5E+2
Operators+ - * /, parentheses, unary minus
Functionsgauss(mean, sigma), abs(x), sqrt(x), min(a, b), max(a, b)

SCPI errors you will see

ErrorWhen
0,"No error"The queue is empty.
-113,"Undefined header;…"The header is not in the profile, or not as a command or query.
-200,"Execution error;…"A formula could not be evaluated, e.g. a variable that is not in estado.