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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I build recieve data buffer?

Status
Not open for further replies.

jgrice

Vendor
Feb 10, 2005
4
US
Thank you for such a great forum on aspect scripting.

I'm would like to build a script which maintains the last 6 lines of received data received on the Terminal in an array. The terminal will be running with VT-320 emulation and should be recieving TL1 data.

So at any point in script execution I can go back and review the 6 previous received lines. Is this possible? Any suggestions would be appreicated.

Thanks,
Jeremy
 
Will you need to see the original data on the screen in its usual place as well, or just the six lines you are interested in? You could use the rget command to read data as it comes in, but this keeps the data from appearing on the screen as it usually does.

Will all the lines be received at the same time, or will they come one at a time with commands you issued between them?

 
Sorry for the vagueness and missing conjunctions in the earlier post! Thanks for the reply.

Yes the original data must be displayed on the screen with the same formating in which it was received.

I'm not looking for any particular set of lines but instead would like to build a general purpose receive buffer which will capture and maintain the last 6 lines of received data with no regards for their content.

I have written some basic scripts for various legacy Alcatel Telecom products and occasionally have run into the need to access data which may have been received 3 or 4 lines into the past. Until now I have used capture files by capturing the data and parsing the capture files for the information which I needed. Although effective it seems less than elegant and not as streamlined as I would prefer.

Would it be possible to redirect or copy the incoming receive buffer. Then delimit and pass it into a 6 element string array within a script. Then have the original data redirected to the terminal for formating/display. As more lines of data come in have the oldest data pushed out.

Am I asking for something which is beyond the abilities of Aspect and Procom.

Thanks,
Jeremy


 
When the lines come across, are they preceded by any standard text, such as a prompt or message of some sort? Does the cursor stay on the same line as the text you are interested in? Does the information come as a single line of text, or could it come in multiple lines at once?

Depending on the above answers, we might be able to identify the lines after they have been received instead of as they are received.

 
No the lines do not have any standard formatting at all. No the text I'm usually looking for is 2 or 3 lines above the current cursor position.

The last question I did not understand fully. The data I'm usually interested in spans multiple lines when displayed.

I built on the rget command and produced the following code this evening. I'm not too sure of its usefulness yet but it does appear to do what I had started out looking for. I'm still reserved as to how useful it will be when I try to integrate it with an actual working script.

Thanks,
Jeremy

string rxbuffer[10]

proc main
set aspect rxdata ON
when $rxdata call rxbuffer_dump

while 1
;; figure I could do useful stuff here and break the
;; loop when I want to exit the script
endwhile

endproc

proc rxbuffer_dump
while $rxdata >= 1

rget rxbuffer[0]
;comread rxbuffer[0] 256
termwrites rxbuffer[0]
strcpy rxbuffer[1] rxbuffer[0]
strcpy rxbuffer[2] rxbuffer[1]
strcpy rxbuffer[3] rxbuffer[2]
strcpy rxbuffer[4] rxbuffer[3]
strcpy rxbuffer[5] rxbuffer[4]
strcpy rxbuffer[6] rxbuffer[5]
strcpy rxbuffer[7] rxbuffer[6]
strcpy rxbuffer[8] rxbuffer[7]
strcpy rxbuffer[9] rxbuffer[8]
endwhile
endproc
 
Could you post an example screen perhaps with the data highlighted/identified in some way? Unfortunately I'm not sure a "clean" way exists to do this, so your rget/termwrites solution may be the best.

 
I hate to sound so vague on the information I'm looking for but the info I'm looking for could at times be fomatted like any of the lines below. Usually the actual data I need is between the " " marks but not always.

Thanks
Jeremy

Some-System-0600 08-06-13 17:16:01
M P8e965 COMPLD
"E1E0-615-23,T3T0-5-9-23:2WAY,E0::IS-NR,BUSY&TS"
;RTRV-CRS::T3T0-5-9-24;

