hagendas - 2021-11-16

Hello, I have a PLC that does not support NBS ( DSE M840 MKII )

I am trying to create a TCP Client connection to a MikroTik router to use with MikroTik API

I could do it easily with the NBS functions, but having trouble getting anything working with SysSocket.

I couldn't find any documentation on the forums or anywhere else on how to properly create a connection and send/receive data.

From some info that I found, I wrote a simple ping program to test connection to the router.
Although this returns TRUE, using wireshark, nothing is transfered to or from the PLC

Does anyone know where I could find more info on SysSocket library or has any examples with working TCP Client connection?

PROGRAM PLC_PRG
VAR 
 //// PING /////
   PingTime:    UDINT;
   PingOk:      BOOL;
   _IPSTRING: STRING := '192.168.1.1';
END_VAR
// Ping command
IF CmpErrors.Errors.ERR_OK = SysSockPing(szIPAddress:=_IPSTRING, ulTimeout:=500, pulReplyTime:= ADR(PingTime)) THEN
   PingOk := TRUE;   
ELSE
   PingOk := FALSE;   
END_IF