Looping

Share your scripts written for the Script Device in this forum.
Post Reply
Thales
Member
Posts: 46
Joined: Sat Sep 29, 2007 3:52 pm

Looping

Post by Thales »

Hello, I am new in this group and I need a infomation How to start a function that send a serial communication and continuosly read this information until the status change to ON or OFF.

I do not what to press one button to start this.

thank you
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

There are several different ways to do this, and a lot of it depends on the data you are receiving. In general, you will want to monitor and possibly process the Received Data property of your Generic Serial Device. For more information on this, read through the 'Receiving Data' section of the 'Generic Serial Device' plugin online help.

If the received data is somewhat complex, you may need to process the data in a script and update discrete properties that are managed by the script to indicate the current state of the received data. You can then use a simple Task to execute actions based on the conditions of the properties set by the task (like 'If PowerState Equals On Then do... something').

If the received data is simple, you may be able to get away without using a script, and simply use a Task that compares the value of the Received Data property with the data you are looking for.
Scott
Post Reply