/1c_rs232

RS232 COM port native driver for 1C

Primary LanguageC++

RS232 COM port native driver for 1C

This is RS232 communication port native driver for 1C:Enterprise 8.x.
This driver provides communication from 1C:Enterprise 8.x to lots of devices that use 
RS232 communication port, such as: modems, thermal printers, bar code scanners and special controllers.

Methods:

int Open(int nPort, int Baud, int nBit, int Parity, int StopBit) - open port, return 0 if success;
	nPort - 1..;
	Baud - 300, 600, 1200, 9600, 14400, 19200, 57600, 115200;
	nBit - 7,8;
	Parity - 0: None, 1: Odd, 2: Even, 3:Mark, 4:Space;
	StopBit - 0: 1.0, 1: 1.5; 2: 2.0.
	Close()       - close port;
int Send(wstr data) - send data;
int Receive() - receive data from port - return number of received chars; 
Delay(int dt) - delay dt milliseconds.

Properties:

bool IsOpen  - is port opened or no;
int Port     - port number;
int Baud     - port speed;
int ByteSize - number of bits;
int Parity   - port parity;
int StopBit  - 1, 1,5 2 stop bit;
wstr Command - last command to port;
wstr Answer  - answer from port;
int Error    - last error code

1C: Examples:

InfoBase - modem demo;
InfoBaseMA - Maria 301 demo.