Closed 2287728768 closed 11 months ago
The DB address you want to write is DB1. DBW0.0, and the result is written to DB1. DBW2.0
Please add a minimal reproduction. The behavior you're experiencing doesn't seem to be a known issue.
yes,Write value offset by 2 bytes
Please add a minimal reproduction (code sample) that causes this problem.
Plc PLC20 = new Plc(CpuType.S71500, "192.168.12.254", 0, 1); PLC20.Open(); PLC20.Write(textBox2.Text, int.Parse(textBox1.Text)); //textBox2 To obtain the DB block address
The operating environment is Visual Studio 2017. PLC operates in a simulation environment Thank you
You're writing an int
, which is 4 bytes, comparable to Siemens DINT
. From your explanation of the issue I'm assuming you were expecting to write a short
, or INT
in Siemens terminology. Changing the code to short.Parse(textBox1.Text)
will probably do what you expected.
such is the case. Thank you for explaining
Please provide an English description of your problem and add a minimal reproduction that shows when the issue happens.