Hello Zenon Team!
I'm designing a project with Zenon, and we are exploring some features.
We need to write on sql data base some variables values. We are doing it by the "allocation" method.
We have done the following steps:
1- We created the data base and the tables wich will receive the values from variables, like described in "SQLDRV drive.pdf".
2- Then on the editor we configured the odbc connection and it was successfull.
3- We defined two variables: varInt1 (internal variable) and varSQL1 (sql variable) with the same data type.
4- we created an allocation between this two variables (varInt1-> varSQL1) with an edge trigger defined.
5- Finally we runned the test project, we changed the value of internal variable and then activated the trigger, nothing was written on SQL tables.
Anyone has experience on this field and coul help us with some information, tutorial.....whatever!
That's good news! Maybe you want to post the reason it did not work in this thread for other users as well?
Thanks!
Common reasons are for example that the table in the SQL server is not configured correctly (e.g. primary key missing or auto-increment not set), or that the date/time format is not compatible (can be solved by setting the checkbox "use TS format" (Time String) in the driver configuration.
Hi there!
We were commited an error. On our Sql variable specification we specified in a wrong way the "driver object type". It should be chosen ´PLC marker´ type and we chose another option.
The Sql Server configuration was fine, as well the table´s fields, so we think that it was the reason why didn't work...
Thanks!
The other type, which is the default type in some cases, is the "driver variable".
In the case of the SQL driver you should use variables of the object type "PLC marker" as you already found out. I admit that this may be a little confusing in the case of the SQL driver.
driver variables can, among other things, be used to retrieve information about the current communication to the PLC or in this case the SQL database.