def getDAQC2DIN():
    global AD
    global DINInterrupt
    global DINByte
    # get DIN digital inputs values
    DINByte = DAQC2.getDINall(AD)
    DINInterrupt = 255
    pass
def DAQC2Interrupt(args):
    global AD
    global DINInterrupt
    global DINByte
    # get DIN digital inputs values
    DINByte = DAQC2.getDINall(AD)
    # debounce button before clearing interrupt (! software deboucining slow down OSC send rate, including CANs)
    # sleep(0.01)
    DINInterrupt = DAQC2.getINTflags(AD)
    pass