plcpeople / nodeS7

Node.JS library for communication to Siemens S7 PLCs
MIT License
356 stars 120 forks source link

[Question] Read boolean value from DB #123

Closed TheGreatOne07 closed 2 years ago

TheGreatOne07 commented 2 years ago

Hi. I've got any question. How can i read boolean (bit) value from Data Block? I have tried something like mixer_working: 'DB2,M58.0', in mapping, but that returned following error:

[10205,26288100] Zero length arrays not allowed, returning undefined [10205,26656600 192.168.0.1 S1] Dropping an undefined request item.

Could you explain me, what i did wrong?

plcpeople commented 2 years ago

DB2,M58.0 is not a valid address. M58.0 is a valid address for a memory bit. DB2,X58.0 is a valid address for a bit in a data block. DB2,X58.0.16 is an array of 16 bits starting at DB2.DBX58.0. I see now that this is not documented well and will edit.