Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rget characters from the row after the transmit

Status
Not open for further replies.

jamesjc

Technical User
Feb 21, 2006
6
CA
Hi,

I'm trying to rget characters from the next line after the "CR" of my transmitted text. The received alarm text is always different so I can't use the waitfor command. My shalarms string is always rgettin "show alarms", the transmitted text. Here's an example of the terminal screen user entered and the part of the script that doesn't rget what I want.

>
>show alarms
PS Fail


proc main
string shalarms
transmit "show alarms^M"
rget shalarms 20
transmit "exit^M"
ddepoke LinkVar "R4C10" shalarms
endproc


I want the "PS Fail" in the string shalarms.

Thanks in advance.
James
 
I've never had good luck working with rget. I'm sure there are folks here that can help you out with that specific avenue.

What I tend to do is to capture the incoming data to a text file and parse the information out of that. But I tend to deal with multiple lines of responses (100k+) so that approach works well for my application.

You said that the response could be different each time, but do you get a follow on prompt after the response is kicked out? Such as:

Code:
>
>show alarms
PS fail
>

Or does the ">" prompt not appear after the PS fail?

Also, see this note from Aspects help concerning rget's default settings:

Code:
To rget a result message from a modem, if rgetchar is set to its default of Carriage Return, you need to do two rgets: one to strip the Carriage Return or rgetchar sent by the modem before its message, and one to capture the modem message itself, since rget ends as soon as it encounters a Carriage Return or rgetchar.

You may have to do two rget's to properly capture your data. But like I said, I don't use rget, as a practice.
 
As kodr mentioned, you'll likely need two rget commands to get the information you are looking for. Most systems will echo back the commands you sent it and ASPECT has no way of knowing if those characters are something that you originally typed, it just knows they came from the remote system.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top