A-Shell Network Post New Topic  Post A Reply
my profile | directory login | search | faq | forum home

  next oldest topic   next newest topic
» A-Shell Network » Program Development » Clearing Input Buffer (ATE)

 - UBBFriend: Email this page to someone!    
Author Topic: Clearing Input Buffer (ATE)
Frank - edgeMED Healthcare
Senior Developer
Member # 73

Icon 1 posted      Profile for Frank - edgeMED Healthcare     Send New Private Message       Edit/Delete Post   Reply With Quote 
Hi,

I have a routine where i use MIAMEX,131 to check for a file on a "remote" or local PC or shared network directory. In cases when its not found, there is often some garbabe in the ATE buffer and the next INFLD statement will have garbage (1,0,0,0) or similar. If i trap for that, and enter a valid string in the INFLD, it will still hiccup on that field. (not process the input for some reason?.. just goes back to that infld... i have not debugged that)

Is there a command that will reset or clear all ATE commands or buffers? I found MIAMEX 88 FLUSH STREAM BUFFER but not sure that would apply here.

Thanks.

[ May 01, 2012, 13:25: Message edited by: Frank - edgeMED Healthcare ]

From: Deerfield Beach, Florida | Registered: Sep 2002  |  IP: Logged | Report this post to a Moderator
Jack McGregor
Administrator
Member # 1

Icon 1 posted      Profile for Jack McGregor     Send New Private Message       Edit/Delete Post   Reply With Quote 
This sounds like an old problem that should have been resolved. What version of the server and ATE are we dealing with?

The only reason I can see for this symptom is if the MX_FILESTATS (131) took longer than the allotted timeout period (about 10 seconds) to respond, in which case when it did respond, the response would probably make its way into the input buffer. That might happen in the case where the specified path is a network path and it can't be resolved.

Unfortunately, clearing the ATE response buffer would depend on the current state of things. If the response hadn't yet been returned, then ATE would still be waiting for it (even though the server may have given up and gone on to issue another command). If the response had already made it into the input buffer, then you could clear the input buffer in the usual way on the server side, i.e. using an XCALL TINKEY loop, or a GETKEY(0) loop (i.e. while getkey(0) >= 0 : loop).

But rather than trying to work around it, I would rather we just get to the bottom of it. Turning on the ATE trace in the debug window would be the place to start (so we can see when the response gets returned, relative to the command).

From: Woodland Hills, CA | Registered: Jun 2001  |  IP: Logged | Report this post to a Moderator
Frank - edgeMED Healthcare
Senior Developer
Member # 73

Icon 1 posted      Profile for Frank - edgeMED Healthcare     Send New Private Message       Edit/Delete Post   Reply With Quote 
Thanks for the reply. I have to run out of the office now.. I will conjure up some traces and get back with you... in the meantime this is under:

ATE: 1150.2
Ashell: 5.0.999.7

Thanks.

From: Deerfield Beach, Florida | Registered: Sep 2002  |  IP: Logged | Report this post to a Moderator
Jack McGregor
Administrator
Member # 1

Icon 1 posted      Profile for Jack McGregor     Send New Private Message       Edit/Delete Post   Reply With Quote 
I suspect that the fix to this was in 5.1.1174.8 (Feb 2010) when the timeout on the MX_FILESTATS function was increased.

You may want to see if it still happens in the current version before spending a lot of time debugging. But note that it is a server-side fix, so updating ATE by itself would not be sufficient.

[ May 01, 2012, 17:00: Message edited by: Jack McGregor ]

From: Woodland Hills, CA | Registered: Jun 2001  |  IP: Logged | Report this post to a Moderator
Frank - edgeMED Healthcare
Senior Developer
Member # 73

Icon 1 posted      Profile for Frank - edgeMED Healthcare     Send New Private Message       Edit/Delete Post   Reply With Quote 
Unfortunately as luck would or would not have it, this is one of our largest servers (75lic) and we aren't in a good position to update them yet.

What I can show you is the debug at the start of our signing program that uses the miamex call. Then i will show you the debug when I enter data in the infld control and it ignores it (probably due to buffer garbage). Then i will show you the small snippet of code im using with the miamex call.

