You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old March 16th, 2018, 07:34 AM   #1
peeka
Member
Canada

peeka is offline
 
Join Date: Jan 2010
Location: canada
Posts: 13
Rslogix 5000 Structered Text

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.
  Reply With Quote
Old March 16th, 2018, 07:39 AM   #2
nhatsen
Member
Venezuela

nhatsen is offline
 
Join Date: Oct 2010
Location: Argentina
Posts: 671
Is the structured text routine being executed?
__________________
"If you can't solve a problem, then there is an easier problem you can solve: find it." (George Pólya)
  Reply With Quote
Old March 16th, 2018, 07:49 AM   #3
peeka
Member
Canada

peeka is offline
 
Join Date: Jan 2010
Location: canada
Posts: 13
nevermind wasn't even calling the subroutine thanx
  Reply With Quote
Old March 16th, 2018, 09:56 PM   #4
Nomographer
Lifetime Supporting Member
United States

Nomographer is offline
 
Join Date: Jun 2013
Location: Texas
Posts: 15
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.
  Reply With Quote
Old March 17th, 2018, 05:23 AM   #5
janner_10
Supporting Member
United Kingdom

janner_10 is offline
 
Join Date: Dec 2014
Location: Tewkesbury
Posts: 646
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 by janner_10; March 17th, 2018 at 05:29 AM.
  Reply With Quote
Old March 17th, 2018, 05:41 AM   #6
Aardwizz
Member
United Kingdom

Aardwizz is offline
 
Aardwizz's Avatar
 
Join Date: Dec 2017
Location: Swindon
Posts: 184
Quote:
Originally Posted by janner_10 View Post
You can just do:

Local:1:O.Data.4 := Local:1:O.Data.0;
B := A the equivalent of XIC(A) OTE(B),

while IF A THEN B:=1 is the equivalent of XIC(A) OTL(B).

OTE is not the same as OTL.
  Reply With Quote
Old March 17th, 2018, 07:02 AM   #7
janner_10
Supporting Member
United Kingdom

janner_10 is offline
 
Join Date: Dec 2014
Location: Tewkesbury
Posts: 646
Good point.
  Reply With Quote
Old March 17th, 2018, 07:31 AM   #8
Ron Beaufort
Lifetime Supporting Member
United States

Ron Beaufort is offline
 
Ron Beaufort's Avatar
 
Join Date: Jul 2002
Location: Charleston, SC
Posts: 5,438
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/showthr...56&postcount=5

party on ...
__________________

2-B ?
Best regards, ----+----] [----+------------( )----
Ron | |
PLC Training Boot Camp | 2-B |
+----]/[----+

I once was lost, but now am found, was blind, but now I see.


Last edited by Ron Beaufort; March 17th, 2018 at 08:01 AM.
  Reply With Quote
Old March 17th, 2018, 08:39 AM   #9
Aardwizz
Member
United Kingdom

Aardwizz is offline
 
Aardwizz's Avatar
 
Join Date: Dec 2017
Location: Swindon
Posts: 184
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.
  Reply With Quote
Old March 17th, 2018, 09:28 AM   #10
Ron Beaufort
Lifetime Supporting Member
United States

Ron Beaufort is offline
 
Ron Beaufort's Avatar
 
Join Date: Jul 2002
Location: Charleston, SC
Posts: 5,438
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 ...
__________________

2-B ?
Best regards, ----+----] [----+------------( )----
Ron | |
PLC Training Boot Camp | 2-B |
+----]/[----+

I once was lost, but now am found, was blind, but now I see.


Last edited by Ron Beaufort; March 17th, 2018 at 09:34 AM.
  Reply With Quote
Old March 17th, 2018, 11:04 AM   #11
Aardwizz
Member
United Kingdom

Aardwizz is offline
 
Aardwizz's Avatar
 
Join Date: Dec 2017
Location: Swindon
Posts: 184
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.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Convert RSLogix Micro project to RSlogix 5000 Michael C LIVE PLC Questions And Answers 7 July 6th, 2017 10:45 PM
RSLogix 5000 Activation troubles dlweber LIVE PLC Questions And Answers 16 November 20th, 2014 08:34 PM
RSLogix 5000 Read Only Access? chrisj91 LIVE PLC Questions And Answers 5 September 19th, 2014 11:23 AM
Rslogix 5000 - structured text- TONR instruction italo2008 LIVE PLC Questions And Answers 3 March 18th, 2010 12:25 PM
Structured Text & RSLogix - good reference books & docs? ChrisOfMaryland LIVE PLC Questions And Answers 4 November 4th, 2009 12:10 PM


All times are GMT -5. The time now is 03:46 PM.


.