Can sombody advise me or show me a semple code how I can obtain 10 bit data information from device connected to my com1 port?
Thank you very much in advance.

Hello,

This one is going to be dependant on the OS. For example, in linux, I can read the raw data on the parallel port by doing some things with the hardware in C, and "read" the port. I take a look at the high (voltage up) and low (no volts) and determine an "answer".

BUT

You are trying to do serial information, so the data is going to be "organized". Your 10 bits might have 1 start bit, 8 data bits, and a stop bit. Your code will probably be OS dependant.

I would suggest doing a google search on this. For me, it would be Linux (as my Mac has USB and that is something else entirely) so I would search on "Linux Serial Port Programming" and I found this:

http://tldp.org/HOWTO/Serial-Programming-HOWTO/index.html

If you do lift sample code, you should in your comments credit the source of the algorithm.

Christian

Thank you Christian. T'll try to find some info on internet.

Hello,

Do check back here to see if others have input. And if you could, please post what you find, so that others can learn too.

Thanks,

Christian

I couldn’t get to anything yet and probably will go in different direction: I was able to obtain the data from the port with Hyper Terminal. Now the question is how to obtain the data coming from 4 channels in a format of numbers from 0 to 1024 (10 bits), which changes every 0.25 seconds and to manipulate it with a C++ program?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.