Welcome, Guest
Username: Password: Remember me
Welcome to TeslaSCADA forum!

Tell us and our members about your experience of using our products.

TOPIC: Sleep function

Sleep function 6 months 1 week ago #2620

  • Anna
  • Anna's Avatar
  • Offline
  • New Member
  • Posts: 19
  • Karma: 0
Good morning ,
I have a problem while I wroting an text script. The script have to do a cycle of counter, but i used the function sleep() and its not work.
In the manual is wrote only this two expression about this function:

"sleep(Input1) - used to make pause. Input1 contains time of the pause in milliseconds.
Example:
sleep(1000); //script sleeps 1000 ms."

Now I'm using a version 2.59.
How can I resolve?
Thanks.
The administrator has disabled public write access.

Sleep function 6 months 1 week ago #2621

  • fatkhrus
  • fatkhrus's Avatar
  • Offline
  • Administrator
  • Posts: 826
  • Thank you received: 123
  • Karma: -107
Hello,

It's better not to use sleep function in your script. If you want to create a counter it's better to create a script with enable "Every cycle" property. This script will be executed every "Update interval" that you can setup in Project properties (by default 1000 ms). Inside this script you can add counter function. For example: Tags.Counter++;

Best regards,
Ruslan
The administrator has disabled public write access.

Sleep function 6 months 1 week ago #2622

  • Anna
  • Anna's Avatar
  • Offline
  • New Member
  • Posts: 19
  • Karma: 0
Dear Ruslan,
I just tried but not work.
Now attach the photo of my script below. In the script I execute a cycle of counting and I would like to insert the deta of countimg by using the meter and after i wold like to see on display the counting.
My problem is: the program work correctly, so i see the counting printed on the copiler screen, but if link the tags to the display object i didn't see the counting. I see only the first value and immediately the finish value.
Best regards.
The administrator has disabled public write access.

Sleep function 6 months 1 week ago #2623

  • fatkhrus
  • fatkhrus's Avatar
  • Offline
  • Administrator
  • Posts: 826
  • Thank you received: 123
  • Karma: -107
It looks like you use counting function inside some cycle. See attached file project.

Best regards,
Ruslan

File Attachment:

File Name: count.tsp2.zip
File Size:2 KB
The administrator has disabled public write access.
Go to top