Menu

Efficient way to connect and process?

2009-10-09
2013-05-09
  • Stephan Berger

    Stephan Berger - 2009-10-09

    Hi,

    I've a general question about connecting and processing with the libnodave.dll

    If I'm accessing values of PLC in a loop for a longer period, even days, weeks…whatever…

    is it necessary or better to

    - disconnect the PLC
    - free the pointers
    - disconnect the adapter
    - close the socket

    each time I've accessed the PLC?

    At moment I once initialize the connection with all the necessary stuff and process the requests in another thread in a loop. I only free the results, nothing else.

    It seems to work fine. But I'm not sure if it's best way for longterm processing.

    Yours,

    Stephan

     
  • Simon

    Simon - 2011-05-20

    I have a daemon that runs on a server elsewhere and it creates a connection momentarily which turns on the programming CP light on the EM243 module.
    I have established a block in the PLC of variables that I wish to monitor - The daemon is a C program that is cwrtten to also read configuration information such as the MySQL database connection details and the address of the PLC. THe daemon sleeps and when it runs it connects (makes three attemts) retrieves data and places it via SQL query into database tables then closes the link - You see the CP light come on momentarily once a minute. Multiple daemons will monitor multiple PLCs; or re-write it and loop through a list of PLCs. I guess its basically a custom tag database:)
    Simon

     

Log in to post a comment.