Solved

Serial Communication with MScomm

Posted on 1997-07-10
1
520 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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 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…

746 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