Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: rs232 timeout Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
phil13
Groupie
Groupie
Avatar

Joined: December 19 2004
Location: France
Online Status: Offline
Posts: 60
Posted: June 07 2005 at 11:59 | IP Logged Quote phil13

Hi,

I would like to send a command on a serial port and then powerhome :

- call a macro "macro1" if something is received on the port (no problem for that, it is defined in ph_comopen)

- call a macro "macro2" if nothing is received in a
amount of time (2 secondes for example).

what is the best way to do that ?

Philippe
Back to Top View phil13's Profile Search for other posts by phil13
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: June 07 2005 at 20:03 | IP Logged Quote TonyNo

How about...

macro1:
ph_killmacrowait("macro1")
handle comm stuff
wait 2
run macro2
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: June 10 2005 at 15:52 | IP Logged Quote dhoward

Philippe,

I think Tony's got it. I would do something very similar like:

Send the COM command
Call Macro 2

Macro1:
ph_killmacrowait("macro2")
handle macro 1 comm stuff

Macro2:
Wait 2
Handle no comm stuff


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