Showing results 1 to 5 of 5

Thread: SQL variables allocation problem

  1. #1
    rloureiro Gast

    Default SQL variables allocation problem

    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!

    Thanks in advance,

    rloureiro

  2. #2
    rloureiro Gast

    Default Re: SQL variables allocation problem

    Hello again!
    Just to inform that we solved our problem!


  3. #3

    Default Re: SQL variables allocation problem

    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.

  4. #4
    rloureiro Gast

    Default Re: SQL variables allocation problem

    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!

  5. #5

    Default Re: SQL variables allocation problem

    thanks for the feedback.

    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.

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •