Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched.
Close
Now I will have a main visualization where I want to display and switch between the GreenLamp or RedLamp visualization when some requirements are met in code or when a button is pressed at the main visualization. With another button it is possible to switch between all lamps so I'm able to select which lamp visu I want to display. A primitive pseudo code could look like this:
If RequirementGreenLampL1 Then // Switch to GreenLamp L1 visualizationElsif RequirementGreenLampL2 Then // Switch to GreenLamp L2 visualizationElsif RequirementRedLampL3 Then // Switch to RedLamp L3 visualizationEnd_If
I can't finde any VisuElems documentation. I'm looking for functions/methods to pass the data to the corresponding visualization and to show this visualization in the main visualization. A frame would be good.
Note: This should be an easy to understand example. The real application will have more custom types (machines with settings visu).
Does someone have any clue how to do it?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the main visualization place 1 frame.
In this frame add 3 visualizations (2x green lamp, 1x red lamp).
Link the FB instances as reference to the visualizations in the frame.
Then there are multiple options to switch between which visualization to show in the frame.
A simple one could be just to use the "Switch frame variable" and in your IF statement set the correct value for this variable.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I created a simple function block for a green lamp and red lamp:
(Red lamp is the same, just the different name)
And I created a visualization with just one lamp called "GreenLamp" and another one called "RedLamp" with the following interface configuration:
(Red lamp is the same, just the different type name)
In my main program I instantiated two instances of the green and one instance of the red lamp:
Now I will have a main visualization where I want to display and switch between the GreenLamp or RedLamp visualization when some requirements are met in code or when a button is pressed at the main visualization. With another button it is possible to switch between all lamps so I'm able to select which lamp visu I want to display. A primitive pseudo code could look like this:
I can't finde any VisuElems documentation. I'm looking for functions/methods to pass the data to the corresponding visualization and to show this visualization in the main visualization. A frame would be good.
Note: This should be an easy to understand example. The real application will have more custom types (machines with settings visu).
Does someone have any clue how to do it?
In the main visualization place 1 frame.
In this frame add 3 visualizations (2x green lamp, 1x red lamp).
Link the FB instances as reference to the visualizations in the frame.
Then there are multiple options to switch between which visualization to show in the frame.
A simple one could be just to use the "Switch frame variable" and in your IF statement set the correct value for this variable.