Sep 11, 2008 Brief description: RS232 logger ActiveX is an ActiveX component that uses Advanced Serial Data Logger to get either data from an RS232 or COM port or already processed and converted data besides the standard export tools in Advanced Serial Data Logger.
Serial I/O (RS232)
Under DOS, it was possible to directly access these ports. However, Windows 95 and above forbid direct hardware access. Therefore, this page exists to help get around windows.
Generic References
- I suggest starting with this good Tutorial.
- Here is the complete standard including the pin out, timing, and signal descriptions.
- Did you know that RS means Recommended Standard? This site also compares Simplex/Duplex and DTE/DCE. Free software shows how to write Windows 95 programs which access the serial port - comm32.zip/comm32.cpp (4kb)
- The Visual Basic help file explains how to use Comm.drv to access serial ports. (Search on serial.)
- Another tutorial and links to various rs232 related sites.
- Books and lots of very good links.
- While Windows does not normally allow you to directly access the hardware, WIN95IO.dll privides a simple work around. Unfortunately, the distribution package does not provide any examples, just 4 function prototypes. The following 2 examples may help.
- vbOut &H378, MyData%
temp% = vbInp &H378 - Many hints are available from comp.lang.basic.visual.misc.
- Hardware kits and book are available from Peter Anderson.
- The comp.arch.hobbyist FAQ contains many links on how to interface to the Serial Port, Parallel Printer, and Joystick, as well as links to information on IR Standards.
- Boondog Automation provides a number of related tutorials describing how to build your own hardware interfaces and how to write interface software. They also sell a parallel I/O, 8255-based ISA card - either as a kit or assembled.
- Information on various UARTs, includes links, pin-outs, and an overview.
- MarshallSoft provides a good FAQ explaining the UART with links to vendor specs. They also provide shareware libraries for a number of programming languages.
- This system.ini patch from Newsgroups: microsoft.public.win95.msdosapps may help you run DOS applications under Windows 95 et al.
- Portmon is a free GUI/device driver combination that monitors and displays all serial and parallel port activity on a system.
- Reynolds Electronics appears to be a basic PC hobby store. It has all sorts of Basic Stamp, PIC, and data aquisition info.
- B&B Electronics provides a variety of serial I/O devices (including a USB Data Acquisition Module - 8s/4d 12-bit ADC, 4 10-bit DAC, 8 digital I/Os, and software), books, and a pretty good free Technical Library.
- ePanorama.net provides a large number of links to all kinds of useful information - serial, parallel, IR, usb, firewire, keyboard, mouse, joystick.
- Isolated Full Duplex RS232C Interface provides schematics and a PC board for a self powered interface circuit the optically isolates the TxD and RxD lines from the PC serial port.
Visual Basic 6.0
Visual Basic Programmers Guide to Serial Communications by Richard Grier. Richard's page provides free ActiveX serial components for those that don't have MSComm32.ocx.
VB 6.0 provides VBTerm, a sample terminal emulation application under ..samplesVB98MSCOMM.
You can open a port as a file. This example, from comp.lang.basic.visual.misc, opens the printer
MS Access 97 SR-2
MS Access 97 SR-2 - Fails
On my system, the following code causes Access to hang.
I tested several variations with the same result - Without Len = 3
- With temp as a variant
- Both 'com1' and 'com1:'
- Both Input and Binary
MS Access 97 SR-2 - Works
- Set the threshold to one (1)
- When the first character is read, set a timer and add the character to the barcode
- As each additional character is read, re-start the timer
- When the timer expires, call the function of your choice and pass the completed barcode. (The example below just writes it to a component.)
- Finally, stop the timer and clear the string Barcode
- In the help, the case statement has many options. To simplify this example, I removed all but the one that reads the data.
- The only available timer is attached to the form. Therefore, it is hard to encapsulate this in a library.
- MS Access 97 SR-2 will not display the MSComm help when you click on a command and press F1 ... unless you FIRST locate and open 'C:WIN98HELPCOMCTL2.HLP'. (Your path may be different.)
- This code requires that MSCOMM32.ocx is installed on every machine that uses this feature. Simply copying the file is NOT sufficient. There are no instructions on how to do it correctly. Copying it installs the TypeLib resistry key, but not the several CLSID's or the License.
- I had everything working perfect. When I tried to demonstrate the code to my boss, NONE of the case constants were defined ... Well they were 2 hours before! (And they work fine now.)
Delphi
C++ Builder
_bios_serialcom
At any rate, I will NOT provide copies of bios.h to anyone.
Virtual Integrated Design provides various RS-232 circuits and free software examples.
Accessing the RS232 Port in DOS using BIOS.H functions provides a summary of the allowed options/contants. There is also a program showing how to use bioscom to access ports.
Microsoft provides a Simple Example Using _bios_serialcom(). The article states that this interface tends to loose data. In order to improve the reliability, the comport needs to call an interrupt routine which moves the data to a buffer. This was easy under DOS, but generally not allowed under Windows.
Windows API
Use CreateFile to open a handle to a communications resource, such as com1 or lpt1.
Test the returned handle to verify that the port is not locked by another process.
Use GetCommState to determine the current settings, SetCommState to change the settings.
You can use BuildCommDCB to pass common parameters (baud, parity, etc.) to the DCB as a string. But you'll still need SetCommState to actually change the settings.
See the DCB help for the supported constants.
Some additional commands - TransmitCommChar, PurgeComm, FlushFileBuffers
Microsoft Platform SDK - Communication Overview, Communication Functions
The only property which is remembered between disconnects is the Baud Rate. Parity, StopBits and the like are reset each time the connection is opened. Unfortunately, both SetCommState and SetCommConfig are extremely slow. As a result, it is not practical to disconnect the comport between uses.
Warning
URL: http:// cpcug.org / user / clemenzi / technical / Languages / SerialIO.htm
HOW TO READ AND WRITE A BYTE DATA USING THE SERIAL PORT 890054
HOW TO READ AND WRITE A BYTE DATA USING THE SERIAL PORT 890054 My question. I NEED TO NOW HOW TO READ AND WRITE A BYTE DATA USING THE SERIAL PORT, IN ORDER TO COMMUNICATE WITH AN HARDWARE. I'M USING PowerBuilder 5.0 AS A PROGRAMMING LANGUAGE. WE PLAN TO USE THE RS-232 AS THE COMMUNICATION PROTOCOL. I WANT TO USE THE FileOpen() FUNCTION, FOR OPEN THE 'COM1' OR 'COM2' ALSO, FileWrite() AND FileRead(), FUNCTIONS. I WANT THAT YOU SEND ME A SAMPLE CODE, USING THESE FUNCTIONS AND THE RS-232 PROTOCOL. I ALSO WANT TO NOW, IF POWERBUILDER USE THE CONFIGURATIO...
Writing & Reading data to a Serial port
I was wondering if anyone can give me a simple way to write and read data to and from a serial port using PB 6.5 or do I need to by some third party libraries. Thank You Chris Bohne [email protected] There are several OCXs on the market for this. Check http:www.deja.com for browsing through the newsgroups. If you want to write to the port by using powerscript, chekc my site for the 32bit modem dialer example. HTH -- - Eric Aling [TeamSybase], AVALIX InformationSystems, The Netherlands Eric's Home & PB Site @ http://www.knoware.nl/users/cypr115 ...
Using Mscomm32.ocx for serial port communication
Hi all, I have a cash drawer and and opener device connected to a USB port that is bridged to a COM16 serial port. According to the vendor I just need to send char(27)+char(53) down the serial port andit will open the cash drawer. They provide a MS Excel VBA sample which uses MScomm32.ocx and it works. But I have difficulties using that ocx file in PB 8. Is there someone here who can give me the required steps to implement and use that ocx in PB? Even better would be a code example. Someone suggested to create a window, do insert-->control-->OLE and select the MScomm32....
how to read data from serial port or usb port
hi,all i know powerbuilder is powerful in database development. i just want to know if i can get data from serial port or usb, and how? thanx I have read data from the serial port by using the Microsoft plugin MSCOMM32.OCX that is included in several of Microsoft's products, but specifically it is included with VISUAL STUDIO. Once you install it in your machine, you can use it from PB by declaring an OLE object container. You then can call its methods and use its properties. Regards 'Xiaotao, Lu' <[email protected]> escribi� en el mensaje ...
Use PB 10 to read/write via serial port (RS-232)
Dear all, Any idea of the captioned subject. I duuno what Win32 API I can use within PB. Hi, i have used SaxComm Activex and it works fine. Bye Marco > Dear all, > Any idea of the captioned subject. I duuno what Win32 > API I can use within PB. On Jan 30, 3:26 am, Marco wrote: > Hi, > > i have used SaxComm Activex and it works fine. > > Bye > > Marco > > > Dear all, > > Any idea of the captioned subject. I duuno what Win32 > > API I can use within PB. Another control that I've used in the past was t...
Using a data set to hold data read from the database. And how to write it back out, getting it out of the listbox
I havent worked with data sets lately so I am hoping from some help from someone.i am working on a web application using asp.net 2.0 and c#. Basically I need to read html text from a column in a database table(600 chars max)I then need to copy this text into a multi line listbox and allow it to be editedOnce the application user has edited the text, then they will press a save buttonand the text will be written back to the database. I don't know if this is the best choice, but I want to use a data set to read the text into.The data set will act as the holder of the text. The problem i...
Reading data from a serial port
Is it posible to read data froom a serial port in power builder? how? Thanks in advance -- J. Jesus Gutierrez Ramirez Yes this is possible, but you have to use an active x control. I purchased the Commx 1.1 Active X communications controls from Greenleaf. It has reading , writing , file transfer utilities. Check them out at www.greenleafsoftware.com HTH John Search for earlier threads. It' is do-able in PB, but much easier by using a 3rd party tool such as CommX by Greenleaf software. -bac Jesus Gutierrez wrote: > Is it posible to read data fro...
Read / Write to a serial port.
Hi, I have to read / write from / to a RS-232 port. PB6.5. Is it easy (and how) with the APIs? It's really better with a third part? Or there's another better way? Thanks in advance, Joe Hi Joe, We have succesfully implemented the CommX 1.1 from GreenLeafSoftware http://www.greenleafsoftware.com/ I am sure there are a few others... HTH John> Hi, > > I have to read / write from / to a RS-232 port. PB6.5. > > Is it easy (and how) with the APIs? It's really better > with a third part? Or there's another better way? > > > ...
read/write from/to serial port
Hi, I work with PowerBuilder 6.5 and I need to read / write from the serial port (COM 1). Does anybody know how can I do? Thanks in advance Bye Dear Joe , We purchased a third party ocx control from http://www.greenleafsoftware.com/ It works great and its easy to program. The program is called CommX 1.1 it includes a file transfer and terminal emulations ... see homepage for more info I know there's something else on the market which i think ( not sure though) is part from Powerbuilder .... Greetingz John Agree, CommX works great in PB. We actua...
Reading data from a serial port
Could someone please tell me how I go about reading data from a serial port (weights from a weighbridge) into a Powerbuilder application. Do I need any third party software to do this? Thanks - Paul yes you need a 3rd party one. I've used greenleaf software's http://www.greenleafsoft.com/ There are others... If you search on this newgroup you will find more listed. <Paul Attard> wrote in message news:[email protected]... > Could someone please tell me how I go about reading data > from a serial port (weights from a weighbridge) into a...
Read data from serial port
I'm trying to control a POS printer attached to serial port, using XPCOM to read and write to /dev/sttyS0. In fact, I almost succedded, and got the printer working! But I have problems trying to read from the blocking device when the printer is turned off and so there is no data available to be read. As expected, nsIScriptableFileInputStream.read() blocks when no data is available, the UI completly hangs, and the process must manually killed. So I used a nsIInputStreamPump to perform asynchronously reads from the device. Thats works fine, I got the data if there are some, and ...
reading data from the Serial port
Hi, I've got a requirement to read streams of data that will be comming in through the serial port. I want to use powerscript on that data to do the processing. Does anyone know a way in powerbuilder of getting data streams from the com port directly using Powerscript function or any API's that can easily be used. Any help would be appreciated. Mick Hi! You can use OCX serial comm control (mscomm32.ocx). That works fine for me in more than 80 installations. Regards, Kragulj Mile [email protected] [email protected] 'Micks news' <mkench...
Reading data from a serial port #2
Could someone please tell me how I go about reading data from a serial port (weights from a weighbridge) into a Powerbuilder application. Do I need any third party software to do this? Thanks - Paul ...
Read and write operation in serial port
Hello, am using win32::serial port for serial communication i can open the port and able to update the settings such as baud rate , parity etc.,but i need to know how to transfer the data through it (read and write), can any give me sound examples On 8/27/07, [email protected] <[email protected]> wrote: > Hello, am using win32::serial port for serial communication i can open > the port and able to update the settings such as baud rate , parity > etc.,but i need to know how to transfer the data through it (read and > write), can any give me sound examp...
HOW TO READ AND WRITE A BYTE DATA USING THE SERIAL PORT 890054 My question. I NEED TO NOW HOW TO READ AND WRITE A BYTE DATA USING THE SERIAL PORT, IN ORDER TO COMMUNICATE WITH AN HARDWARE. I'M USING PowerBuilder 5.0 AS A PROGRAMMING LANGUAGE. WE PLAN TO USE THE RS-232 AS THE COMMUNICATION PROTOCOL. I WANT TO USE THE FileOpen() FUNCTION, FOR OPEN THE 'COM1' OR 'COM2' ALSO, FileWrite() AND FileRead(), FUNCTIONS. I WANT THAT YOU SEND ME A SAMPLE CODE, USING THESE FUNCTIONS AND THE RS-232 PROTOCOL. I ALSO WANT TO NOW, IF POWERBUILDER USE THE CONFIGURATIO...
Writing & Reading data to a Serial port
I was wondering if anyone can give me a simple way to write and read data to and from a serial port using PB 6.5 or do I need to by some third party libraries. Thank You Chris Bohne [email protected] There are several OCXs on the market for this. Check http:www.deja.com for browsing through the newsgroups. If you want to write to the port by using powerscript, chekc my site for the 32bit modem dialer example. HTH -- - Eric Aling [TeamSybase], AVALIX InformationSystems, The Netherlands Eric's Home & PB Site @ http://www.knoware.nl/users/cypr115 ...
Using Mscomm32.ocx for serial port communication
Hi all, I have a cash drawer and and opener device connected to a USB port that is bridged to a COM16 serial port. According to the vendor I just need to send char(27)+char(53) down the serial port andit will open the cash drawer. They provide a MS Excel VBA sample which uses MScomm32.ocx and it works. But I have difficulties using that ocx file in PB 8. Is there someone here who can give me the required steps to implement and use that ocx in PB? Even better would be a code example. Someone suggested to create a window, do insert-->control-->OLE and select the MScomm32....
how to read data from serial port or usb port
hi,all i know powerbuilder is powerful in database development. i just want to know if i can get data from serial port or usb, and how? thanx I have read data from the serial port by using the Microsoft plugin MSCOMM32.OCX that is included in several of Microsoft's products, but specifically it is included with VISUAL STUDIO. Once you install it in your machine, you can use it from PB by declaring an OLE object container. You then can call its methods and use its properties. Regards 'Xiaotao, Lu' <[email protected]> escribi� en el mensaje ...
Use PB 10 to read/write via serial port (RS-232)
Dear all, Any idea of the captioned subject. I duuno what Win32 API I can use within PB. Hi, i have used SaxComm Activex and it works fine. Bye Marco > Dear all, > Any idea of the captioned subject. I duuno what Win32 > API I can use within PB. On Jan 30, 3:26 am, Marco wrote: > Hi, > > i have used SaxComm Activex and it works fine. > > Bye > > Marco > > > Dear all, > > Any idea of the captioned subject. I duuno what Win32 > > API I can use within PB. Another control that I've used in the past was t...
Using a data set to hold data read from the database. And how to write it back out, getting it out of the listbox
I havent worked with data sets lately so I am hoping from some help from someone.i am working on a web application using asp.net 2.0 and c#. Basically I need to read html text from a column in a database table(600 chars max)I then need to copy this text into a multi line listbox and allow it to be editedOnce the application user has edited the text, then they will press a save buttonand the text will be written back to the database. I don't know if this is the best choice, but I want to use a data set to read the text into.The data set will act as the holder of the text. The problem i...
Reading data from a serial port
Is it posible to read data froom a serial port in power builder? how? Thanks in advance -- J. Jesus Gutierrez Ramirez Yes this is possible, but you have to use an active x control. I purchased the Commx 1.1 Active X communications controls from Greenleaf. It has reading , writing , file transfer utilities. Check them out at www.greenleafsoftware.com HTH John Search for earlier threads. It' is do-able in PB, but much easier by using a 3rd party tool such as CommX by Greenleaf software. -bac Jesus Gutierrez wrote: > Is it posible to read data fro...
Read / Write to a serial port.
Hi, I have to read / write from / to a RS-232 port. PB6.5. Is it easy (and how) with the APIs? It's really better with a third part? Or there's another better way? Thanks in advance, Joe Hi Joe, We have succesfully implemented the CommX 1.1 from GreenLeafSoftware http://www.greenleafsoftware.com/ I am sure there are a few others... HTH John> Hi, > > I have to read / write from / to a RS-232 port. PB6.5. > > Is it easy (and how) with the APIs? It's really better > with a third part? Or there's another better way? > > > ...
read/write from/to serial port
Hi, I work with PowerBuilder 6.5 and I need to read / write from the serial port (COM 1). Does anybody know how can I do? Thanks in advance Bye Dear Joe , We purchased a third party ocx control from http://www.greenleafsoftware.com/ It works great and its easy to program. The program is called CommX 1.1 it includes a file transfer and terminal emulations ... see homepage for more info I know there's something else on the market which i think ( not sure though) is part from Powerbuilder .... Greetingz John Agree, CommX works great in PB. We actua...
Reading data from a serial port
Could someone please tell me how I go about reading data from a serial port (weights from a weighbridge) into a Powerbuilder application. Do I need any third party software to do this? Thanks - Paul yes you need a 3rd party one. I've used greenleaf software's http://www.greenleafsoft.com/ There are others... If you search on this newgroup you will find more listed. <Paul Attard> wrote in message news:[email protected]... > Could someone please tell me how I go about reading data > from a serial port (weights from a weighbridge) into a...
Read data from serial port
I'm trying to control a POS printer attached to serial port, using XPCOM to read and write to /dev/sttyS0. In fact, I almost succedded, and got the printer working! But I have problems trying to read from the blocking device when the printer is turned off and so there is no data available to be read. As expected, nsIScriptableFileInputStream.read() blocks when no data is available, the UI completly hangs, and the process must manually killed. So I used a nsIInputStreamPump to perform asynchronously reads from the device. Thats works fine, I got the data if there are some, and ...
reading data from the Serial port
Hi, I've got a requirement to read streams of data that will be comming in through the serial port. I want to use powerscript on that data to do the processing. Does anyone know a way in powerbuilder of getting data streams from the com port directly using Powerscript function or any API's that can easily be used. Any help would be appreciated. Mick Hi! You can use OCX serial comm control (mscomm32.ocx). That works fine for me in more than 80 installations. Regards, Kragulj Mile [email protected] [email protected] 'Micks news' <mkench...
Reading data from a serial port #2
Could someone please tell me how I go about reading data from a serial port (weights from a weighbridge) into a Powerbuilder application. Do I need any third party software to do this? Thanks - Paul ...
Read and write operation in serial port
Hello, am using win32::serial port for serial communication i can open the port and able to update the settings such as baud rate , parity etc.,but i need to know how to transfer the data through it (read and write), can any give me sound examples On 8/27/07, [email protected] <[email protected]> wrote: > Hello, am using win32::serial port for serial communication i can open > the port and able to update the settings such as baud rate , parity > etc.,but i need to know how to transfer the data through it (read and > write), can any give me sound examp...