Applies To:
  • CitectSCADA 5.xx, 5.50, 5.50 Service Pack A, 5.50 Service Pack B, 5.50 Service Pack C, 6.00, 6.00 Service Pack A, 6.10

ComOpen() returns -1 for an existing Com Port. If I use Windows Hyperterminal to open the Com Port, the Port opens successfully. My BOARD and PORT forms configurations in Citect are correct.

By default, ComOpen will fail, i.e. return -1, if any configured ports are non-existant on the PC. This means that if multiple com ports are defined in the Citect project but the PC only has 1 or 2 actual ports then using the ComOpen function will fail on all ports (even the existing ones). To get around this issue, a new INI parameter has been introduced in COMX driver version v2.03.06 and above that allows ComOpen to succeed if at least one configured COM port is present.

To use that feature you need to set the following citect.ini parameter:

PassIfAnyInitPortsPass=1 ! 0 by default

The version of the COMX driver can be checked by right clicking on the COMX.DLL file, which is located in the Citect\CitectSCADA\Bin directory, and then click on the version tab.

To obtain the latest version of the COMX driver, please contact Citect Support.

COMX, ComOpen