You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Greetings first of all thanks for such a library i try to read just 1 bit but return object
constsnap7=require('node-snap7');// Bağlantı yapılacak PLC'nin IP adresi ve diğer bağlantı bilgilericonsts7client=newsnap7.S7Client();constip='176.16.11.45';// PLC'nin IP adresiconstrack=0;// PLC rack numarasıconstslot=3;// PLC slot numarasıs7client.ConnectTo(ip,rack,slot,(err)=>{if(err){console.error('Connection error: '+err);return;}elseconsole.log('Connetion established...');// plc.DBRead(215, 256, 1, (err, data) => {s7client.ReadArea(s7client.S7AreaDB,215,256,1,s7client.S7WLBit,(err,data)=>{if(err){console.error('Read Error: '+err);s7client.Disconnect();return;}// Okunan veri DB215.DBX.256.01 adresinde bulunurconsole.log('Read data: '+data);console.log(typeof(data));// Bağlantıyı kapats7client.Disconnect();});});
ReadArea() always returns a buffer object (For S7WLBit either 0x00 or 0x01). Issue with your code is that you force a type change in your console.log('Read data: ' + data); by concatenating the buffer object with a string and 0x00 or 0x01 are no printable utf8 characters.
Greetings first of all thanks for such a library i try to read just 1 bit but return object
if i use DBRead and 1 byte get %
The text was updated successfully, but these errors were encountered: