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 January 31st, 2007, 07:47 PM   #1
skyfox
Member
United States

skyfox is offline
 
skyfox's Avatar
 
Join Date: Nov 2006
Location: CA
Posts: 140
How to force an AB PLC 5/SLC Input bit with logic?

Hello all,

Is it possible to write a "1" into an input image table location? No input card installed. Wondering how to turn on an input bit using logic (without forcing). I only want to write to a single location.

For example; Write a 1 in to I:013/1

Is this even possibble?

Is it possible to Programmatically force a bit using logic?

Thx.
  Reply With Quote
Old January 31st, 2007, 07:53 PM   #2
OkiePC
Lifetime Supporting Member
United States

OkiePC is offline
 
OkiePC's Avatar
 
Join Date: Mar 2005
Location: ENE of Nowhere Oklahoma
Posts: 7,817
You can use the force function in either a SLC or PLC to force the input address on. In a PLC5 I think you can just punch a one in the data table and it will stay there as long as there isn't a card installed.

In a SLC, the processor will fault if the configured card is absent. I don't know of a way around this.

In a SLC you can use an input address in an OTE or OTL instruction. I don't know about the PLC5.
  Reply With Quote
Old January 31st, 2007, 08:03 PM   #3
doug2
Member
United States

doug2 is offline
 
Join Date: Dec 2006
Location: California
Posts: 180
I am not positive on this....

In the slc under processor status / I/O you can put a 0 in the s:11 word/bit associated with the missing input module location and run the program with out a fault.

maybe? someone will have to verify that 1 though.
  Reply With Quote
Old January 31st, 2007, 08:11 PM   #4
skyfox
Member
United States

skyfox is offline
 
skyfox's Avatar
 
Join Date: Nov 2006
Location: CA
Posts: 140
Helloand Thanks for the respone.

What I am after is trying to accomplish thi via logic as in using the ladder program without actually physically/manually forcing the bit. Basically for simulation purpose.

Is it possible?

Thx
  Reply With Quote
Old January 31st, 2007, 08:15 PM   #5
Ken Roach
Lifetime Supporting Member + Moderator
United States

Ken Roach is offline
 
Ken Roach's Avatar
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 10,520
No, there is no programmatic way to Force an Input data word or bit.

In PLC-5 controllers, I/O memory for slots that do not have installed modules can be written to by programming software, but not by application logic.

Use a memory bit like B3:1/13 or N7:1/13 for your simulation. Write a branch around the actual Input bit instruction to evaluate them in parallel.
__________________
"Luck is probability taken personally"
  Reply With Quote
Old January 31st, 2007, 08:21 PM   #6
skyfox
Member
United States

skyfox is offline
 
skyfox's Avatar
 
Join Date: Nov 2006
Location: CA
Posts: 140
Thanks.
  Reply With Quote
Old January 31st, 2007, 08:22 PM   #7
OkiePC
Lifetime Supporting Member
United States

OkiePC is offline
 
OkiePC's Avatar
 
Join Date: Mar 2005
Location: ENE of Nowhere Oklahoma
Posts: 7,817
I use a method similar to what Ken describes, but I did test this and found it interesting (SLC 5/04):

  Reply With Quote
Old January 31st, 2007, 08:29 PM   #8
TConnolly
Lifetime Supporting Member
United States

TConnolly is offline
 
TConnolly's Avatar
 
Join Date: Apr 2005
Location: Salt Lake City
Posts: 5,806
Has everybody forgotten how PLCs work?

Our distinguished colleague Ron Beaufort teaches this exercise in his PLC bootcamp to illustrate the fact that a PLC COPIES the inputs into an input image table. Then it solves the logic. Then it COPIES the output image table to the outputs. The input image table is NOT the actual inputs, its a read/write memory location that is updated with a copy of the actual inputs in between the scans. So if you write a 1 to a bit in the input image table on the first rung of the program, logic will solve as though the input was on, even if is is not actually on.


Ron has a post on here somewhere covering this, I'll try and find it.

Edit:I have to type faster, I see OKIE beat me to it.
  Reply With Quote
Old January 31st, 2007, 08:45 PM   #9
Ken Roach
Lifetime Supporting Member + Moderator
United States

Ken Roach is offline
 
Ken Roach's Avatar
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 10,520
Skyfox asked about Forcing, so I answered about Forcing.

"Forcing" is a temporary override in memory of an Input data element or override of the logic program's result of an Output data element. It's a very specific thing and can only be done by the controller's operating system under instructions from the editing software. Forces can be globally turned on and off, and globally removed with the push of a button.

I had not considered putting an "overwrite" routine in the first program subroutine. It wouldn't work when interrupts or immediate input instructions were present, but it's a very clever technique.

If you didn't put the "override" routine in the first program subroutine, you'd have the input bits at different states at different times in the program, which would be troublesome.

I'll take back my assertion "but not by application logic" above, as it is demonstrably incorrect. Back to bootcamp for me.

Very enlightening posts, guys !
__________________
"Luck is probability taken personally"

Last edited by Ken Roach; January 31st, 2007 at 08:50 PM.
  Reply With Quote
