Applies To:
  • CitectSCADA

I am currently trying to print to a serial printer, bypassing Windows Print Manager by using a device configured as an "ASCII_DEV" and "COM1:" as the file name. This system works provided that the com port is configured with the correct parameters (baud rate, data bits, etc). Is there any way of initialising the com port to the settings that I need when citect starts?  

Use the DOS command "Mode" to initialise the com port.

For example you could write a function that calls the mode command as per;

Exec("COMMAND.COM /C Mode COM1: BAUD=9600 PARITY=n DATA=8 STOP-1 XON=on ODSR=off OCTS=off DTR=on RTS=on IDSR=off TO=on",6);

For information on the Mode command check your DOS or Windows help function. Note article Q2593 regarding using a spool device for serial communications.