code:
0 14:11:51 <TELNET> TAB(-10,26);0,,
1 14:11:51 <TELNET> Setting KS_HOLD for tab(-10,26)
2 14:11:51 <TELNET> TAB(-10,49);
3 14:11:51 <TELNET> Releasing KS_HOLD
4 14:11:52 <TELNET> TAB(-10,49);
5 14:11:52 <TELNET> Setting KS_HOLD for tab(-10,49)
6 14:11:52 <TELNET> Releasing KS_HOLD
7 14:11:52 <TELNET> TAB(-10,66);&#9616;
8 14:11:52 <TELNET> Setting KS_HOLD for tab(-10,66)
9 14:11:52 <TELNET> -> send response (kbd): WinXP,Service Pack 3,2600,Windows/32 (37 bytes, icc=0)
10 14:11:52 <TELNET> sending kbd response directly (37 bytes): WinXP,Service Pack 3,2600,Windows/32
<&#9616;
11 14:11:52 <TELNET> TAB(-10,27);&#9616;-1,0,0,0,0,0,0,0,0,2,-1
12 14:11:52 <TELNET> -> send response (kbd): 18,37,56,20,1,30,0,1,1024,768,1 (32 bytes, icc=0)
13 14:11:52 <TELNET> sending kbd response directly (32 bytes): 18,37,56,20,1,30,0,1,1024,768,1
<&#9616;
14 14:11:52 <TELNET> TAB(-10,31);&#9616;%miame%\icons\vista\zoom1.bmp
15 14:11:52 <TELNET> -> send response (kbd): 3932214,1232474442,0,1233330555 (32 bytes, icc=0)
16 14:11:52 <TELNET> sending kbd response directly (32 bytes): 3932214,1232474442,0,1233330555
<&#9616;
17 14:11:52 <TELNET> TAB(-10,49);
18 14:11:52 <TELNET> Releasing KS_HOLD
19 14:11:52 <TELNET> TAB(-10,66);&#9616;
20 14:11:52 <TELNET> Setting KS_HOLD for tab(-10,66)
21 14:11:52 <TELNET> -> send response (kbd): WinXP,Service Pack 3,2600,Windows/32 (37 bytes, icc=0)
22 14:11:52 <TELNET> sending kbd response directly (37 bytes): WinXP,Service Pack 3,2600,Windows/32
<&#9616;
23 14:11:52 <TELNET> TAB(-10,27);&#9616;-1,0,0,0,0,0,0,0,0,2,-1
24 14:11:52 <TELNET> -> send response (kbd): 18,37,56,20,1,30,0,1,1024,768,1 (32 bytes, icc=0)
25 14:11:52 <TELNET> sending kbd response directly (32 bytes): 18,37,56,20,1,30,0,1,1024,768,1
<&#9616;
26 14:11:52 <TELNET> TAB(-10,31);&#9616;%miame%\icons\vista\zoom1.bmp
27 14:11:52 <TELNET> -> send response (kbd): 3932214,1232474442,0,1233330555 (32 bytes, icc=0)
28 14:11:52 <TELNET> sending kbd response directly (32 bytes): 3932214,1232474442,0,1233330555
<&#9616;
29 14:11:52 <TELNET> EditControl(hi=0] 3,0[null],"*",0,[,0,0],0,-,0x57fcd0,0,0,200000,200000,0,0,0,0,,,0,0)
30 14:11:52 <TELNET> TAB(-10,34);1,0
31 14:11:52 <TELNET> setfont: client=1024x692, minmargin=0, fudge=0, cell req=12x24, actual width=12
32 14:11:52 <TELNET> spacehorz=12, spacevert=27, tmargin=7, lmargin=32
33 14:11:52 <TELNET> setfont: client=1024x692, minmargin=0, fudge=0, cell req=12x24, actual width=12
34 14:11:53 <TELNET> spacehorz=12, spacevert=27, tmargin=7, lmargin=32
35 14:11:53 <TELNET> SetControlFont(idx=0,attr=0,scale=0,face=,type=0,max=0,winsize=0,0,state=max)
36 14:11:53 <TELNET> fidx=0, nref=0, face=MS Shell Dlg, ht=-11, wd=0, cs=400, pf=0
37 14:11:53 <TELNET> TAB(-10,21);&#9616;7,0,"",0,0,"",,0,0
38 14:11:53 <TELNET> EditMenuItem op=7, id=0 txt=, state=0, type=0, cmd=, parent=0
39 14:11:53 <TELNET> EditMenuItem op=1, id=4 txt=h1, state=0, type=800, cmd=, parent=0
40 14:11:53 <TELNET> rtn:0, id=0
41 14:11:53 <TELNET> EditMenuItem op=1, id=4 txt=&Contents and Index, state=0, type=20000, cmd=C:\ZOOM\ATE\doc\ateref.chm, parent=0
42 14:11:53 <TELNET> rtn:0, id=1
43 14:11:53 <TELNET> EditMenuItem op=1, id=4 txt=A-Shell Docs &Online, state=0, type=20000, cmd=http://www.microsabio.com/document..., parent=0
44 14:11:53 <TELNET> rtn:0, id=2
45 14:11:53 <TELNET> EditMenuItem op=1, id=4 txt=Readme.txt, state=3, type=20000, cmd=C:\ZOOM\ATE\doc\readme.txt, parent=0
46 14:11:53 <TELNET> rtn:0, id=3
47 14:11:53 <TELNET> EditMenuItem op=1, id=3 txt=sf3, state=0, type=800, cmd=, parent=0
48 14:11:53 <TELNET> rtn:0, id=4
49 14:11:53 <TELNET> EditMenuItem op=1, id=3 txt=&Connection Properties, state=0, type=0, cmd=$ASHELL -e -2 ate -z TELNET Medpro..., parent=0
50 14:11:53 <TELNET> rtn:0, id=5
51 14:11:53 <TELNET> EditMenuItem op=3, id=1 txt=5, state=0, type=0, cmd=, parent=0
52 14:11:53 <TELNET> rtn:0, id=-195
53 14:11:53 <TELNET> EditMenuItem op=1, id=1 txt=&Open Local Session, state=0, type=0, cmd=$ASHELL -n -ate, parent=0
54 14:11:53 <TELNET> rtn:0, id=6
55 14:11:53 <TELNET> EditMenuItem op=1, id=1 txt=&Update PC-based License, state=0, type=0, cmd=$ASHELL -n -e -ate LICENS/ATE, parent=0
56 14:11:53 <TELNET> rtn:0, id=7
57 14:11:53 <TELNET> EditMenuItem op=1, id=1 txt=&Disconnect, state=0, type=10000, cmd=|D, parent=0
58 14:11:53 <TELNET> rtn:0, id=8
59 14:11:53 <TELNET> rtn:0, id=-200
60 14:11:53 <TELNET> TAB(-10,2);ZOOM for Linux [Signin]
61 14:11:53 <TELNET> TAB(-10,1);ZOOM for Linux [Signin]
62 14:11:53 <TELNET> EditControl(hi=0] 3,0[null],"*",0,[,0,0],0,-,0x57fcd0,0,0,200000,200000,0,0,0,0,,,0,0)
63 14:11:53 <TELNET> TAB(-10,20);&#9616;3,0,"",0,536870912,"",,0,0,0,0,-2,-1,0,0,,"",,1,,0,0,0,,
64 14:11:53 <TELNET> EditControl(hi=0] 3,0[],"",0,[,0,0],20000000,-,0x168540,0,0,0,0,-2,-1,0,0,,,,0)
65 14:11:53 <TELNET> -> send response (kbd): -2,0 (5 bytes, icc=0)
66 14:11:53 <TELNET> sending kbd response directly (5 bytes): -2,0
<&#9616;
67 14:11:53 <TELNET> TAB(-10,39);%miame%\icons\vista\zoom1.bmp,0
68 14:11:53 <TELNET> Releasing KS_HOLD
69 14:11:53 <TELNET> EditControl(hi=0] 3,0[null],"*",0,[,0,0],0,-,0x57fcd0,0,0,200000,200000,0,0,0,0,,,0,0)
----------------------------------------------------------------
70 14:11:53 <TELNET> TAB(-10,31);&#9616;\\fl-nas01\ZOOM\Scan_Files\zoom\apps\edgescan.ico
71 14:11:53 <TELNET> Setting KS_HOLD for tab(-10,31)
72 14:12:00 <TELNET> -> send response (kbd): -1,0,0,0 (9 bytes, icc=0)
-----------------------------------------------------------------
73 14:12:00 <TELNET> sending kbd response directly (9 bytes): -1,0,0,0
<&#9616;
74 14:12:00 <TELNET> TAB(-10,49);
75 14:12:00 <TELNET> Releasing KS_HOLD
76 14:12:00 <TELNET> TAB(-10,20);&#9616;1,0,"ZOOM Signin",0,671088896,"",,10,17,21,65,0,0,0,0,,"",,1,,0,0,16,,
77 14:12:00 <TELNET> Setting KS_HOLD for tab(-10,20)
78 14:12:00 <TELNET> EditControl(hi=0] 1,0[],"ZOOM Signin",0,[,0,0],28000100,-,0x16854b,10000,17000,22000,66000,0,0,0,0,,,,16)
79 14:12:00 <TELNET> Rough reverse coord conv: MIAMEDLGI,28000100 (10000,17000,22000,66000) -> (10000,17320,22000,66130)
80 14:12:00 <TELNET> Create Control #0 47d0214 (MIAMEDLGI) : 10000,17000-22000,66000 (220,246-808,583)
81 14:12:00 <TELNET> -> send response (kbd): 0,1 (4 bytes, icc=0)
82 14:12:00 <TELNET> sending kbd response directly (4 bytes): 0,1
<&#9616;
83 14:12:00 <TELNET> TAB(-10,20);&#9616;1,0,"",0,0,"",,9,1,9,80,-2,-2,0,0,,"",,0,STATIC,1342181381,0,0,,
84 14:12:00 <TELNET> EditControl(hi=1] 1,0[],"",0,[STATIC,50001005,0],0,-,0x168538,9500,1000,9500,81000,-2,-2,0,0,,,,0)
85 14:12:00 <TELNET> Rough reverse coord conv: STATIC,40000 (9500,1000,9500,81000) -> (9500,1000,9500,81160)
86 14:12:00 <TELNET> Create Control #1 258028e (STATIC) : 9500,1000-9500,81000 (0,229-960,230)
87 14:12:00 <TELNET> SetControlFont(idx=-1,attr=0,scale=0,face=,type=262144,max=80,winsize=1024,692,state=max)
88 14:12:00 <TELNET> fidx=1, nref=1, face=MS Shell Dlg, ht=-15, wd=0, cs=400, pf=0
89 14:12:00 <TELNET> EditControl(hi=2] 4,0[null],"*",0,[,0,0],0,-,0x57fcd0,10000,1000,11000,2000,0,0,0,0,,,,0)
90 14:12:00 <TELNET> EditControl(hi=2] 4,0[null],"*",0,[,0,0],0,-,0x57fcd0,10000,1000,25000,81000,0,0,0,0,,,,0)
91 14:12:00 <TELNET> TAB(-10,20);&#9616;1,0,"&OK",0,134283264,"%VK_xF999%",,10200,34,11400,40,0,0,0,0,,"",,1,,0,0,0,,
92 14:12:00 <TELNET> EditControl(hi=2] 1,0[],"&OK",0,[,0,0],8010000,-,0x16854d,10200,34000,11400,41000,0,0,0,0,,,,2)
93 14:12:00 <TELNET> Rough reverse coord conv: ASHBUTTON,8010400 (10200,34000,11400,41000) -> (10160,34000,11300,41160)
94 14:12:00 <TELNET> Create Control #2 34d023a (ASHBUTTON) : 10200,34000-11400,41000 (396,248-480,280)
95 14:12:00 <TELNET> SetControlFont(idx=-1,attr=0,scale=0,face=,type=134284288,max=7,winsize=1024,692,state=max)
96 14:12:00 <TELNET> fidx=1, nref=2, face=MS Shell Dlg, ht=-15, wd=0, cs=400, pf=0
97 14:12:00 <TELNET> -> send response (kbd): 0,3 (4 bytes, icc=0)
98 14:12:00 <TELNET> sending kbd response directly (4 bytes): 0,3
<&#9616;
99 14:12:00 <TELNET> TAB(-10,20);&#9616;1,0,"Close",0,134283264,"%VK_ESCAPE%",,10200,42,11400,48,0,0,0,0,,"",,1,,0,0,0,,
100 14:12:00 <TELNET> EditControl(hi=3] 1,0[],"Close",0,[,0,0],8010000,-,0x168550,10200,42000,11400,49000,0,0,0,0,,,,2)
101 14:12:00 <TELNET> Rough reverse coord conv: ASHBUTTON,8010400 (10200,42000,11400,49000) -> (10160,42000,11300,49160)
102 14:12:00 <TELNET> Create Control #3 3ec01ac (ASHBUTTON) : 10200,42000-11400,49000 (492,248-576,280)
103 14:12:00 <TELNET> SetControlFont(idx=-1,attr=0,scale=0,face=,type=134284288,max=7,winsize=1024,692,state=max)
104 14:12:00 <TELNET> fidx=1, nref=3, face=MS Shell Dlg, ht=-15, wd=0, cs=400, pf=0
105 14:12:00 <TELNET> -> send response (kbd): 0,4 (4 bytes, icc=0)
106 14:12:00 <TELNET> sending kbd response directly (4 bytes): 0,4
<&#9616;
107 14:12:00 <TELNET> TAB(-10,20);1,0,User Name,0, 262272 ,,, 4100 , 2 , 4800 , 10 ,-1,-1,0,0,,, 0
108 14:12:00 <TELNET> EditControl(hi=4] 1,0[],"User Name",0,[,0,0],40080,-,0x168543,4100,2000,4800,11000,-1,-1,0,0,,,0 ,2)
109 14:12:00 <TELNET> Rough reverse coord conv: ASHSTATIC,40080 (4100,2000,4800,11000) -> (4000,2000,4880,11160)
110 14:12:00 <TELNET> Create Control #4 313026e (ASHSTATIC) : 4100,2000-4800,11000 (12,83-120,102)
111 14:12:00 <TELNET> SetControlFont(idx=-1,attr=0,scale=0,face=,type=262272,max=9,winsize=1024,692,state=max)
112 14:12:00 <TELNET> fidx=1, nref=4, face=MS Shell Dlg, ht=-15, wd=0, cs=400, pf=0
113 14:12:00 <TELNET> TAB(-10,20);1,0,"",2099456,134808640,"·1.", ,4,12,4,21,-2,-2,0,0,,"%|G|E|K*|2ghc123456T9Lk?",,0,,0,0
114 14:12:00 <TELNET> EditControl(hi=5] 1,0[],"",200900,[,0,0],8090440,-,0x168549,4000,12000,5000,22000,-2,-2,0,0,,%|G|E|K*|2ghc123456T9Lk?,,0)
115 14:12:00 <TELNET> Rough reverse coord conv: ASHEDIT,8090440 (4000,12000,5000,22000) -> (4000,11840,5000,22160)
116 14:12:00 <TELNET> Create Control #5 200160 (ASHEDIT) : 4000,12000-5000,22000 (130,81-254,104)
117 14:12:00 <TELNET> SetControlFont(idx=-1,attr=0,scale=0,face=,type=134808640,max=10,winsize=1024,692,state=max)
118 14:12:00 <TELNET> fidx=1, nref=5, face=MS Shell Dlg, ht=-15, wd=0, cs=400, pf=0
119 14:12:00 <TELNET> TAB(-10,20);1,0,Password,0, 262272 ,,, 4100 , 25 , 4800 , 32 ,-1,-1,0,0,,, 0
120 14:12:00 <TELNET> EditControl(hi=6] 1,0[],"Password",0,[,0,0],40080,-,0x168542,4100,25000,4800,33000,-1,-1,0,0,,,0 ,2)
121 14:12:00 <TELNET> Rough reverse coord conv: ASHSTATIC,40080 (4100,25000,4800,33000) -> (4000,25000,4880,33160)
122 14:12:00 <TELNET> Create Control #6 213020c (ASHSTATIC) : 4100,25000-4800,33000 (288,83-384,102)
123 14:12:00 <TELNET> SetControlFont(idx=-1,attr=0,scale=0,face=,type=262272,max=8,winsize=1024,692,state=max)
124 14:12:00 <TELNET> fidx=1, nref=6, face=MS Shell Dlg, ht=-15, wd=0, cs=400, pf=0
125 14:12:00 <TELNET> TAB(-10,20);1,0,"",2099456,134808640,"·2.", ,4,34,4,43,-2,-2,0,0,,"%|G|E|K*|2ghc123456T9Lk?SO",,0,,0,0
126 14:12:00 <TELNET> EditControl(hi=7] 1,0[],"",200900,[,0,0],8090440,-,0x168549,4000,34000,5000,44000,-2,-2,0,0,,%|G|E|K*|2ghc123456T9Lk?SO,,0)
127 14:12:00 <TELNET> Rough reverse coord conv: ASHEDIT,8090440 (4000,34000,5000,44000) -> (4000,33840,5000,44160)
128 14:12:00 <TELNET> Create Control #7 1d60272 (ASHEDIT) : 4000,34000-5000,44000 (394,81-518,104)
129 14:12:00 <TELNET> SetControlFont(idx=-1,attr=0,scale=0,face=,type=134808640,max=10,winsize=1024,692,state=max)
130 14:12:00 <TELNET> fidx=1, nref=7, face=MS Shell Dlg, ht=-15, wd=0, cs=400, pf=0
131 14:12:00 <TELNET> TAB(-10,20);1,0,Database,0, 262272 ,,, 6100 , 3 , 6800 , 10 ,-1,-1,0,0,,, 0
132 14:12:00 <TELNET> EditControl(hi=8] 1,0[],"Database",0,[,0,0],40080,-,0x168542,6100,3000,6800,11000,-1,-1,0,0,,,0 ,2)
133 14:12:00 <TELNET> Rough reverse coord conv: ASHSTATIC,40080 (6100,3000,6800,11000) -> (6000,3000,6880,11160)
134 14:12:00 <TELNET> Create Control #8 3620262 (ASHSTATIC) : 6100,3000-6800,11000 (24,137-120,156)
135 14:12:00 <TELNET> SetControlFont(idx=-1,attr=0,scale=0,face=,type=262272,max=8,winsize=1024,692,state=max)
136 14:12:00 <TELNET> fidx=1, nref=8, face=MS Shell Dlg, ht=-15, wd=0, cs=400, pf=0
137 14:12:01 <TELNET> TAB(-10,20);1,0,"",2099200,201393152,"·3.", ,6,12,8,43,-2,-2,0,0,,"%|G|E|K*|2gh123456T9Lk?OO||C||S||L|}]",,0,,0,0
138 14:12:01 <TELNET> EditControl(hi=9] 1,0[],"",200800,[,0,0],c010400,-,0x168549,6000,12000,9000,44000,-2,-2,0,0,,%|G|E|K*|2gh123456T9Lk?OO||C||S||L|}],,0)
139 14:12:01 <TELNET> Rough reverse coord conv: ASHCOMBO,c010400 (6000,12000,9000,44000) -> (6000,11840,8980,44160)
140 14:12:01 <TELNET> Create Control #9 4540212 (ASHCOMBO) : 6000,12000-9000,44000 (130,135-518,213)
141 14:12:01 <TELNET> SetControlFont(idx=-1,attr=0,scale=0,face=,type=201393152,max=32,winsize=1024,692,state=max)
142 14:12:01 <TELNET> fidx=1, nref=9, face=MS Shell Dlg, ht=-15, wd=0, cs=400, pf=0
143 14:12:01 <TELNET> TAB(-10,20);&#9616;1,0,"Sign-in Information",0,167772224,"",,2,2,8,47,0,-1,0,0,,"",,1,,0,0,0,,
144 14:12:01 <TELNET> EditControl(hi=10] 1,0[],"Sign-in Information",0,[,0,0],a000040,-,0x168553,2000,2000,9000,48000,0,-1,0,0,,,,0)
145 14:12:01 <TELNET> Rough reverse coord conv: ASHGROUPBOX,a000040 (2000,2000,9000,48000) -> (2000,2000,8980,48160)
146 14:12:01 <TELNET> Create Control #10 49801fe (ASHGROUPBOX) : 2000,2000-9000,48000 (12,27-564,211)
147 14:12:01 <TELNET> SetControlFont(idx=-1,attr=0,scale=0,face=,type=167772224,max=46,winsize=1024,692,state=max)
148 14:12:01 <TELNET> fidx=1, nref=10, face=MS Shell Dlg, ht=-15, wd=0, cs=400, pf=0
149 14:12:01 <TELNET> -> send response (kbd): 0,11 (5 bytes, icc=0)
150 14:12:01 <TELNET> sending kbd response directly (5 bytes): 0,11
<&#9616;
151 14:12:01 <TELNET> TAB(-10,96);&#9616;4,12,10,0,"|G|E|K*|2ghc123456T9Lk?|f","",129,0,0,-1,-1,-1,"","/105//01//..//",">%~·1.","",10,,
152 14:12:01 <TELNET> infld control(1,id,,0,1342177408,,,4,12,4,21,-2,-2)
153 14:12:01 <TELNET> EditControl(hi=11] 1,0[],"",200000,[ASHEDIT,50000080,200],400,-,NULL,4000,12000,5000,22000,-2,-2,0,0,,%|G|E|K*|2ghc123456T9Lk?|f,,0)
154 14:12:01 <TELNET> Dereference Font #1, (ctl) nRef=9
155 14:12:01 <TELNET> Destroy Control #5 200160 (ASHEDIT) @ 4000,12000
156 14:12:01 <TELNET> Rough reverse coord conv: ASHEDIT,80400 (4000,12000,5000,22000) -> (4000,11840,5000,22160)
157 14:12:01 <TELNET> Create Control #5 210160 (ASHEDIT) : 4000,12000-5000,22000 (130,81-254,104)
158 14:12:01 <TELNET> SetControlFont(idx=-1,attr=0,scale=0,face=,type=525312,max=10,winsize=1024,692,state=max)
159 14:12:01 <TELNET> fidx=1, nref=10, face=MS Shell Dlg, ht=-15, wd=0, cs=400, pf=0

