MDSplus Support - Host Side scripts and MDSplus On Board
D-TACQ intelligent digitizers are deployed at a number of large MDSplus installations. Experienced users at these sites have developed their own TDI scripts to interface to the D-TACQ device support. The control part comprises scriptable ASCII commands, while data transfer uses large binary vectors for efficiency. The standard MDSplus distribution includes a set of TDI drivers. The cards may be located in a common PCI backplane with an embedded x86 computer, or - increasingly commonly - remotely as standalone ethernet nodes. D-TACQ provides the "HUB" driver to provide a common interface, so that the same TDI script is unaware whether the target card is on the local PCI backplane or remote on Ethernet.
In addition, D-TACQ has embedded a custom MDSplus thin client on the card, and this is capable of submitting the post shot data directly back to an MDSIP server. The thin client provides a simple way to script MDSTCP commands from shell scripts.
We think an ideal use case is to use the standard host side TDI scripting to setup and initiate the capture, posting a "stored upload procedure" to the card and then to have the card execute the stored upload procedure when the data is available. We think this is the maximal scaleable solution. A variation on this theme is to use "Pre Programmed Triggers" - the card is involved in a long capture, but at intervals submits pre defined data sets to the MDSplus server autonomously, while the capture continues to local memory.
The Thin Client features the high level Channel-Aware command mdsPutCh, capable of uploading the channelized data for any and all channels. Even better it supports timebase selection and can include voltage calibration for each input range in the channel expression.
# first, at boot time, you need to connect to the server
# (this could go in /ffs/rc.local in a turnkey unit)
# Add these three commands to post shot script /usr/local/bin/acq200.pp
# and enjoy automated, target push post shot data upload.
mdsPutCh --expr %CAL --field ACQ216_023:CH%02d 1:16
# in this case, mdsPutCh uploads all the data for channels 1:16,
# together with their individual calibration expressions,
# to the mdsPlus field specified by the sprintf() style field string.
# We need to call open on the TREE each time, because we are expecting a new shot file.
The Thin Client also supports MDSplus Long Pulse Segments. This enables a "Live Scope" mode, as well as allowing channel data upload to the limit of memory.
Higher performance applications such as Continuous Streaming feature upload of raw data from the digitizer, followed by a host-side process of data demux and submit to the data tree.
- jScope-o-matic : We use jScope for data display - it is an excellent display tool, but when you have tens and hundreds of channels to configure, doing it by point-and-click can be tedious, so we use jScope-o-matic to autogenerate jScope configuration files for us.
Canonical Tree generator : We use a simple script to generate test trees for use with our cards. make_acqtree.tar
To install make_acqtree
cd /usr/local;sudo tar xvf make_acqtree.tar
To make a tree:
configure TREE_path in the normal way (eg add to /usr/local/mdsplus/local/envsyms, login again)
./make_acqtree TREE host1,channels1 [host2,channels2 ...]
make_acqtree gts_test acq196_064,96 acq196_065,96, acq196_067,96
TIP: tree name for make_acqtree MUST in Lower Case
MDSplus Thin Client Synopsis:
The mdsplus Thin Client "mdsshell" is implemented as a local proxy server that will create and hold up a connection to a MDSIPD, and a series of client commands that will communicate with the proxy server. The client commands are regular one-shot programs that are readily scriptable using the shell.
- mdsConnect host
- mdsOpen tree
- mdsPut [opts] expression
- mdsPutCh [opts]
- mdsValue [opts] expression
Example using MDSplus Thin Client to load AWG waveforms, and download data post shot.
MDSplus Thin Client - also useful Host-Side:
Ability to script tree access from the shell is useful host side, especially for users who don't have licenses for proprietary math tools.
D-TACQ makes extensive use of the excellent, free GNU-Octave package for math analysis and signal generation.
The octave interface to mdsshell is implemented as a simple wrapper
Example Octave session: creating an AWG data set for ACQ196 FAWG
[pgm@islay AWG]$ octave
GNU Octave, version 2.1.71 (i686-pc-linux-gnu).
Copyright (C) 2005 John W. Eaton.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTIBILITY or
FITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'.
Additional information about Octave is
available at https://www.gnu.org/software/octave/.
LOADPATH = ~/.octave:
octave:1> mds # load mds support
octave:3> t=1:512; # generate some data
octave:7> mdsConnect("kilda"); # connect MDSIPD
octave:8> mdsOpen("iroko"); # open the TREE
# and store data
octave:9> putRamps("ACQ196_010AO", t, 1, 8);
mdsPut( ACQ196_010AO:CH01 ) OK
mdsPut( ACQ196_010AO:CH02 ) OK
mdsPut( ACQ196_010AO:CH03 ) OK
mdsPut( ACQ196_010AO:CH04 ) OK
mdsPut( ACQ196_010AO:CH05 ) OK
mdsPut( ACQ196_010AO:CH06 ) OK
mdsPut( ACQ196_010AO:CH07 ) OK
mdsPut( ACQ196_010AO:CH08 ) OK
octave:10> putRamps("ACQ196_010AO", r, 9, 16);
mdsPut( ACQ196_010AO:CH09 ) OK
mdsPut( ACQ196_010AO:CH10 ) OK
mdsPut( ACQ196_010AO:CH11 ) OK
mdsPut( ACQ196_010AO:CH12 ) OK
mdsPut( ACQ196_010AO:CH13 ) OK
mdsPut( ACQ196_010AO:CH14 ) OK
mdsPut( ACQ196_010AO:CH15 ) OK
mdsPut( ACQ196_010AO:CH16 ) OK
|Source Data plotted on jScope