Menu

Create read fonction that accept string parmater [Suggestion]

bouba
2014-08-10
2014-08-11
  • bouba

    bouba - 2014-08-10

    Hello David
    I have a suggestion for snap7.It would be cool if there is one read fonction that accept String parameter like this:

    plcTagRead("string")

    string parameter would be :"DB10.DBB0" or "M20.0" or "DB10.BBX100.2" etc...

    That's more flexible for doing the polling.

     
  • Davide Nardella

    Davide Nardella - 2014-08-11

    It's interesting,
    maybe in a next release..

    I'm already using a similar code in my programs (I translate to you in C#):

    private int ReadTagByName(string Tag, byte[] Buffer)
    {
    int Area, DBNumber, Start, Amount, WordLen;

        /*
         *  Here parse the string and extract Area, DBNumber etc.. from it
         * 
         * */
    
        return Client.ReadArea(Area, DBNumber, Start, Amount, WordLen, Buffer);
    }
    
     

Log in to post a comment.