Here is the trace after the first Input
code:
161 14:14:43 <TELNET>    fidx=1, nref=10, face=MS Shell Dlg, ht=-15, wd=0, cs=400, pf=0
162 14:14:51 <TELNET> EditControl(hi=11] 3,6[null],"",0,[,0,0],0,-,0x57fcd0,4000,12000,5000,22000,-2,-2,0,0,,,0,0)
163 14:14:51 <TELNET> Dereference Font #1, (ctl) nRef=9
164 14:14:51 <TELNET> Destroy Control #5 317026e (ASHEDIT) @ 4000,12000
165 14:14:51 <TELNET> TAB(-10,20);1,0,"FMC",2097408,134808640,"·1.", ,4,12,4,21,-2,-2,0,0,,"%|G|E|K*|2ghc123456T9Lk?|f",,0,,1342177280,0
166 14:14:51 <TELNET> EditControl(hi=11] 1,0[],"FMC",200100,[,50000000,0],8090440,-,0x16854c,4000,12000,5000,22000,-2,-2,0,0,,%|G|E|K*|2ghc123456T9Lk?|f,,0)
167 14:14:51 <TELNET> Rough reverse coord conv: ASHEDIT,8090440 (4000,12000,5000,22000) -> (4000,11840,5000,22160)
168 14:14:51 <TELNET> Create Control #5 318026e (ASHEDIT) : 4000,12000-5000,22000 (130,81-254,104)
169 14:14:51 <TELNET> SetControlFont(idx=-1,attr=0,scale=0,face=,type=134808640,max=10,winsize=1024,692,state=max)
170 14:14:51 <TELNET> fidx=1, nref=10, face=MS Shell Dlg, ht=-15, wd=0, cs=400, pf=0
171 14:14:51 <TELNET> -> send response (kbd): 0,13,0,0~FMC (20 bytes, icc=0)
172 14:14:51 <TELNET> sending kbd response directly (20 bytes): 0,13,0,0~FMC  <&#9616;
173 14:14:51 <TELNET> TAB(-10,96);&#9616;4,12,10,0,"|G|E|K*|2ghc123456T9Lk?|f","",129,0,0,-1,-1,-1,"","/105//01//..//",">%~·1.","",10,,
174 14:14:51 <TELNET> infld control(1,id,,0,1342177408,,,4,12,4,21,-2,-2)
175 14:14:51 <TELNET> EditControl(hi=11] 1,0[],"",200000,[ASHEDIT,50000080,200],400,-,NULL,4000,12000,5000,22000,-2,-2,0,0,,%|G|E|K*|2ghc123456T9Lk?|f,,0)
176 14:14:51 <TELNET> Dereference Font #1, (ctl) nRef=9
177 14:14:51 <TELNET> Destroy Control #5 318026e (ASHEDIT) @ 4000,12000
178 14:14:51 <TELNET> Rough reverse coord conv: ASHEDIT,80400 (4000,12000,5000,22000) -> (4000,11840,5000,22160)
179 14:14:51 <TELNET> Create Control #5 319026e (ASHEDIT) : 4000,12000-5000,22000 (130,81-254,104)
180 14:14:51 <TELNET> SetControlFont(idx=-1,attr=0,scale=0,face=,type=525312,max=10,winsize=1024,692,state=max)
181 14:14:51 <TELNET> fidx=1, nref=10, face=MS Shell Dlg, ht=-15, wd=0, cs=400, pf=0

