Applies To:
  • CitectSCADA 4.xx, 5.xx

Summary:
It is difficult to support the COMX driver due to the lack of debug information. 

Solution:
Version 2.01 of the COMX driver provides a method to dump debug information. A different file is produced for each com port and each of three function write, read and status. The debug files are configured by settings in the Citect.ini and are written to the default OS path. The following Citect.ini entries are used:

[COMX]
WritePortName=X1,X2 ...
WriteDebugLevel=Y
WriteFileSize=Z
ReadPortName=X1,X2...
ReadDebugLevel=Y
ReadFileSize=Z
StatusPortName=X1,X2...
StatusDebugLevel=Y
StatusFileSize=Z

Where:

Xi is a port name as it appears in the Citect|Communications|Ports form. eg PORT_1.
Y is 1 to enable debugging 0 to disable it.
Z is the file size in Kb. The default is 1000 Kb

For example the following entries would:
Log up to 2000 kb of data written to ports PORT_1 and PORT_2.
Log up to 1000Kb of data read from PORT_1,
Log up to 10Kb of status data from PORT_2.

[COMX]
WritePortName=PORT_1,PORT_2
WriteDebugLevel=1
WriteFileSize=2000
ReadPortName=PORT_1
ReadDebugLevel=1
ReadFileSize=1000
StatusPortName=PORT_2
StatusDebugLevel=1
StatusFileSize=10

Files Produced

The following text files would be created in the OS Path ( generally WINDOWS or WINNT ):

  • WPORT_1.dat
  • WPORT_2.dat
  • RPORT_1.dat
  • SPORT_2.dat

In general the format for the files names is R, W or S followed by the Port name requested followed by .DAT .

File Formats

For the write file

LINE 1
WRITE Debug file Started PORTNAME Debug Level 1 DOW MONTH DOM HH:MM:SS.msec
LINE 2
HH:MM:SS:.msec
LINE 3
Out W In X nBytes Y Status Z
LINES 4
AA BB CC ...

Where,
W X are values of buffer pointers, Y is the number of bytes written and Z is the return status of the WriteFile.
AA BB CC .. are the values in hex of each byte written.

For Example.

WRITE Debug file Started PORT1_BOARD1 Mon Dec 15 16:07:07.998
16:07:09.810
Out 0 In 8 nBytes 8 iStatus 997
0e 02 00 00 00 10 00 00
16:07:10.802
Out 8 In 16 nBytes 8 iStatus 997
0e 02 00 00 00 10 00 00

For the read file

LINE 1
READ Debug file Started PORTNAME Debug Level 1 DOW MONTH DOM HH:MM:SS.msec
LINE 2
HH:MM:SS:.msec
LINE 3
Out W InRx X nBytes Y Status Z
LINES 4
AA BB CC ...

Where
W X are values of buffer pointers, Y is the number of bytes read and Z is the number of characters remaining in the buffer.
AA BB CC .. are the values in hex of each byte read.

For example.

READ Debug file Started PORT1_BOARD1 Mon Dec 15 16:07:07.998
16:07:09.830
Out 0 In 0 nBytes 8 iStatus 0
0e 02 00 00 00 10 00 00
16:07:10.822
Out 0 In 8 nBytes 8 iStatus 0
0e 02 00 00 00 10 00 00

For the status file

LINE 1
STATUS Debug file Started PORTNAME Debug Level 1 DOW MONTH DOM HH:MM:SS.msec
LINE 2
HH:MM:SS:.msec
LINE 3
modemStatus X

For example.

STATUS Debug file Started PORT_1 Debug Level 1 Wed Nov 05 15:28:55.310
15:29:55.950
modemStatus 34


Keywords:
 

Attachments