Unity Pro and M340 - how to save a value of variable ?

pazuzu

Member
Join Date
Jul 2013
Location
Poland
Posts
18
Hi
I have a small problem. I want to save on memory card installed on PLC or in PLC's internal memory a value of selected variables.
Example:
I have a counter triged by binnary impuls and counting of those impulses. Number of thos impulses is in variable %MW100.
And i have a power out situation. After restart my counter count from 0, but i want him to count from the latest value of %MW100. Is it possible to store such a information on PLC?

Please, help me with that.

Best wishes and sorry for my english.
Kamil
 
is the "value" in the tag data properties set to 0? this will change the value of the tag when the PLC does a cold-start.

For me when I power cycle the PLC, the value of the memory words are retained
 
Hi
Thanks for Your answer.
I understand that You show me how to set a initial value of a variable. I want to retain an information of value of my variable when coldstart is done.
Value field is empty.
 
On the plc cpu configuration tab -
-Make sure 'Initialise %mw on cold start' is not set
-Make sure 'Cold start only' is not set
 
Hi
This settings is set like You describe.
After power cycle or reset of the PLC those value of my variables are erased and set to 0.
Is there any option to save a value of a variable on the memory card ?
 
If the values are as described, then all 'located' variables will not lose there current values during power off.
If you are using a counter then this counter will lose its value. To retain the value during power off then don't use a counter instead use an ADD function (right click on the ADD block and turn on the Enable input) and use the enable input the same as you are using the counter trigger, put your located variable (eg %MW100) on one of the inputs and a 1 on the other input, then put the same located variable on the output pin. This is the only way to have a retentative counter.
 
I found other solutions.
If You want to save a value of variable You must:
- check a saved options on variable witch one You want to save
- check "initial value on cold start" on plc configuration screen
- during program set on a two system bits, first %S94 and then %S66
It works for me.
 
  • %s94 works well, i normally energise it ones a day and also have it linked to a save button on my SCADA pid loop tuning page. its very handy for loop settings and running hours.
just for interest sake if you need to do a full download you can retain your values by uploading data file from the plc,and downloading it again after your download.
 

Similar Topics

Greetings, I'm new at PLC programming, but good a logic - so I thought. I've inherited a PLC system, which is presently operating in the field...
Replies
6
Views
2,485
If I am disconnected from M340, I cant see the Values. Unlike RSLogix when one gets to choose upload state values upon exit, and these state...
Replies
4
Views
2,259
I am trying to make a function that count the number of True BOOL inn a specific Array and return the count to an INT AlarmArrayActiveAlarms. I...
Replies
8
Views
4,433
Hello all, My company have sourced a Modicon M340 PLC with a Magelis (XPT GTO4310) HMI. The intention here is to use this setup in order to...
Replies
6
Views
3,692
I am having trouble with creating a shift register in Unity Pro on my Schneider M340. I am using the FFB SHR to try and get this to work. I have...
Replies
13
Views
5,071
Back
Top Bottom