任务单 #37524

waitregex inputstr does not contain recieved line when command timesout

开放日期: 2017-09-20 03:05 最后更新: 2017-11-30 07:34

报告人:
属主:
(无)
类型:
状态:
开启
组件:
里程碑:
(无)
优先:
5 - Medium
严重性:
5 - Medium
处理结果:
文件:
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Details

I created a snippet of code to demonstrate what I am doing. I have a pass through device that sends SDI-12 commands to a sensor and the sensor responds to the commands.
When the response matches the regular expression the returned value is placed in the inputstr and the matchstr variables.
When the response does not match the regular expression the previous responses that did match are located in the inpustr and matchstr variables.
I was expecting the inputstr and all matchstr variables would be set to null and then the received string would be captured to the inputstr and if the regular expression matched it would also be copied to the matchstr variable.

; waitregex demonstrates how inputstr does not contain most recent result but contains last matched result
; Description:
; Updated: 09/19/2017 Initial release
; Author: Scott Breyman

timeout = 1
send '?R0!'

;expected result
waitregex '0\+\d+\.\d{2}+-\d+\.\d\+0-9+\r'
sprintf2 strMessage 'inputstr "%s"\nmatchstr "%s"' inputstr matchstr
strspecial strMessage
messagebox strMessage 'match'

send '?R0!'

;expected result
waitregex '0\+\d+\.\d{2}+-\d+\.\d\r'
sprintf2 strMessage 'inputstr "%s"\nmatchstr "%s"' inputstr matchstr
strspecial strMessage
messagebox strMessage 'no match'

end

任务单历史 (3/4 Histories)

2017-09-20 03:05 Updated by: scbreyman
  • New Ticket "waitregex inputstr does not contain recieved line when command timesout " created
2017-09-20 22:43 Updated by: (del#1144)
评论

In current version, waitregex command doesn't clear inpustr, matchstr and groupmatchstr1..9 when a expected string wasn't receive.

Please check 'result' variable to judge success or failure of waitregex command.

https://ttssh2.osdn.jp/manual/en/macro/command/waitregex.html

2017-11-30 07:34 Updated by: (del#1144)
  • 严重性 Update from 8 to 5 - Medium
  • 优先 Update from 8 to 5 - Medium
  • Details Updated
2017-11-30 07:34 Updated by: (del#1144)

Attachment File List

No attachments

编辑

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » 登录名