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
localhost
as serverName in one tool and127.0.0.1
in 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.
Inputs🔗
socketType
: The type of the server socket to connect to. If set toNoSocket
, no connection will be attempted.serverAddress
: The address of the server. If socketType isLocalSocket
, serverAddress is the path to the socket, e.g/run/va-ioserver.sock
. If socketType isTcpSocket
orSslSocket
, serverAddress is the internet host name of the server.TcpSocket
also 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.sendInitialValue
: If this flag istrue
and trigger is not connected, the tool will send the initial value of the channel immediately after start-up.
Outputs🔗
value
: The value received from the I/O device, commonly 0 or 1.