Read digital input🔗
Reads the value of an input channel in a remote I/O device. If neither of the connectable inputs is connected, the tool emits the value of the specified channel whenever a change event is received from an I/O server. If an input is connected, the current value of the specified input channel is emitted whenever the tool is processed.
The I/O subsystem shares connections to I/O servers. There will be only one connection to each server, identified by socketType, serverAddress and port. All tools with identical values will use the same socket connection. Consequences:
It is usually fine for a server implementation to support a single connected client only. This is what the reference implementation in the SDK does.
A connection may fail if a server supporting only one client is reached with a different identification triple. For example, if you use
localhostas serverName in one tool and
127.0.0.1in another, the I/O subsystem will try to establish two connections.
The first tool to initiate a connection will supply the password. You may thus notice that a password-protected connection works without a password in another tool. You shouldn’t rely on this unless you can guarantee tool execution order.
socketType: The type of the server socket to connect to. If set to
NoSocket, no connection will be attempted.
serverAddress: The address of the server. If socketType is
LocalSocket, serverAddress is the path to the socket, e.g
/run/va-ioserver.sock. If socketType is
SslSocket, serverAddress is the internet host name of the server.
TcpSocketalso supports IP addresses (IPv4 and IPv6).
port: The TCP port number on the server. Only applicable to TCP and SSL sockets.
password: Server password. Depending on server configuration password may or may not be required.
channel: The zero-based index of the output channel to read.
trigger: A trigger input that accepts any object type. If channel is set to a fixed value, this input can be used to trigger a read operation.
value: The value received from the I/O device, commonly 0 or 1.