PdCom5 Process¶
-
class
pdcom5.
ListReply
(vars, dicts)¶ Reply of Process.list().
-
directories
= None¶ List of directories.
-
variables
= None¶ List of Variables.
-
-
class
pdcom5.
BroadcastMessage
(msg, attr, time, user)¶ Broadcast Message.
-
class
pdcom5.
Process
(appname: str = '')¶ PdCom Process.
- Parameters
appname – Name of this application, default “”.
-
async
activeMessages
() → list[Message]¶ Get a list of active messages.
Active messages are messages which haven’t been resetted yet.
-
async
broadcast
(message: str, attr: str = 'text')¶ Send a broadcast message to all clients.
- Parameters
message – Message
attr – type of the message, default ‘text’
-
close
()¶ Close the connection.
-
async
connect
(url: str, ssl_ctx: Optional[ssl.SSLContext] = None)¶ Create a connection.
- Parameters
url – URL of the server, format msr[s]://user:password@server.port
ssl_ctx – Optional SSLContext instance for secure communication.
- Raises
LoginFailed – Login has failed
LoginRequired – Login is required by the server but no credentials were supplied.
-
create_subscriber
(transmission: pdcom5._PdComWrapper.Transmission) → pdcom5.Subscription.Subscriber¶ Create a Subscriber instance.
-
async
find
(path: str) → Optional[pdcom5.Variable.Variable]¶ Find a Variable.
- Returns
None (if Variable not found) or Variable
-
async
getClientStatistics
() → list[PdComWrapper.ClientStatistics]¶ Get statistics about all connected clients.
-
async
getMessage
(id: int) → Optional[pdcom5._PdComWrapper.Message]¶ Get a specific message.
- Parameters
id – Number of the Message.
-
async
getVariableValue
(var: Union[pdcom5.Variable.Variable, str])¶ Get the current value of a variable.
- Parameters
var – Variable or its path.
-
async
list
(path: str = '') → pdcom5.Process.ListReply¶ List all Variables and directories.
-
property
name
¶ Name of the server application.
-
async
ping
(timeout: float = None)¶ ping the server.
-
async
pollMessage
() → pdcom5._PdComWrapper.Message¶ Wait for a new Event to happen/for a message to be sent.
-
async
setVariableValue
(var: Union[pdcom5.Variable.Variable, str], value)¶ Set a variable to a given value.
- Parameters
var – Variable or its path.
value – Desired value.
-
async
subscribe
(transmission: pdcom5._PdComWrapper.Transmission, variable: Union[str, pdcom5._PdComWrapper.Variable], selector: Optional[pdcom5._PdComWrapper.Selector] = None) → pdcom5.Subscription.Subscription¶ Subscribe to a Variable.
- Parameters
transmission – Transmission mode, can also be a float (=period in seconds) or timedelta instance.
variable – The Variable to subscribe to, or its path.
selector – Optional selector to create a view on multidimensional data.
-
property
version
¶ Version of the server application