05-15-2006 04:28 PM
05-15-2006 04:29 PM
05-16-2006 08:33 AM
05-16-2006 01:46 PM
Hi Sheetal,
Well In debug mode things work at a slower rate than release mode. So considering you are writing to the serial port....there could be time outs occuring or if u are using wait loops or anyting.....in release mode these are executed at a faster rate.
My suggestion from over the top is you should get a port monitor software, capture the port u using, have a breakpoint write after that line.....and observe what was sent out....
Hope it helps....if u can provide more parts to ur code that could help narrow the problem.
k1_ke
05-17-2006 02:59 PM
Thanks for your response.
It is very strange. It some time works in release mode and some time does not. Even if I don't change any thing in my code. I am still investigating this problem and post solution if I find one!
05-18-2006 01:46 PM
Ok. Here is what I found. It still does not work in release mode
Here is my code.
/////////////////////////////////////////////////////////////////////////////////////////////////////////
FlushInQ (PRINTER_PORT);
FlushOutQ (PRINTER_PORT);
size = strlen(read_file); //size is > 6000 bytes
written = ComWrt (PRINTER_PORT, read_file, size);
if(written != size)
{
Error(__FILE__, __FUNCTION__, __LINE__, "Printer Bytes written is not same as filesize FAILED");
Write_Status("Printing Error FAILED");
Write_Message("Printing Error FAILED");
return FAIL;
}
return PASS;
//////////////////////////////////////////////////////////////////////////////////
I used serial port monitor and in release mode I do not see any data but in debug mode I do see data. So problem is on PC side not on printer side.
In release mode I do not get error. that means bytes written is same as size.
It this functions always returns PASS.
05-18-2006 03:18 PM
I think I found problem.
here is my code where I read a file.
stream = fopen (PRINT_FILE_MASTER, "r");
written = fread (read_file, 1, size, stream);
fclose(stream);
if PRINT_FILE is "print.txt" it does not work in release mode. my project location is Z:\ .
But If I use "Z:\print.txt" it works.. in release mode.