Autor Thema: OSCAT Network 130 for CoDeSys V3  (Gelesen 21649 mal)

0 Mitglieder und 1 Gast betrachten dieses Thema.

Offline jzhvymetal

  • Newbie
  • *
  • Beiträge: 9
  • Original SoMachine Ninja
    • Profil anzeigen
OSCAT Network 130 for CoDeSys V3
« am: 20. Juni 2012, 03:11:19 »
Attached is a version of the OSCAT 121 Network and the required OSCAT BASIC 3.33

Made changes to use newer version 3 library SysSocket and SysFile.  All code was tested on CoDesys SoftPLC and Schneider Electric PLC with ehternet and file systems and using SoMachine software.

1. Had to Set option for local address reuse in all network cases
  SysSockSetOption(socket, SOCKET_SOL, SOCKET_SO_REUSEADDR, ADR(dint_true), SIZEOF(dint_true));
2. Had to change NETWORK_BUFFER_LONG_SIZE : UINT := 1999; //Changed from 3999 else socket would not work when reading
3. If PORT is zero use port specified by IP_C.C_PORT.
4. CoDeSys has a bug that does not release the ports on a warm or cold reset.  What this means if you do a reset any function blocks that require binding to the socket to stay open will no longer work.  As of now the only way to clear the port is to recycle the power on the PLC. 

1.  Always Used Port 23. Changed to only use 23 if no port passed via IP_C.PORT

1.  Moved VAR_TEMP varible to VAR

1.  Put [] around dat intial values

1.  Put [] around dat intial values

Need to reset the socket after the receive data timed out.  Since there is no code to detect that the Socket is still open you must force the socket closed and wait for the next connection.

Case 10:
IP_C.R_OBSERVE := TRUE; (* keine Empfangsueberwachung *)


    ip_state := BYTE#4; (* Abmelden *)
   state := 00;

/////////NEED TO FIX//////////////////
1.  Always Used Port 21. Changed to only use 21 if no port as specified in passed URL

[gelöscht durch Administrator]
« Letzte Änderung: 20. März 2014, 00:53:41 von jzhvymetal »

Offline jzhvymetal

  • Newbie
  • *
  • Beiträge: 9
  • Original SoMachine Ninja
    • Profil anzeigen
Re: OSCAT Network 121 for CoDeSys V3
« Antwort #1 am: 18. März 2014, 19:56:16 »
Updated Network Library 1.30

[gelöscht durch Administrator]


  • Gast
Re: OSCAT Network 130 for CoDeSys V3
« Antwort #2 am: 14. Mai 2014, 13:57:45 »

I have this problem with MB_SERVER:,2192.0.html

The same problem is with MB_CLIENT.

Can you please shortly explain me what to do to make auto re-connection work.

Thank you very much.
« Letzte Änderung: 15. Mai 2014, 13:58:40 von blisk »

Offline PasiM

  • Newbie
  • *
  • Beiträge: 3
    • Profil anzeigen
    • E-Mail
Re: OSCAT Network 130 for CoDeSys V3
« Antwort #3 am: 23. Juni 2015, 14:56:38 »

Thank you jzhvymetal for SoMachine library.
I have problem when using FTP-Client in Schneider PLC, Codesys 3.5
Sending file works great at first time after power off/on. 

Next send jumps between Step 200 and 210 for several minutes, so it is not stopping for "TIMEOUT"
FSD.Move jumps between 0 and 1
IP_C2.mailbox[2] jumps between 0..1.

it stops to fault
Error_T 16#05
Error_C 16#03DE0096

After fault and new "ACTIVATE" then it works great once...

On the loop continues... :o

Does somebody know what is happening?