Skip to content

spec digital read pulse width

Ken Sharp edited this page Dec 10, 2025 · 2 revisions

Digital Read Pulse Width

Reads a digital pulse width on a a digital input channel.

LabVIEW

Developer Note

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.

Command Packet

Digital Read Pulse Width Command
Description Reads a digital pulse width on a a digital input channel.
Size 10 Bytes
Format 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
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 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 : 0x0E PACKET NUM CMD : 0x0044 RESP PIN NUM STIM PIN NUM STIM PULSE POLARITY TIMEOUT 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 Pulse Width Command.
RESP PIN NUM DI channel to read response.
STIM PIN NUM DO channel to send stimulus.
STIM Stimulus: 0x00 = No Stimulation, 0x01 = High, Low, High, 0x02 - Low, High, Low
PULSE POLARITY Pulse Polarity : 0 = Active Low, 1 = Active High
TIMEOUT U32 Timeout mS.
CHECKSUM Checksum. Computed by adding all of the bytes in the packet in U8 form ignoring rollover.

LINX Target

Developer Note

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.

Response Packet

Digital Read Pulse Width Response
Description LINX device's response to Digital Read Pulse Width command
Size 10 Bytes
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 : 0x0A PACKET NUM STATUS VALUE 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.
VALUE U32 Pulse width in uS
CHECKSUM Checksum. Computed by adding all of the bytes in the packet in U8 form ignoring rollover.

Return Status

No function specific statuses. See Return Status for universal return statuses.

Related Links

LINX

Clone this wiki locally