Rslogix 5000 Structered Text

peeka

Member
Join Date
Jan 2010
Location
canada
Posts
13
IF Local:1:O.Data.0 THEN Local:1:O.Data.4:= 1;
END_IF;

for some reason I cant get the output (data.4) to turn on..... do I need to enable structured text for the plc at all ? I've just started to learn structured text as you can see.
 
I fell into a similar trap last week. I cut-and-pasted some simple code, then stared at it for over an hour before realizing the program didn't have a main routine specified.
 
You can just do:

Local:1:O.Data.4 := Local:1:O.Data.0;

Or

IF Output.0.Condition
THEN Local:1:O.Data.4 := 1;
Local:1:O.Data.0 := 1;

END_IF;
 
Last edited:
well, actually

B [:=] A;

is the equivalent of the rung construction XIC(A) OTE(B) ...

specifically, you need the [ ] square brackets to make the "non-retentive" equivalent of the OTE instruction ...

without the [ ] square brackets, the := assignment is "retentive" - like an OTL instruction ...

and we're only talking about Allen-Bradley's version of Structured Text as used in RSLogix/Studio 5000 systems ... it's different in the Structured Text used in the older PLC-5 family using RSLogix 5 ... and I have no idea how other manufacturers handle their "retentive" and "non-retentive" assignments ...

some additional material for those who might be interested can be found in the following thread from yesteryear ...

http://www.plctalk.net/qanda/showthread.php?p=529056&postcount=5

party on ...
 
Last edited:
well actually....

There are two aspects of OTL that are "retentive": that the bit remains true when the rung conditions are false, and that the bit remains true when "first scan" conditions occur.

OTE is wholly "non-retentive", in that the bit goes false if the rung conditions go false, AND it goes false when "first scan" conditions occur.

If A then B:=0 is truly non-retentive, as the bit remains set when both A = false AND on "first scan".

B[:=]A is truly retentive, as the bit becomes false when either A = false OR on "first scan".

B:=A is -- what? "semi-retentive" -- in that it acts like an OTE in how it responds to A (which was my point), but is immune to "first scan" resets (which is Ron's).

I would expect (though never tried it) that If A then B[:=]0 would be ¿quasi-retentive? as the B would be immune to A going false, but affected by first-scan. If so, it would be an "interesting" way of initializing a sequencer, provided one is an expert of when "first scan" applies, and when it doesn't.

I, for one, am not such an expert.
 
I'm trying to be "gentle" here (as I was in my previous post) ...

you are confusing "first scan" with "pre scan" ... they are not the same ...
 
Last edited:
Oh, don't be gentle. I've often said that posting here is the best way to learn, if you've got the stomach for it: posting something right is fine; when you post something wrong, you'll hear about it. And that's when you learn.

I had put "first scan" in quotes because I was thinking of pre-scan, but was having a bout of anomia and couldn't pull out the correct term. Thanks for keeping me honest.
 

Similar Topics

Hello all, I have a question in regards to RSlogix 5000. I am having issues with the program force closing when I try to make online edits. We...
Replies
0
Views
95
Greetings ... someone sent me a request for some student handsouts that I developed ... turns out that I had this hosted on my business website...
Replies
0
Views
110
Thank you for any and all responses/help. I have an RSLogix 5000 v20 and a Cognex In-Sight v5.9 spreadsheet (8502P). I can not figure out how to...
Replies
0
Views
101
Hi All, I've been pulling my hair out trying to fix this for a few days and need some advice. I have V19.01, v20.05, V21, V24, V30, V31, V32...
Replies
5
Views
352
Hello Friends I have a installation with v16, v17, v18, v19, v20. When I tried to open a v20 file, the enable source protection was not enabled...
Replies
1
Views
214
Back
Top Bottom