When the listener function on pdo.js:104-106 gets executed, it has the "this" scope of the dataObject it was assigned to on line 113: entry.on('update', listener);.
The problem is that you want to call Pdo.write(), so the "this" should be the Pdo and not the dataObject.
Solved by replacling pdo.js:104-106 by an arrow function: const listener = () => this.write(cobId);
I haven't tested the other cases in Pdo.start(), but the other listener functions problably need similar fixes.
When the listener function on pdo.js:104-106 gets executed, it has the "this" scope of the dataObject it was assigned to on line 113:
entry.on('update', listener);
. The problem is that you want to call Pdo.write(), so the "this" should be the Pdo and not the dataObject. Solved by replacling pdo.js:104-106 by an arrow function:const listener = () => this.write(cobId);
I haven't tested the other cases in Pdo.start(), but the other listener functions problably need similar fixes.