Hello,

Is this function "EscapeCommFunction" is correct to set RTS signal?
Here is my code.

I want to set on RTS before sending data to rs232, and set off RTS after sending data.

// RTS on.
EscapeCommFunction(*hComDevice, SETRTS);

// Sending data to port.
fWriteStat = WriteFile(*hComDevice, txbuf,(DWORD) iTxPosition,&dwBytesWritten, NULL) ;

// RTS off.
EscapeCommFunction(*hComDevice, CLRRTS);

It will work or not????
I have connected also Osc. but no singnal

Its urgent for me... if anyone could help me out

In low level communications applications between the UI and hardware, its ESSENTIAL to check every error message you get from your control commands. Can't tell you how many hours you could save just by logging everything that occurs at each stage of processing. It might not seem important now but just wait until your project becomes more sophisticated.

So check the return results for EscapeCommFunction(). If it returns a zero you need to call GetLastError() and get more information on the error your getting. I bet its giving you problems.

Good luck with your project.

Thanks for the ans..
but EscapeCommFunction() this function returns me 1.
still no signal in oscilloscope.

You connected to the right COM port? Although I'm sure you have already checked that.

Do you get any signals from your 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.