.portset Method

Function:

Sets the I/O port specified by the num argument to the state specified by the state argument.

Syntax:

io.portset(num as pl_io_port_num, state as byte)

Returns:

---

See Also:

Line/Port Manipulation Without Preselection, io.portget


Part

Description

num

See the list of pl_io_port_num constants in the platform specifications.

state

0-255. Each bit of this value corresponds to one member I/O line of the 8-bit port.


Details

No line preselection with the io.portnum property is required and the value of io.portnum will not be changed.


Exception Safety

There are a few situations in which an exception may be thrown when invoking this method. For more information, see Handling Exceptions.


Exception

Root Cause(s)

std::invalid_argument

  • The selected port number is invalid.
  • An I/O line number of the selected port number is invalid.

std::system_error

There was an error reading the value of the selected port.


.portset Method

Details

Exception Safety