Program Snippet

code:
CHECK'NETWORK:
!
! Check to see if this PC is "licensed" by looking for the ICON
! in the windows APPS DIRECTORY.
!
BYTES=0
WORK=APPS'DIR$+"\edgescan.ico"
LOGG$="Looking for ZOOM Scan: "+WORK : CALL UPDATE'LOG
XCALL MIAMEX,131,"R",WORK,BYTES ! Lookup file in PC Format
!
! Pause here for Miamex to finish
!
FOR X=1 TO 5
XCALL SLEEP,.5
XCALL NBUF,A
IF A=13 OR BYTES<>0 X=5
NEXT X
!
IF BYTES=<1 LOGG$="NOT FOUND! Bytes="+STR(BYTES) : CALL UPDATE'LOG :
!
LOGG$="FOUND! Activated ZOOM Scan. Bytes="+STR(BYTES) : CALL UPDATE'LO
ZSCAN=2
RETURN

ps: 7 seconds also seems to be a long delay for the miamex command to respond... Any way to decrease the timeout?

Thanks.

[ May 02, 2012, 13:28: Message edited by: Frank - edgeMED Healthcare ]

From: Deerfield Beach, Florida | Registered: Sep 2002  |  IP: Logged | Report this post to a Moderator
Jack McGregor
Administrator
Member # 1

