I have trouble to read data in DB of a Siemens PLC S7 1500 using S7netplus.
The situation:
- I have a C# application running.
- I connect on the PLC very well.
- I can read data such as Boolean, UInt, UShot, Bytes
But I don't know how to read String data (see the image below)
To read the other datas like Boolean I use this call:
plc.Read("DB105.DBX0.0")
I understood that this read in the Datablock 105 (DB105) with a datatype Boolean (DBX) at the offset 0.0 I would like to apply the same type of reading for the string. So I Tried "DB105.DBB10.0" in my example. But it return a value "40" in Byte type (and i should have something else)
I saw that there is another reading method
plc.ReadBytes(DataType DB, int DBNumber, int StartByteArray, int lengthToRead)
But I have difficulties to see how to apply it to my example (I know that I have to convert it to string after).
TO resume: - Is there a simple way with a string like "DB105.DBX0.0" to read string data in a Siemens PLC? - If not how to use the ReadBytes function in my example?
Thanks for your help