Solved

MSComm doing individual control characters

Posted on 2001-06-11
11
222 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
  • 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

816 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now