initialize serial port

M

miguel.ossa

Hi to all!

I have a very strange problem... I am working with a fiscal printer on
Polland, and trying to communicate with it. I have a program in Visual
C++ 1.52, over MS/DOS, that initializes the port using int 14h,
function 00h (the same that does the mode.com command).

I can send any information to the printer using COM1, and the printer
hears me with no problem, but it's not answering to any command.

If I previously execute MSD.EXE, and then I press "C" (Com port
status), then the thing works properly.

Does anybody knows which function I can use to emulate this program?
Or does anybody have another program that does exactly the same
function without interaction with the user? I need to activate the
ports in a public commerce, and I don't want they press "c" and "F3"
every morning in order to work (it's not a clean solucion, isn't it?).

Well, I would appreciate any suggestion... I am leaving Polland this
sunday...

Thanks!!!
 
R

Ruediger Knoerig

miguel.ossa said:
Hi to all!

I have a very strange problem... I am working with a fiscal printer on
Polland, and trying to communicate with it. I have a program in Visual
C++ 1.52, over MS/DOS, that initializes the port using int 14h,
function 00h (the same that does the mode.com command).

I can send any information to the printer using COM1, and the printer
hears me with no problem, but it's not answering to any command.

If I previously execute MSD.EXE, and then I press "C" (Com port
status), then the thing works properly.

Does anybody knows which function I can use to emulate this program?
Or does anybody have another program that does exactly the same
function without interaction with the user? I need to activate the
ports in a public commerce, and I don't want they press "c" and "F3"
every morning in order to work (it's not a clean solucion, isn't it?).

Well, I would appreciate any suggestion... I am leaving Polland this
sunday...

Thanks!!!
Since you use only ascii commands - why don't you open the com1: file

ofstream comport("Com1:");
if(!comport)
{
// meckern!
}
else
{
comport << "C" << "Hello printer!" << endl;
}
 
D

David Harmon

I have a very strange problem... I am working with a fiscal printer on
Polland, and trying to communicate with it. I have a program in Visual
C++ 1.52, over MS/DOS,

Answers to this kind of question will be found over on
comp.os.msdos.programmer

http://groups.google.com/groups?q=initialize+serial&as_ugroup=comp.os.msdos.programmer

See the welcome message posted twice per week in comp.lang.c++ or
available at http://www.slack.net/~shiva/welcome.txt

This issue is covered in Marshall Cline's C++ FAQ. See the topic
"[5.9] Which newsgroup should I post my questions?" It is always good
to check the FAQ before posting. You can get the FAQ at:
http://www.parashift.com/c++-faq-lite/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top