PdCom5 Variable

class pdcom5.Variable(v: pdcom5._PdComWrapper.Variable)

Process Variable, can be retrieved via Process.find().

property empty

Whether the variable handle is empty (usually not the case)

property name

Name of the variable (last part of the path)

property path

Path of the variable

async poll() → tuple[Union[Number, np.ndarray], timedelta]

Poll a Variable without a subscription.

async setValue(value: Union[numpy.ndarray, numbers.Number], selector: Optional[pdcom5._PdComWrapper.Selector] = None)

Set the given variable to a certain value.

This is a coroutine, so you have to await it.

Parameters
  • value – the desired value

  • selector – Optional selector to change a subset of a multidimensional variable.

property shape

Shape of the variable

temporaryTrue()

Set a bool parameter to True temporarily.

Use this in an async with statement:

async with variable.temporaryTrue():
    # variable is now True until the block scope is left
    pass
property writeable

Variable is writeable