Hello,
I'm using the cns_getNodeTypeIcon() function to load the CNS node type icon.
However, immediately after opening the project, this function returns an empty string for all node types. Only after I launch the PlanModel Editor and call the function again does it return the icons' path.
I'm running WinCC OA 3.20.8 - Windows 64-bit.
Thank you,
Elad
CNS node types icon path not loaded
Search
Re: CNS node types icon path not loaded
I checked the code and the mapping which is used to store CNS information is filled with data when the CNS editor is opened.
Therefore, the function does not return a value if the panel was not loaded.
Where do you want to use the information for the CNS icon?
Best Regards
Leopold Knipp
Senior Support Specialist
Therefore, the function does not return a value if the panel was not loaded.
Where do you want to use the information for the CNS icon?
Best Regards
Leopold Knipp
Senior Support Specialist
Re: CNS node types icon path not loaded
Thank you, Leopold, for confirming the behavior.
I'm using the icons on one of the panels as icons on a tree widget. Anyways, the icon is a property that needs to be accessible, like, for example, the CNS node types, which are loaded even if the CNS editor is not opened. I'm expecting consistency in the behavior.
Kind regards,
Elad
I'm using the icons on one of the panels as icons on a tree widget. Anyways, the icon is a property that needs to be accessible, like, for example, the CNS node types, which are loaded even if the CNS editor is not opened. I'm expecting consistency in the behavior.
Kind regards,
Elad
Re: CNS node types icon path not loaded
If you want to use the same icons in an own tree widget (not related to CNS) you can simply load the graphics from the "pictures" folder or the subfolder where the icon (as picture) is saved.
The "cns" functions are especially designed for usage in combination with CNS applications.
Best Regards
Leopold Knipp
Senior Support Specialist
The "cns" functions are especially designed for usage in combination with CNS applications.
Best Regards
Leopold Knipp
Senior Support Specialist
Re: CNS node types icon path not loaded
Leopold, my tree is showing some data from CNS.
Why should we have a workaround when there is a specific function for this task: cns_getNodeTypeIcon().
What is the logic that icons are not loaded, but node types are? Why not make the icons accessible as well?
Thanks,
Elad
Why should we have a workaround when there is a specific function for this task: cns_getNodeTypeIcon().
What is the logic that icons are not loaded, but node types are? Why not make the icons accessible as well?
Thanks,
Elad
Re: CNS node types icon path not loaded
I have compared the functions cns_getNodeTypeDisplayName(), cns_getNodeTypeValue() and cns_getNodeTypeIcon().
They work different. While the first 2 mentioned functions work more or less as stand alone functions the third one has some prerequisites. The prequisite is that the mappings which are used inside of the function must be filled with data. Creating and adding data to the mappings is done when the CNS editor is opened.
If you still have questions concerning the WinCC OA functions please get in contact with your common WinCC OA support, e.g. by looking at https://www.winccoa.com/support.html.
Best Regards
Leopold Knipp
Senior Support Specialist
They work different. While the first 2 mentioned functions work more or less as stand alone functions the third one has some prerequisites. The prequisite is that the mappings which are used inside of the function must be filled with data. Creating and adding data to the mappings is done when the CNS editor is opened.
If you still have questions concerning the WinCC OA functions please get in contact with your common WinCC OA support, e.g. by looking at https://www.winccoa.com/support.html.
Best Regards
Leopold Knipp
Senior Support Specialist
Re: CNS node types icon path not loaded
Thank you Leopold.
I have no further questions about the function; it is clear.
I still think this is a bug, and not a "feature". If it were a feature, the documentation would have reflected the strange behavior of the function.
Kind regards,
Elad
I have no further questions about the function; it is clear.
I still think this is a bug, and not a "feature". If it were a feature, the documentation would have reflected the strange behavior of the function.
Kind regards,
Elad