Some-System-0600 08-06-13 17:16:15
M P8e966 COMPLD
"T3T0-5-9-24,E1E0-615-24:2WAY,E0::IS-NR,BUSY&TS"
"T3T0-5-9-24,E1E0-666-10:TA,E0::IS-NR,"
;RTRV-CRS::E1E0-615-24;IP P8e968
<

Some-System-0600 08-06-13 17:16:29
M P8e968 COMPLD
"E1E0-615-24,T3T0-5-9-24:2WAY,E0::IS-NR,BUSY&TS"
;RTRV-T1::T3T1-4-8;

Some-System-0600 08-06-13 17:16:41
M P8e969 COMPLD
"T3T1-4-8::AISC=LOFLOS,AISF=Y,AIST=ONES,FENDNTE=NONE,SHELF=,MODE=,SDTHSW=4,CARDID=LMU-3-1-10,FMT=ESF,IDLE=TRB,SEQ=D4,TACC=N,TACC0
=N,INQUAL=,SYNCMSGIN=N:OOS-AU,ACT&FAF&SDEE&TRM&TS"
;RTRV-TO::T3T0-4-8-1&&-24;

Some-System-0600 08-06-13 17:16:54
M 0 DENY
ICNV
;RTRV-CRS::T3T0-4-8-1&&-24;IP P8e971
<RTRV-T1::T3T1-

Some-System-0600 08-06-13 17:17:20
M P8e971 COMPLD
"T3T0-4-8-15,E1E0-1430-15:2WAY,E0::OOS-AU,BUSY&SGEO&TS"
"T3T0-4-8-15,E1E0-1862-27:2WAYTA,E0::OOS-AU,SGEO"
"T3T0-4-8-16,E1E0-1430-16:2WAY,E0::OOS-AU,BUSY&SGEO&TS"
"T3T0-4-8-16,E1E0-1862-28:2WAYTA,E0::OOS-AU,SGEO"
"T3T0-4-8-17,E1E0-1430-17:2WAY,E0::OOS-AU,BUSY&SGEO&TS"
"T3T0-4-8-17,E1E0-1862-29:2WAYTA,E0::OOS-AU,SGEO"
"T3T0-4-8-18,E1E0-1430-18:2WAY,E0::OOS-AU,BUSY&SGEO&TS"
"T3T0-4-8-18,E1E0-1862-30:2WAYTA,E0::OOS-AU,SGEO"
"T3T0-4-8-19,E1E0-1430-19:2WAY,E0::OOS-AU,BUSY&SGEO&TS"
"T3T0-4-8-19,E1E0-1862-31:2WAYTA,E0::OOS-AU,SGEO"
"T3T0-4-8-20,E1E0-1430-20:2WAY,E0::OOS-AU,BUSY&SGEO&TS"
"T3T0-4-8-20,E1E0-1863-0:2WAYTA,E0::OOS-AU,SGEO"
"T3T0-4-8-21,E1E0-1430-21:2WAY,E0::OOS-AU,BUSY&SGEO&TS"
"T3T0-4-8-21,E1E0-1863-1:2WAYTA,E0::OOS-AU,SGEO"
"T3T0-4-8-22,E1E0-1430-22:2WAY,E0::OOS-AU,BUSY&SGEO&TS"
"T3T0-4-8-22,E1E0-1863-2:2WAYTA,E0::OOS-AU,SGEO"
"T3T0-4-8-23,E1E0-1430-23:2WAY,E0::OOS-AU,BUSY&SGEO&TS"
"T3T0-4-8-23,E1E0-1863-3:2WAYTA,E0::OOS-AU,SGEO"
"T3T0-4-8-24,E1E0-1430-24:2WAY,E0::OOS-AU,BUSY&SGEO&TS"
"T3T0-4-8-24,E1E0-1863-4:2WAYTA,E0::OOS-AU,SGEO"
 
It looks like all but one of the examples you posted below had a common string that ended in "COMPLD" Is that something that could be keyed off of for those particular results at least? That might get you started at least.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top