StrChan class - femanov/pycx4 GitHub Wiki

CdaObject -> BaseChan -> StrChan

This class implements python's string input/output over CXv4. Instances of this class registers required cda events to track time/value of selected control system channel. You can get information about channel trough it's properties. All the properties are read-only. It's an error if you try to assign properties If you need a notifications use instance signals.

StrChan is a vector chan, it uses byte encoding on CX-server level. Current vector length determined automaticaly as length of encoded string, be careful it's not equal to number of symbols in original python string.

properties: inherited: int max_nelems - max number of elements, default is 1024

cda_dataref_t ref - cda channel's id

cxdtype_t dtype - cx data type

str name - channel name (not full)

object context - context

int64 time - server-provided time of last value, us from UNIX epoch

int64 prev_time - server-provided time of previous value, us from UNIX epoch

size_t itemsize - value size, bytes

self-defined: str val - last-known value. It's a string for both python 2.6+ and 3+, for python 3 it's UTF-8 encoded.