Solved

MSComm doing individual control characters

Posted on 2001-06-11
11
225 Views
Last Modified: 2013-12-03
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
0
Comment
Question by:timberbt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 2
11 Comments
 
LVL 1

Author Comment

by:timberbt
ID: 6176996
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
0
 
LVL 5

Expert Comment

by:AndrewDev
ID: 6177102
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
0
 
LVL 5

Accepted Solution

by:
AndrewDev earned 200 total points
ID: 6177123
I should have said using the ASC function.
ie to send an Stx.
strMyString = ASC(2)

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Expert Comment

by:3rsrichard
ID: 6177168
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
0
 
LVL 3

Expert Comment

by:3rsrichard
ID: 6177187
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
0
 
LVL 1

Author Comment

by:timberbt
ID: 6177323
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
0
 
LVL 1

Author Comment

by:timberbt
ID: 6177328
sorry that should have been DTE.  Apologies.

=timberbt
0
 
LVL 1

Author Comment

by:timberbt
ID: 6177369
sorry that should have been DTE.  Apologies.

=timberbt
0
 
LVL 1

Author Comment

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

=timberbt
0
 
LVL 1

Author Comment

by:timberbt
ID: 6177991
sorry that should have been DTE.  Apologies.

=timberbt
0
 
LVL 5

Expert Comment

by:AndrewDev
ID: 6187579
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
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

689 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question