Controlling a Com Port without using the MSCOMM control.

Posted on 2005-05-12
Last Modified: 2008-01-09
I have an application, written in Access 2002 & VBA. I plan on redistributing this application using the access runtime.

I need to be able to output to a pole display hooked up to a comm port. I don't want to use the mscomm method because after reading some things about it, I think it will cause too much grief.

Using Open and Write to the comm port won't work as far as I know because I also want to send configuration commands to the display, not just text.

I would prefer being able to communicate directly using the correct driver. Honestly, I'm not sure exactly what to do here.

Here's what I need to do, someone can hopefully guide me in the right direction :->

On program startup, using VBA, I need to be able to configure the pole display correctly, in case something has gone wrong.
  I need to reset the display
  Set the Comm port
  Set the Baud Rate
  Set the Parity
  Set the Command Type (although I'm not even sure which command type to use)

During program operation I need to be able to
  Send text to the display
  Clear the display

The Pole Display I am using is a PartnerTech CD7220. It’s hooked up via USB, but winds up communicating through one of the computer’s comm ports.

I've exhausted every avenue with Partner Tech. Although they were very nice, they didn't know much about using the display with Access.

One more thing - if anything I've stated above about not being able to do, is in-correct, please let me know.



Question by:bselltiz
    LVL 17

    Expert Comment

    Most of the serial devices I've talked to use character strings to communicate in either direction.  Often times, it's a character command followed by a hexadecimal value.  In the past these were referred to as escape sequences.  With that in mind, using Open and write should be appropriate.  You would Open and write # to a printer just like you would write to a sequential file.   Have you tried it yet?
    LVL 48

    Accepted Solution

    It may not be that easy.
    You can save a lot of time by using a supporting dll:

    LVL 17

    Expert Comment

    It may not but it also may.. I've had years of experience talking to serial devices like that.  You really have to look at the technical reference of the device in question to know one way or the other.  That being said, a custom comms dll is almost always an easier way but usually you have to spend money on the one you referenced.

    Author Comment


    cactus_data  - I have downloaded and am currently evaluating Marshall Software's DLL.

    Arji - Can you give me an example of using your method, to do each of the following:

         Set Baud Rate
         Set Parity
         Set Command Type
    LVL 17

    Expert Comment

    Let me find some of my older code and I'll get back to you but if I remember correctly it was in VB so maybe the dll would be better....I'll get back to you though.


    Author Comment

    As long as it doesn't use the comm control, it should work in VBA, I hope.


    Author Comment

    Arji - any luck?
    LVL 17

    Assisted Solution

    So far none.  I have to pull it off a tape so it's kind of difficult.  But in thinking about it, I was doing that in VB a while back.  There should be VB documentation showing how to open a com port.  It was somethng like Open "Com1:, 9600, 1 ,1, Odd" as #1.  There's got to be some documentation on that somewhere.  I think I'll take a look at Googe to see if I can find it.  After Opening the port you would use the OUT method to send serial data to the device.  Something like "Out #1, HD0 & H00"......

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    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.

    Suggested Solutions

    This isn't a frequent question on EE. I must have seen it three or four times (among several thousand questions). However, I use this trick quite often, most frequently as a delayed Current event. A form does not expose it's calculation dependenc…
    I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
    Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

    779 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