How to Clear thoose Temp variable ?

google08

Member
Join Date
Jun 2011
Location
Kiruna
Posts
51
How to Clear thoose Temp variable ?

start with #exampel i mean clear so it be 0

is there a faster way to clear thoose MW then MOVE 0 to MW?

its kind of boring when u need to do 4 MOVE function to clear

MW2,4,6,8
 
So you want to clear MW2-MW8. You want to use variable #example declared on temp area where you first move 0 to have it clear, correct?

Are you using S7-300, S7-400, S7-1200 or some other plc?
 
Temp variables in S7 may contain any value when a block is called. Temp memory is allocated at runtime and the memory allocate will contain whetever values were left there by the last block to use that particular piece of memory.

Never ever use a temp variable in your code unless you have first set it to a value!

As for the OPs question, what's wrong with:

Code:
L 0
T MD 2
T MD 6

There are, of course, many other ways to achive the same end result.

Why do you want to clear MW's anyway? Most people use a MW because they want the value to be retained.

Nick
 
Temp's are L memory, which can be any state.

M memory is not TEMP, I would use the TEMP area for temporary memory, that is after all what they are there for.

Look in the standard libraries, there is a FILL block where you can fill an area with whatever values you want, including zero's.
 
i want to clear thoose MW because in WinCC i used a input to a

MW in Step7 , incase they type wrong number i want to make a

reset button to clear what they have typed
 
Reset button on WinCC or physical button?
Cause in WinCC you can just directly write 0 into the tags in question.
 
Code:
A #myResetButton
JC =M001
JU =M002
M001: L 0
T MD 2
T MD 6
M002: NOP 0

Is that what you are trying to achieve.... but more adventurous??

Not too sure how to make it more 'interesting' than that really....
 
Code:
A #myResetButton
JC =M001
JU =M002
M001: L 0
T MD 2
T MD 6
M002: NOP 0
Is that what you are trying to achieve.... but more adventurous??

Not too sure how to make it more 'interesting' than that really....


Code:
A #myRstBtn
JCN M001
L 0
T MD 2
T MD 6
M001: NOP 0
Less typing = less boring.
 
So you blow the bomb if you don't want to destroy civilization?


That's hidden code for which regions he's gonna bomb.
Load 0 (ie complete destruction) to Region 2 and Region 6.
If I'm not mistaken, that means Europe, Middle East, RSA, Japan, Greenland and China.
 

Similar Topics

Hi, Experts: We have 20 + years old GE PLC series 90-30 stop running (the run led not on and battery led not on) and HMI showing that "PLC has...
Replies
7
Views
198
Hi everyone, recently i worked with a cmore panel and have the question that how can clear alarm list whit remote form,right now only can with...
Replies
0
Views
107
Hi guys, I have a data table as REAL type VALUES_TABLE[32,100]. I want to clear this table. For that i created a REAL type CLEAR_DATA tag with...
Replies
8
Views
562
Hi, I have bought a used 1756-L73S and SP, it is running firmware 30.013 and safety locked, im running Logix Designer 30.01.00. The controller...
Replies
10
Views
1,663
First time using a panelview. I have all of my alarms mapped to bits of dints. How do I get the alarm panel to popup when an alarm happens...
Replies
6
Views
2,122
Back
Top Bottom