Read serial port sugestions

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Reimon
Pro Scripter
Posts: 55
Joined: Wed Mar 31, 2004 4:46 pm

Read serial port sugestions

Post by Reimon » Thu Jul 16, 2009 10:32 am

Hello.

Please, can you suggest me how to improve this code so that it works?

Greetings,

Reimon

Code: Select all

OnEvent>KEY_DOWN,VK106,8,KeyPress
Let>vexit=0
Label>Start
If>vexit=1,end
wait>.5
ReadLn>COM1:,1,line
If>line<MessageModal>%line%
Endif
Goto>Start
srt>KeyPress
  Let>vexit=1
  MessageModal>vexit
END>KeyPress
Label>end
Exit>0

Reimon
Pro Scripter
Posts: 55
Joined: Wed Mar 31, 2004 4:46 pm

Code

Post by Reimon » Thu Jul 16, 2009 10:34 am

OnEvent>KEY_DOWN,VK106,8,KeyPress
Let>vexit=0
Label>Start
If>vexit=1,end
wait>.5
ReadLn>COM1:,1,line
If>line%line%
Endif
Goto>Start
srt>KeyPress
Let>vexit=1
MessageModal>vexit
END>KeyPress
Label>end
Exit>0

Reimon
Pro Scripter
Posts: 55
Joined: Wed Mar 31, 2004 4:46 pm

Code

Post by Reimon » Thu Jul 16, 2009 10:49 am

Sorry but when I post de code with quotation marks for null and major than is not published correctly.

Uff. Disable HTML in this post. Ok.

Code: Select all

OnEvent>KEY_DOWN,VK106,8,KeyPress
Let>vexit=0
Label>Start
If>vexit=1,end
wait>.5
ReadLn>COM1:,1,line
If>line<>""
    MessageModal>%line%
Endif
Goto>Start
srt>KeyPress
  Let>vexit=1
  MessageModal>vexit
END>KeyPress
Label>end
Exit>0

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts