Technical Forum

STEP 7 (TIA Portal)

Suspended program plc

Thread Starter: zbyszek23   Started: 6/5/2012 9:37 PM   Replies: 1

« Previous thread Next thread »
Page 1 of 1 (2 items)
  6/5/2012, 9:37 PM
Joined 7/26/2011
Last visit: 6/19/2013
Posts: 1
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hi

I had situation like on picture (sorry, i've lost screenshot from online connection), what is the reason that bit DB1.DBX0.3 was always in true, even though bit is reset in the same network. Variable DB1.DBX0.3 is used only in this network. Bit DB1.DBX0.3 is set by HMI, by pressing button (event Release).

Can somebody explain me, what could cause this strange behavior of plc program.
Program was corrected by throw away instruction P_TRIG

Hardware configuration is S7-1200 (V2.0) and touch panel KTP600 Basic mono.


Attachment: pic.JPG  (15 Downloads)

Top
  6/5/2012, 10:04 PM
Joined 7/7/2010
Last visit: 6/19/2013
Posts: 1999
Rating:
Rated: Excellent [4 out of 5 / rated 203 time(s)]. (203) 
Users with special expertise supervising conferences
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
zbyszek23 wrote:
Hi

I had situation like on picture (sorry, i've lost screenshot from online connection), what is the reason that bit DB1.DBX0.3 was always in true, even though bit is reset in the same network. Variable DB1.DBX0.3 is used only in this network. Bit DB1.DBX0.3 is set by HMI, by pressing button (event Release).

Can somebody explain me, what could cause this strange behavior of plc program.
Program was corrected by throw away instruction P_TRIG

Hardware configuration is S7-1200 (V2.0) and touch panel KTP600 Basic mono.

I can think of a couple of ways this can happen, or more than a couple actually.

1. Least likely: somewhere you move a value into DB1.DBB0 divisible by 3.
2. More likely: most HMI panels set or reset with a certain amount of persistence from the PLC program's point of view.  The program is responsible to reset the bit similar to what your image shows after detecting it was pressed.
3. Most likely, something else in the logic processed after network 12 (maybe in another FB/FC/OB) is turning the bit back on with a -(S)-

One way that seems more HMI manufacturer independent is to use a P-TRIG and ADD on each press of a button to generate a toggle action.
btn
-||---|p|----[ADD 1->X]----  // increment button state count

-[X==2]---[MOV 0->X]-- // detect toggle back to off from on

-[X==0]---(R)--  // reset plc_button_bit

-[X==1]---(S)--  // set plc_button_bit

plc_btn_bit
-------||------------[take action for button ON]--

plc_btn_bit
-------|/|-----------[take action for button OFF]--

I have yet to run across a PLC / HMI combo that does not handle this extremely well.  There are no order of solve problems, and it is easy to troubleshoot.  Push the button, increment the count.  You can use the count or the button bit in the plc to set the values displayed on the button as well.

An FB to handle hmi button toggles like this works great so you only write the logic once cool

Helpful? Rate it.
Solved? Post it.
Top
Page 1 of 1 (2 items)
Actions