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 July 7th, 2018, 07:14 PM   #1
FreddyC
Member
United States

FreddyC is offline
 
Join Date: May 2016
Location: Sweetwater, Tennessee
Posts: 6
AIO Bool reset

I have put together an AOI to pass several REAL data types eventually controlling a motion controller connected Ethernet IP. I added some BOOL outputs I called EN, DN, PC, IP with the intent of it acting like a MAM. The problem is; when the rung is no longer true, the EN an DN bits stay latched because the AIO instruction stops scanning as soon as the rung is false. Rockwell's AOI manual claims you would use the "EnableInFalse" routine to reset these outputs, but when enabling this function, the AOI always passes data regardless of any conditions.
That is probably OK if you only use the AOI once, if you use the AOI more than once in the code; then all of them scan pass data all the time.
Hope this makes sense.
  Reply With Quote
Old July 8th, 2018, 03:16 AM   #2
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,360
Quote:
Originally Posted by FreddyC View Post
I have put together an AOI to pass several REAL data types eventually controlling a motion controller connected Ethernet IP. I added some BOOL outputs I called EN, DN, PC, IP with the intent of it acting like a MAM. The problem is; when the rung is no longer true, the EN an DN bits stay latched because the AIO instruction stops scanning as soon as the rung is false. Rockwell's AOI manual claims you would use the "EnableInFalse" routine to reset these outputs, but when enabling this function, the AOI always passes data regardless of any conditions.
That is probably OK if you only use the AOI once, if you use the AOI more than once in the code; then all of them scan pass data all the time.
Hope this makes sense.
No, not really...

From your description, it sounds like you have put the same code in the"EnableInFalse" routine as you have in the normal routine. If all you want to do is reset some outputs, then that is all you would do in the EnableInFalse routine.

Not sure what you mean by "pass data all the time". If you mean that your AOI tags are being updated by external logic when the AOI is false, then that will happen anyway. But your AOI instruction will not be processing that data when the EnableInFalse routine is being executed.

As an example, I have written an AOI for a Retentive-Timer-On (RTO) instruction that clocks at 1 second, instead of the system's RTO that is milliseconds timebase.

The AOIs live in a Periodic Task, set to execute once per second. The AOI "Logic" routine deals with when the instruction is enabled, i.e. counting up the accumulator, testing for .DN etc., and the "EnableInFalse" routine deals with what to do when the AOI timer is not enabled. Of course, the code for resetting the timer must exist in both the "Logic" and "EnableInFalse" routines, because the timer must reset whether it is enabled or not..

This AOI RTO will run for over 68 years before it overflows !!
Attached Images
File Type: jpg MainRoutine_1Sec.jpg (46.9 KB, 10 views)
File Type: jpg Logic Routine.jpg (57.7 KB, 9 views)
File Type: jpg EnableInFalse Routine.jpg (22.2 KB, 10 views)
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem


  Reply With Quote
Old July 8th, 2018, 06:19 AM   #3
FreddyC
Member
United States

FreddyC is offline
 
Join Date: May 2016
Location: Sweetwater, Tennessee
Posts: 6
The only thing inside the EnableInFalse routine is an unlatch of the EN an DN bits. and it worked fine. When I reused the AOI in another place in the code; when both AOI's are false, both of them take turns passing the data in the AOI as long as they are false.
  Reply With Quote
Old July 8th, 2018, 07:49 AM   #4
FreddyC
Member
United States

FreddyC is offline
 
Join Date: May 2016
Location: Sweetwater, Tennessee
Posts: 6
Quote:
Originally Posted by FreddyC View Post
The only thing inside the EnableInFalse routine is an unlatch of the EN an DN bits. and it worked fine. When I reused the AOI in another place in the code; when both AOI's are false, both of them take turns passing the data in the AOI as long as they are false.
See attached .png files showing what I have.
Attached Images
File Type: png AOI Code.PNG (11.1 KB, 12 views)
File Type: png False Routine.PNG (6.1 KB, 11 views)
File Type: png Code using AOI.PNG (23.2 KB, 12 views)
  Reply With Quote
Old July 8th, 2018, 08:37 AM   #5
jkerekes
Member
United States

jkerekes is offline
 
jkerekes's Avatar
 
Join Date: Aug 2007
Location: NJ
Posts: 2,142
You’re not using the same instance are you?
__________________
John
  Reply With Quote
Old July 8th, 2018, 09:38 AM   #6
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,360
No he isn't... 3rd pic shows two separate AOI tags, Move_Forward and Move_Reverse.


I had the same thought though...
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem



Last edited by daba; July 8th, 2018 at 09:46 AM.
  Reply With Quote
Old July 8th, 2018, 09:45 AM   #7
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,360
Freddy_C, please post your AOI parameters and local tags declarations.


I cannot see anything wrong with the code, and it looks to me like Move_2 was the last to be executed, as the _OUTs have the specified _IN values, in that instance call.....
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem


  Reply With Quote
