
- #Excel vba serial port mscomm control how to
- #Excel vba serial port mscomm control serial
- #Excel vba serial port mscomm control code
- #Excel vba serial port mscomm control Pc
#Excel vba serial port mscomm control serial
I have also installed an extra serial port in my CPU, to allow me to test transmissions and receptions. Version 6 is no longer available at my local computer store. I have bought Visual Basic.NET Standard Edition. What is the default for the Handshaking property of the MSComm control? How do I actually send strings, adding ASCII characters like and (shown above)? How would I capture a character string, strip extra characters, and display it (would a message box or text box work best)? Some more specific discussion along these lines would be quite helpful. Are the use of MSComm and the Open Comm statement equivalent? How does the Comm statement work? What would a sample subroutine using the Comm statement look like? How does one decide whether to use Xon/Xoff, RTS/CTS, or both for handshaking? Perhaps I should focus and even expand a little. Osmodean, Thank you for your encouragement, but I still need an answer to my questions. Should I ignore the Handshaking property, or set it to something?Ī little advice, up front, should help me get this coding started. I envision starting with something like, Private Sub Form_Load( ) With MSComm1.Settings = '9600,O,7,2' 'baud,parity,data bits,stop bits.CommPort = 1.PortOpen = True End With although I've also seen statements like, Open 'COM1:9600,n,7,2' For Input as #1 Is this equivalent to the previous 'With' statement? Also, the protocol says the use of handshaking when communicating with the controller is optional.
#Excel vba serial port mscomm control code
Perhaps someone can help me 'jump start' this part of the project with some simple code samples? For example, I'd like to ask the controller what setup program is assigned to pump drive 1, 'N1 and display the numeric response from the controller, '#', with the carriage return removed. I'm slowly working through a site, a number of MicroSoft Knowledge Base articles, and code samples provided by Expert Exchange members, to get started writing actual subroutines. Now that I am familiar with the controller protocol, I'm moving on to VBA code. The controller resonds with an 'acknowledge' symbol, a 'negative acknowledge' symbol, or numeric data.
#Excel vba serial port mscomm control Pc
The body of PC transmissions may have 1- or 2-letter commands, sometimes followed by numeric parameters. The controller responds with data, followed. Commands from the PC begin with a 'start of text' character and end with a 'carriage return'.

The controller has its own serial protocol using ASCII characters. Since then, I have established communication with the controller using Hyperterminal. The work PC is actually hooked up to the serial device, a pump controller. I have succeeded in getting it on my home Windows XP machine where I write code, and a PC at work running Win' 98.

#Excel vba serial port mscomm control how to
Recently, I got helpful advice on how to install and register MSComm32.ocx for a serial communication project I am working on. For more information about WinWedge please visit. It also supports sending data out a serial port as well. WinWedge is an executable program that runs in the background and feeds serial data directly to other programs either by stuffing the keyboard buffer or by passing the data to other programs using Dynamic Data Exchange (DDE). The easiest way to get serial data into an Excel spreadsheet would be to use a 3rd party tool like WinWedge from TALtech.

If you have it on your system but do not have Visual Studio 6 installed, it also will not work because you do not have a license to use it. Possible Hardware Sources USB to serial and/or parallel ports can be found at.Įxcel does not come with the MSComm ActiveX control- it is provided with Visual Studio 6. Download ZaberExcelVBdemo for some examples on MSComm in Excel. Well if you have Visual Basic (probably VB6) then bypass the next few attempts.
