def set_digital_line_state(line_name, state):
    """Set the state of a single digital line.

    line_name (str) - The physical name of the line.
        e.g line_name="Dev1/port0/line3"
        This should be a single digital line. Specifying more than one would
        result in unexpected behaviour. For example "Dev1/port0/line0:5" is
        not allowed.
        see http://zone.ni.com/reference/en-XX/help/370466W-01/mxcncpts/physchannames/
        for details of naming lines.
    state (bool) - state=True sets the line to high, state=False sets to low.

    """
    # get the line number from the line name. Thats the number of bits to shift
    bits_to_shift = int(line_name.split('line')[-1])
    dig_data = np.ones(2, dtype="uint32")*bool(state)*(2**bits_to_shift)
    # Note here that the number of samples written here are 2, which is the
    # minimum required for a buffered write. If we configure a timing for the
    # write, it is considered buffered.
    # see http://zone.ni.com/reference/en-XX/help/370471Y-01/daqmxcfunc/daqmxwritedigitalu32/
    DigitalOutputTask(line_name, dig_data).StartAndWait()
Set the state of a single digital line.

    line_name (str) - The physical name of the line.
        e.g line_name="Dev1/port0/line3"
        This should be a single digital line. Specifying more than one would
        result in unexpected behaviour. For example "Dev1/port0/line0:5" is
        not allowed.
        see http://zone.ni.com/reference/en-XX/help/370466W-01/mxcncpts/physchannames/
        for details of naming lines.
    state (bool) - state=True sets the line to high, state=False sets to low.