I'm using the Wago 750-880 with the 750-650 to communicate over RS232. I'm using the serial_interface_01.lib (http://www.wago.com/wagoweb/documentati ... 10901e.htm). With this library I am able to receive data, but not sending data. This is the code I have so far:
VARÂ Â COM2Â Â Â Â :SERIAL_INTERFACE;Â Â xOpenPort2Â Â :BOOL:=TRUE;Â Â xInitPort2Â Â Â Â :BOOL;Â Â xSendActive2Â Â :BOOL;Â Â SendString2Â Â :STRING:='Msg from COM2';Â Â ReceiveBuffer2Â Â :typRing_Buffer;Â Â index:INT;END_VAR
index :=index+1;IFindex=1000THEN
  xSendActive2 :=TRUE;END_IFIFindex=2000THEN
  xSendActive2 :=FALSE;
  index :=0;END_IFCOM2(  bCOM_PORT_NR  :=2,
  (*  cbBAUDRATE    :=wBaudRate,
    cbsBYTESIZE    :=bDataBits,
    cpPARITY      :=bParity,
    csSTOPBITS    :=STOPBITS_1,
    cfFLOW_CONTROL  :=bFlowControl,*)
    utRECEIVE_BUFFER   :=ReceiveBuffer2,
    ptSEND_BUFFER  :=ADR(SendString2),
    xINIT      :=xInitPort2,
       xOPEN_COM_PORT   :=xOpenPort2,
    iBYTES_TO_SEND  :=LEN(SendString2)+1,
    xSTART_SEND    :=xSendActive2);
Data should be sent when xSTART_SEND is TRUE? The function block does not reset this value to FALSE.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
I'm using the Wago 750-880 with the 750-650 to communicate over RS232. I'm using the serial_interface_01.lib (http://www.wago.com/wagoweb/documentati ... 10901e.htm). With this library I am able to receive data, but not sending data. This is the code I have so far:
Data should be sent when xSTART_SEND is TRUE? The function block does not reset this value to FALSE.
Apparently, the module has flow control enabled.... So it works now.
if this counter is used as a type of counter then better use a task, you can time it.
and check if buffer empty before putting data in to buffer.