edit : found my problem : The variable in the PLC was a short int (= 1 byte) and I tried to read S7WLInt which is 2 bytes big. I replaced this one with S7WLByte and that solved my problem.
❤️
1
Last edit: steven noppe 2021-03-22
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I already read the docs, but I'm still having trouble understanding how to read a certain value inside a DB.
for example : I want to read an integer inside a DB (200) at address (435).
If I try this :
iResult = m_Client.ReadArea(S7Consts.S7AreaDB, 200, 435, 1, S7Consts.S7WLInt, m_DataBuffer, ref iSizeRead);
the function results in : 9437184
iSizeRead = 0, so I guess no data is read.
what am I doing wrong?
edit : found my problem : The variable in the PLC was a short int (= 1 byte) and I tried to read S7WLInt which is 2 bytes big. I replaced this one with S7WLByte and that solved my problem.
Last edit: steven noppe 2021-03-22