%MW values retain , is it possible ?

More
01 Sep 2012 09:01 #23825 by bigalex
Hello gents.

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.


:blink: bigalex

Please Log in or Create an account to join the conversation.

More
01 Sep 2012 14:47 #23831 by cmorley
Unfortunately not with classicladder (practically anyways)

Can you tell what you are trying to do?

Please Log in or Create an account to join the conversation.

More
02 Sep 2012 07:41 #23839 by bigalex
Hello cmorley.

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 .

:blink: bigalex

Please Log in or Create an account to join the conversation.

More
03 Sep 2012 03:41 #23850 by cmorley
Well aside from modifying classicladder.... (which would be a great add on BTW)

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.

More
03 Sep 2012 16:51 #23860 by bigalex
Hello cmorley

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 ?

:blink: bigalex

Please Log in or Create an account to join the conversation.

More
04 Sep 2012 00:57 - 04 Sep 2012 01:03 #23870 by cmorley
you would copy the %W numbers to %QW when you wanted to save them. %QW export HAL pins.
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.
Last edit: 04 Sep 2012 01:03 by cmorley.

Please Log in or Create an account to join the conversation.

More
04 Sep 2012 07:37 #23873 by bigalex
Personally I would like to not use HAL for this .

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.

:blink: bigalex

Please Log in or Create an account to join the conversation.

More
15 Apr 2013 19:58 #32748 by bigalex
Hi, people.
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. :woohoo:
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 :blink:

Please Log in or Create an account to join the conversation.

More
18 Apr 2013 05:21 #32853 by wizard69
Generally retained memory areas on a PLC are battery backed up. I'm not sure how you could successfully cover all possibilities with automatic saves to disk and then restart and never get corrupted data. As such I'm not sure automatic backups to secondary storage is a wise avenue to take.

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.

More
18 Apr 2013 16:06 - 18 Apr 2013 16:06 #32876 by bigalex
Hi wizard69 , thank you for your reply .
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 :blink:
Last edit: 18 Apr 2013 16:06 by bigalex.

Please Log in or Create an account to join the conversation.

Time to create page: 0.114 seconds
Powered by Kunena Forum