Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: question on macros Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
npavkov
Groupie
Groupie


Joined: February 29 2004
Location: United States
Online Status: Offline
Posts: 91
Posted: November 04 2005 at 23:13 | IP Logged Quote npavkov

I have a trigger that when I hold the dim button of a switch it produces multiple dim commands to be sent depending on how long the button is held down.
is there a way to code a macro to only execute once (triggered) even though the trigger tries to execute the macro multiple times because of the multiple dim commands being seen?
Back to Top View npavkov's Profile Search for other posts by npavkov
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: November 04 2005 at 23:34 | IP Logged Quote TonyNo

I would use a Global Variable to hold a flag, normally set to "1", and used in the trigger's enable field. In your macro, set that variable to "0", handle the dim, do a Wait for some time (several seconds?), then set the variable back to "1".

This should give you what you want.
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
npavkov
Groupie
Groupie


Joined: February 29 2004
Location: United States
Online Status: Offline
Posts: 91
Posted: November 05 2005 at 19:05 | IP Logged Quote npavkov

Tony is there a way to make a macro wait "until" a global variable changes? I want to put a macro in wait staus, then allow it to continue when a global variable changes.
Back to Top View npavkov's Profile Search for other posts by npavkov
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: November 06 2005 at 09:28 | IP Logged Quote TonyNo

Maybe split the macro in two around the proposed wait location, then create a trigger to run the second macro when the GV changes?
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: November 06 2005 at 19:23 | IP Logged Quote dhoward

Tony,

Excellent solution for working around the multiple dim problem

Concerning the macro wait until GV changes...again, I would do as Tony suggests since a waiting macro is strictly timed based. You could have the macro wait a shorter time period and everytime it wakes up, check the GV and if not set, wait again, but I would try to split it up and have the second part of the macro triggered when the GV changes.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum