|
|
|
Crestron Control Systems Forum - View Post
|
|
|
|
|
|
|
The following page was printed from RemoteCentral.com:
Simpl+ and ChangeRx function
| |
|
Topic: | Simpl+ and ChangeRx function This thread has 1 response. Displaying all posts. |
|
Post 1 made on Monday February 6, 2012 at 07:39 |
mundackal Lurking Member |
Joined: Posts: | November 2009 5 |
|
|
Hi, Can the ChangeRx fucntion can work on two strings coming in,
a typical example is like this, I am sending a command say for example A, the response i am getting are say B and C, i compare B and C on changeRx function with If statement, after sometime i am sending a command D whose response are E and F, will i be able to process this on the same changerx function.?
The flow is like this
Change OpRx_$ { if(mid(OpRx_$,1,4) = B)) { do something1; } else if (mid(OpRx_$,1,5) = C)) { do something2; }
if(mid(OpRx_$,1,4) = E)) { do something3; } else if (mid(OpRx_$,1,5) = F)) { do something4; }
} }
}
Push Poll { makestring(OpRx_$,"%s",A); delay(Time); makestring(OpRx_$,"%s",D); }
will this kind of a function work, or is there a way i can make it work, this function is not woking for me as after the delay when the second make string is send again the first comparison only will happen on the chagerx$
Any solutions
Mahesh
|
|
Post 2 made on Monday March 19, 2012 at 15:36 |
total control Lurking Member |
|
|
that is logically correct, or you can processes all the do somethings together.
if (mid(OpRx_$,1,4) = B)) { do something1; } else if (mid(OpRx_$,1,5) = C)) { do something2; }
else if(mid(OpRx_$,1,4) = E)) { do something3; } else if (mid(OpRx_$,1,5) = F)) { do something4; }
when ever OpRx_$ changes , a new thread will start processing, and it will do the appropriate something. you might want to prevent reentry if that is a problem for your do something functions. i cant say without knowing what they do.
|
|
|
Before you can reply to a message... |
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now. |
Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.
|
|
|
|