Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Async reading. Example doesn't work

2017-05-11
2017-05-12
  • luigisvideos - 2017-05-11

    Hi all.

    File reading/writing seems to be a really challenging thing on Codesys: libraries are not well documented, frequently they are not in sync with their last documentation, and examples are really rare to find.

    In this forum I found @ l viewtopic.php?t=5575 l an example of async reading. For sake of semplicity I'll attach the project below.

    I've some questions:
    1) where in the code am I supposed to read data? Maybe in the STATE_CATCHEVENT section?
    2) since data seem to be stored in the "event" ARRAY, I should be able to read the whole array at time, right?
    if this is true, is there any sup limitations to its size?

    The most important thing, however, is that I still have not managed to run correctly this program; simply it gets stuck at STATE_READ because "state" variable is always 0 and never changes. Why?
    Maybe there are some problems in the Task configuration? It seems to use the task name for doing strange things; I've set the taskName variable according to the task's name but doesn't work. Have I to set event-based task or something like this?

    Please, since I'm relatively new to Codesys I'd like to have a complete answer on this problem, especially if a real solution is found.

    Best regards,
    Luigi Ferrara.

    reading.project [116.66 KiB]

     
  • luigisvideos - 2017-05-12

    For those interested,

    synchronous reading/writing worked for me, take a look @ l viewtopic.php?f=11&t=7847 l .

    Luigi Ferrara

     
  • Anonymous - 2017-05-12

    Originally created by: Viacheslav Mezentsev

    Try to update the CoDeSys and the libraries.

    IMG: 2017

     

Log in to post a comment.