acq400
acq400.py interface to one acq400 appliance instance
enumerates all site services, available as uut.sX.knob
monitors transient status on uut, provides blocking events
read_channels() reads all data from channel data service.
simple property interface allows natural “script-like” usage
eg:
uut1.s0.set_arm = 1equivalent to running this on a logged in shell session on the UUT:
set.site1 set_arm=1
- class AcqPorts[source]
Bases:
object
uut server port constants
- TSTAT = 2235
- STREAM = 4210
- SITE0 = 4220
- SEGSW = 4250
- SEGSR = 4251
- DPGSTL = 4521
- GPGSTL = 4541
- GPGDUMP = 4543
- WRPG = 4606
- DIO482_PG_STL = 45001
- DIO482_PG_DUMP = 45003
- BOLO8_CAL = 45072
- DATA0 = 53000
- DATAT = 53333
- MULTI_EVENT_TMP = 53555
- MULTI_EVENT_DISK = 53556
- DATA_SPY = 53667
- LIVETOP = 53998
- ONESHOT = 53999
- AWG_ONCE = 54201
- AWG_AUTOREARM = 54202
- AWG_CONTINUOUS = 54205
- AWG_STREAM = 54207
- MGTDRAM = 53993
- MGTDRAM_PULL_DATA = 53991
- SLOWMON = 53666
- class AcqSites[source]
Bases:
object
uut site constants
- SITE0 = 0
- SITE1 = 1
- SITE2 = 2
- SITE3 = 3
- SITE4 = 4
- SITE5 = 5
- SITE6 = 6
- SITE_CA = 13
- SITE_CB = 12
- SITE_CC = 11
- SITE_DSP = 14
- SITE_HUDP = 10
- class SF[source]
Bases:
object
uut system state constants
- STATE = 0
- PRE = 1
- POST = 2
- ELAPSED = 3
- DEMUX = 5
- class STATE[source]
Bases:
object
transient state constants
- IDLE = 0
- ARM = 1
- RUNPRE = 2
- RUNPOST = 3
- POPROCESS = 4
- CLEANUP = 5
- class RawClient[source]
Bases:
Netclient
handles raw data from any service port
- __init__(addr, port)[source]
init RawClient
- Parameters:
addr (str) – ip or hostname
port (int) – service port see AcqPorts
- class ChannelClient[source]
Bases:
RawClient
handles post shot data for one channel.
- Parameters:
addr (str) – ip address or hostname
ch (int) – channel number 1..N
- class Statusmonitor[source]
Bases:
object
monitors the status channel
Efficient event-driven monitoring in a separate thread
- st_re = re.compile('([0-9]) ([0-9]+) ([0-9]+) ([0-9]+) ([0-9])+')
- st_shot_re = re.compile('SHOT=([0-9]),([0-9]+),([0-9]+),([0-9]+)')
- st_failed_to_find_event_re = re.compile('ERROR EVENT NOT FOUND')
- st_timer_re = re.compile('Timer::report\\(([0-9]+)\\) ([A-Z]{3}) ([0-9]+) msec')
- trace = 0
- class Acq400[source]
Bases:
object
Host-side proxy for Acq400 uut.
acq400 discovers and maintains all site servers, maintains a monitor and handles multiple channel post shot upload
- classmethod create_uuts(uut_names)[source]
create_uuts(): factory .. create them in parallel
* Experimental Do Not Use *
- uuts_methods = {}
- uuts = {}
- __init__(_uut, monitor=True, s0_client=None)[source]
init acq400
- Parameters:
_uut (srt) – uut hostname or ip-address
monitor (bool, optional) – start statusmonitor. Defaults to True.
s0_client (netclient.Siteclient, optional) – existing siteclient. Defaults to None.
- chan2volts(chan, raw)[source]
returns calibrated volts for channel
- Parameters:
chan (int) – channel index
raw (ndarray) – uncalibrated data array
- Returns:
calibrated data array
- Return type:
ndarray
- read_chan(chan, nsam=0, data_size=None)[source]
Reads a channels data
- Parameters:
chan (int) – channel number
nsam (int, optional) – Number of samples. Defaults to 0.
data_size (int, optional) – data size in bytes. Defaults to None.
- Returns:
ndarray
- nchan()[source]
gets total number of channels
can include scratchpad
- Returns:
number of channels
- Return type:
int
- read_channels(channels=(), nsam=0, localdemux=False)[source]
read selected channels post shot data.
uut_demux_enabled() == False: UUT did NOT demux the data, data order [sample][channel] uut_demux_enabled() == True: UUT did demux the data, data order [channel][sample]
DEMUX is a synonym for uut_demux_enabled()..
channels=(0) : return all (bulk) data, likely in raw[sample][channel] format. channels=(0) localdemux=True: return all (bulk) in demux[channel][sample] format.
channels=N or channels=(N,N1,N2 ..) # N >= 1 && N <= NCHAN
There are 4 cases: channels=(1,2…nchan) and (remote) DEMUX=1: SIMPLE, pull each channel at a time from the UUT. channels=(0) and DEMUX=0 : SIMPLE: return the raw data.
channels=(1,2..) and DEMUX=1 : demux locally.
channels=(0) and DEMUX=0 and localdemux : demux locally, return bulk data [channels][samnples]
- Parameters:
channels (tuple, optional) – tuple contining channels to read . Defaults to all.
nsam (int, optional) – Number of samples. Defaults to 0.
localdemux (bool, optional) – demux data. Defaults to False.
- Returns:
channel data
- Return type:
ndarray
- load_stl(stl, port, trace=False, wait_eof=True, wait_eol=True)[source]
Send a STL file to the specified port
- Parameters:
stl (str) – stl string each line seperated by newlines
port (int) – port num see AcqPorts
trace (bool, optional) – print each line sent. Defaults to False.
wait_eof (bool, optional) – wait for end of file. Defaults to True.
wait_eol (bool, optional) – wait for end of line. Defaults to True.
- load_gpg(stl, trace=False)[source]
Send stl to GPG port
- Parameters:
stl (str) – stl string each line seperated by newlines
trace (bool, optional) – print each line sent. Defaults to False.
- load_dpg(stl, trace=False)[source]
Send stl to DPG port
- Parameters:
stl (str) – stl string each line seperated by newlines
trace (bool, optional) – print each line sent. Defaults to False.
- load_awg(data, autorearm=False, continuous=False, repeats=1, port=None)[source]
Load and config a AWG pattern
- Parameters:
data (str) – AWG pattern
autorearm (bool, optional) – Rearm and wait after run. Defaults to False.
continuous (bool, optional) – Run pattern continuously. Defaults to False.
repeats (int, optional) – Number of pattern repetitions. Defaults to 1.
- run_service(port, eof='EOF', prompt='>')[source]
Run a service on the uut
- Parameters:
port (int) – service port see AcqPorts
eof (str, optional) – end connection on character. Defaults to “EOF”.
prompt (str, optional) – prompt character. Defaults to ‘>’.
- Returns:
service transcript
- Return type:
str
- configure_post(role, trigger=[1, 1, 1], post=100000)[source]
Configure UUT for a regular transient capture
- Parameters:
role (str) – uut role
master
orslave
trigger (list, optional) – Trigger trinary. Defaults to [1,1,1].
post (int, optional) – post samples. Defaults to 100k.
- configure_pre_post(role, trigger=[1, 1, 1], event=[1, 1, 1], pre=50000, post=100000)[source]
Configure UUT for pre/post mode.
Default setup: soft trigger starts the data flow and trigger the event on a hard external trigger.
- Parameters:
role (str) – uut role
master
orslave
trigger (list, optional) – Trigger trinary. Defaults to [1,1,1].
event (list, optional) – Event trinary. Defaults to [1,1,1].
pre (int, optional) – pre samples. Defaults to 50k.
post (int, optional) – post samples. Defaults to 100k.
- configure_rtm(role, trigger=[1, 1, 1], event=[1, 1, 1], post=50000, rtm_translen=5000, gpg=0)[source]
Configure UUT for rtm mode.
Default setup: external trigger starts the capture and takes 5000 samples, each subsequent trigger gives us another 5000 samples.
GPG can be used in RTM mode as the Event. If you are using the GPG then this function can put the GPG output onto the event bus (to use as an Event for RTM).
- Parameters:
role (str) – uut role
master
orslave
trigger (list, optional) – Trigger trinary. Defaults to [1,1,1].
event (list, optional) – Event trinary. Defaults to [1,1,1].
post (int, optional) – post samples. Defaults to 100k.
rtm_translen (int, optional) – translen. Defaults to 5000.
gpg (int, optional) – _description_. Defaults to 0.
- configure_transient(pre=0, post=100000, sig_DX='d0', auto_soft_trigger=0, demux=1, edge='rising')[source]
Configure uut for transient capture.
- Parameters:
pre (int, optional) – pre samples. Defaults to 0.
post (int, optional) – post samples. Defaults to 100k.
sig_DX (str, optional) – signal line responsible for
trigger
orevent
. Defaults to ‘d0’.auto_soft_trigger (int, optional) – automatically soft trigger. Defaults to 0.
demux (int, optional) – demux data on/off. Defaults to 1.
edge (str, optional) – trigger edge. Defaults to ‘rising’.
- configure_rgm(role, trigger=[1, 0, 1], event=[1, 1, 1], post='100000', gpg=0)[source]
Configure UUT for RGM mode
- Parameters:
role (str) – uut role
master
orslave
trigger (list, optional) – Trigger trinary. Defaults to [1,0,1].
event (list, optional) – Event trinary. Defaults to [1,1,1].
post (int, optional) – post samples. Defaults to 100k.
gpg (int, optional) – Put GPG output onto the event bus (to use as an Event for RGM). Defaults to 0.
- get_demux_state()[source]
Returns the current state of demux
Beware: if demux is set after the shot then this function will return the new state. There is no way to determine what the state was during the previous shot.
- pull_plot(channels=(), demux=-1)[source]
This function returns an array of the specified channels and plots the data.
Pulls data from 53000 or 5300X and will return the corresponding data from each 5300X port (if demux is on) or will return the corresponding data filtered from 53000 if demux is off.
- Parameters:
channels (tuple, optional) – tuple containing channel indexes. Defaults to ().
demux (int, optional) – 1 demux on 0 demux off -1 autodetect. Defaults to -1.
- get_ai_channels()[source]
Gets total number of AI channels
nchan can sometimes include scratchpad
- Returns:
total AI channels
- Return type:
int
- get_site_types()[source]
gets all sites grouped by site type
- Returns:
AISITES, AOSITES, and DIOSITES
- Return type:
dict
- get_es_indices(file_path='default', nchan='default', human_readable=0, return_hex_string=0)[source]
Returns the location of event samples.
- Parameters:
file_path (str, optional) – data source. Can load from file. Defaults to from uut.
nchan (int, optional) – total chans use when loading from file. Defaults to from uut.
human_readable (int, optional) – returns hex interpretations of the event sample data. Defaults to 0.
return_hex_string (int, optional) – if 1 and human_readable 1 returns single string containing all of the event samples. Defaults to 0.
- Returns:
[ [Event sample indices], [Event sample data] ]
- Return type:
list
- stream(recvlen=131072, port=4210, data_size=2)[source]
Runs stream and yields data buffers
- Parameters:
recvlen (_type_, optional) – buffer size. Defaults to 4096*32.
port (_type_, optional) – uut port. Defaults to AcqPorts.STREAM value.
data_size (int, optional) – data size in bytes. Defaults to 2.
- Yields:
ndarray – data buffer
- class Acq2106[source]
Bases:
Acq400
Acq2106 specialization of Acq400
Defines features specific to ACQ2106
- __init__(_uut, monitor=True, s0_client=None, has_dsp=False, has_comms=True, has_wr=False, has_hudp=False)[source]
init acq2106
- Parameters:
_uut (srt) – uut hostname or ip-address
monitor (bool, optional) – start statusmonitor. Defaults to True.
s0_client (netclient.Siteclient, optional) – existing siteclient. Defaults to None.
has_dsp (bool, optional) – if uut has dsp. Defaults to False.
has_comms (bool, optional) – if uut has comms. Defaults to True.
has_wr (bool, optional) – if uut has white rabbit. Defaults to False.
has_hudp (bool, optional) – if uut has hudp. Defaults to False.
- class Acq2106_Mgtdram8[source]
Bases:
Acq2106
Mgtdram8 specialization of Acq2106
Defines features specific to Acq2106_Mgtdram8
- MGT_BLOCK_BYTES = 4194304
- MGT_BLOCK_MULTIPLE = 16
- __init__(uut, monitor=True, s0_client=None)[source]
init Acq2106_Mgtdram8
- Parameters:
_uut (srt) – uut hostname or ip-address
monitor (bool, optional) – start statusmonitor. Defaults to True.
s0_client (netclient.Siteclient, optional) – existing siteclient. Defaults to None.
- class Acq2106_TIGA[source]
Bases:
Acq2106
TIGA specialization of Acq2106
Defines features specific to Acq2106_TIGA
- __init__(uut, monitor=True, s0_client=None)[source]
init Acq2106_TIGA
- Parameters:
_uut (srt) – uut hostname or ip-address
monitor (bool, optional) – start statusmonitor. Defaults to True.
s0_client (netclient.Siteclient, optional) – existing siteclient. Defaults to None.