-
Notifications
You must be signed in to change notification settings - Fork 115
spec digital set pin mode
Ken Sharp edited this page Dec 10, 2025
·
2 revisions
Configures the specified digital pin(s) as input or output.
The Set DIO Pin Direction VI takes an array of clusters. Each cluster contains a U8 for the pin number and an enum for the direction (0=output / 1=input). This will allow the user to configure/reconfigure an arbitrary number of pins in a single call.
| Set DIO Pin Mode Command | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description | Configures the specified digital pin(s) as input or output. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Size | Variable | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Format | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
| SoF : 0xFF | PACKET SIZE | PACKET NUM | CMD : 0x0040 | NUM PINS | PIN NUM(S) | DIR(s) | CHECKSUM | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SoF | Start of Frame. Always 0xFF. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PACKET SIZE | Packet Size In Bytes | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PACKET NUM | The Current Packet Number. This value increments with each new packet or repeats for a multi packet command. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CMD | Set Digital Pin Mode Command. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| NUM PINS | The number of pins to be configured. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PIN NUM(S) | Variable Length. The DIO pin numbers to configure. Each byte represents one pin number. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DIR(s) | Variable Length. One bit per pin. 0=Input, 1=Output. The MSB pin corresponds to the LSb of the MSB direction. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CHECKSUM | Checksum. Computed by adding all of the bytes in the packet in U8 form ignoring rollover. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Loop over each pin byte. Set the direction of the pin based on the corresponding direction bit.
| Set DIO Pin Mode Response | ||||||||||||||||||||||||||||||||||||||||||||||||
| Description | LINX device's response to Set DIO Pin Mode Command | |||||||||||||||||||||||||||||||||||||||||||||||
| Size | 6 Bytes | |||||||||||||||||||||||||||||||||||||||||||||||
| Format | 0 | 1 | 2 | 3 | 4 | 5 | ||||||||||||||||||||||||||||||||||||||||||
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
| SoF : 0xFF | PACKET SIZE | PACKET NUM | STATUS | CHECKSUM | ||||||||||||||||||||||||||||||||||||||||||||
| SoF | Start of Frame. Always 0xFF. | |||||||||||||||||||||||||||||||||||||||||||||||
| PACKET SIZE | Total packet size in bytes. | |||||||||||||||||||||||||||||||||||||||||||||||
| PACKET NUM | The packet number of the packet that generated the response. | |||||||||||||||||||||||||||||||||||||||||||||||
| STATUS | See Return Status section below. | |||||||||||||||||||||||||||||||||||||||||||||||
| CHECKSUM | Checksum. Computed by adding all of the bytes in the packet in U8 form ignoring rollover. | |||||||||||||||||||||||||||||||||||||||||||||||
No function specific statuses. See Return Status for universal return statuses.