Old January 31st, 2007, 09:06 PM   #10
TConnolly
Lifetime Supporting Member
United States

TConnolly is offline
 
TConnolly's Avatar
 
Join Date: Apr 2005
Location: Salt Lake City
Posts: 5,806
Here is Ron's post, its on the MrPLC board - its an overview of bootcamp. Scroll down, its a long post, he has some screen shots of the exercise.
http://forums.mrplc.com/index.php?sh...32&#entry36932

Ken's right, we are not writing to the force table here, but if you don't have any IIMs then this method will work - as long as you are clear on exactly what it happening and make sure your program and subroutines are constructed accordingly.

The IO module must be configured, and unless you set the status bit the program will fault if the module is actually missing as already mentioned above.

Last edited by TConnolly; January 31st, 2007 at 09:15 PM.
  Reply With Quote
Old January 31st, 2007, 09:17 PM   #11
skyfox
Member
United States

skyfox is offline
 
skyfox's Avatar
 
Join Date: Nov 2006
Location: CA
Posts: 140
Well, may be I missused the word "Forcing" in the context in which I needed to accomplish my task.

Basically, I want to be able to write a one or a zero in to an input image table location using logic.

Following OkiePC's example, I used an OTE instruction to turn on an input bit in the I/O image table. This was the first line in my main program. However, it keeps toggling on/of without holding a steady state of "ON" or a 1. I even tried adding an OTE latch instruction, but did not help the cause. Even tried the instruction at multiple locations (beg. and at end of Main routine) w/o any sucess. By the way, I am trying this with a PLC 5/40.

sigh...
  Reply With Quote
Old January 31st, 2007, 09:27 PM   #12
TConnolly
Lifetime Supporting Member
United States

TConnolly is offline
 
TConnolly's Avatar
 
Join Date: Apr 2005
Location: Salt Lake City
Posts: 5,806
Is it actually toggling on and off in your program scan, or are you just seeing it toggle in Logix500? You computer reads the IO image table asynchronous to the progam scan, so the bit could still be on for the full portion of the progam solving part of the scan. Try this


I:1/0
--------------------------------( )---

