cmseaton42 / node-ethernet-ip

A Lightweight Ethernet/IP API written to interface with Rockwell ControlLogix/CompactLogix Controllers.
MIT License
265 stars 106 forks source link

PLC.foreach() doesn't work #95

Open planetixin opened 2 years ago

planetixin commented 2 years ago

Current Behavior

function doesn't work inside PLC.foreach()

Expected Behavior

PLC.foreach() should work.

Possible Solution (Optional)

Context

const PLC = new Controller(); var number = 0;

PLC.connect('ip adress', 0).then(async () => { PLC.forEach(tag =>{
number++; }); console.log(number);

});

Steps to Reproduce (for bugs only)

1. 2. 3. 4.

Your Environment

cmseaton42 commented 2 years ago

the forEach method is available for a TagGroup instance not on a Controller instance.