-
Notifications
You must be signed in to change notification settings - Fork 7
Raw byte handling
Felix Weiß edited this page Jun 21, 2022
·
2 revisions
The target array in the PLC is a word array with the definition size ARRAY[0..9] OF WORD
and a starting adress of DT2500.
That means the array exists in the memory from DT2500 to DT2509 and it can hold 20 bytes / 10 words.
var testBytes = new byte[20];
//write 0 - 19 to each byte
for (int i = 0; i < testBytes.Length; i++) {
testBytes[i] = (byte)i;
}
await interf.WriteByteRange(2500, testBytes);
The byte array definition in the PLC is the same but this time we just want to read back 13 bytes in total.
var bytes = await interf.ReadByteRange(2500, 13);