Visualization Codesys

69 views
Skip to first unread message

Fito Coulter

unread,
Aug 5, 2024, 4:45:15 AM8/5/24
to wealthcusoha
Im an absolute beginner with CoDeSys Visualization, and am trying to teach myself to build WebVisu applications. I am running CoDeSys v3.5 SP12, and the target system is a Raspberry Pi running firmware 3.5.12.0. I'll be doing real projects with IndraWorks and Indramat XM22 controllers, but the Pi gives me a cheap way to practice and learn.

When I tried to Build the project, the error message was "The configured start visualization is not instantiated. Does it contain an interface or is the instantiation missing within the visualization manager ?"


Once I delete any variables in the VAR_IN_OUT section for the Visualization, and tie all my objects to ordinary Global or Program scope variable in the PLC application, the Visualization appears in the list of Visualizations under the Visualization Manager, and the project Builds and loads and runs correctly. I suppose that's what the error message meant when it said "is the instantiation missing within the visualization manager".


I have the same problem! Worse, when I generate an error of this type, my visualisation never reappeared on the visualisation manager. I need to create a new visualisation and paste all my items into.

So, a solution is to use VAR_GLOBAL. This variables are available into and outside your visualisation.


My understanding is that when you add variables inside the VAR_IN_OUT is that it then becomes a dialog. If you want variables to use inside the visualization without it becoming a dialog you need to add a VAR section so it would look like:


That information helps me understand the error message; when it says "does it contain an interface" it's referring to the VAR_IN_OUT section as an "interface". The fact that this is used for dialogs instead of ordinary windows helps me understand it.


I have a problem with the visualization. There are a lot of lag / slow refresh rate when running animations in the visualization window in the editor in both simulation mode and online mode. When I start moving the mouse the lag goes away and the animation works really well but gets bad when I stop. It feels that the refreash is very random and sometimes just waits for more then a second. But directly when the mouse_move events (or mouse click) starts firing the animation starts running smooth. I have tried many settings in the Visu_task and the webvisu update with no luck.


Are you seeing the same? Try it out in the webVisu project example or even easier, create a new project and add the waiting symbol flower. Try to run it in simulation mode and in online mode and view the spinner in the codesys window. Compare when moving the mouse.


It works much better when running in the browser, but not perfect. This is probably not related to the pi but how codesys is refreshing the canvas drawing. Or maybe something wrong with my setup? I have tried on multiple computers though.


I have tried that. I have tried all possible settings from 1ms to 1000ms. Updaterate doesn't seem to do much. The only thing that influences is if i put the task to update very slow say 5 seconds. Then it will only update at that freq (with some variation).


I changed the internal monitoring to 10ms but still slow. I changed the webvisu update rate down to 40ms still slow. If I want to decrease it more it gives me an error. Anybody knows why? Finally when I change the VISU_TASK it has strange behaviour. Forexample if I change the priority to 2 and cycle speed to t#2ms it became very slow. In case priority 10, and cycle speed t#10ms it is the "less slow". In Type freewhele it is completely useless. My code is very simple and the visualization as well. Any idea?


I have a strange problem with one of my libraries. Including the library in an application causes visualizations to stop working. This happen even if the library is only included in the library manager, and none of the function blocks are actually used in the program. I get a message "The online visualization is waiting for a connection. Please start the application", and applies to web visualizations as well. I can see by monitoring the cycle times in VISU_TASK that it's not actually doing anything (33uS cycle time), though it does show a status of "Valid, Active"

The rest of the program runs without any issues. I included checks_in_libs in the compile options, and have set breakpoints in all the implicit checks. There are no out of bounds issues, or bad pointers.

I can get this to consistently occur by simple adding or removing the library from the library manager. One other thing happens whenever the library is included. The program downloads and runs. I remove the library from library manager, perform a "Clean All", and try to download the new program, without the library. Every time, I'll get a message: "No connection to the device. Please rescan your network." The application in the PLC is then deleted, the PLC restarts, and then I can then download as normal.

There's nothing wrong with any of the code in the libraries. If I copy the function blocks and visualizations from the library directly into my project, I can use them without any issues. I thought maybe I could pinpoint which object was causing the problem by deleting them one by one in the library, but this doesn't solve the problem. If I delete everything from the library and include it as an empty library, the visualization works.


Questions:

1. If I include a library in the library manager, but don't actually use any of the objects in it, should it have any effect on the program? I have to do a "Clean All" in order to download after making changes to the library, because the compiler seems to recognize that I haven't actually made any changes to the program by changing a library that's not used anywhere. But it makes a difference on the visualization for some reason.

2. Is there any way to further troubleshoot why a visualization won't start? The log file doesn't contain anything useful, though sometimes I get "LOGGING BUFFER OVERFLOW; LOG MESSAGES DISMISSED"

I'm using Schneider Machine Expert 1.2.4 (Codesys 3.5.12.80), with an M241 controller


I finally have some error messages in the log. I'll get "Allocating a new chunk of memory (60000 bytes) for the dynamic texts failed" over 300 times in the log after a download/start. References component CmpDynamicText. I can't find any information on this error, does anyone know what it means?


I'm not sure if that makes sense. I've played around with the size of memory for visu in the Visualization Manager, increasing it all the way to 3 MB, and I can see the Device Memory Info reflect that (attached), but I get the same error, that it can't allocate 60KB. Or is there another memory area that being referenced here?


The size in the visu manager is no longer relevant (it will only provide the initial size required for the visualization).

If this memory is not sufficient, it will allocate more memory dynamically.


OK, thanks for the information, it has helped me to narrow down the problem.

I had a library with quite a few enumerations, all of which had text list support. If I remove the text list support from some of them, things start to work. Then I added another library, and it stopped working again, until I removed more text list support. Maybe I was hitting the limit of available memory for text lists, which is why sometimes one library would appear to be causing the issue, another times, a different library--there's nothing wrong with the individual libraries, but adding them together required too much memory.

That does raise another question. If I go to /usr/Visu on the controller, I can see a .txt file for each text list. Are they all loaded into memory on bootup?

Another thing I've noticed is that the lists exist multiple times in the file system. So, for example, there's a file called library1.list1.txt, then there's another file called library2.library1.list1.txt, which is the same list, but library 2 contains library 1. Could this be why there's so much memory used?


Hey,

yes there are loaded into memory on startup.

There can be multiple textlists with the same name, since the lib may be included in different versions resulting in the possibility that some ids may be removed/added or their translation changed.

To ensure that the user of the textlist does not run into problems, every textlist/lib version combination will be downloaded and loaded.


One further question comes up. I've been removing the text list support from the enumerations and creating separate text lists. This seems to be working better. Is there a difference between the two methods as far as memory use and allocation?


That depends where you create the textlists.

If you add the textlist in the same lib the enumeration is, I would expect no difference.

But if there is only one textlist (e.g. in the application level), there will be a difference.


This product allows for the creation of operating interfaces with CODESYS visualization for an HMI device (PC or panel), with data from CODESYS V2, CODESYS V3 and OPC UA controllers. The visualization is created with the CODESYS Development System (V3), the free IEC 61131-3 development system with a full-fledged visualization editor.


HVAC (Heating Ventilation and Air-Conditioning) functional components and HTML5 visualisation. Automate and visualise your entire building technology professionally and independently of hardware: ventilation systems, heat generation, heating circuit distribution, individual room control, room automation, light and blind control.


This tutorial is based on the sample program RefigeratorControl, which was created in the "Your First Program in CODESYS" chapter. The finished program can also be found in the installation directory of CODESYS in the Projects subfolder.


This screen includes the representation of a refrigerator. The refrigerator consists of several polygon type visualization elements. The doors of the refrigerator are drawn in both the closed and open states. Both doors consist of a group of single elements.

3a8082e126
Reply all
Reply to author
Forward
0 new messages