Writing wide (212 character) lines to Serial Port

Writing wide (212 character) lines to Serial Port

I have written a program to do listings on an old serial printer, using the SPORT routines (IVF ver 9.1.025). For files 132 characters wide or less, it works just fine, but when I do a wider file, the program stops, emitting result = 996. What am I missing ?

Thanks

7 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

The SPORT routines don't have length limits, but it's possible that the buffer in the driver does. Try breaking it into smaller chunks.

Steve - Intel Developer Support

Hmm, error 996 is "Overlapped I/O event is not in a signaled state." This suggests to me that the device can't accept so much data in one gulp.

Steve - Intel Developer Support

I don't think it is a limitation of the device. The Fortran I am writing is to replace a program written in 1987 in QuickBasic, that still runs on an old XT (which may fail at any time)hooked up to the printer, and it works just fine with wide listings.

20071 OPEN "COM1: 1200,E,7,1,ASC,LF" FOR OUTPUT AS #2 is what I am trying to set up in Fortran. I thinkthe problem may be related to "ASC" ASCII mode, which I have set to use Xon/Xoff. There are a few other parameters in the SPORT_SET_STATE_EX that I don't understand that may need adjusting.

It could be a bug in the SPORT routines. I looked at the source and, internally, they do specify the "overlapped" mode so they should be checking for completion of a prior operation before starting a new one.

A timely workaround would be for you to call the Win32 API routines yourself, such as CreateFile, SetCommState, WriteFile, etc. You'll have more control over what is happening.

Steve - Intel Developer Support

The program runs without actually being connected to the serial printer, and stops at exactly the same place as it does when being connected. So:

1. Should I submit source code to Premier support, and report this as a possible bug ?

2. Do you have an sample bit of source code that uses the Win32 API routines ?

Thanks

Brian

Yes, please do submit an example to Premier. No, I don't have a sample using the API.

Steve - Intel Developer Support

Leave a Comment

Please sign in to add a comment. Not a member? Join today