[value, timestamp] = lcaGet(pvs, nmax, type)
If all PVs are of native type DBF_STRING or DBF_ENUM, the values are returned as character strings; otherwise, all values are converted into double precision numbers. Explicit type conversion into strings can be enforced by submitting the `type' argument described below.
It can be desirable, however, to use a different data type for the transfer because by default CA transfers are limited to ˜ 16kB. Legal values for type are byte, short, long, float, double, native or char (strings). There should rarely be a need for using anything other than native, the default, which directs CA to use the same type for transfer as the data are stored on the server.
Occasionally, conversion to char can be useful: retrieve a number of PVs as strings, i.e. let the CA server convert them to strings (if the PVs are not native strings already) and transfer them.
If multiple PVs are requested, either none or all must be of native DBF_STRING or DBF_ENUM type unless explicit conversion to char is enforced by specifying this argument.
Note that while native might result in different types being used for different PVs, it is currently not possible to explicitly request different types for individual PVs (i.e. type can't be a vector).
The result is either a `double' or a (matlab: cell-) `string' matrix (if all PVs are of native string type or explicit conversion was requested by setting the `type' argument to `char').
labCA checks the channel access severity of the retrieved PVs and fills the rows corresponding to INVALID PVs with NaN9. In addition, warning messages are printed to the console if a PV's alarm status exceeds a configurable threshold. The refusal to read PVs with INVALID severity can be tuned using the lcaSetSeverityWarnLevel call as well.
// read a PV lcaGet( 'thepv' ) // read multiple PVs along with their EPICS timestamps [ vals, tstamps] = lcaGet( [ 'aPV' ; 'anotherPV' ] ) // read an 'ENUM/STRING' lcaGet( 'thepv.SCAN' ) // read an 'ENUM/STRING' as a number (server converts) lcaGet( 'thepv.SCAN', 0, 'float' ) // enforce reading all PVs as strings (server converts) // NOTE: necessary if native num/nonnum types are mixed lcaGet( [ 'apv.SCAN'; 'numericalPV' ] , 0, 'char' ) // limit reading a waveform to its NORD elements nord = lcaGet( 'waveform.NORD' ) if nord > 0 then lcaGet( 'waveform', nord ) end