I’m seeing what looks like a bug with user-defined enumerated data types in OpenPLC Editor.
I created a custom enum data type named HOA_MODE and defined these values:
The data type itself appears to be created correctly.
Problem
If I create a variable in the variable table and assign it the HOA_MODE data type, then try to use that variable in my main program editor area, the editor cannot find it or does not recognize the type correctly.
However, if I create the variable directly in the editor area, the program can find and use the HOA_MODE data type without a problem.
What I expected
I expected variables created in the variable table and assigned a custom enum type to be usable the same way as variables created directly in the editor area.
What actually happens
- Variable created in variable table with type
HOA_MODE:- editor area does not recognize it properly
- seems like the type or variable is not available where it should be
- Variable created in editor area with type
HOA_MODE:
Additional detail
I also noticed that in some places the editor displays the type name as HOA MODE instead of HOA_MODE, even though the actual type definition is named HOA_MODE. I am not sure if this is only display formatting or related to the issue.
Steps to reproduce
- Create a custom enum data type called
HOA_MODE - Add enum values such as:
- Go to the variable table
- Create a variable and set its type to
HOA_MODE - Try to use that variable in the main program editor
- Observe that the editor does not recognize it properly
- Then create a similar variable directly in the editor area
- Observe that this version works
Question
Has anyone else seen this behavior with:
- custom enum data types
- variables created in the variable table
- differences between the variable table and editor area
I’m trying to figure out whether this is a known bug, a sync issue in the editor, or something specific to how custom data types are handled.