Can you help me creating a script in flexible?

Join Date
Mar 2008
Location
løgstør
Posts
22
Hi.

I would like to do a scheduled operation in a flexible that are running on a PC.
I have a page in the project that shows a graph. The graph shows logged temperatures from the last 24 hours.
I would like to automaticly print this graph once a day at 11.59 PM.

My idea was to create a scheduled opereation that changes to the screen with that graph, and then run a script that pints the screen.
But i a not very good at making scripts, so i was hoping that you could help me making the script.
My problem is that when the screen is loaded, then there has go go some time until the screen is printet. But how can i put a timer into my script??

I have an idea of what the scrpt should do:
1) start timer
2) when timer is gone, then print screen
3) change screen to previous

I have tried to create a "timer" by creating a internal tag called "count_1" and then write:

Do
Count_1 = Count_1+1
Loop Until Count_1=30000
PrintScreen
Count_1=0
ActivatePreviousScreen

But the "count_1" gets =30000 way to fast. I need the time to be about 30 seconds, cause the trend on the page is taking some time to be loaded. And first after that i need to print screen..

Can you please help me creating a script that works, or maby tell me a better way of solving my problem - change screen at 11.59 PM, and print screen???

Hope to hear from you

Best regards
Morten
 
idell:

Thanks for your reply. But as i wrote, the problem is that if i just activate screen and then print screen, then the trend is not loaded (the lines are not showed) cause there are a lot of data to load when i log 2 temperatures every minute for 24 hours..
So i need to activcate the screen - wait some time - and then print screen..
But i dont know how to create the delay from loading the screen until printing screen??
 
There are a few tricks to create a timer in WinCC Flexible. But I think it will just create other odd problems.

Simply let the PLC handle the timer.
When the page is loaded, let WinCC Flex set a bit in the PLC.
In the PLC, let a timer run when the bit goes active,and reset the bit when the timer is finished.
In WinCC Flexible, use the below value event on the bit to activate the print screen.

Btw. put a label on the screen with the text "loading data. do not change the screen".
Let the label have visibility animation by the same bit tag that starts the print screen.

Gee, no scripts involved at all !
 
Thanks Jesper.
I will try it out. I haven't thought about this solution, but is sounds like a good idea.. I actually i was trying to create a script that handles it and using a timer in the PLC. But i don't understand why i would not work..
The script looks like this:

Do
SetBit SmartTags("Start timer T84")
Loop Until SmartTags("Timer 84 gået")=1
PrintScreen
ResetBit SmartTags("Start timer T84")
ActivatePreviousScreen

The bit "start timer T84" starts a timer in the PLC on 1 minute. When the timer has countet, it sets the bit "Timer 84 gået". And i can see that the timer is startet when i run the script, and the bit "Timer 84 gået" goes high when the timer has finished. But the "print screen" is never executet.. I belived that it would work, but what is wrong? I have almost never createt scrpits, so i am just trying and hoping it is working. But what am i doing wrong?

I think that i will use the sollution that you suggest Jesper, but I would like to know why my script dont work??
 
Next question:

I dont realy understand what you meen by
"use the below value event on the bit to activate the print screen"
Should i go to the event on the bit in the taglist, or how?
And how do i make it change back to previous screen after the print screen?

Sorry for the noobie questions, but i would like to learn what i am doing wrong, and i appreciate your help very much..
 
But in event of the bit, i don't have one called below value. I have "change value", "High limit" and "low limit".. Im not sure that i understand what you mean?
And again - how can i make it change to previous screen after the print screen is executet??

And still i would like to know what i am doing wrong in the script that i made. I cant make it print screen. It starts the timer, and a bit goes high when the timer is finished. But it dont print screen???
 

Similar Topics

Hello everyone, In a factory where we installed Citect 7.20 the computer began to show the first signs of end of life. They never considered...
Replies
0
Views
73
Hello - you folks were kind in helping me the other day so I'm back for more... My program is finished however the end customer hasn't provided...
Replies
4
Views
1,932
Hi guys I need some help with programming a pvp ME Screen , the plc is a micrologix 1400 on Ethernet , The thought behind this prompt screen is...
Replies
3
Views
1,512
I have 8 pumps to control in PLC S7 1200...so in Wincc 7.4 i want o make faceplate ...just one window control can use for all 8 pump ! I read...
Replies
0
Views
2,029
The process consists of a parking garage with an entrance and an exit door. The garage has 25 parking spaces. We assume the garage is empty at the...
Replies
8
Views
3,153
Back
Top Bottom