Thanks JR and Menchar,
It seems that there is a bit of isolation between my application code and the actual I/O hardware.
I have tried not using an output queue, but to no avail.
Initialisation code is as follows:
comms_channel_failure = OpenComConfig(new /* COMPort, */
, "" /* char deviceName[] */
, baud_rate /* long baudRate, (9600 used) */
, 0 /* int parity */
, 8 /* int dataBits */
, 1 /* int stopBits */
, 0 /* int inputQueueSize = 512*/
, -1) ; /* int outputQueueSize = not used */
And here is my test code:
static int number = 5 ;
clock_t start, end, duration ;
start = clock() ; /* get start time */
ComSetEscape(comms_channel, SETRTS) ; // turn on RTS to enable RS485 driver
strcpy(buf, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ") ;
status = ComWrt(comms_channel
, buf
, number) ;
// ProcessSystemEvents() ;
end = clock() ;
duration = end - start ; // calculate duration of routine
ComSetEscape(comms_channel, CLRRTS) ; // turn off RTS to disable driver and permit reception
number += 5 ;
This allowed me to check the length of time that the ComWrt routine was taking. It was tested using ProcessSystemEvents() and also with that routine commented out.
The following table records the calculated durations for various send string lengths.
number duration PSEduration
5 0 13
10 0 13
15 0 19
20 0 13
25 0 1 honest!
30 0 12
35 33 34
40 32 45
45 32 34
50 32 45
55 33 33
60 32 45
65 66 67
Where to from here. I am sure that this could be done if I write my own device driver, but that is something I have not done before and I don't think I have the necessary tools or knowledge.
Any ideas folks will be much appreciated.