Menu

S7MultiVar reference - data limits

Mateusz
2018-07-09
2018-07-11
  • Mateusz

    Mateusz - 2018-07-09

    hello everyone,
    I'm trying to read data using S7 MultiVar reference, everything works but when I try to read bigger space i've got error.

    S7MultiVar Reader = new S7MultiVar(Client); // This method work
    
    byte[] DB_A = new byte[1024];
    byte[] DB_B = new byte[1024];
    byte[] DB_C = new byte[1024];
    
    int DBNumber_A = 1; // DB1
    int DBNumber_B = 1; // DB2
    int DBNumber_C = 1; // DB3
    Reader.Add(S7Consts.S7AreaDB, S7Consts.S7WLByte, DBNumber_A, 0, 16, ref DB_A);
    Reader.Add(S7Consts.S7AreaDB, S7Consts.S7WLByte, DBNumber_B, 0, 16, ref DB_B);
    Reader.Add(S7Consts.S7AreaDB, S7Consts.S7WLByte, DBNumber_C, 0, 16, ref DB_C);
    int Result = Reader.Read();
    
    S7MultiVar Reader = new S7MultiVar(Client); // This method dosn't work
    
    byte[] DB_A = new byte[1024];
    byte[] DB_B = new byte[1024];
    byte[] DB_C = new byte[1024];
    
    int DBNumber_A = 1; // DB1
    int DBNumber_B = 1; // DB2
    int DBNumber_C = 1; // DB3
    Reader.Add(S7Consts.S7AreaDB, S7Consts.S7WLByte, DBNumber_A, 0, 100, ref DB_A);
    Reader.Add(S7Consts.S7AreaDB, S7Consts.S7WLByte, DBNumber_B, 0, 100, ref DB_B);
    Reader.Add(S7Consts.S7AreaDB, S7Consts.S7WLByte, DBNumber_C, 0, 100, ref DB_C);
    int Result = Reader.Read();
    

    Now my question is if there is a data limit for this method?

    Thanks for your kindly help

     
  • Davide Nardella

    Davide Nardella - 2018-07-09

    yes, all these conditions must be met:
    1 - You can transfer Max 20 Vars
    2 - The maximum amount of data (including the overhead) must be less then the PDU
    3 - Every Var has 12 byte of overhead, the Multiread function has 12 byte of overhead.

     
  • Mateusz

    Mateusz - 2018-07-09

    Thanks David for explanation.
    Is there another way to read data from several DB in the same time?
    I'd like to read 400B from 8 different DB in the same time to not waste the time.

     
  • Davide Nardella

    Davide Nardella - 2018-07-09

    the only one is opening multiple connections to the same plc. using different clients of course.

     
  • Mateusz

    Mateusz - 2018-07-10

    thank one more time. One more question, how to configure PLC S7 300 to get 10 connections. Because now I can connect only 5 clients in the same time.
    How to manage Connection Resources in PLC to get maximum quantity connections?
    https://zapodaj.net/601a0b1a632f2.jpg.html

     
  • Davide Nardella

    Davide Nardella - 2018-07-10

    https://zapodaj.net/601a0b1a632f2.jpg.html
    that's correct.
    Hardware Configuration-->CPU property-->Communication
    modify the values and then download the hardware config into the PLC.

    As I can see you are using a 317 or 318 CPU, you should not have problems.

     
  • Mateusz

    Mateusz - 2018-07-10

    I have 32 connection resources but i can make only 5 Snap7 connections.
    One Snap7 Conditions needs more than one PLC connection resources?
    I'm using CP 343-1 Lean. I think this is a bottleneck.

     

    Last edit: Mateusz 2018-07-10
  • Davide Nardella

    Davide Nardella - 2018-07-11

    Correct it's CP343-1 Lean the problem

     
  • Mateusz

    Mateusz - 2018-07-11

    I checked it on CP 343-1 (not Leen) and it is works.
    I have another question, how to check if I added some variables to S7MultiVa? . Because if I not added any i will have a error during the writing to the PLC. Class S7MultiVar has private count, so I can't use it.
    How to solve this issue?

     
  • Davide Nardella

    Davide Nardella - 2018-07-11

    can you explain better please ?
    You should know if you added or not a variable.
    You can modify the wrapper (it's in source form) to use a counter into the class.

     
  • Davide Nardella

    Davide Nardella - 2018-07-11

    can you explain better please ?
    You should know if you added or not a variable.
    You can modify the wrapper (it's in source form) to use a counter into the class.

     
  • Mateusz

    Mateusz - 2018-07-11

    i'd like to write a method which will send data to PLC depends if there are some data to send in each loop cycle( sometimes will be some data to send sometimes no). I can of course add additional variable to memorize that I added a variable to send.
    ones again, thank you.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.