Menu

#11 writing data in plc s7 through arduino

1.0
open
2017-08-12
2017-08-08
No

Hello Sir,
I'm trying to write data into plc through arduino mega using your library, but while tring to write int data the data written in plc is differs from the actual data that i was writing.
Here is my code:

int dataToWrite=100;
void *target1;
target1= &dataToWrite;
Client.WriteArea(S7AreaDB, // We are requesting DB access
DBNum, // DB Number
10, // Start from byte N.0
2, // We need "Size" bytes
target1);

The data writing in plc is 25600 instead of 100.

Thank you in advance.

Discussion

  • Davide Nardella

    Davide Nardella - 2017-08-12
     
    • Tanmay J Gharat

      Tanmay J Gharat - 2017-08-12

      Thank you sir.

      On Sat, Aug 12, 2017 at 4:05 PM, Davide Nardella davenardella@users.sf.net
      wrote:

      http://snap7.sourceforge.net/siemens_dataformat.html

      Status: open
      Milestone: 1.0
      Labels: Snap 7 Arduino Mega PLC S7_300
      Created: Tue Aug 08, 2017 07:30 AM UTC by Tanmay J Gharat
      Last Updated: Tue Aug 08, 2017 07:30 AM UTC
      Owner: Davide Nardella

      Hello Sir,
      I'm trying to write data into plc through arduino mega using your library,
      but while tring to write int data the data written in plc is differs from
      the actual data that i was writing.
      Here is my code:

      int dataToWrite=100;
      void *target1;
      target1= &dataToWrite;
      Client.WriteArea(S7AreaDB, // We are requesting DB access
      DBNum, // DB Number
      10, // Start from byte N.0
      2, // We need "Size" bytes
      target1);

      The data writing in plc is 25600 instead of 100.

      Thank you in advance.

      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/snap7/tickets/11/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

Log in to post a comment.