torfbolt / PyDAQFlex

Python implementation of Measurement Computing's DAQFlex command framework
15 stars 14 forks source link

1608GX #7

Open dassishot opened 9 years ago

dassishot commented 9 years ago

First, thank you for this development.

Well I have a running application in C # and was trying to implement the same project in python, however've been trying to perform the same task and have received "Send failed, possibly wrong command?".

Another problem I have, I would be with the answer in relation VOLT because whenever I try something like "I {}: VALUE / VOLT or AI {}: VALUE" he returns me the same result.

There anything I can do to fix this?

I appreciate your attention.

Device = daqflex.USB_1608GX()

Device.send_message("AI:CHMODE=SE")
Device.send_message("AI:CAL=ENABLE")
Device.send_message("AI:SCALE=ENABLE")
Device.send_message("AI{6}:RANGE=BIP10V")
Device.send_message("AI{7}:RANGE=BIP10V")

temperature = Device.send_message ("?AI{6}:VALUE/VOLTS")
pressure = Device.send_message ("?AI{7}:VALUE/VOLTS")

f = open('output.txt', 'w')
f.write(u"Temperatura: %s \n" % temperature)
f.write(u"Pressao: %s" % pressure)
f.close()