from labjack import ljm # Open first found LabJack. handle = ljm.openS("ANY", "ANY", "ANY") # Configure the counter. aNames = ["DIO18_EF_INDEX", "DIO18_EF_ENABLE"] aValues = [7, 1] numFrames = len(aNames) results = ljm.eWriteNames(handle, numFrames, aNames, aValues) aScanListNames = ["DIO18_EF_READ_A","STREAM_DATA_CAPTURE_16"] numAddresses = len(aScanListNames) aScanList = ljm.namesToAddresses(numAddresses, aScanListNames)[0] scanRate = 10 scansPerRead = int(scanRate/2) LJME=ljm.eStreamStart(handle, scansPerRead, numAddresses, aScanList, scanRate) print "Stream started at %f Hz\n" % (scanRate) # start = datetime.now() result_append=[] flag=True while flag==True: ret = ljm.eStreamRead(handle) data=ret[0] for i in range(0,len(data)): if i%2==0: LSW=data[i] MSW=0 if i%2!=0: MSW=data[i] result=LSW+MSW*65536 result_append.append(result) print result_append result_append=[] print("\nStop Stream") ljm.eStreamStop(handle) # Close handle ljm.close(handle)