Icon 1 posted      Profile for Jack McGregor     Send New Private Message       Edit/Delete Post   Reply With Quote 
A few comments...

1. You appear to be checking redundantly for the zoom1.bmp file - see trace lines 14 and 26. (No harm, no foul, but does waste time.)

2. Indeed, the check for \\fl-nas01\ZOOM\Scan_Files\zoom\apps\edgescan.ico (line 70) is failing, and taking 7 seconds to respond. Unfortunately, what the client-side trace doesn't show is that the server-side XCALL MIAMEX has probably already returned by the time ATE sends the response (since it's timeout was 5 seconds). So the response ends up in the keyboard buffer.

Your code is waiting an extra 2.5 seconds after the MIAMEX,MX_FILESTATS returns, but that isn't really accomplishing anything since the value of BYTES (passed to MIAMEX,MX_FILESTATS) isn't going to change during that time. Nor is the value of A. (I suspect that loop was left over from an earlier implementation which used TAB(-10,AG_FILESTATS) instead of MIAMEX, MX_FILESTATS.)

Also, although the actual delay seems to be about 7 seconds, I'm not sure that adding your 2.5 to the initial 5 is quite enough to be safe.

A workaround (short of updating A-Shell) would be to change the code to detect when it timed out (BYTES = -15) and then wait another few seconds and actually suck up the keyboard response. Something like...

