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 May 14th, 2013, 02:18 PM   #1
AutoJig
Member
United States

AutoJig is offline
 
Join Date: May 2013
Location: NYC
Posts: 14
Add On Instructions and Feedback

Hi All,

I wrote code for Add on instruction and its working well with my static control operation. I have another application where I have dynamic operation.

For logic, I have to send value for index and ones my operation execute that I need to get updated status from that operation. If I wait for feedback then controller go in fault condition.

Any one ever tried to use AOI and use feedback functionality ?

Thanks
  Reply With Quote
Old May 14th, 2013, 02:45 PM   #2
mellis
Member
United States

mellis is offline
 
Join Date: Nov 2004
Location: Cincinnati, Ohio
Posts: 802
Describe what you are trying to do in the real world.
Post the code you have.
Describe how it is failing to do what you want.

From your very generalized description, the only comment I have is: Generally, "waiting" for anything in PLC code will fault the processor.
  Reply With Quote
Old May 15th, 2013, 03:49 PM   #3
AutoJig
Member
United States

AutoJig is offline
 
Join Date: May 2013
Location: NYC
Posts: 14
Here is sample and simple code.

Quote:
Repeat

If ET1.state.[i] = 1 then
i = i + 1;
End if

ET1.Cmdstop.[i] = 1;

Until i= Total_Operations

End_repeat;
Where i is index used in AOI and Operation ET1. If i-index change without getting state updates from ET1 operation then It will look next operation

I have to wait until operation don't give me updated state. but this way I can not use waiting , I tried to do some fake calculation in else condition but that dont work either.
  Reply With Quote
Old May 15th, 2013, 10:08 PM   #4
MichaelG
Member
Australia

MichaelG is offline
 
Join Date: Nov 2006
Location: Brisbane
Posts: 685
You may have to change your thinking

Try something like the following - The code must be called every scan and must exit every scan and be re-entrant (ie remember where it was in the loop from one call to the next)

Quote:

IF i <> Total_Operations THEN
If ET1.state.[i] = 1 then
i = i + 1;
End if

ET1.Cmdstop.[i] = 1;
ENDIF
If you want to loop say 100 times before exiting then try the following

Quote:
Counter = 0
Repeat
Counter = Counter + 1;
If ET1.state.[i] = 1 then
i = i + 1;
End if

ET1.Cmdstop.[i] = 1;
Until i >= Total_Operations OR Counter > 100
End repeat

Note: we are not initializing i that is done elsewhere
  Reply With Quote
Old May 17th, 2013, 10:21 AM   #5
AutoJig
Member
United States

AutoJig is offline
 
Join Date: May 2013
Location: NYC
Posts: 14
Smile

Thanks man,

I changed logic and It works
  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
Quick comparison of PID, PIDE, and PI instructions in RSLogix5000 ... Ron Beaufort LIVE PLC Questions And Answers 14 June 7th, 2018 01:24 PM
Logixpro data table Rengas LIVE PLC Questions And Answers 68 April 24th, 2013 12:49 PM
Motion Instructions synchronized movement Darkzadow LIVE PLC Questions And Answers 9 January 9th, 2012 11:49 AM


All times are GMT -5. The time now is 07:35 PM.


.