Reset a word to 0000000000

Darren Mackay

Member
Join Date
Feb 2012
Location
Shepparton
Posts
3
Hi guys,
How do I reset a word to 0000000000. I am using it to contain data from a bit shift instruction and want to be able to zero it.

Thanks in advance.
Dazzz
 
Welcome to the Forum !

The precise instruction depends on the controller instruction set. Some use a Move instruction (to place a zero value into the word), some will use a Clear, and some will use a Multiply.

What model of controller are you using, and what is the data table or tag address format of the "word" register ?
 
How do I reset a word to 0000000000 ?
I worked it out by using a (RES) with the word address eg: #B3:2
In which case your original word was probably a 16-bit binary word, and your reset value would then be "0000 0000 0000 0000", not "00 0000 0000". Resetting all 16 bits is not exactly the same as setting the first 10 bits to 0. In some cases, there may be a need to preserve some of the original bits, so that they do not get reset to 0.

If you only want to reset 10 bits out of the 16-bit B3:2 as you first stated, you would need to use the MVM masked-move instruction.
 
Last edited:
Well we still don't know what platform he is using, and it must be a strange one with a 10-bit word !!

If we don't get the manufacturer, type, and version, I have to admit the generic answer was given by rootboy.

XOR'ing any data with itself will always reset all the data bits.

Back to the OP's question.....I initially thought, because I saw the address B3:2, it was PLC5 or SLC, but when I tried RES with the indexed address #B3:2 in an SLC program, the rung was not accepted.... see pic.

Which all goes to show that I have wasted my time trying to second-guess and answer a badly constructed question.....

And the OP has stated that his problem is solved, but there will be nothing to search on, because we still don't know what PLC he is using.

2012-05-12_011356.jpg
 
Then as daba pointed out, RESET will not work very well for a Binary B3 or Integer N7 word. It only works in the LogixPro Simulator because LogixPro does not duplicate the RSLogix software exactly. This is one of the differences of which you need to be aware.

Suggestion: CLR (Clear) and MOV (Move) work in both LogixPro and RSLogix to reset word values to 0.

RESET TEST FOR LOGIXPRO- Reset ON.jpg
 
Last edited:
At the risk of repeating myself, XOR it?

Supposedly this is the fastest way (machine cycle wise) to zero out a register in a CPU (be it a PLC or whatever).

Back in the day I suppose that it mattered. Nowadays, guys like Peter N. are going to be the only ones who need any of the speed benifits of XORing.

But it still works, and you don't have to concern yourself with the data type that you are trying to clear out (as long as the XOR statement will accept your parameters).

@Ken, be careful with multiplying. In some PLCs, that will zero out the next highest register as well. You might not want that...
 
Based on execution times, XOR is slower than either a MOV or a CLR. CLR is the fastest.

But realistically, or OP wasn't asking for the fastest way. Perhaps the method others will easily understand would be best.

OG
 

Similar Topics

Hi, I have bought a 1769-L36ERMS from ebay 4 months ago. I bought it just for practice safety features of AB which are not available in my...
Replies
7
Views
3,030
The other day I installed Rockwell IntelliCENTER software on my laptop, and as part of that it required that I enter a password. It seems that...
Replies
2
Views
1,421
hello Friend There is one old system with S7 300 CPU which is password protected and I dont know the password. Now I want to remove the password...
Replies
6
Views
5,927
Hi, Sorry if this question is been already asked or this is not correct forum. I am working on VM Ware after very long time and I forgot the...
Replies
2
Views
1,867
Hi, I just bought a used Omron CPM2C (with CIF01). It is password protected and I don't know the password. Is it possible to clear it, so that I...
Replies
3
Views
2,078
Back
Top Bottom