I:1/0
---] [-----------------------+-CTU-----+-(EN)-
| C5:0 +-(DN)-
| 0 |
| 0 |
+---------+



The ladder should up count only once, and then not count afterwards.
  Reply With Quote
Old January 31st, 2007, 10:13 PM   #13
skyfox
Member
United States

skyfox is offline
 
skyfox's Avatar
 
Join Date: Nov 2006
Location: CA
Posts: 140
Perfect. It wasn't toggling. I was wrong! At least now I can setup a test routine just to toggle the bit's I need without modifying the existing logic.

This has been very educational and I appreciate the help I've gotten from all of you. Back to the boot camp post..........


Cheers!
  Reply With Quote
Old February 1st, 2007, 04:56 AM   #14
MichaelG
Member
Australia

MichaelG is offline
 
Join Date: Nov 2006
Location: Brisbane
Posts: 500
Not for clx5000

Just a Warning - The input image in a controllogix 5000 is updated independant of the PLC scan (ie between one rung and the next)

PS I have sucessfully used simulation code in SLC500 where the simulation code changed the I table based on the O table using timers and basic logic - Great for testing the program and HMI in the office before turning up on site.
  Reply With Quote
Old February 3rd, 2007, 04:38 PM   #15
Ron Beaufort
Lifetime Supporting Member
United States

Ron Beaufort is offline
 
Ron Beaufort's Avatar
 
Join Date: Jul 2002
Location: Charleston, SC
Posts: 4,356
Greetings to all ...



standard disclaimer: first of all let me say that I always feel slightly “uncomfortable” whenever I use Phil’s excellent forum to discuss the PLC training that I do - because I’m sure that there are some who consider any comments that I make to be “advertising” ... on the other hand, occasionally my PLC courses do get mentioned, and in many of those situations I feel that I should make SOME type of personal response ... I can assure you that my feelings will NOT be hurt if Phil decides to edit (or even completely remove) anything that follows ...



also ... I’ve been out of touch for a few days of vacation in Florida which is why I haven’t already responded to the questions posed in this thread ...



also ... the material that I’m posting here pertains to the Allen-Bradley PLC-5, SLC, and MicroLogix platforms ... specifically, it does NOT apply to the ControlLogix or CompactLogix platforms (for the reasons that MichaelG correctly pointed out in post #14) ...



from skyfox:



Quote:
Well, may be I missused the word "Forcing" in the context in which I needed to accomplish my task.




yes, your original terminology could be causing some of the confusion ... just to nail this idea down, my PLC classes generally last for five days ... I usually don’t let the students “force” anything until at least Wednesday or sometimes Thursday ... the reason is that until they understand EXACTLY how the PLC processor’s “scan sequence” works, the “force” feature can be quite confusing ...



personally I use the term “hijacking” for the operation that you’re looking for in this thread ... specifically, we can use a simple OTE rung to “hijack” the 1-or-0 status of any INPUT bit during the execution of the ladder logic rungs ... more specifically, we can MAKE the processor interpret the status of that “hijacked” input bit as either a 1 condition or as a 0 condition throughout the REST of the ladder logic rungs - REGARDLESS of the actual on/off condition of the field device itself ...



Quote:
Basically, I want to be able to write a one or a zero in to an input image table location using logic.


that’s not a problem ... in fact, I use exactly the same approach VERY often when I need to demonstrate to a customer how his program will react to a certain input - even when my lab equipment isn’t set up to duplicate the exact addresses of his input devices ...



here’s a quick example ... suppose that a customer has a rung which uses the field address I:014/12 for a start button ... I don’t normally have my lab equipment set up to duplicate that specific address - so I just drop in a temporary rung to “hijack” the status of that input bit ... to keep things neat and clean I usually put this new rung in a TEMPORARY subroutine file ... the customer doesn’t even need to see this part of the setup ... but now when I turn my lab’s simulator module switch (I:000/0) on and off, I can easily change the status of the original bit ... just make sure that your JSR rungs are set up so that you jump into the “hijack” routine BEFORE you jump into the original file ... or if you want to keep things simple, skip the “subroutine” idea and just put the “hijack” rung in the same program file as the original rung ... but again, be sure that the “hijack” rung is scanned BEFORE the original rung - or else the whole idea won’t work ...















and yes, I know how “weird” it looks to “control” an INPUT device with an OUTPUT instruction ... but it works - and it’s VERY educational ...








and now the puppet dances ... all we have to do is pull the (simulator) strings ...



and since “forces” were mentioned too, click here for an interesting post which pits the brutal power of the mighty FORCE against the wimpy little OTE instruction ... guess who wins? ...



Quote:
Following OkiePC's example, I used an OTE instruction to turn on an input bit in the I/O image table. This was the first line in my main program. However, it keeps toggling on/of without holding a steady state of "ON" or a 1. ... By the way, I am trying this with a PLC 5/40.




probably what confused you here was that the status of the bit on the RSLogix5 display screen appeared to keep toggling on and off ... the “PLC-5/40” is REALLY important ...



secret handshake #1: with the PLC-5 platform (and RSLogix5) the screen “communicates” with the processor at RANDOM times during the ladder execution sequence ... so SOMETIMES the status of the “hijacked” bit might look ON - but SOMETIMES the status might look OFF ... but if you really understand how the rungs are scanned (their order of execution) then you can accurately forecast how the ladder logic will interpret the status of the “hijacked” bit - regardless of what you see on the display screen ...



secret handshake #2: with the SLC and MicroLogix platforms (and RSLogix500) the screen usually “communicates” with the processor at the VERY END of the ladder execution sequence ... so the status of the “hijacked” bit will NOT usually appear to “toggle” on the screen the way you witnessed ... and once again, if you really understand how the rungs are scanned (their order of execution) then you can accurately forecast how the ladder logic will interpret the status of the “hijacked” bit - regardless of what you see on the display screen ...



actually this “you-can’t-always-trust-the-screen” lesson is always a critical part of the classes that I teach ... some students have a LOT of trouble “unlearning” some of the misconceptions that they’ve picked up “along the way” ... usually their biggest problem is pure old-fashioned stubbornness ... “but I’ve THOUGHT it for so long that it MUST be right” ... sorry ... that approach doesn’t always work ...



Quote:
Perfect. It wasn't toggling. I was wrong! At least now I can setup a test routine just to toggle the bit's I need without modifying the existing logic.

This has been very educational and I appreciate the help I've gotten from all of you. Back to the boot camp post..........




and it looks like it’s all been taken care of ...



finally ... I do NOT recommend using this “hijacking” approach as a regular programming technique ... this will confuse the daylights out of a LOT of people - even some who have been successfully writing PLC programs for years ... it’s just too doggone WEIRD! ... but ... it really DOES have a lot of uses for demonstration and training purposes ... and (as long as SAFETY permits) it can sometimes come in handy for a TEMPORARY “quick-fix” to replace one field device with another ... again, I do NOT recommend it - I’m just trying to make you aware of what will happen IF (big IF) the “hijack” situation ever does arise ...



and REALLY finally ... thanks to Alaric for the kind compliments - and for the link in post #10 ... if anyone has any additional questions along these lines after reading that particular “epic” then please post again ... I’ll be glad to try to nail things down ... just between you and me, these particular ideas are ABSOLUTELY CRUCIAL to fully understanding PLCs and they are well worth the time it takes to master them ...
__________________

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.

  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
S7 - using Arrays with Multiplex Addressing in ProTool RMA LIVE PLC Questions And Answers 4 August 12th, 2005 07:39 AM
AB PLC Micro Logic 1000 Jason H LIVE PLC Questions And Answers 13 May 8th, 2005 11:09 PM
AB PLC 5/20e jrs2563 LIVE PLC Questions And Answers 5 September 17th, 2004 03:57 PM
AB Analog Input Help GTX LIVE PLC Questions And Answers 2 December 14th, 2003 02:37 PM
AB PLC analog input card 1771 IFE diribarren LIVE PLC Questions And Answers 13 May 9th, 2003 10:40 PM


All times are GMT -5. The time now is 07:20 AM.


.