Applies To:
  • CitectSCADA v1.00, v1.01, v1.10, v1.11, v1.20, v2.00, v2.01

If you have a report that only calls a Cicode function, and it has no output device, and it has blank lines after the Cicode function, Citect will compile, but at runtime will generate the hardware error 'bad handle specified' because the system will try to print the blank lines. 

Make sure you don't have any characters outside of the {CICODE} and {END} statements, including carriage returns and spaces. For example your report should not have any characters in the places show below:

no characters here{CICODE}
your Cicode in here
your Cicode in here

{END}no characters here

Some editors will automatically place carriage return and line feed characters at the end of every line. This will cause a problem with the {END} statement because Citect will try to printout the carriage return. You may be able to disable this feature with some editors, however some editors will always do this. If you only have Cicode in your report, you can just leave off the final {END} statement. For example:

your Cicode in here
your Cicode in here

This is a valid Cicode only report and should get around any editor problems.

Another solution is to configure an ASCII device to accept any junk outpu,t and make your Cicode reports output to this device.