Solved

MSComm doing individual control characters

Posted on 2001-06-11
11
219 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
 
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

743 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

12 Experts available now in Live!

Get 1:1 Help Now