I have a device that is attached to my COM2.  How do I use VB to sends commands to operate the device?  I have commands instruction to operate it but I dont have any driver for it.  Can I send commands to the device without driver?  If yes, how?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Put MSComm Control on your form.
In code:

Const Baud = "38400"
Const Port = "Com1:"
Const DataBit = "7"
Const Parity = "Odd"
Const FlowControl = 1

'Open port
    MSComm1.CommPort = Val(Mid(Port, 4, 1))              
    MSComm1.Settings = Baud & "," & Format(Left(Parity, 1), "<") & _
                "," & DataBit & "," & FlowControl
    MSComm1.OutBufferSize = 512
    MSComm1.PortOpen = True

    OpenPort = MSComm1.PortOpen

'If port open, then send your string
if OpenPort = True then
        MSComm1.Output = MyStr
end if

'Close port
    MSComm1.PortOpen = False


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cdlovesAuthor Commented:

I have another question if you would do I choose to print to the printer that is not a default printer?

You dont have to answer this....

Sorry, I don't know how to print on non-default printer without it's selecting. But I saw a discussion about it 3-5 days ago.
Usually I'm using CommonDialog.ShowPrinter to select a destination printer
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.