Menu

S7 C/C++ functions for mapping data read by Snap7

Reyan
2015-12-24
2016-11-03
  • Reyan

    Reyan - 2015-12-24

    Davide
    Please below are the S7 C/C++ mapping functions for the Snap7. Maybe it could be useful for the programmers that are working in C/C++ and trying to mapping the data read by Snap7. I basically following the same ideas in most of parts what you have for .NET. All the functions were tested. Please feel free to use it or make any recommendation. Thanks

    https://github.com/reyanvaldes/S7-cpp-for-Snap7

     
    • Vish74

      Vish74 - 2016-11-03

      Thank you very much this. It works perfectly. +1

       
  • Davide Nardella

    Davide Nardella - 2016-01-21

    Many Thanks ;)
    I will update the next release.

     
  • Zenou

    Zenou - 2016-02-14

    Hello,
    What are these functions intended for?

     
    • Vish74

      Vish74 - 2016-11-03

      In simple terms functions retrurns data what you are looking for, usally Snap7 API returns null pointer to value. As far as I know, python wrapper has similar data read implementation.
      For ex:

      #include snap7.h;
      byte MyDB32[256];
      TS7Client *MyClient;
      void SymplyGet()
      {
      MyClient = new TS7Client();
      MyClient->ConnectTo(“192.168.10.100”,0,2);
      MyClient->DBRead(32, 0, 16, &MyDB32);
      
      std::cout << "DBRead:" << S7_GetUIntAt(MyDB32, int Pos);
      
      // This will return int value if your DB contains that at "Pos". (Taken from those functions.)
      
      delete MyClient;
      }
      
       

Log in to post a comment.