Showing results 1 to 6 of 6

Thread: Save to SQL server every 3min

  1. #1
    Join Date
    28.07.2015
    Posts
    3

    Default Save to SQL server every 3min

    Hello everyone!

    I am wondering if it is possible to save the data to SQL server every 3 minutes or so. I do not want to increase the update time on S7 TCP-IP driver though. I tried increasing the time on SQL Driver, but it keeps sending the data at the same time interval as before, only that it doesnt refresh that often.

    The other thing I want to do is save the data only when variable "cycle" equals "1". Is this possible?

    Thanks for all the help.

  2. #2
    Join Date
    25.06.2012
    Posts
    157

    Default Re: Save to SQL server every 3min

    Hello jst123,

    Let me try to help without knowing the project details.

    You can create SQLDRV "buffer" variables so that their values are only updated and sent to the SQL database every 3 minutes via allocations controlled by a trigger variable.

    The allocations can be configured in the editor under the variables node. For example:

    Allocation X:
    Source variable: S7TCP32_bool
    Target variable: SQLDRV_bool
    Trigger variable: Intern_bool
    Trigger type: Edge

    You can find more information in the zenon documentation topic Manual > Allocations.

    To set(/reset) the trigger variable you can use the time control module linked to write set value functions, so that the trigger variable = 1 (/0: after the allocations are executed) every 3 minutes.

    You can find more information in the zenon documentation topic Manual > Time control.

    I wish you good luck!

    David Cerdeira

  3. #3
    Join Date
    23.04.2015
    Posts
    2

    Default Re: Save to SQL server every 3min

    Hi guys,

    I did what you mentioned above but it still did not work.
    I found that all these variables' values had changed but nothing happened.

    Source variable: S7TCP32_bool
    Target variable: SQLDRV_bool
    Trigger variable: Intern_bool

    Zenon did not write 'SQLDRV_bool' variable to Sql database server.

    Please, help me.

  4. #4
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    881

    Default Re: Save to SQL server every 3min

    Make sure that you have also configured the allocation between the database variable (plain text name) and the zenon variable (memory number) - see help at:
    Drivers -> SqlDrv -> Configuration -> Settings in the driver dialog -> SqlDrv variables driver dialog

    If this configuration is missing writing to SQL DB will not work - instead an error message is written into the Diagnosis Viewer

    regards,
    herbert


  5. #5
    Join Date
    23.04.2015
    Posts
    2

    Default Re: Save to SQL server every 3min

    Hi Herberto,

    Actually, I am using EXPORTSQL32 DRIVER (Write variable values in SQL)

    I did everything as I read in Help document ExportSQL32, but the value of 'TEST' variable did not write in SQL.

    I uploaded my project here, hope you could check it out what is wrong with it.

    https://drive.google.com/file/d/0Bw-...ew?usp=sharing

    Thanks a lot.

  6. #6
    Join Date
    25.06.2012
    Posts
    157

    Default Re: Save to SQL server every 3min

    Dear tailq,

    let me suggest you to contact your local COPA-DATA support to get help on this request.

    Note in the forum we are limited in terms of support resources and communication.

    Thank you very much for your understanding.

    Best regards,
    David Cerdeira

Similar Threads

  1. SQL Server strong password
    By drehpet in forum Engineering Studio & Service Engine
    Replies: 4
    Last Post: 3rd September 2015, 16:05
  2. Export data to SQL server
    By jst123 in forum zenon Service Engine Supervisor
    Replies: 3
    Last Post: 28th July 2015, 20:58
  3. Passwort SA für SQL-Server
    By hare1268 in forum zenon Service Engine Supervisor
    Replies: 2
    Last Post: 24th July 2014, 15:05
  4. Historian SQL Server
    By junior in forum zenon Service Engine Supervisor
    Replies: 3
    Last Post: 27th March 2014, 14:27
  5. SQL Server Logdatei
    By kwb in forum zenon Service Engine Supervisor
    Replies: 1
    Last Post: 3rd March 2009, 12:00

Posting Rules

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