Skip to content

Commit 809881b

Browse files
committed
mitsub_vfd -add open, close then open agaon - some systems require it.
For some reason open then close then open works.
1 parent 4d056d4 commit 809881b

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/hal/user_comps/mitsub_vfd.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,12 @@ def __init__(self,vfd_names=[['mitsub_vfd','00']],baudrate=9600,port='/dev/ttyUS
5252
self.ser.open()
5353
self.ser.isOpen()
5454
except:
55-
print "ERROR : mitsub_vfd - No serial interface found at %s"% port
56-
raise SystemExit
55+
try:
56+
self.ser.close()
57+
self.ser.open()
58+
except Exception as e:
59+
print("ERROR : mitsub_vfd - No serial interface found at %s\nError: %s"% (port,e))
60+
raise SystemExit
5761
print "Mitsubishi VFD serial computer link has loaded"
5862
print "Port: %s,\nbaudrate: %d\n8 data bits, no parity, 2 stop bits\n"%(port,baudrate)
5963

0 commit comments

Comments
 (0)