View Full Version : Wincc Problem
al_d
June 24th, 2006, 12:18 AM
Hi,
I am new to wincc and was wondering how to force on PLC contacts. At the moment I have set up and assigned a external tag with contact I124.0 (as an input). I can get the light on the button to turn on when the contact on the PLC closes, but when I made a new tag and assigned it as an output with the same contact I124.0 I cannot switch the contact on in wincc. I have not found any useful documentation on this topic, does anyone have such documentation?
Thanks.
girevik
June 24th, 2006, 12:46 AM
In fact you are changing the I124.0 in the PLC, but at the start of the new cycle of the PLC this contact updated according to the PLC input status...
so it might be a good idea to use in your program merker area contact like m124.0.
but it's not totally clear what do you want to achieve, do you want to always overwrite the I124.0 bit from the WinCC or just sometimes?
In the first way, you just use m124.0 instead of i124.0 and write there from wincc, since you will not need any information from real input.
In the second way, you will need additional bit which will state if the bit should be taken from wincc or from real input, let's say m124.1=0 when you need to get info from winccc and m124.1=1 when you want to get info from plc input... then you will have to use easy logic, like if m124.1=1 then m124.0=i124.0...
just my opinion...
al_d
June 24th, 2006, 02:01 AM
I am trying to set up a tag and assign it to a button and use this button to turn on I124.0. I am very new to wincc and dont no much.
Thanks.
girevik
June 24th, 2006, 02:29 AM
I124.0 is an PLC input, so you cant turn it directly (and i'm not sure why you really need to turn the PLC input, in case of such deal, you would not need PLC input at all, so could you explain some more details what and why do you need, that way we couyld help more), you can use above mentioned way with M bits...
al_d
June 24th, 2006, 02:49 AM
I have currently set up wincc to communicate with 2 s7-300.The outputs of the PLCs are not connected to anything at this stage and at the moment I would like perform a basic task in being able to switch on I124.0 in wincc using a button and see this contact close in step-7. I am not sure how to set up the tags or properties of the button to be able to do this.
Thanks.
CroCop
June 24th, 2006, 02:58 AM
I have currently set up wincc to communicate with 2 s7-300.The outputs of the PLCs are not connected to anything at this stage and at the moment I would like perform a basic task in being able to switch on I124.0 in wincc using a button and see this contact close in step-7. I am not sure how to set up the tags or properties of the button to be able to do this.
Thanks.
As Grivek said, you won't be able to alter an input directly. You'll need to alter a variable that isn't written over on every scan....
al_d
June 24th, 2006, 03:07 AM
If i have a network with I124.0 in series with Q124.0 in step 7 and i want to use a button in wincc to turn the output Q124.0 what would i have to do?
Thanks.
CroCop
June 24th, 2006, 03:10 AM
If i have a network with I124.0 in series with Q124.0 in step 7 and i want to use a button in wincc to turn the output Q124.0 what would i have to do?
Thanks.
Do like Grivek said.
Put the m124.0 in parallel with the I124.0, and reference m124.0 in your wincc.
PeterW
June 24th, 2006, 03:16 AM
Not sure why you want to turn on an Input, it is possible though.
As someone mentioned, the Inputs are updated at the start of every scan so if you do it as a once switch, it will turn off again on the next scan. If you set a tag to continuously set the input, then it will still get turned off at the start of a scan, wincc will then turn it back on again, but there will be scans and part scans where it will be controlled by the real world again.
As someone mentioned it is better to turn on/off a flag and use this.
Call a function as the very first instruction in OB1, call this function Force_Input. You could then set up all the forces you require in there, either individual bits or whole bytes words.
examples.
A M 124.0
O I 124.0
= I 124.0
or
L MB124
L IB124
OW
T IB124
or
L MW124
L IW124
OW
T IW124
If I was doing this I would want some sort of warning to let me know an input was forced, to help remember to turn it off again.
If your requirement is only to turn on the output, there's no need to turn on the input at all, either select a flag and set the output via that, i.e.
A M 124.0
= Q 12.0
or ensure the output is not addressed anywhere in the PLC code and just set the output.
Forcing outputs can be dangerous though, hope you know what your doing.
al_d
June 24th, 2006, 03:19 AM
Ok thanks girevik and CroCop.
girevik
June 24th, 2006, 03:31 AM
I'm not sure if you should Put the m124.0 in parallel with the I124.0.. if you do so, there are two choices:
a) if the input is not connected somewhere, it's always zero, and is updated to zero each scan, so at the start of the scan it does not change anything in parallel connection since it's always zero.
b) if the input is connected somewhere and sometimes may go to 1, then you will not have the real control over the input from WinCC, i mean if real input goes to 1, then it will stay 1 and will not depend on value from WinCC, so you can't controll it totally, you just will be able to force it to 1 but will not able to always force it to zero...
so if you need to ignore real input and use WinCC value, you just should use something like
A M 124.0
= I 124.0
at the start of the program in OB1.. like PeterW has mentioned...
just my opinion...
PeterW
June 24th, 2006, 03:44 AM
I've seen this before to enable forcing temporarily failed inputs (in word format though).
A M 124.0
O I 124.0
= I 124.0
enables the actual real input to control its own state when the flag is off.
A M 124.0
= I 124.0
is not good, as the input can never control itself.
The first option works whether the input is physically connected or not.
The code I came across was some time ago in an S5.
L DL4
L IB4
OW
L DR4
AW
T IB4
The DL's were all off normally and the DR's were normally on, therefore turning on a L bit forced the input ON, turning off a R bit forced it OFF. OFF had priority.
al_d
June 24th, 2006, 04:03 AM
Thanks for help.
al_d
June 24th, 2006, 04:04 AM
Thanks for the help.
girevik
June 24th, 2006, 04:08 AM
in case of haveing the choice: to force or to use real input i would go with such logic:
http://www.plctalk.net/qanda/uploads/3597621561.JPG
that way I can either use real input (when m124.1=0) or control the input from WinCC when the m124.1=1, now i can either make input 0 or 1...
in my opinion
A M 124.0
O I 124.0
= I 124.0
will work correctly only without connected devices to the real input, as i have mentioned if the device turn on the input, you will not be able to control it through WinCC, it will be ON always untill the device turn it off..
but everything depend on the task, and it may be ok for some tasks... i'm just not sure if the author of the topic should have the whole control or just to turn it on... and if he should still have the control on the real input or not...
now he has many choices
just my opinion...
PeterW
June 24th, 2006, 04:15 AM
I see where your coming from now, its a bit similar to the old S5 thing I mentioned.
I was going on the original question of forcing on, not totally controlling.
girevik
June 24th, 2006, 04:26 AM
that's right...
.