Link to home
Start Free TrialLog in
Avatar of timberbt
timberbt

asked on

MSComm doing individual control characters

I'm in the process of replacing an old piece of Digital equipment that was running a measurement tool and I've run into a bit of a snag.
The old machine communicates serially to the measurement control machine.  I've hooked up a serial logic analyzer and I saw the following:

DTE: M220101006500016017018EiS
DCE:                        A

DTE: M220101006600016019020EeS
DCE:                        A

DTE: M220101006700016021022Ea:Do
DCE:                        AQ:S

Where S=Sx E=Ex A=Ak D=Dl Q=Eq

Now what I need help on is the control character use in the mscomm control of VB.  I send out the first string,
M220101006500016017018, but how do I send the Ex and wait for the Ak?  How do I send the Sx after that?  After I send the string, I simply receive an infinite amount of Ex characters returned to me, at the rate of about 1/sec.  

Anyone have any ideas on this level of control for the mscomm control?  Thanks in advance!!!!

=timberbt
Avatar of timberbt
timberbt

ASKER

Okay, my spaces were condensed there.  Quess it's not a fixed width font.  :)  The Ak's shown occur on the character follow the E.  so the first 'A' is positioned under the 'i', etc...  Sorry about that.

=timberbt
I haven't used the MSComm control but can't you build up your string using the ASCII codes for the control characters.

Soh is ASCII 1
Stx is ASCII 2
Etx is ASCII 3
Eot is ASCII 4
Enq is ASCII 5
Ack is ASCII 6

Dle is ASCII 16

all numbers in decimal

Hope this helps
Andrew
ASKER CERTIFIED SOLUTION
Avatar of AndrewDev
AndrewDev

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Put the numbers you wabt to send in an array NumData.
Convert from numeric to character like this.

    For MyLoop = 1 To items
        STRDATA$ = STRDATA$ & Chr$(NumData(Outer))
    Next MyLoop
Oops

Put the numbers you want to send in an array NumData.
                     Convert from numeric to character like this.

                        For MyLoop = 1 To items
                            STRDATA$ = STRDATA$ & Chr$(NumData(MyLoop))
                        Next MyLoop

Then send the string to MSComm
Andrewdev,
 
Now forgive me on my control character knowledge here, it's been a little while...  
From the serial logic analyzer we make the following relations to the ascii control characters:

Sx = STX
Ex = ETX
Ak = ACK
Dl = DLE
Eq = ENQ

so now on the DCE side, what are the 'i', 'e', and 'a' that occur simultaneously with the 'Ak'?  Since they're occuring the same time you're waiting fo the Ack, it shouldn't matter what they are at all, correct?  I just want to make sure it isn't some odd thing I'm not used to.  Thanks.

=timberbt
sorry that should have been DTE.  Apologies.

=timberbt
sorry that should have been DTE.  Apologies.

=timberbt
I also have one more control character of 'Ec'  I'm guessing that would be 'ESC' then eh?

=timberbt
sorry that should have been DTE.  Apologies.

=timberbt
I haven't got my full list of control caracters at home. I will look them up at work tomorrow and give you the full list

In answer to your question about the odd i e etc. I think your OK in assuming that it should be OK as you are waiting for ACK. Possibly noise producing spurious characters but I also am a bit rusty.

Regards
Andrew