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.
IP_CONTROL
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.
TN_FRAMEWORK
1. Always Used Port 23. Changed to only use 23 if no port passed via IP_C.PORT
STRING_TO_URL
1. Moved VAR_TEMP varible to VAR
WORLD_WEATHER_ICON_OSCAT
1. Put [] around dat intial values
YAHOO_WEATHER_ICON_OSCAT
1. Put [] around dat intial values
MB_SERVER
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 *)
and
IF ENABLE = FALSE OR t.Q THEN
ip_state := BYTE#4; (* Abmelden *)
state := 00;
IP_C.C_ENABLE := FALSE;
END_IF;
/////////NEED TO FIX//////////////////
FTP_CLIENT
1. Always Used Port 21. Changed to only use 21 if no port as specified in passed URL
[gelöscht durch Administrator]
Updated Network Library 1.30
[gelöscht durch Administrator]
Hi,
I have this problem with MB_SERVER:
http://www.oscat.de/community/index.php/topic,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.
Zdenko.
Hi
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?
Thanks