Experix - Syntax

Syntax

A command line can have practically arbitrary length, and is a series of tokens. For example,
.01 1000 ]+ \c .sin * graph/yK function1=
would create an array of 1000 double-precision values representing the function j*0.01*sin(j*.01) for j from 0 to 999; draw a graph of that using black points on a yellow background; and copy that array into a variable called function1. This sample of command tokens will give an idea of the range of capabilities that experix has.

  • 123e4
    puts the double-precision number 1.23*10^6 on the stack
  • #x5a1
    puts the integer 0x5a1 on the stack
  • +
    adds the object in stack level 1 to the object in level 2; what that means exactly depends on what those objects are: add two numbers, or add a number to each member of an array, or add corresponding members of two arrays
  • .cos
    replaces the number in stack level 1, or each member of the array in stack level 1, with cosine(that number)
  • ;c
    puts the speed of light on the stack
  • :BS
    sets the bit designated by stack level 1 (integer) in the integer in stack level 2; does arrays too
  • ]
    makes an array from numbers on the stack
  • ]+
    makes a ramp array using the increment value in level 2 and number of elements in level 1
  • [=
    sets the value of an array element
  • [s
    extracts a subspace of an array as specified by stack arguments
  • %v
    gets the smaller value of two stack objects
  • \/D
    (that's backslash,slash,D) decodes the option characters which follow the name of a command in a command string
  • ?\/
    displays the help file about the command-option operators
  • ??fft
    starts a virtual terminal session with a text editor loaded with the help file about the Fourier transform function
  • &path
    runs the commands from the file specified by "path"
  • $9:
    command string label number 9
  • >=$9
    if the value in stack level 1 is greater than that in level 2, command execution branches to label $9:
  • >D
    makes a deferred command

  • runs a deferred command
  • ,3s
    sets command string local variable number 3
  • |
    concatenates two strings or arrays
  • )
    makes a complex number from two numbers or a complex array from two arrays
  • .>3Y
    makes an unsigned 1-byte number or array with values from stack level 3, which may be in any numerical type
  • \d
    drops stack level 1
  • \;3u
    gets the number of data units in the object in stack level 3
  • >0A
    makes a truth value: 1 (true) if all members of the array in stack level 1 are greater than 0; 0 (false) otherwise
  • def
    creates variables and commands
  • graph
    draws graphs
  • exec
    runs programs and collects the standard output and standard error in files that can be displayed or edited by special help operators
  • file
    transfers data between files and stack objects
  • xcd
    performs operations on experix device files

Experix provides hardware operations by way of a command-line interface to device drivers. An experix driver has a 'read' entry point which functions more like an ioctl. It copies the integer array that experix has prepared, finds in it an operation code and supporting information, performs the operation and returns results to the array. The driver maintains a control page which experix maps with read-only permission, and a number of data pages which are mapped with read-write permission. The xcd function performs this memory mapping and creates command variables that represent the data pages. These variables can then be used in command strings to perform data display and analysis.

A data acquisition device driver has an interrupt handler which uses data from the output pages and stores data in the input pages. At designated index values it sends the new data signal to experix. The xcd function is used to bind the signal to an experix command string. Then that command is executed whenever the new data signal comes. A device handler command might update variables, perform analysis functions, draw graphs and issue warnings. It runs atomically, which means it uses a separate stack and runs uninterrupted between two tokens in whatever user command happens to be in progress.

Read more about this topic:  Experix