Old July 8th, 2018, 09:49 AM   #8
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,360
Quote:
Originally Posted by FreddyC View Post
...When I reused the AOI in another place in the code; when both AOI's are false, both of them take turns passing the data in the AOI as long as they are false.

Well that is how it should be, the PLC does not know what you will be doing in your "EnableInFalse" routine, so it passes the AOI tags in anyway... But you are not doing the MOV instructions when the AOI rung is false, so it doesn't matter...


EDIT : Think of your AOI as if it were an in-built TON instruction, the instruction execution has to be passed the TIMER tag, so that it can operate on the correct timer. The instruction acts on the AOI or Timer tag depending on whether the rung driving it is True or False. In the case of the timer, that is pre-defined, in the case of the AOI, you program what the actions are....


ANOTHER EDIT : The other thing to consider is that your _IN values are going into two different tag elements.



Instance 1 : Move_Forward.Position_IN, Move_Forward.Accel_IN, & Move_Forward.Decel_IN
Instance 2 : Move_Reverse.Position_IN, Move_Reverse.Accel_IN, & Move_Reverse.Decel_IN


Unless, of course, you have specified the _IN parameters as In/Out parameters, which would be incorrect, they should be Input parameters, and the _OUT should be Output parameters...
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem



Last edited by daba; July 8th, 2018 at 10:19 AM.
  Reply With Quote
Old July 8th, 2018, 05:45 PM   #9
FreddyC
Member
United States

FreddyC is offline
 
Join Date: May 2016
Location: Sweetwater, Tennessee
Posts: 6
i am going to try and upload the entire program as an export and zip it.
Attached Files
File Type: zip Motion.L5K.zip (2.5 KB, 3 views)
  Reply With Quote
Old July 11th, 2018, 06:13 AM   #10
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,360
Now that I have actually ran that code, I can see the problem you are having.


The fact is that the AOI instruction will always "map" the input data into the "Input" parameters, and always "map" the output parameters to the designated "Output" locations, you can't stop it doing it.


So even if both instances are False, the "EnableInFalse" routines are executed to turn off your bits, but the data inside the AOI tags Move_Forward and Move_Reverse will always be copied to the supplied output tags.


Even if the Move_Forward was true, and the Move_Reverse was false, the data in the Motion Controller tags will be mostly that of the Move_Reverse.


I am assuming this AOI is the start of something bigger, with more functionality, so wouldn't like to suggest you don't need an AOI to do what you are doing. However, I would approach this slightly differently, to minimise the effort needed to cure the problem. The cure is simple enough - just don't have those Output parameters, and pass as an in/out parameter the Motion Controller tag, and do the MOVs directly to them within the AOI Logic routine.


You will be creating a "Last One Wins" scenario, so you need to ensure only one Move_x BOOL is true at any one time.


See the pics for how I would do it.
Attached Images
File Type: jpg AOI Code.jpg (118.6 KB, 3 views)
File Type: jpg AOI Logic.jpg (53.4 KB, 2 views)
File Type: jpg AOI_EnableInFalse.jpg (32.4 KB, 2 views)
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem


  Reply With Quote
Old July 11th, 2018, 08:24 AM   #11
FreddyC
Member
United States

FreddyC is offline
 
Join Date: May 2016
Location: Sweetwater, Tennessee
Posts: 6
I have tried similar code to prevent both rungs from being true, but nothing works. the only thing that truly works; is not have the bits and forget the EnableFalse routine. I did write the code using the EN bit to seal in the rung. The last rung in the AOI code is unlatch the EN, but even that is not perfect. Thanks for the help.
  Reply With Quote
Old July 11th, 2018, 08:43 AM   #12
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,360
How many times do you need to instantiate the AOI ?


If it is up to 32, you could use the bits of a DINT to trigger each AOI, and clear the DINT immediately, sort of like a ONS arrangement... It will guarantee only one AOI can execute in the same scan.
Attached Images
File Type: jpg AOI Code1.jpg (67.1 KB, 27 views)
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem


  Reply With Quote
Old July 11th, 2018, 06:11 PM   #13
FreddyC
Member
United States

FreddyC is offline
 
Join Date: May 2016
Location: Sweetwater, Tennessee
Posts: 6
not a bad idea, it could go over 32 with 8 axis of motion.
What about nesting? could something be done there?
  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
Conversion: SCL Simatic to Portal SCL Combo LIVE PLC Questions And Answers 6 November 12th, 2015 01:03 PM
S7-300 Can't find inputs or outputs? keith@electechs.co.u LIVE PLC Questions And Answers 19 September 19th, 2012 04:29 AM
Logix guy with a new Step 7 project PatrickG LIVE PLC Questions And Answers 15 August 11th, 2010 05:44 PM
Confused "again" S7 indirect Thim LIVE PLC Questions And Answers 17 July 22nd, 2008 04:47 PM
Loop Problem sparkysliderz LIVE PLC Questions And Answers 20 June 18th, 2005 06:04 AM


All times are GMT -5. The time now is 05:43 AM.


.