%MW values retain , is it possible ?
I would like to know if there is any way to retain the values of the %MW data at application shut down and restore the values at the next startup.
Thanks for any advice.
bigalex
Please Log in or Create an account to join the conversation.
Can you tell what you are trying to do?
Please Log in or Create an account to join the conversation.
I would like to use %MWs to store values that have to be retained .
PLCs normally have a retain memory area p.e. Schneider Electric PLCs use %MWs for that.
If I want to store some values as recipe that are used to determine some machine device settings
or status how can I do it ?
ClassicLadder is a valid tool as much is usable as a "standard PLC" in order to save money for
a PLC's CPU.
I imagine a file that every time a %MW value change the new value it's stored into and when the
ClassicLadder Instance is launched at the stratup the values contained into this file are restored.
Is there any way to have something similar?
I hope I'm clear enough .
bigalex
Please Log in or Create an account to join the conversation.
Off the top of my head...
you could create a HAL component that saves the values (on a timeout or by a signal or probably when closed)
This component could export the data on different pins that classicladder could read and use to set your data.
Kinda kludgy but it would work...
Please Log in or Create an account to join the conversation.
I do believe that could be better to store the %MW values at runtime into a database like sqlite ( I know that it is possible to use Python to do that because of Pysqlite module ) .
I do not have a solid expertise with Python so maybe you or somebody else can evaluate this option.
I also don't know how get the values of the %MW to use with an external application than ClassicLadder.
Am I clear on the basic idea ?
bigalex
Please Log in or Create an account to join the conversation.
Then you would connect your custom component using HAL pins and signals.
To get them back you would connect the custom component to classicladder using %IW input pins then copy them to the %W memory.
As I said kludgy....
Classicladder is written in C so C would be the natural language to add feature to it.
Classicladder already uses plain text files for configuration and ladder programs so
a plain text file of the memory would seem fine to me.
The only real question is do we create new memory names or just save the regular ones (%B for bit and %W for s32)
If we save the regular ones how to we tell CL we want to remember them vrs when we want to zero them.
Please Log in or Create an account to join the conversation.
I think that we can keep the "native" name as you say %B,%W .
%I and %Q is not needed .
The most useful is %W because is the natural candidate for the memory storing feature (compare to standard PLC functionality) .
I don't know how is made ClassicLadder so if plain text method is already used as variables initializer maybe could be elegant to use
a similar approach.
In some Schneider Electric PLC's Family for example you can select (into a configuration section) if you want to reset
all variables %W values at PLC first cycle or you want to keep the values stored at the previuos shut down.
bigalex
Please Log in or Create an account to join the conversation.
As per search on Google I've found this .
This project include a sort of softlogic as ClassicLadder and have the feature to save a user selected PLC variable list (Registers maily) at
the softlogic shutdown.
To be more precise on it , it is possible to declare which variables have to be periodically stored on the Hard Drive (into a text file) and at the
next softlogic startup the variables values will be restored at their last values.
I don't know if this can be "easily" improved but maybe it can be an inspiration for the developers .
bigalex
Please Log in or Create an account to join the conversation.
My suggestion would be to modify classic ladder to load a well defined configuration file for those registers. I'm not real familiar with classic ladder so maybe there is an init running at start up that could be modified to do this. The init file could be edited manually or you could force an update from the classic ladder menus. I just don't see how you could assure that an automatic save will always be correct and safe.
A slightly different route would be to modify Classic ladder to allow saves and restores of the data area from the menus whenever you want. Done right you could have a range of files saved to restore as needed.
Please Log in or Create an account to join the conversation.
On commercial PLC the retained data are not only backupped by batteries .
For example Simens Simatic PLC's (S7-300) use an SD memory card and the values of the retained memory area are saved at PLC's shutdown
and restored at PLC's powerup .
I know that ClassicLadder softlogic is a quite different situation but I also know that there are many different (commercial) soflogic solutions
that provide the data retention function (Siemens WinAC RTX , Beckoff TwinCAT, Codesys .... and more).
On the system integration side LinuxCNC+ClassidLadder bundle is a good solution because it is not needed a PLC CPU but only the I/O system
(embedded [parallel port,Mesa cards and so on] and/or remote via usb or ethernet [Modbus TCP/IP]).
Moreover if the external PLC CPU is not needed no other programming language is needed as well.
As you say :
A slightly different route would be to modify Classic ladder to allow saves and restores of the data area from the menus whenever you want. Done right you could have a range of files saved to restore as needed.
can be a "better than nothing" solution.
I don't wont to be misunderstood .
I appreciate so much what LinuxCNC project is giving .
I'm just wondering if is possible to improve the usability of ClassiLadder .
The %W retain values is an important feature for a PLC job.
It is very hard to imagine an automatic machine that do not have "memory".
bigalex
Please Log in or Create an account to join the conversation.