-
Notifications
You must be signed in to change notification settings - Fork 115
spec digital read
Ken Sharp edited this page Dec 10, 2025
·
2 revisions
Reads the value (high or low) from the specified digital pin(s). You must use Digital Set Pin Mode to configure the specified pin as an input before using this function.
This VI takes an array of U8s. Each U8 represents a pin and data is returned in a U8/Boolean/ Array. The values returned are in the same order as the pin values. Do we scale in LV or on the uController? The ucontroller could return the number of bits per sample and the ref voltage.
| Digital Read Command | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description | Reads the value (high or low) from the specified digital pin(s). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Size | Variable | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Format | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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 : 0x0042 | PIN NUM(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. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CMD | Read Digital Command. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PIN NUM(S) | Variable Length. The DIO pin numbers to read. Each byte represents one pin. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CHECKSUM | Checksum. Computed by adding all of the bytes in the packet in U8 form ignoring rollover. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Loop over each pin byte. Read the value of the pin and pack data for response. Potentially return Aref and bits of resolution if LV is scaling.
| Digital Read Response | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description | LINX device's response to Digital Read command | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Size | 6 Bytes | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Format | 0 | 1 | 2 | 3 | 4 | 5 | 6 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 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 | STATUS | ~VALUES | 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. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ~VALUES | Digital Values. The MSb value corresponds to the MSB pin in the Digital Read Command packet. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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.