The information in this article applies to:
SUMMARYThis article describes the settings necessary to send data to the serial port by using Mscomm32.ocx. Mscomm32.ocx ships with the Professional Edition of Visual FoxPro. It can be used in Windows 95 or Windows NT only. MORE INFORMATIONThe most frequently used properties to send data to the serial port using the mscomm control are as follows: CommPortThe CommPort property specifies the communications port number. A numeric property that corresponds to the Comm port. By default, this property is set to 1 corresponding to com1. Valid values are 1, 2, 3, or 4 depending on the serial ports installed on the computer and their configuration.SettingsThe Settings property configures the baud rate, parity, data bits, and stop bits for the serial port. It is a character string with individual values separated by commas. By default, the Settings property contains 9600,N,8,1. This corresponds to 9600 baud, no parity, 8 data bits, and 1 stop bit.PortOpenThe PortOpen property specifies a logical value that controls whether or not the serial port is open and active. Once the previous properties are set to begin using the serial port, you can set this property to true.OutputThe Output property is assigned the string of characters to be sent to the serial port. To output the string "Hello World" to the serial port after the previous properties are set, use the following command:
Other properties that may be also be needed depending on the application
are as follows:
CommEventThe CommEvent property contains a value that represents the most recent communications event or errors.SthresholdThe Sthreshold property specifies the minimum number of characters in the output buffer that are sent.OutBufferCountThe OutBufferCount control returns the number of characters waiting in the transmit buffer. This should always be zero if the Sthreshold property is zero. Setting the OutBufferCount property to zero will clear the transmit buffer.OutBufferSizeThe OutBufferSize property specifies the size of the transmit buffer. By default, this buffer is 512 bytes. The larger the transmit buffer, the less memory available to other applications. Slow baud rates and large text strings written to the serial port may mean you need to make this value larger.Following is a sample that shows how to set up the comm control and dial the phone number 555-1234 by using the standard Hayes Modem commands.
Additional query words:
Keywords : kbcode kbnokeyword kbVFp300 kbVFp500 kbVFp600 |
Last Reviewed: July 27, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |