AIO Bool reset

FreddyC

Member
Join Date
May 2016
Location
Sweetwater, Tennessee
Posts
6
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.
 
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 !!

MainRoutine_1Sec.jpg Logic Routine.jpg EnableInFalse Routine.jpg
 
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.
 
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.

AOI Code.PNG False Routine.PNG Code using AOI.PNG
 
No he isn't... 3rd pic shows two separate AOI tags, Move_Forward and Move_Reverse.


I had the same thought though...
 
Last edited:
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.....
 
...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...
 
Last edited:
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.

AOI Code.jpg AOI Logic.jpg AOI_EnableInFalse.jpg
 
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.
 
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.

AOI Code1.jpg
 

Similar Topics

Hello. I want to know if anybody have some experience with combining an AOI and a global object in factory talk view 7. I have my AOI, with this...
Replies
4
Views
2,973
I received the following message via PM, and am posting here publicly to help others. ============================================ I had a...
Replies
10
Views
972
Greetings. I have a 1769-L30ER that runs a new piece of equipment my company bought. I would like to read from and write to some tags on this PLC...
Replies
7
Views
1,393
I need to move a large Bool array to Word array in Schneider Control Expert. Is there an easier way to do this? For example: Bool[128] array to...
Replies
4
Views
1,291
I work at a cheese factory and we recently ran into a problem where in an older controller they where able to use a REAL Data type in OTU and XIC...
Replies
13
Views
2,400
Back
Top Bottom