CNS node types icon path not loaded

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
Search

Post Reply
7 posts • Page 1 of 1
eladsa
Posts: 10
Joined: Tue Dec 31, 2024 6:57 pm

CNS node types icon path not loaded

Post by eladsa »

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

User avatar
leoknipp
Posts: 2926
Joined: Tue Aug 24, 2010 7:28 pm

Re: CNS node types icon path not loaded

Post by leoknipp »

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

eladsa
Posts: 10
Joined: Tue Dec 31, 2024 6:57 pm

Re: CNS node types icon path not loaded

Post by eladsa »

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

User avatar
leoknipp
Posts: 2926
Joined: Tue Aug 24, 2010 7:28 pm

Re: CNS node types icon path not loaded

Post by leoknipp »

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

eladsa
Posts: 10
Joined: Tue Dec 31, 2024 6:57 pm

Re: CNS node types icon path not loaded

Post by eladsa »

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

User avatar
leoknipp
Posts: 2926
Joined: Tue Aug 24, 2010 7:28 pm

Re: CNS node types icon path not loaded

Post by leoknipp »

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

eladsa
Posts: 10
Joined: Tue Dec 31, 2024 6:57 pm

Re: CNS node types icon path not loaded

Post by eladsa »

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

Post Reply
7 posts • Page 1 of 1