Beamline Instrument Software Support |
|
SPEC Macro documentation:
[ Macro Index |
BCU Home ]
|
WAGOCORE.MAC | ||||||
[ source code | installed at | configured at ] | ||||||
See other macros in category: All | ||||||
Description:
| ||||||
Documentation:
This macro set provides basic functionality and utilities to access Wago I/O stations through the device server class Wagods. It also provides a simple way to declare I/O channels as spec pseudomotors or pseudocounters. EXAMPLE DEPENDENCIES ============================================================= ============================================================= 2018/05/03 - rh __wagopseudocheck: included double check of mnemonic to solve the issue associated to the new spec version (eval inside cnt_num() and motor_num() ============================================================= ============================================================= jtdo("stlist") SETUP | ||||||
Macros:
Usage: wagosetup <wagoname1> [<wagoname2> [...]] Declares new Wago I/O stations. The corresponding device server(s) must be running and the device names be in conformity with the BLISS convention (<blname>/<wagoname>/wc). All the logical names declared to the device server become accesible through this macro set. This line must be included in the spec setup file. wagopseudosetup Usage: wagopseudosetup {<mne> <wagoch>} ... Declares channels in Wago I/O stations as spec pseudomotors or pseudocounters. If <mne> is a spec mnemonic and <wagoch> a valid single-channel wago name, the channel gets configured as a pseudomotor or pseudocounter depending on the type of mnemonic. Pseudomotors only can be assigned to output channels. Pseudocounters can be assigned to either input or output channels. In the case of pseudocounters, the scale factor in the config file is applied. wagoshow Usage: wagoshow Lists the currently declared Wago I/O stations and the associated logical names. wagoinfo Usage: wagoinfo Prints the status of currently declared Wago I/O stations. Usefull to get hardware info about wago box and modules wread Usage: wread <logname1> [<logname2> [...]] Reads the current values of the Wago channels corresponding to the logical names in the parameter list. The logical names accept subarray syntax. A single dot character ('.') represents all the available channels. wwrite Usage: wwrite <logname> <value1> <value2> [...] Writes the channels corresponding to the logical name <logname>. The logical name accepts subarray syntax and must only include output channels. One must specify values for all the channels. wago_readch Usage: wago_readch (<chid> [, <out_array>]) This macro function reads the current values of the Wago channels identified by <chid>. <chid> can be either a string or an associative array. In the case of a string, <chid> must be a Wago logic name with optional subarray syntax (i.e. "temp[1,4]"). If <chid> is an array, the elements chid[0], ..., chid[n] must contain strings with the corresponding logical names of the n channels to read. If a logical name is associated to several the physical channels, the channel index within the logical name must be specified in chid[i]["ch"]. If <chid> is a string and refers to only one channel, the function returns the corresponding value. If <chid> is an associative array or a string that refers to more than one channel, the function returns the number of channels actually read into the output array <out_arr> that is mandatory in that case. If there is an error, the function returns an emty string (""). wago_writech Usage: wago_writech (<chid>, <data>]) This macro function writes into the output Wago channels identified by <chid>. <chid> can be either a string or an associative array. In the case of a string, <chid> must be a Wago logic name with optional subarray syntax (i.e. "dac[1,4]"). If <chid> is an array, the elements chid[0], ..., chid[n] must contain strings with the corresponding logical names of the n output channels to write. If a logical name is associated to several physical channels, the channel index within the logical name must be specified in chid[i]["ch"]. If <chid> is a string and refers to a single output channel, the parameter <data> can be a simple numerical value. Otherwise <data> must be an array containing all the values to be written. The function returns the number of channels written if it completes succesfully. It returns 0 if there is an error in the channel specification or in the data format, and -1 if the error happens in the access to the device server. wc_comm Usage: wc_comm wc_sendcomm Usage: wc_sendcomm (<wcname>, <command>, <npar>, <par>, <res> [, <silent>]) wc_getversion Usage: wc_getversion (<wcname>) Loads and returns the current version of the isgmain program running in the controller <wcname>. Returns 0 if there is no response. wago__chanrange Usage: wago__chanrange (<logname>, <chlist>) This macro function parses the logical name in the string <logname> and stores the information so obtained in the associative array <chlist>. Individual channels or channel ranges within the logical name can be specified by using the spec subarray syntax (i.e. "vin[0,4:7]"). If there is an error, the function returns -1, otherwise it returns the total number of physical channels n that is also stored in chlist["n"].%BR chlist["key"] contains the device server key, and the array elements chlist[0] to chlist[n] contain the indexes of the channels. Other information available is the device server name in chlist["ds"] and the logical name in chlist["name"]. | ||||||
Internal Macros: | ||||||
Usage: _dowagosetup(args) wagounsetup Usage: wagounsetup __wagopseudocheck Usage: __wagopseudocheck(mne, wchan, warr) wago_move Usage: wago_move(motors, wtp, wds, wkey, wname) wago_getangles Usage: wago_getangles(motors, wtp, wds, wkey, wname) wago_getcounts Usage: wago_getcounts(counters, wtp, wds, wkey, wname) wagomotorunsetup Usage: wagomotorunsetup wagocounterunsetup Usage: wagocounterunsetup _wagoremove Usage: _wagoremove(wcname) _wagoadd Usage: _wagoadd(wcname) wago_io Usage: wago_io(tp, ds, cmd, argin, argout) wago__getkeys Usage: wago__getkeys(ds, tp) __wread Usage: __wread(chlbl) wago__plcinit Usage: wago__plcinit() wc_getstring Usage: wc_getstring(device, comm, npar, par, silent) wago__parseindex Usage: wago__parseindex(str, arr, maxidx) wago__parseindex0 Usage: wago__parseindex0(str, arr, n, maxidx) wago__type2code Usage: wago__type2code(type) wago__code2type Usage: wago__code2type(code) wago__hard2log Usage: wago__hard2log(wcname, channel, type) wago__log2hard Usage: wago__log2hard(chname) wago__log2scale Usage: wago__log2scale(chname) | ||||||
|