Folks,
Thanks for the help with this query. I have been barking up the incorrect
tree all along.
After doing a hex dump (function of the printer) it transpires that my data
string was formatted incorrectly. There was no problem with the serial
comms. I was using OxA (\n) instead of 0xD (\r). Why it worked under
Hyperterm was because HT was doing the necessary character translations to
convert all 0xA to 0xD and I was not aware of it. A comparison between what
HT dumped and what my code dumped showed this up. The commands to the
printer are terminated with a \r. The command that the printer received was
never correctly terminated and this nothing was printed.This led me to
believe it was comms.

Hylton
----- Original Message ----- 
From: "Jason Teagle" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 16, 2004 12:14 PM
Subject: RE: [msvc] A (not so) Quick Comms Question.


> > nothing wrong with the command, I assume there is nothing wrong with the
> > cable either (home made cable - any one have the specs for a
> > rs232 cable to
> > device that supports xon/xoff) or hyperterm is working some kind of
magic
> > that my code isn't. It even works with hyperterm when I turn handshaking
> > off.
>
> If you're using the same cable for Hyperterm as for your own program, then
> it can't be the problem.
>
> >
> > I am setting up the dcb block as follows
> >
> >  case EHandshakeSoftware:
> >   dcb.fOutxCtsFlow = false;     // Disable CTS (Clear To Send)
> >   dcb.fOutxDsrFlow = false;     // Disable DSR (Data Set Ready)
> >   dcb.fDtrControl = DTR_CONTROL_DISABLE;  // Disable DTR (Data Terminal
> > Ready)
> >   dcb.fRtsControl = RTS_CONTROL_DISABLE;  // Disable RTS (Ready To Send)
>
> You may want to try various combinations of these. Unfortunately I'm very
> sketchy on how to use these, with the exception that RTS must be enabled
for
> RS485 comms (so not applicable here). Sadly Hyperterm gives up no
> information on what these are set at, so that's no help.
>
> > What else should I be looking for to try and get this printer to
recognise
> > the communication?
> > Well this is essentially a serial port question, I am getting quite
> > desperate and any additional advice will be helpful.
>
> What about the rest of the DCB parameters? Where are they initialised? You
> may remember that I said you must set them ALL if you're working on 2K or
XP
> (or possibly NT).
>
> --
> Jason Teagle
> [EMAIL PROTECTED]
>
>
>
> _______________________________________________
> msvc mailing list
> [EMAIL PROTECTED]
> See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for
subscription changes, and list archive.




Reply via email to