The Digital Output Read block reads the current state of output pins by accessing the LAT (latch) register, not the PORT register. This means it reflects the commanded output value, not the actual pin voltage. Selected pins must already be configured as digital outputs by a Digital Output Write block. The read operation inherently has a 1-sample delay (z^-1) relative to the write, which is useful for diagnostics, state verification, and closed-loop control applications.
When to use:
When NOT to use:
No screenshot available โ block uses standard parameter dialog similar to Digital Input.
| Port | Data Type | Description |
|---|---|---|
| Port signal | boolean or uint16 | Current state of LAT register for selected pin(s) with 1 sample delay. If multiple pins are selected without PACK option, each pin has its own boolean output. If PACK option is enabled, a single uint16 output contains LAT states in corresponding bit positions. |
| Parameter | Variable | Type | Description |
|---|---|---|---|
| Port | PORT | popup | GPIO port selection (A, B, C, etc.). Dynamically populated based on target device pin map. Shows available pin indices for each port. |
| Pins | PIN | edit | Array of pin indices to read, e.g., [0] or [0 1 2]. Valid range is [0..15] for 16-bit ports or [0..31] for 32-bit ports. Out-of-range or unavailable pins are automatically filtered out with a warning. Pins must be configured as outputs by a Digital Output Write block. |
| set block output as one uint16/uint32 | PACK | checkbox | Conditional. When enabled, returns a single uint16 (16-bit ports) or uint32 (32-bit ports) output where bit positions correspond to pin numbers. When disabled, each pin has an individual boolean output. Always visible. |
| Request exact simultaneous read | SIMULTANEOUS | checkbox | Conditional. When enabled, all pins are read from LAT register in a single access for atomic simultaneous read. Only visible when multiple pins are selected AND PACK is disabled. |
| Block execution ordering | ORDERING | popup | Controls block scheduling: None, Input, Output, or Input & Output. Used for internal ordering in the parent Digital Output subsystem block. |
| Sample Time | SampleTime | edit | Sampling interval in seconds. Use -1 for inherited sample time. |
Output Data Type:
uint16, unpacked mode outputs individual boolean per pinuint32, unpacked mode outputs individual boolean per pinLAT Register Read Behavior:
Port Availability:
Usage Note:
Problem: Read value doesn’t match expected output
Problem: Block reads incorrect values
Problem: Cannot read pin states