code:
XCALL MIAMEX, MX_FILESTATS, "R", WORK, BYTES

! If the above timed out, BYTES will be -15
! in which case we should wait to retrieve
! the delayed response

IF BYTES = -15 THEN
CHAN = 0 ! keyboard
BYTES'REQ = -2 ! input until CR
BUFFER$ = ""
TIMEOUT = 4000 ! 4 secs
XCALL GET, BUFFER$, CHAN, BYTES'REQ, BYTES'RCV, TIMEOUT
BYTES = val(BUFFER$)
ENDIF

As for decreasing the timeout, the problem here is that it is occurring within a system call to check the stats of the specified file. Normally such an operation would take microseconds, but if the filespec is a network path and the network doesn't respond quickly either with an actual connection or a failure, there no easy way for us to interrupt that. We can tinker with the timeout in the MIAMEX, MX_FILESTATS call, but that timeout occurs on the server side, and making it quit earlier doesn't solve the problem of ATE waiting for the check-stats-of-file system call to return, after which it puts the result codes into the keyboard buffer to send back to the server (not knowing that the server has already given up).

What we could do (but it would require more updating of A-Shell and/or ATE), would be to send some kind of time limit indicator in advance to ATE (say, 3 seconds). Then, although ATE couldn't prevent the actual delay while waiting for the network to respond, it could detect after the fact that the delay was more than 3 seconds, so there would be no point in sending back any response.

