6/7/2023 1:22 AM | |
Joined: 11/12/2008 Last visit: 7/8/2024 Posts: 180 Rating:
|
Hello, To Run the script by external digital input you can do it as the following: 1: in wincc flexible you have to draw the Circle or any object . 2: assigne a New Tag, For Example (Name(Tag_1), Type (Bolean), Address(I0.0) 3: On properties of tag in Event (ChangeValue) on Function Select Your Script. 4: Go to WinCC Flexible active the Circle Animation property and select the Tag_1 as a Animation control, select For Bit (0) Background Color (White) and Bit(1) Background Color (Green) 5: So ON your Script write the following Code on the FIRST LINE, means Before Your Script Statement ..... Dim objectExample Set objectExample = HmiRuntime.Screens("Screen_1").ScreenItems("Circle_1") If objectExample.BackColor=vbGreen Then here write your script , forexample to insert data into database SO ON THE LAST LINE AFTER YOUR SCRIPR WRITE Else Exit Sub End If Note: If you run the script in (Changevalue) in integer Tage , the script will run at any change of tag even from upper to lower also when stopruntime and start agian but like that illustrated above the script will run at Posirive Signal of tag. I hope this sample solution will help Best Regards AttachmentPics.zip (386 Downloads) |
HASSAN.S POJAILA |
|
This contribution was helpful to
3 thankful Users |
Follow us on