This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Creating event scripts
#1
Hi,

It would be nice when we create an event based script,  that there is the checkbox "Execute on group read:", so that we can enable this straightaway.  This would save time and prevent mistakes.


Thanks,

Roger
Reply
#2
Hi,

Don't know I you seen it but
in the Last FW, hL1.5 / sL1.2, you have the 'run script' function inside the editor that allow you to execute the script with a specific value.

I'm not sure it's exactly what you want, but it should do the trick.
Reply
#3
Enabling exec on read by default will lead to more errors as most users won't bother with checking event.type in their scripts.
Reply
#4
Photo 
Hi,

I know that.  That's why I am saying add the "option" to enable it, see screenshot.  By default it would be unchecked.

   

This will simply save a lot of time on those event based script that are only used for providing feedback on the bus.

thanks,


Roger
Reply
#5
Hi Roger

Why do you need it? 

I have seen a huge amount of HL/SL projects and the only time i have seen it used is for 3th party app where you need the objects respond like a object server.

I agree with admin as it would bring a lot more support for a almost never used feature.

BR,

Erwin
Reply
#6
Hi Erwin,

Yes I need to make the objects respond like an object server. Then simply make this option available to be enabled in the lm settings screen. so by default it won't be available, but for the installers that do need it, then it can be enabled. Then everyone is happy.


Thanks,

Roger
Reply
#7
Hi Roger,

Make one event based script and put it to the TAG for example "Read Request" and turn on the execute read checkbox just once for this single script (;

Add this script in it:

Code:
-- only reply to group read requests
if event.type == 'groupread' then
 obj = grp.find(event.dst)
    -- object found and has datatype set
 if obj and obj.decoded then
   grp.response(event.dst, obj.value, obj.datatype)
 end
end

With mass edit you can add the TAG ''Read Request" to all your object and you are done. 

BR,

Erwin van der Zwart
Reply


Forum Jump: