Solved

Serial Communication with MScomm

Posted on 1997-07-10
1
523 Views
Last Modified: 2010-01-13
I am trying to communicate with a serial device called a DataLink(DL). This DataLink is a protocol converter and a communication controller. The purpose of my program is to configure the DataLink (ie. Set the DL's COM and IRQ ect). My problem is this: When I transmit a message in ASCII or HEX (ie: DLE STX ETX .... OR IN HEX 10 02 03.. ect) the DataLink will reply with an "ACK" or "NACK" meaning a correct or incorrect transfer configuration. I am capable of transfer to the DL but cannot seem to be able to capture its response into VB. I have set the RThreshold to 1. I would like to be able to trap the message in a text box with the use of: MScomm1.Input    
        Text1.text = Mscomm1.Input
But this isn't working. Can you help me ? I would appreciate it enormly !
Thanks
Jean-Francois:   francois@intergate.bc.ca
0
Comment
Question by:pussycat
1 Comment
 
LVL 2

Accepted Solution

by:
DavidMartin earned 100 total points
ID: 1428202
Every time data is passed through the Comm Control a comm event is triggered you need to capture your data in there...

Sub MSComm_OnComm()

    'Each time this event is triggered
    'Add the contents of the Reader buffer to the internal buffer
    msBuffer = msBuffer & MSComm.Input

End Sub

You can then build up the message character by character until you are happy that you have a complete message, if I remember correctly this event gets triggered when you send data out so you'll have to code for that as well.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
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…

911 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

23 Experts available now in Live!

Get 1:1 Help Now