Skip to content
Advertisement

ReferenceError: LE1DOWNmachen is not defined

I wrote it in one of the hmi design programs. It´s IoT software. After connecting with the source (my fall Siemens Logo 8) – PLC hardware, I get the ReferenceError, when I click on every button. These are my triggers to fire up the function. They are connected to start the animation. What should I change to get rid of this errors? Thanks, RJ

JavaScript

Advertisement

Answer

Your code calls

JavaScript

But the only function definition that contains that label is this:

JavaScript

But this code is not defining a function called LE1DOWNmachen(). It is actually equivalent to this:

JavaScript

The LE1DOWNmachen is meaningless here. It is being ignored. To invoke this function, you need to call

JavaScript

Demo:

JavaScript

If you want the function to be called LE1DOWNmachen, then define it like this:

JavaScript

or this

JavaScript

If you want both names to work, you can do this:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement