aktuell arbeite ich mit Codesys 3.5 SP18 und zum ersten mal mit der Rezepturverwaltung. Speichern funktioniert, laden funktioniert. Jetzt habe ich aber umfangreichere Funktionsblöcke, welche Ein/Ausgänge, Einstellwerte und auch interne Werte (für Regler usw.) besitzen. Es sollen nur die Einstellwerte in das Rezept gespeichert werden. Aber für jeden Funktionsblock von dem es mehrfach Instanzen gibt händisch jede notwendige Variable hinzufügen ist sehr mühsam (vor allem, wenn sich die Blöcke ändern oder eventuell neue dazu kommen).
Ist es möglich, gleich bei der Variablendeklarierung des Funktionsblocks Codesys zu sagen, hier soll die Rezepturverwaltung Variablen hinzufügen können bzw. genau umgekehrt? Oder eventuell überhaupt eine ganz andere Methode?
Danke schon mal im Voraus!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
4) and now if you need to update RECIPE DEFINITION you can just start to enter name in the first row of GVL and it puts all the variables from this list incl. structured variables.
You can test it with GVL. I bet you have GVL in your project. Just try to put all values from GVL and it put them all there:
Hey ignat,
thank you - that was a good one. You gave my brain a little kick with the STRUCT. Instead of writing the configuration variables of my function blocks directly in the VAR_INPUT, i've created a DUT for every FB with just the configuration variables declared.
With the recipe manager i just had to insert the DUT (lets say the name of FB is "machine" and the configuration is "config" => PLC_PRG.machine.config) and everything was good :)
With RecipeManCommands i can read and save the recipes. I just did that with a separate IEC-Task with low priority, saving the whole recipe every second and load that at startup.
Could that be a problem? Because i don't know an easy way to check if an update is required... just iterating over all objects and check if the old value <> new value... something like an event would be great on value change :)
👍
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I did it quite the same - load on startup but during operation only logged-in user can edit/manage it. I have a page like 'Recipe' where operator can select recipe - and values are loaded by recipe name changing (all available recipes are in the dropdown menu, the list is loaded on Startup or by RecipeManCommands, i think it was from initial Recipe example, with little changes).
And Administrator can edit recipes - and during editing all other menu are blocked, so you are not able to leave the page without saving.
You approach is good, I would just check the task configuration. If the task doesn't load the plc too much - then it's ok.
Some events like for VisuElems would be great, agree
Last edit: ignat 2022-11-21
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hallo,
aktuell arbeite ich mit Codesys 3.5 SP18 und zum ersten mal mit der Rezepturverwaltung. Speichern funktioniert, laden funktioniert. Jetzt habe ich aber umfangreichere Funktionsblöcke, welche Ein/Ausgänge, Einstellwerte und auch interne Werte (für Regler usw.) besitzen. Es sollen nur die Einstellwerte in das Rezept gespeichert werden. Aber für jeden Funktionsblock von dem es mehrfach Instanzen gibt händisch jede notwendige Variable hinzufügen ist sehr mühsam (vor allem, wenn sich die Blöcke ändern oder eventuell neue dazu kommen).
Ist es möglich, gleich bei der Variablendeklarierung des Funktionsblocks Codesys zu sagen, hier soll die Rezepturverwaltung Variablen hinzufügen können bzw. genau umgekehrt? Oder eventuell überhaupt eine ganz andere Methode?
Danke schon mal im Voraus!
Hi,
as far as I know there is no automatic binding to Recipe Manager.
Ein paar ideas how to 'optimize' it, maybe it will be helpful:
depends on how many FB you have and how many instances of Fb you have, but:
1) I would make some UDT for transfer to RezeptVerwaltung like
2) and link them to specific instances of function blocks
3) when i collect all such a data in one GVL. e.g.
4) and now if you need to update RECIPE DEFINITION you can just start to enter name in the first row of GVL and it puts all the variables from this list incl. structured variables.
You can test it with GVL. I bet you have GVL in your project. Just try to put all values from GVL and it put them all there:
Last edit: ignat 2022-11-18
Hey ignat,
thank you - that was a good one. You gave my brain a little kick with the STRUCT. Instead of writing the configuration variables of my function blocks directly in the VAR_INPUT, i've created a DUT for every FB with just the configuration variables declared.
With the recipe manager i just had to insert the DUT (lets say the name of FB is "machine" and the configuration is "config" => PLC_PRG.machine.config) and everything was good :)
With RecipeManCommands i can read and save the recipes. I just did that with a separate IEC-Task with low priority, saving the whole recipe every second and load that at startup.
Could that be a problem? Because i don't know an easy way to check if an update is required... just iterating over all objects and check if the old value <> new value... something like an event would be great on value change :)
Hi paho,
I did it quite the same - load on startup but during operation only logged-in user can edit/manage it. I have a page like 'Recipe' where operator can select recipe - and values are loaded by recipe name changing (all available recipes are in the dropdown menu, the list is loaded on Startup or by RecipeManCommands, i think it was from initial Recipe example, with little changes).
And Administrator can edit recipes - and during editing all other menu are blocked, so you are not able to leave the page without saving.
You approach is good, I would just check the task configuration. If the task doesn't load the plc too much - then it's ok.
Some events like for VisuElems would be great, agree
Last edit: ignat 2022-11-21