a real use for the S:24 bit.

olsq

Member
Join Date
Apr 2011
Location
Houston area, TX
Posts
62
I had a real world problem at work today.
To be clear:
I am not a programmer or plc guy.
I am a BUBBA!
I know enough to be dangerous.
Since, I am the only one to go online for months...I caused this problem.

Long story short...
PC running wonderware talks to a AB 5/04
S:24 was set to 3 instead of 0.
After 8 hrs and a lot of phone calls, it is fixed now.
In terms of my question the details do not matter.

Question...
In real world terms why/how would the S:24 bit be used.

Answers in short, single syllable terms would be appreciated.

Thanx in advance.
 
I don't mean to alarm you - but your problem MIGHT be back someday ...

secret handshake: there are many different things in the PLC program that can change the value stored in S:24 ... (the HMI might also change the value - but that's a lot less likely) ...

my advice is that you post your program here and let us take a look at it ... (you'll have to ZIP the file first - forum rule) ...

and make sure with your boss that the program isn't considered proprietary or trade secret information ...

and one step further ... technically speaking S:24 is a "word" (16 bits) not a "bit" ... but that's not important here ...
 
Thanx for replying Ron,
I can't Post the file.
It is a 15yr old system that has gone thru various upgrades.
After a search of all the saved files, the bit was changed in march.
Why it became a problem today, I Don't know.
The short term/permanent solution was to add a MOV instruction to the top of the main program. I write a zero every scan to S:24.
I have fat fingers, so the problem is 99% self inflicted.

I posted the question to try to learn the possible uses for the S:24 bit.
 
As Ron pointed out, S24 is a Word, not a Bit. Specifically it is referred to Index Register. It is generally used for an Offset or Indexing into files using Indirect Adressing. Something like;

N7:[S:24] or N7:10/[S:24]

Do a search in the RSLogix Help for Indirect Addressing.

What PLC does this apply to?

Stu...
 
S24 is used for indexed addressing, and a number of instructions can use it as well as the user can use it. Depending on your program arbitrarily zeroing it out might not be a good thing. It could be harmless, but we really can't say without seeing the program.

In indexed addressing the value in S:24 is added to an indexed address in the program. Indexed addresses are preceded by a # sign. An indexed address is like saying "The party is at the third house past the one with the tall red brick fence." So in an indexed address, if S:24 = 3 then #N7:21 is the third address past N7:21, or N7:24. Its a very useful feature when working with groups of data.


So you might want to search your program for any address that has a # in front of it and let us know what that is or if you can post a screen shot of the rung.

🍺
 
S:24 is the Index Register. It is used by a number of instructions. You can usually tell its use if an address has a '#' in front of it.

For most instructions it doesn't matter what S:24 is set to. The instruction will start its value at whatever it needs and leave it when it is done.

But it can also be used in a manner that S:24 is expected to have a certain value before the instruction is executed. Many warnings exist to 'properly set S:24' if it is to be used. But it is possible that this isn't done.

You may be lucky that effectively setting S:24 to zero at all times worked, it could have rendered parts of the program unworkable. It would have been better to establish what S:24 is used for before such a change.
 
After a search of all the saved files, the bit was changed in march.

in most programs, that S:24 ("bit") word gets changed thousands of times an hour ... smart money says that when the program was saved in March, the word had a value of 3 ... chances are if the program "save" button had been clicked 2 milliseconds later, the value would have been something completely different ... again, we can't tell without seeing the program file ...

if you're not allowed to post it we'll understand - but all we can do is help you GUESS at the problem ...

The short term/permanent solution was to add a MOV instruction to the top of the main program. I write a zero every scan to S:24.

well, maybe yes - but maybe no ... there's a better than 50/50 chance that you've just set yourself up for some other problem down the road ...

final thoughts: if it works OK and you're happy - then we're happy ... just keep in mind that if other parts of the system start acting up, you might just have to go back and find out how S:24 is being used ...

party on ...
 
Last edited:
All,
Thanks again for all your input and responses.

After talking to my OP's Mgr, Posting the file online would fall under the umbrella of our new corporate "social networking" guidelines. At this time that isn't a sound option for me.

The line is running with no adverse affects as of yet.
If it were down, "they" would "authorize", me to do whatever it takes to get it back up and running. Give it time, before you know it all will have a look at the inner working of the bread and butter line.

About the MOV instruction...
My OP's Mgr has a background in plcs, being in system integration 10 or 15 years ago. I don't know how it works in the real world, but in my little slice of heaven, when the boss of my boss makes a recommendation, I do it. Even if I think its a train wreck. I call it the "Continuous Employment Program".

The Project Engineer in charge of this bit of logic, recommended removing the "#" from the affected instructions. All the data is direct and not offset by the S:24 word.

I will keep this in mind if issues arise.

I really appreciate everyones time taking a look.

Regards,
Billy

@Ron B.
I lobby a couple times a week, to take your class.
 
The Project Engineer in charge of this bit of logic, recommended removing the "#" from the affected instructions.

well, just for future reference, SOME types of instructions (COP - Copy for example) won't let you just remove the "#" ... these types of instructions use S:24 whether you want them to or not ...
 
Ron Beaufort said:
well, just for future reference, SOME types of instructions (COP - Copy for example) won't let you just remove the "#" ... these types of instructions use S:24 whether you want them to or not ...

olsq said:
The Project Engineer in charge of this bit of logic, recommended removing the "#" from the affected instructions. All the data is direct and not offset by the S:24 word.

If the "#" symbols are there by mistake, then definitely remove them. I had an error caused by my own "drag and drop" editing like yours where I had the index delimiter in some instructions where they should have been direct. My logic faulted right away and I had to hunt it down and fix it, but I can see how it could crop up much later if the logic that intentionally changed the register was conditional, and rarely was processed true during the same scan as the erroneous indexed reference.
 
Greetings olsq ...

just in case it appears that my distinguished colleague OkiePC and I are giving you conflicting advice – we are not ...

the main problem is that neither of us can see your program – and so we are (each in his own way) trying to help you out by basically GUESSING at what might be your problem ...

you started this thread with this frank admission:
To be clear:
I am not a programmer or plc guy.
I am a BUBBA!
I know enough to be dangerous.



with that in mind, we're both warning you to be extremely careful with what you're doing to your program ...

IMPORTANT! ... make SURE that you have a good backup file safely stored away ...

as just a GUESS, one thing that MIGHT be going on is that the program was originally written for an older SLC model processor (for example: an SLC-5/01 or SLC-5/02) ... these older systems did NOT support indirect addressing (using the square brackets characters) ...

so back in the "old days" the alternative to INDIRECT addressing was INDEXED addressing (using the pound sign character) and S:24 as an "offset" to an address ...

it's possible (but again, just a guess) that the program was later updated for use with your SLC-5/04 processor – and the pound sign characters (and the INDIRECT addressing that they represent) – are hold-overs from the original platform ...

IF (big IF) that's what's happened, then those "#" characters are still necessary to the operation of the program ...

all of this is pure supposition – and we can't really nail down anything specific without seeing a copy of your program ...

please be careful ... you've already admitted that you're not very experienced with this type of stuff ... personally I'd be afraid to make changes to things that I didn't fully understand ...

in short (no, it's too late for that) – it's completely possible (probable?) that the "#" characters you've found are merely typographical (or Drag-and-Drop) errors ... but then again, if those characters were put there for a reason, then we've got to wonder whether taking them out is going to end up being a "good" thing – or a "bad" thing ...

this machinery isn't dangerous is it? ... either to personnel around it – or to the machinery itself? ...

be safe ...
 
I'm curious, why did you think that having a value other then zero in S:24 was a problem?

Did the machine/process/PLC stop working? Or did you just fix something that wasn't broke?
 
First, a link on how to quote would be appreciated.
2nd Because of the policies at work, I cannot post the actual program.
3rd I have something similar based on a ML 1000. My own creation not directly related to job. wink wink.
If anyone would like to take a look at "my" pgm, I will be happy to post it.
@ alaric.. thanks for the dumbed down explanation. I orignaly posted to try to figure out how and when this word could be used in a real world application.
@Ron post 8... line is running and still happy.
@okie post11... the logic was a sample from AB modified to fit our app. The original pgmr said as much and pointed out where the the changes needed to be made.
@Ron B post12... I am here to learn. Any and all responses are viewed and skull sweated over. I have a very clear understanding of what it like to trouble shoot a system over the phone. I can't begin to imagine what is like to take a random question on a piece of eqmpt you have never seen and make your best guess. Many thanks to you and all for taking the time to "think it over"
@mickey post 12...plc receives recipe values from a PC running wonder ware. all of a sudden ultra 3000 drives wouldn't go to recipe position.
after a lot of ph calls and instruction help. We figured out the recipe values were being sent some where else and the drives went to there last known value. The drives could be "jogged" to the close enough location with minor downtime. So we worked on this on the fly. It has been working to the production depts satisfaction for the last 2 days.

Many thanks again to all for taking the time to think this one over.
OLSQ
 

Similar Topics

The topic of reading or writing floating-point values via Modbus seems to come up regularly, and it is to my mind not that difficult. That said...
Replies
0
Views
1,391
Hello, First, please excuse my question I am new to Modbus. I have a CX-5140 control unit from Beckhoff and an instrumentation device that...
Replies
3
Views
3,127
I am having problems expressing an ANALOG OUTPUT 16bit INT word (0-10V Proportional Valve Voltage) as a REAL decimal number. From my...
Replies
6
Views
9,180
DearAll, I have a problem in coverting 48bit integer to Real.Kindly see the details as below System:- compactlogix L43 With MVI69-MCM...
Replies
1
Views
1,702
Dear sir, There is a level data coming from another station, and it is REAL. This data should transfer another station over my redundant (414-4H)...
Replies
11
Views
2,875
Back
Top Bottom