Jump to content

How to program non-volatile memory?


Recommended Posts

  • MVP 2023

System bit SB 8 turns on when the battery is low.  I always put a small indicator on the screen for this.

If the settings will never change you can either check the power-up box or put them in a Data Table with the "Part of Project" checked.  You could load them when the PLC powers up.

33 minutes ago, ZebioEE said:

PS. is nonsense nowadays use volatile memory related battery condition :(

We have to deal with the cards we're dealt.  The battery is rated for 7 years and they typically last for 10 years.  Your client will have to change them from time to time.

Joe T.

Link to comment
Share on other sites

  • MVP 2023
7 hours ago, ZebioEE said:

is nonsense nowadays use volatile memory related battery condition :(

You have probably not seen how many times a dead battery leads to the failure of modern equipment. This cannot be avoided because a forgetful person has to take care of it.

The best day - "dead battery day" is the first day of the week after a long weekend... :)

 

The most important thing for the consumer is the ability to restore the application through the SD card as mentioned above.

When performing an important project, I always make an autocorrector subroutine for parameters that are critical, they are constants in the code or are pulled from the data table stored in flash.

If the battery goes down, as indicated by Joe above, when the machine is turned on and an automatic warning window appears and "Confirm" button must be used.

If the parameters have skyrocketed (at least one of them went beyond the allowed limits and the battery died SB8=1), then their automatic correction also generates a window that says that the battery has already died and the standard parameters are used. There is a warning about this in the user manual that I provide for the machine operator.

P.S. However, one user exceeded all my expectations. After the battery failed, he did not replace it, but only entered the parameters manually (in info mode) with operands printed on paper every time the machine was turned on at the beginning of the week.

This was his solution to the problem - because he was afraid to disassemble the PLC case to replace the battery.

Link to comment
Share on other sites

System bit SB 8 not help because data already lost after week of PLC off.

Use dedicated SD card, an artificial solution, additional  hardware just to fix failure of PLC . Is like add to you TV disel generators.

PC won't boot one morning because the bios battery is dead - But all data safe in CD hard disk!

Data Table with the "Part of Project" checked - Please explain where can do this check.

Link to comment
Share on other sites

  • MVP 2023

You must configure machine - write needed parameters to part of project DT columns (maybe different data type column needed.  Save DT to PLC write data to DT.

Then configure 'Restore default' button on some settings display and create  rung with restore contact -|P| -  and needed DT read function. Data from DT must overwrite losted data in PLC.

 

Link to comment
Share on other sites

  • MVP 2023
3 hours ago, ZebioEE said:

Use dedicated SD card, an artificial solution, additional  hardware just to fix failure of PLC . Is like add to you TV disel generators.

This is silly. You want flash memory to store data in the PLC? Unitronics has supplied the facility for adding flash memory to the PLC. An SD card is just additional flash memory for you to use as needed or as you see fit. Nothing artificial about it.

Link to comment
Share on other sites

55 minutes ago, Gabriel Franco said:

To me, it is simpler to STORE constant values to registers in a "restore to factory" subroutine called whenever you need, rather than use DT with "part of project" which implies operations with database.

Some critical parameters  I write in power up section and reprogram PLC...

 

save.JPG

Link to comment
Share on other sites

14 minutes ago, Flex727 said:

This is silly. You want flash memory to store data in the PLC? Unitronics has supplied the facility for adding flash memory to the PLC. An SD card is just additional flash memory for you to use as needed or as you see fit. Nothing artificial about it.

I wish  Unitronics  use non-volatile flash memory build in to forgot about this problems.

Instead babysitting with backup battery's. and get silly questions from consumers.

Link to comment
Share on other sites

  • MVP 2023
10 hours ago, ZebioEE said:

PC won't boot one morning because the bios battery is dead - But all data safe in CD hard disk!

You've defeated your own argument here.  Your "CD hard disk" ONLY has the data in it because either the PC or you have written data to the disk.  The situation is exactly the same with the PLC.  If you need optimised data to be saved by the system, you need to record it in some way.  And then have the PLC programmed to be able to retrieve it as necessary.  Kratmel has shown you a way of doing it which is very simple and effective, but I do things a little differently.

Perhaps you have not considered the way many people would, perhaps accidentally, use NVM in a PLC.  If it was written to every scan, MTBF would be markedly lower.  Using RAM totally alleviates this issue, but it needs the battery.  I have not personally used a plc without a battery, be it super-cap, rechargeable or standard.  They may be out there, but I'm guessing it is not done much due to potential durability issues.

My systems are 24/7 and constantly create optimised amounts for various parts of the program.  These amounts are written every minute to a data table, and every 24 hours that table is written to the SD card as a new file, not FIFO.  I routinely go through those files remotely or when next on site, and if it is worth changing any power up value to one of the optimised amounts, I do.  Regardless, I have the latest best values, at most 24 hours ago in PLC run time, stored for use in a component that doesn't need a battery.  Ready to reload as necessary by a few simple button pushes.  Hmmmm......that sounds like...clicking the mouse on my computer and opening a file I have saved to be used by a program already installed on the PC, and all of it coming from the "CD hard disk!"  

  • Upvote 1
Link to comment
Share on other sites

On 12/15/2023 at 11:53 PM, Ausman said:

You've defeated your own argument here.  Your "CD hard disk" ONLY has the data in it because either the PC or you have written data to the disk.  The situation is exactly the same with the PLC.  If you need optimised data to be saved by the system, you need to record it in some way.  And then have the PLC programmed to be able to retrieve it as necessary.  Kratmel has shown you a way of doing it which is very simple and effective, but I do things a little differently.

Perhaps you have not considered the way many people would, perhaps accidentally, use NVM in a PLC.  If it was written to every scan, MTBF would be markedly lower.  Using RAM totally alleviates this issue, but it needs the battery.  I have not personally used a plc without a battery, be it super-cap, rechargeable or standard.  They may be out there, but I'm guessing it is not done much due to potential durability issues.

My systems are 24/7 and constantly create optimised amounts for various parts of the program.  These amounts are written every minute to a data table, and every 24 hours that table is written to the SD card as a new file, not FIFO.  I routinely go through those files remotely or when next on site, and if it is worth changing any power up value to one of the optimised amounts, I do.  Regardless, I have the latest best values, at most 24 hours ago in PLC run time, stored for use in a component that doesn't need a battery.  Ready to reload as necessary by a few simple button pushes.  Hmmmm......that sounds like...clicking the mouse on my computer and opening a file I have saved to be used by a program already installed on the PC, and all of it coming from the "CD hard disk!"  

Thank you Ausman for advice on.

is different situations can pop up when have hundreds of consumers happy story and bad story.

Some consumers use sytem > 7 year and not  have problem but some in some countries  have always been issues with electricity cut off, also PLC are very sensible to SD card brand , some time it lost SD card, loose capacity, lost formatting etc.

Best way will be some amount of  NVM build in PLC what can be use way you described.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...