Set Digital Pin Mode

Configures the specified digital pin(s) as input or output.

LabVIEW

Developer Note

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.

Command Packet

  • Set DIO Pin Mode Command
  • Set DIO Pin Mode Response
  • Set DIO Pin Mode Command
    Description Configures the specified digital pin(s) as input or output.
    Size Variable
    Format
    -
    -
    0
    1
    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
    N/A
    SoF : 0xFF
    PACKET SIZE
    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
    PACKET NUM
    CMD : 0x0040
    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
    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.

    LINX Target

    Developer Note

    Loop over each pin byte. Set the direction of the pin based on the corresponding direction bit.

    Response Packet

    Set DIO Pin Mode Response
    Description LINX device's response to Set DIO Pin Mode Command
    Size 6 Bytes
    Format
    -
    -
    0
    1
    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
    N/A
    SoF : 0xFF
    PACKET SIZE
    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
    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.

    Return Status

    No function specific statuses. See return_status for universal return statuses.