AnsweredAssumed Answered

Interface event (DAV) timeout problem.

Question asked by VRFuser on Mar 6, 1997
Item Subject: cc:Mail Text
     Hello.
     A piece of my program has to read binary data from a serial port and
     then parse it. The problem is that the length of the data (number of
     bytes can be anywhere from 0 (no data available) to 15).
    
     Using Interface Event for serial port seemed to be the winning
     solution since when set on "WAIT", its "event" pin fires the number of
     bytes received which can be plugged into intput pin "A" of serial
     interface DIO object configured for READ BINARY x BYTE ARRAY:a. This
     configuration works fine when there are some data available to be
     read. When there is no data on serial interface, the program
     hopelessly hangs as timeout feature of Interface Event does not seem
     to be working.
    
     I am attaching the source code for the program for those who care and
     are able to read it.
    
     Questions:
     1. Is there a workaround for this situation besides abandoning
     Interface Event and reading input string one byte at a time?
     2. Does HP VEE 4.0 addresses this situation?
    
     Regards,
    
     Sergey Ermolin
     HP - Santa Clara Division

.......................................................................

Item Subject: com2rsv.vee 3/6/97 5:27P
Could not convert BINARY FILE item to text.
Will attempt to 'shar' item as file '047efnq' at end of msg.


# This is a shell archive.  Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by Woody Anderson <openmail@hpcc31> on Thu Mar  6 17:33:19 1997
#
# This archive contains:
#     047efnq     
#
# Error checking via wc(1) will be performed.

LANG=""; export LANG
PATH=/bin:/usr/bin:$PATH; export PATH


rm -f /tmp/uud$$
(echo "begin 666 /tmp/uud$$
#;VL*n#6%@x

end" | uudecode) >/dev/null 2>&1
if [ X"`cat /tmp/uud$$ 2>&1`" = Xok ]
then
     unpacker=uudecode
else
     echo Compiling unpacker for non-ascii files
     pwd=`pwd`; cd /tmp
     cat >unpack$$.c <<'EOF'
#include <stdio.h>
#define C (*p++ - ' ' & 077)
main()
{
     int n;
     char buf[128], *p, a,b;

     scanf("begin %o ", &n);
     gets(buf);

     if (freopen(buf, "w", stdout) == NULL) {
          perror(buf);
          exit(1);
     }

     while (gets(p=buf) && (n=C)) {
          while (n>0) {
               a = C;
               if (n-- > 0) putchar(a << 2 | (b=C) >> 4);
               if (n-- > 0) putchar(b << 4 | (a=C) >> 2);
               if (n-- > 0) putchar(a << 6 | C);
          }
     }
     exit(0);
}
EOF
     cc -o unpack$$ unpack$$.c
     rm unpack$$.c
     cd $pwd
     unpacker=/tmp/unpack$$
fi
rm -f /tmp/uud$$

echo x - 047efnq '[non-ascii]'
$unpacker <<'@eof'
begin 660 047efnq
M*'-A=F5&;W)M870@(C(N,"(I#0HH9&%T92 B5&AU(# V+TUA<BQ.3DW(#$WX
M.C(W.C,X("(I#0HH=F5E<F5V("(S+C(Q(BD-"BAP;&%T9F]R;2 B4$,B*0T*X
M*%-A=F5#1B!N;RD-"BAF:6QT97).04X@,"D-"BAC;VUP;VYE;G0@,"!23T]4X
M0T].5$585 T*("AN86UE(")5;G1I=&QE9"(I#0H@*&EM<&QE;65N=&%T:6]NX
M#0H@("AL;V-K960@;FI#0H@("AT<FEG36]D92!D96<I#0H@("AN97AT240@X
M.3(I#0H@("AC;VUP;VYE;G0@-#0@5$585$1)4U!,05D-"B @("AI;G1E<F9AX
M8V4-"@DH:6YP=70@,0T*"2 H;F%M92 B1&%T82(I#0H)*0T*(" @*0T*(" @X
M*&EM<&QE;65N=&%T:6]N#0H@(" I#0H@("D-"B @*&-O;7!O;F5N=" W.2!4X
M15A41$E34$Q!60T*(" @*&EN=&5R9F%C90T*"2AI;G!U=" Q#0H)("AN86UEX
M(")$871A(BD-"@DI#0H@(" I#0H@(" H:6UP;&5M96YT871I;VX-"B @("D-X
M"B @*0T*(" H8V]M<&]N96YT(#@S($E/1$5624-%#0H@(" H;F%M92 B<V5RX
M:6%L7V-O;3(@*"! (#(I(BD-"B @("AI;G1E<F9A8V4-"@DH:6YP=70@,0T*X
M"2 H;F%M92 B02(I#0H)("AO<'1I;VYA;"!Y97,I#0H)*0T*"2AO=71P=70@X
M,0T*"2 H;F%M92 B6"(I#0H)("AL;V-K(&-O;G-T<F%I;G1S*0T*"2 H;W!TX
M:6]N86P@>65S*0T*"2D-"B @("D-"B @("AI;7!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T.2D-"@DI#0H@(" I#0H@X
M(" H<W1A8VMI;F=/<F1E<B S(#$@-" U(# @,BD-"B @*0T*(" H=&ET;&5"X
M9R B1W)A>2(I#0H@("AT:71L949G(")";&%C:R(I#0H@("AN=6UB97)&;W)MX
M871S#0H@(" H<F5A;$9O<FUA="!S=&%N9&%R9"D-"B @("AR96%L4VEG1&EGX
M:71S(#0I#0H@(" H<F5A;%)A9&EX4W!E8R T*0T*(" @*&EN=&5G97)"87-EX
7(&1E8VEM86PI#0H@("D-"B I#0HI#0IE                            X
                                                             X
end
@eof
set `wc -lwc <047efnq`
if test $1$2$3 != 2044203263
then
     echo ERROR: wc results of 047efnq are $* should be 204 420 3263
fi

chmod 660 047efnq

rm -f /tmp/unpack$$
exit 0

Outcomes