But for now, I would suggest trying to come up with a different way to detect whether that file exists. Keep in mind that the problem is not the non-existence of the file, it's the non-existence (or non-responsiveness) of the network mapped directory. If you could arrange to put that file (or some other indicator) in some directory presumed to be local to the workstation (%MIAME%, %TEMP%, %ATEPERMCACHE%, etc.) then checking for its existence would be uniformly quick.

From: Woodland Hills, CA | Registered: Jun 2001  |  IP: Logged | Report this post to a Moderator
Frank - edgeMED Healthcare
Senior Developer
Member # 73

Icon 1 posted      Profile for Frank - edgeMED Healthcare     Send New Private Message       Edit/Delete Post   Reply With Quote 
Thanks for the Analysis Capn.

On Point:

1. I set an environment variable in our main housekeeping subroutine by looking for the zoom1.bmp file. The only other time i reference this file is when it is displayed. Is it possible the code to display the bmp does a "precheck" of the file? I am not calling miamex,131 twice here. If it is indeed ashell, perhaps that is redundant and can be removed?

2. A couple things worth noting up front. Unfortunately the customer sets up the best place for this directory. (it is for scanned images. We merely check for this .ico file as a basis of knowing if the PC is mapped properly). In the case of this customer they have remote stations as well, which also provides for a delay. (The trace above was from MY local ATE to their server).

You are correct in that if the PC "sees" the directory it will return an OK very quickly. If it doesnt, the delay persists. It is our intention to upgrade all sites to 6.0 as needed, perhaps if you add the timeout option it would provide me additional incentive when talking them into upgrading [Smile]

As an aside, in all my test cases, BYTES is never -15. It is always a -1 or -2 if the result is negative. So i suppose i could use your example above when BYTES<0? Just to make sure the input buffer is empty after the call. I think you are correct about the coded 2.5 second delay, i will remove that logic thanks.

Since this is only 1 program, it is convenient to make some local changes if it resolves the issue. If there are additional updates to 6.0 I can test those inhouse and if it provides a performance enhancement i can move towards an upgrade to this customer.

As always, thanks for your assistance.

From: Deerfield Beach, Florida | Registered: Sep 2002  |  IP: Logged | Report this post to a Moderator
Frank - edgeMED Healthcare
Senior Developer
Member # 73

Icon 1 posted      Profile for Frank - edgeMED Healthcare     Send New Private Message       Edit/Delete Post   Reply With Quote 
Followup:

I added your recommendation and it has helped to clear the input buffer, thanks. I thought you might be interested in the trace below. It looks like when the return from miame,131 = -2 the buffer gets hungup. Thanks again for your help.

0 11:42:31 <TEST> XCALL MIAMEX,131
1 11:42:31 <TEST> DONE: BYTES=-1
2 11:42:31 <TEST> XCALL GET:
3 11:42:35 <TEST> BUF$=>><< BYTES'REC=-1
4 11:42:43 <TEST> XCALL MIAMEX,131
5 11:42:43 <TEST> DONE: BYTES=-1
6 11:42:43 <TEST> XCALL GET:
7 11:42:47 <TEST> BUF$=>><< BYTES'REC=-1
8 11:43:29 <TEST> XCALL MIAMEX,131
9 11:43:29 <TEST> DONE: BYTES=-1
10 11:43:29 <TEST> XCALL GET:
11 11:43:33 <TEST> BUF$=>><< BYTES'REC=-1
12 11:43:49 <TEST> XCALL MIAMEX,131
13 11:43:57 <TEST> DONE: BYTES=-2
14 11:43:57 <TEST> XCALL GET:
15 11:43:57 <TEST> BUF$=>>▐-1,0,0,0<< BYTES'REC=9
16 11:44:33 <TEST> XCALL MIAMEX,131
17 11:44:40 <TEST> DONE: BYTES=-2
18 11:44:40 <TEST> XCALL GET:
19 11:44:40 <TEST> BUF$=>>▐-1,0,0,0<< BYTES'REC=9
20 11:45:11 <TEST> XCALL MIAMEX,131
21 11:45:19 <TEST> DONE: BYTES=-2
22 11:45:19 <TEST> XCALL GET:
23 11:45:19 <TEST> BUF$=>>▐-1,0,0,0<< BYTES'REC=9

From: Deerfield Beach, Florida | Registered: Sep 2002  |  IP: Logged | Report this post to a Moderator
Jack McGregor
Administrator
Member # 1

Icon 1 posted      Profile for Jack McGregor     Send New Private Message       Edit/Delete Post   Reply With Quote 
My mistake on the -15 vs -2. (-15 occurs when there is a total breakdown of the ATE protocol, not just a timeout as in your case.) I think it would be safe to consider anything less than -1 as a probable timeout (particularly if there was a time delay of 5+ seconds during the call).

