WAGO My_SQL.Lib Error

musman

Member
Join Date
Nov 2014
Location
Munich
Posts
20
Has anyone worked with WAGO My_SQL.lib. I am facing an error while using this lib..

16#80001006 => 'TCP-ERROR: "SysSockSend()" returns 0. Socket was "gracefully closed"'

In your reply, you told me this


I have attached my PLC code and I want some suggestions from all of you to overcome this error

Sql_Stat.sq1.....This signal is updated in another POU Sql_Stat where SQL Statement is made

Start_Sql signal is coming from PLC_PRG POU. This signal becomes one once PLC is connected to DB

Sql_stat.start_execute ....becomes TRUE if PLC is connected to DB...

SQL_Stat POU is being controlled by task which runs after every 30 sec. I am uploading the data after every 30 sec...

I am facing the same error after an hour or two once PLC is connected to DB. Blink block produces pulse train with on time = 1 sec and off time = 30 sec..

once this error occurs, then even after 30 sec when the new pulse comes, data is not uploaded.

Please provide me some suggestions and way to improve this code.

SQL DB.png
 
do you have a genuine version licensed or a DEMO version (That one will stop after 2 hours to function.)
the error is that you put sending on but the message is empty.
 
do you have a genuine version licensed or a DEMO version (That one will stop after 2 hours to function.)
the error is that you put sending on but the message is empty.
I have purchased the software from Wago.. the problem is that my plc program contains 5 more pou. One of which is performing the calculation of real time power and energy consumption.. I want to send this data to db...sql-stat pou is ma k ing sql stat based upon these values. The rest of my program is working...I am getting real time data but when I want to send it, I got the above mentioned error...
 
I've done quite a bit of SQL function block programming with the WAGO 750-88x controllers. I highly recommend that you set up a state machine for each step of your interface. WAGO has sample code that is available as well. I've also been in touch with their tech support and they've been very helpful.

Good Luck,

Yosi
 
Basically you set up a set of steps (typically using a CASE statement). The 1st step would be a "do nothing" step where you'd give the controller stack some time to initialize. The 2nd would be a login step. The 3rd where you'd execute your SQL instructions and the last would be a log-out.

The instructions themselves have internal state machines as well so the trick to getting this whole thing right is to let those state machines do what they're supposed to do and not cut corners. An example of this would be not doing a logout even when the connection has closed (I made this mistake and it drove me crazy.) Evidently you've got to do that logout regardless.

I'm on vacation until Sunday so it will be difficult providing you with code (I can try to check this thread now and then) until then. Also, I've used the MS-SQL interface which should be pretty similar.

Finally you should contact WAGO in Minden. They've provided me with excellent support in the past.

Good luck,

Yosi
 

Similar Topics

I am using 750-880 WAGO Controller to send data to remote SQL DB. I have noticed that when my PLC 750-880 is connected to SQL DB for approximately...
Replies
0
Views
1,793
I am using WAGO MySQL Lib to connect my PLC (750-880) with SQL DB on remote server.Once I download the program, I have found that until I click on...
Replies
1
Views
2,113
Hi all, I'm trying to connect my WAGO PLC to multiple databases. It is currently connected to a single MySQL database using the library...
Replies
0
Views
924
Hello, I am in possession of a WAGO PFC 200 750-8216 which I was successfully able to set up as a Modbus RTU Master to a slave device using...
Replies
0
Views
87
I have a project to setup base programs across multiple PLC platforms that can be used for Modbus communications to various sensors that have...
Replies
0
Views
124
Back
Top Bottom