Autor Thema: rs232 in transparent mode  (Gelesen 7192 mal)

Offline Lukasz

  • Newbie
  • *
  • Beiträge: 17
rs232 in transparent mode
« am: Februar 12, 2010, 00:00:52 Vormittag »
Hello

I would like to use easycontrol's rs232 (com1) in transparent mode (I want to send and receive messages to gsm modem)

below is my code:

IF uchwyt=0 THEN
uchwyt:=SysComOpen(Port:=Com1);
END_IF
typComSettings.typPort:=1;
typComSettings.typBaudRate:=baud_38400;
typComSettings.typParity:=0;
typComSettings.typStopBits:=0;
res:=SysComSetSettings(uchwyt,ADR(typComSettings));

IF res=1 THEN
IF c=0 THEN
SysComWrite(uchwyt,ADR(dozapisu),5,0);
c:=1;
END_IF
END_IF
IF c=1 THEN
b:=SysComRead(uchwyt,ADR(odczyt),3,0);
END_IF

dozapisu:dword:='abc';

writing are working without problem (I connect PC terminal and see this text)

When I send word "abc" to easycontrol I allways receive only 1 byte (though in command syscomread are 3 bytes)
sometimes receive "a", sometimes "b".
I try to set various value (3, 5, 15). I allways receive 1 byte.
I try to set various value of time (in command above i "0"), but it still receive 1 byte.

Any ideas?

Lukasz
« Letzte Änderung: Februar 13, 2010, 07:55:14 Vormittag von Lukasz »