Enumerators in FBD

Hi,
I’m new to PLCNext engineer and I have a question about enumerators. I’m using PLCNext engineer 2025.0
I have 2 programs doing the same thing using an array with an enumerator. One is in ST one is in FBD. But it seems that using the enumerator in FBD is giving me the error „invalid variable name“ and I don’t really understand why.
afbeelding.pngafbeelding.pngI double checked that the variables are declared correctly.
Does anyone know what I’m doing wrong here?
Kind regards,
Edwin

Do the setting like below:
Extras–Complier–check"Allow entended Ifentifiers"
image.png
Have a try please.

That seems to do the trick.
Thank you very much!

I think I spoke a little too soon. In my project the enumeration is working, but I got 15 other compile errors now.
afbeelding.pngThe error is given on the „/“. Placing a space before and after the ‚/‘ fixes this error.
Another example is „OUT01:= TRUE;“ This gives an error. But if I place a space between 1 and : the compile error is gone. „OUT01 := TRUE;“ is correct.
For almost all the compile errors I could place spaces, but there is 1 compile error that is inside a library, which I don’t know if I can adapt this.
afbeelding.pngThis is in library PxCSE ANL_Hysteresis2_1afbeelding.png

From the PLCnext Engineer help:
Extended Identifiers as IEC 61131-3 Variable Names ');\n mywindow.document.close(); \n mywindow.focus();\n setTimeout(function () {\n mywindow.print();\n mywindow.close();\n }, 1000)\n return true;\n}\r\n\r\n\r\n image.png
You will need to contact the developers of that library to get the function block fixed.

It still sounds like a bug to me. Both editors (ST / FBD) should handle the same expression equally.
You shouldn’t be forced to change a library to work around a bug.

There’s two issues in this discussion:

  • The use of an enumeration element as an array index in ST vs FB. I agree that this should be handled the same in ST and FBD, and the fact that it isn’t looks like a bug in PLCnext Engineer.
  • The Hysteresis2 FB in the PxCSE Analog Library cannot currently be used when the „Extended Identifiers“ option is enabled, because the library developers missed a space in front of an assignment operator. This isn’t related to the first issue, and it’s not a bug in PLCnext Engineer.

I think I agree with Martin on the last comment.
I have mailed the developer of the library with the change request.
Do I need to report this bug in PLCNext engineer seperately, or is the development team involved is the discussions on this forum?

Hi Edwin
Thank you for using our libraries. These blocks were written a while ago and there are no plans to „update“ these blocks. Since the blocks are open, there are opportunities for users to make their own blocks and use our blocks as inspiration.
Best regards Acke

Do I need to report this bug in PLCNext engineer seperately, or is the development team involved is the discussions on this forum?I’ve now report this issue to the PLCnext Engineer support team.

You can overwrite the function blocks via copy & paste from the library to your local function block folder. That will allow you to edit the problematic code. PLCnext Engineer will favor the local type over the library one as long as the prototypes of both FBs are identical.

BR
DivisionByZero