[?]: Win CC v6--- how to create button toggle

Utilites for Simatic Automation
Post Reply
stanic
Posts: 9
Joined: Fri May 18, 2012 12:06 am

[?]: Win CC v6--- how to create button toggle

Post by stanic » Sat Jun 23, 2012 2:50 pm

How to create "button" in winn CC (6.0 ... )? When I press button with left click mouse it should be in logic 1, when I release button it should be in logic 0 .

Button clicked - SET
Button released - RESET

Can anybody explain to me; step by step ?

serg_58
Posts: 99
Joined: Thu Jun 03, 2010 7:43 pm
Location: Russia

Re: [?]: Win CC v6--- how to create button toggle

Post by serg_58 » Sat Jun 23, 2012 9:12 pm

Hi.
Very easy.
At keystroke to event it is necessary to write scipt,
for instance in VB:

Code: Select all

Sub OnClick(ByVal Item)     
If HMIRuntime.Tags("ToggleTag").Read=0 Then
   HMIRuntime.Tags("ToggleTag").Write 1
Else
   HMIRuntime.Tags("ToggleTag").Write 0
End If 
End Sub

stanic
Posts: 9
Joined: Fri May 18, 2012 12:06 am

Re: [?]: Win CC v6--- how to create button toggle

Post by stanic » Sat Jun 23, 2012 9:27 pm

thank you, but there should be a way without writing a code ?

In WinCC graphic designer (6.0) on right side there is option "windows objects". In side of windows object there is a option "BUTTON",
Is it possible to make this button like I wrote before.

Without writting a code please.

Its probably something the easyest but Iam having problems with it.

serg_58
Posts: 99
Joined: Thu Jun 03, 2010 7:43 pm
Location: Russia

Re: [?]: Win CC v6--- how to create button toggle

Post by serg_58 » Sun Jun 24, 2012 12:07 pm

Ok.
In grafic desiner open Wiew\library\global library\operation\toggle buttons, select required object, open properties and insert tag name in tag assign.

stanic
Posts: 9
Joined: Fri May 18, 2012 12:06 am

Re: [?]: Win CC v6--- how to create button toggle

Post by stanic » Sun Jun 24, 2012 10:34 pm

OK i did it before but there is a problem : This buttons work like:

when i press it is ON,
when I press it again it is OFF,

I need : when i press it it is ON,
when i realese it it is OFF

Do you understand what i need : I have to use button from Windows objects menu:

Button clicked (when i hold clicked )- it is ON
Button released (unclicked ) - OFF

Do you understand my needs ? It should be something simple, but how to do it ?

Post Reply