en
  • English
  • German
  • Chinese

Knowledge-Base

SBench Sequence Script

SBench 6 can be controlled by simple text based scripts. A script can be given as start parameter to SBench 6. This allows to control SBench 6 from a  batch file by calling SBench 6 together with a script file.

SBench 6 Script files are plain text files with the extension sb6seq. Each line contains one command.

Script Calling

The script is loaded during runtime using a start paramater:

SBench6.exe -example.sb6seq

Setup

  • SB6_LOAD_PROJECT [File]: a project file sb6prj is loaded.The [File] paramter describes an absolue path (for example C:/Users/Spectrum/SB6_ApplicationData/projects/fft average/fft average.sb6prj. Please note that the installed card(s) must match the cards that are stored in the project file
  • SB6_LOAD_CONFIG [File]. A configuration file sb6cfg is loaded. The [File] paramter describes an absolue path. Please note that the configuration files have been replaced by project files that contain more information. LOAD_CONFIG should only be used for older configuration files

Commands

  • SB6_START_SINGLE: a single acqusition is started once. This can be a singleshot or a FIFO acquisition depending on the project setup
  • SB6_START_LOOP: an acquisition loop is started. SBench 6 will immediately start the next acqusition after the last acquisition has been terminated. This will run forever until a stop command is issued or the software is terminated
  • SB6_WAIT_SEC [Seconds]: the script waits for a specified number of seconds until the next command is issued
  • SB6_WAIT_JOBS_DONE: the script waits until all current calculations and export commands have finished their job. This command is needed if multiple nested calculations are running after an acquisition
  • SB6_STOP: all current acquisitions and calculations are stopped. SBench 6 goes back into idle state.
  • SB6_APP_QUIT: SBench 6 program is quit
  • SB6_LOOP_START [Loops]: the next part until LOOP_END is repeated a defined number of times.
  • SB6_LOOP_END: closing command of a loop

Data Processing/

  • SB6_EXPORT_DATA [ExportFormat] [FileName]. The current data is exported to file. Export format is set in the project file and can't be changed by the script. The [ExportFormat] defines one of the following export modes:
    - SB6: standard SBench 6 file format *.sb6dat
    - SB5: SBench 5 file format *.sb5
    - BIN: Pure binary export *.bin
    - WAV: export as wave file *.wav
    - MATLAB: export as matlab file *.mat
    - ASCII: ASCII export *.txt
    - VCD: Value Change Dump export (digital files) *.vcd
  • SB6_CALL_PROGRAM [Program] [Params]: an external program is called. The [Program] parameter describes an absolue path (for example C:/Users/Spectrum/SB6_ApplicationData/scripts/send acquisition file). The [Params] paramter describes a number of call parameters that are forwarded to the called program.

Examples

Single predefined acquisition. Data is stored according to project settings:

SB6_LOAD_PROJECT C:/Users/Spectrum/SB6_ApplicationData/projects/test1/test1.sb6pr
SB6_START_SINGLE
SB6_WAIT_JOBS_DONE
SB6_APP_QUIT

Do one acquisition per minute, store this as ASCII file and let an external program execute some further analysis on this. The whole process should run for 24 hours

SB6_LOAD_PROJECT C:/Users/Spectrum/SB6_ApplicationData/projects/test1/test2.sb6pr
SB6_LOOP_START 1440
    SB6_START_SINGLE
    SB6_WAIT_JOBS_DONE
    SB6_EXPORT_DATA ASCII c:/testresults/testresult.txt
    SB6_CALL_PROGRAM c:/testresults/analysis.exe -showresult
    SB6_WAIT_SEC 60
SB6_LOOP_END
SB6_APP_QUIT

Contact

On location for you. Choose your region.

Europe USA Asia
Contact Europe
Phone +49 (0)4102 6956-0
Fax +49 (0)4102 6956-66
E-Mail info@spec.de
Contact USA
Phone +1 (201) 562-1999
Fax +1 (201) 820-2691
E-Mail sales@spectrum-instrumentation.com
Contact Asia
Phone +61 402 130 414
E-Mail greg.tate@spectrum-instrumentation.com
Support

Request support. We are happy to help.

Support