Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSComm.Output with multiple keystrokes (Ctrl+Shift+B)

Status
Not open for further replies.

ALSav

Technical User
Feb 21, 2001
66
0
0
GB
Hi there,
I have a gas analyser on port 3 and would like to send it the following string. (Brackets indicate that the keys are held down together)

(Ctrl+Shift+B)& "*AKON" & (Ctrl+Shift+C)

I can send this string successfully using the hyperterminal and keyboard but I would really like to send it using VB because the analyser will be sampling every 10 minutes for 2 days so I was wondering
(a) Would it be easier for VB to communicate this string to the hyperterminal and employ SendKeys to handle the multiple keystrokes? I am having difficulty getting to work so any help wih this one would be gratefully received or
(b)Should I use MSComm. I have tried this too but my main problem is translating the above message into a single string to use with

MSComm1.Output = "mystring"

All suggestions welcome

regards
ALSav
 
It would be best to use the mscomm components. Otherwise you will have no interaction with your hardware.

Ctrl-Shift-B initiates or opens the connection.
Ctrl-Shift-C closes or hangs-up the connection.

Try this code on a form with an msscomm control.

With MSComm1
.CommPort = 3

.PortOpen = True
.Output = "*AKON"
.PortOpen = False
End With
 
Thanks VBrit,
that would make sense, hadn't thought of that at all!!

It will be a few days before I can try it out but I will keep you posted.

regards

ALSAv
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top