Solved

MSComm doing individual control characters

Posted on 2001-06-11
11
224 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Good resource for accessibility implementation 1 98
Windows Script Host failed (Access is denied.) error 6 340
TT Auto Dashboard 13 101
VB script to continue despite error 2 55
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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

733 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