In your trace above, the XCALL GET following an immediate return of -1 from MIAMEX,131 (ex. lines 0-3) is just wasting 4 seconds, since you've already gotten the response and nothing else is going to arrive. It is only needed in the case where you receive -2 and there was a 5+ second delay (as in lines 12-15). Note that the XCALL GET (line 14) returned within 1 second, indicating that the MIAMEX,131 timeout occurred just before ATE sent its response (i.e. just before the network timeout).

So to improve my earlier example...

code:
T1 = TIME  ! time the MX_FILESTATS call...

XCALL MIAMEX, MX_FILESTATS, "R", WORK, BYTES

! If the above timed out, BYTES will be -2 (or less),
! and at least 5 seconds will have elapsed,
! in which case we should wait to retrieve
! the delayed response

IF BYTES < -1 and (TIME-T1) >= 5 THEN
CHAN = 0 ! keyboard
BYTES'REQ = -2 ! input until CR
BUFFER$ = ""
TIMEOUT = 8000 ! 8 secs max
XCALL GET, BUFFER$, CHAN, BYTES'REQ, BYTES'RCV, TIMEOUT
BYTES = val(BUFFER$)
ENDIF

On point #1, perhaps we should discuss that offline, as I think it is going to require looking at your code or adding more traces (to the server side) to pin down where the redundant MX_FILESTATS call is coming from. It's hard for me to imagine it could be generated within A-Shell, because A-Shell wouldn't have any other way of knowing about that particular .bmp filespec.

As for improving the actual performance of testing for an inoperative network location, 6.0 isn't going to solve that. I'm not sure anything can solve it. (This is based on the likely fact that if you type that UNC path into the Start menu Run/Search box, you'll probably get the same delay.) 6.0 would most likely eliminate the need for the workaround code snippet above (to deal with the timeout), since the timeout has been increased enough to probably prevent it from happening. But that isn't going to improve the "performance" (i.e. responsiveness).

About the only way I can see to improve the responsiveness in the MX_FILESTATS call would be to implement some kind of two-step, multi-thread mechanism. On receipt of the request, ATE could spawn a separate thread to do the file lookup, while setting a short timeout in the main thread (maybe 1.5 seconds). If the timer expires before the lookup has returned, it could send back a special code to the MX_FILESTATS call indicating that the operation is taking longer than expected. The application could then go on to do some other operations without waiting for the network timeout. Meanwhile, when the network lookup finally returns, ATE would just store the result, until the application requested it via a subsequent variation of the MX_FILESTATS call.

That would allow you to avoid the wait (or more specifically, to do something else during that time), but it requires rather complicated changes to your app, not to mention updating both ATE and A-Shell to support the new protocol. Furthermore, since the typical network timeout (*see below) seems to be several seconds, it would only be useful if you actually had several seconds worth of other stuff to do in the meantime. (Maybe if you sent the query immediately on startup and didn't need the answer until you got into an actual program, that might work, but if you need the result for the main menu display, several seconds would probably be way too long anyway.)

* Further note on the network timeout: Using the Start menu search/run box is probably a good way to test the range of delays. On my Windows 7 machine in a P2P workgroup, if I type in a totally bogus \\xyz\abc path, it takes about 25 seconds for it to respond that it couldn't find the directory. So that seems like a worst-case scenario, but one that could easily happen on a remote machine. If I enter \\server\abc where \\server is valid but there is no \abc share, the delay is not much better (maybe 20 seconds). But if I enter both requests in sequence, then the second delay is much shorter than the first. Also, the first time I enter a valid \\server\path, it sometimes takes a few seconds to respond, whereas subsequently it responds instantly to the same path. So in other words, the network delay is hard to predict (although most likely it would be much faster in a domain environment).

What we really need is a faster way to identify if a network path is valid or not.

From: Woodland Hills, CA | Registered: Jun 2001  |  IP: Logged | Report this post to a Moderator
Stephen Funkhouser
Senior Developer
Member # 301

Icon 1 posted      Profile for Stephen Funkhouser     Send New Private Message       Edit/Delete Post   Reply With Quote 
It would certainly be nice to have a faster method to identify if a network host/path was valid, but if there was a reliable faster method there would be a Window's API call for it.

I just can't see how you can make it any faster; except, for perhaps in a domain environment where you have an authoritative WINS master.

--------------------
Stephen Funkhouser
Diversified Data Solutions

From: Northwest Arkansas | Registered: Nov 2006  |  IP: Logged | Report this post to a Moderator
Frank - edgeMED Healthcare
Senior Developer
Member # 73

Icon 1 posted      Profile for Frank - edgeMED Healthcare     Send New Private Message       Edit/Delete Post   Reply With Quote 
Thanks again for the analysis and recomendations.

With these latest tweaks i think we have souped up this hot rod about as much as we can for now.

Sometimes it comes straight down to the answer of "it is what it is". As is the case with the network search. Since this is a 1 time sign-in event for the customer i think a 4-5 second delay won't hinder productivity too much... [Wink]

With fixing the input buffer and only waiting "if necessary" i think we are in good shape.

As far as the zoom1.bmp, dont worry, doesnt seem to be stealing away too many cpu cycles.. if for some reason you get bored and are fearing an onset of senility unless you debug something... let me know [Smile]

From: Deerfield Beach, Florida | Registered: Sep 2002  |  IP: Logged | Report this post to a Moderator
   

Quick Reply
Message:

HTML is not enabled.
UBB Code™ is enabled.

Instant Graemlins
   


Post New Topic  Post A Reply Close Topic   Feature Topic   Move Topic   Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:


Contact Us | Visit our main website at www.microsabio.com

Powered by UBB.classic™ 6.7.3