Python Forum
Pyserial Issues with Python3.7 and Fluke Multimeter
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pyserial Issues with Python3.7 and Fluke Multimeter
#7
[quote='DeaD_EyE' pid='51872' dateline='1530950771']
Quote:If you're able to open the port again, then send bytes and not a str.
ser.write(b'SENS:VOLT:RANG 10 \r\n')
or
ser.write('SENS:VOLT:RANG 10 \r\n'.encode())

I have tried both of the suggested approaches and it just causes a loop to occur at the readline for whatever reason.

Updated Code:
import serial
import time
 
ser = serial.Serial()
ser.baudrate = 9600
ser.bytesize = 8
ser.stopbits = 1
ser.xonxoff = 0
ser.rtscts = 0
ser.timeout = None
ser.port = "COM4"  
parity=serial.PARITY_NONE
 
ser.open()
print ("Connection to Fluke successful")
ser.write('MEAS:VOLT:RANG 10 \r\n'.encode())
time.sleep(2)
print ("Time Sleep successful")
print(ser.readline())
ser.close()
print ("Connection Severed")
Output:
Connection to Fluke successful Time Sleep successful
Reply


Messages In This Thread
RE: Pyserial Issues with Python3.7 and Fluke Multimeter - by jfisher930 - Jul-09-2018, 02:30 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020