Why isn't the error code returned in de S7DataItem[] array when a ReadMultiVar is requested with an address location which is not available in the CPU ??
Tag DB15.DBW0 is in the list but not in the CPU --> returns value 0 but no error !!
The S7DataItem.Return = 0
Best regards,
Andy
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I redesigned snap7.net.cs due to many issues related to GC :(
In a few days I will release Snap7 1.4.0 which contains a new release of .net wrapper.
In meantime in attach you find the new snap7.net.cs if you would like to test.
Some notes:
1 -----------------------------------------------------------------
The Read/write Multivars was changed : now there is the class S7Multivar which makes it easier and safer operations.
Into the full release you will find a complete WinForm C# demo.
Example of usage:
public void DBMultiRead()
{
// Reader Instance
S7MultiVar Reader = new S7MultiVar(Client);
TxtRes_A.Text = "";
TxtRes_B.Text = "";
TxtRes_C.Text = "";
int DBNumber_A = System.Convert.ToInt32(TxtDB_A.Text);
int DBNumber_B = System.Convert.ToInt32(TxtDB_B.Text);
int DBNumber_C = System.Convert.ToInt32(TxtDB_C.Text);
// Add Items def.
Reader.Add(S7Client.S7AreaDB, S7Client.S7WLByte, DBNumber_A, 0, 16, ref DB_A);
Reader.Add(S7Client.S7AreaDB, S7Client.S7WLByte, DBNumber_B, 0, 16, ref DB_B);
Reader.Add(S7Client.S7AreaDB, S7Client.S7WLByte, DBNumber_C, 0, 16, ref DB_C);
// Performs the Read
int Result = Reader.Read();
// Dumps the data and shows the results
ShowResult(Result);
TxtRes_A.Text = Client.ErrorText(Reader.Results[0]);
if (Reader.Results[0] == 0)
Dump(TxtDump_A, DB_A, 16);
else
TxtDump_A.Text = "< No Data Available >";
TxtRes_B.Text = Client.ErrorText(Reader.Results[1]);
if (Reader.Results[1] == 0)
Dump(TxtDump_B, DB_B, 16);
else
TxtDump_B.Text = "< No Data Available >";
TxtRes_C.Text = Client.ErrorText(Reader.Results[2]);
if (Reader.Results[2] == 0)
Dump(TxtDump_C, DB_C, 16);
else
TxtDump_C.Text = "< No Data Available >";
}
DB_A, DB_B and DB_C are 3 array of byte.
2 -----------------------------------------------------------------
Tere are many also helper functions : now ALL S7 types are handled (including 64 bit types of S71500)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2015-06-07
Hello,
amazing how fast you're responding....
I just tested the readmultivar class and it is working.
I now get an 'Address out of range' error when item is not available in the CPU.
Another improvement would be to let the new S7MultiVarClass handle a split read, when amount of requested items > PDU Size.
I will try to work this out, and send you a testversion.
Thanks,
Andy
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Mmmm... I don't know if that's possible.
The MultiRead/Write uses a specific protocol function which is limited, by design, to the PDU size.
Unless to write a "splittable" MRWrite.
Consider that the advantage of this fun. is to transfer more and small tags using a single transaction.
All remaining functions already split automatically the tags.
I don't know if the increasing complexity could lead to a real speed benefit : in any case you can transfer only "PDU" size bytes at time.
Nevertheless you are welcome to test and propose new solutions of course ;)
Regards
Dave
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Why isn't the error code returned in de S7DataItem[] array when a ReadMultiVar is requested with an address location which is not available in the CPU ??
Tag DB15.DBW0 is in the list but not in the CPU --> returns value 0 but no error !!
The S7DataItem.Return = 0
Best regards,
Andy
Release ?
OS ?
CPU (Architecture) ?
Wrapper ?
I don't have the cristal ball ;)
Last edit: Davide Nardella 2015-05-29
Hello,
Release : 1.3.1
OS : Windows 8.1
CPU : x64
Wrapper : dot.net -> snap7.net.cs
Best regards,
Andy
I redesigned snap7.net.cs due to many issues related to GC :(
In a few days I will release Snap7 1.4.0 which contains a new release of .net wrapper.
In meantime in attach you find the new snap7.net.cs if you would like to test.
Some notes:
1 -----------------------------------------------------------------
The Read/write Multivars was changed : now there is the class S7Multivar which makes it easier and safer operations.
Into the full release you will find a complete WinForm C# demo.
Example of usage:
DB_A, DB_B and DB_C are 3 array of byte.
2 -----------------------------------------------------------------
Tere are many also helper functions : now ALL S7 types are handled (including 64 bit types of S71500)
Let me know...
Hello,
amazing how fast you're responding....
I just tested the readmultivar class and it is working.
I now get an 'Address out of range' error when item is not available in the CPU.
Another improvement would be to let the new S7MultiVarClass handle a split read, when amount of requested items > PDU Size.
I will try to work this out, and send you a testversion.
Thanks,
Andy
Mmmm... I don't know if that's possible.
The MultiRead/Write uses a specific protocol function which is limited, by design, to the PDU size.
Unless to write a "splittable" MRWrite.
Consider that the advantage of this fun. is to transfer more and small tags using a single transaction.
All remaining functions already split automatically the tags.
I don't know if the increasing complexity could lead to a real speed benefit : in any case you can transfer only "PDU" size bytes at time.
Nevertheless you are welcome to test and propose new solutions of course ;)
Regards
Dave