It is currently Sun Nov 18, 2018 4:28 am



Reply to topic  [ 1 post ] 
 FreePIE Crashes When Using serialPort.ReadLine() 
Author Message
One Eyed Hopeful

Joined: Mon Apr 30, 2018 5:10 pm
Posts: 1
Reply with quote
The following script works (it outputs the expected values) but when I stop stop the script (using Script>Stop script menu command), it shows the following error message and then crashes:

Quote:
Had to forcibly shut down script - try removing infinite loops from the script
at ...



Code:
import clr
clr.AddReference('System')
from System import *
global serialPort

def update():
  global serialPort
  line = serialPort.ReadLine()
  diagnostics.watch(line) 

if starting:
  global serialPort
  serialPort = IO.Ports.SerialPort("COM10")
  serialPort.BaudRate = 921600
  serialPort.DataBits = 8
  serialPort.Open()

update()



I guess the issue is in the line

Code:
line = serialPort.ReadLine()


but I'm not sure how to resolve it.


Wed May 16, 2018 5:00 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by STSoftware.