ADICON Support Forum Applied Digital, Inc.
Page 1 of 1 1
Topic Options
#21605 - 02/01/10 10:03 AM Master and slave
Ariel Offline
newbie


Registered: 09/12/07
Posts: 23
Loc: Argentina
Hi!

I have two Leopard controllers. Setting one as the master controller and the other as a slave, will I need one or two PSC05 interfaces for X10 control? What is the necessity of defining them as master and slave?

Thanks!

Top
#21606 - 02/01/10 10:28 AM Re: Master and slave [Re: Ariel]
ADI Tech Support Moderator Offline
old hand


Registered: 12/22/02
Posts: 723
Loc: Branson West, MO
If you are only controlling X10 devices and don't want to connect the Leopards together via RS485, then yes you will need a TW523 or PSC05 for each Leopard. There would then be no need to configure them for Master-Slave. The only time you need to configure them as Master-Slave is in the event you are connecting them via the RS485 communications bus.

Kevin Barrett
ADI Tech Support

Top
#21607 - 02/01/10 04:24 PM Re: Master and slave [Re: ADI Tech Support]
Ariel Offline
newbie


Registered: 09/12/07
Posts: 23
Loc: Argentina
Therefore, connecting the two Leopards via RS485 there is no need of two TW523 or PSC05, is ok?

Thanks!

Top
#21608 - 02/01/10 07:37 PM Re: Master and slave [Re: Ariel]
Guy Lavoie Administrator Offline
Beyond All Hope
*****

Registered: 12/21/02
Posts: 6548
Loc: Montreal, QC, Canada
The PSC05/TW523 is needed if you want to send/receive X10 signals. By nature, a Leopard is a standalone device, with optional exapansion modules or slave controllers. Having two Leopards connected together (with one master and the other slave) allows the following functionality: The master can see button presses on the slave, IR codes received and recognized by the slave, and variables that changed on the slave (it has to poll the slave for the particular variables you want to monitor). Additonnaly, the master can set a variable in the slave, and make it transmit a IR code.

As you can see from the list, no X10 commands can be triggered or received across the master/slave link. Thus if you want both modules to be able to send X10, they each need their own PSC05/TW523 powerline interface. Alternately, you could have only the master with a powerline interface, and have it monitor the slave's button presses if you want to use both Leopards to send X10 commands by pressing buttons. You would probably find the added delay a bit annoying if you go this way. In such a setup, you would want to keep all X10 macros, time of day events, etc on the master, and only use the slave to show buttons that the master would receive events from.
_________________________
"If you don't know what you're doing, do it neatly..."

Top
#21614 - 02/05/10 12:17 PM Re: Master and slave [Re: Guy Lavoie]
Ariel Offline
newbie


Registered: 09/12/07
Posts: 23
Loc: Argentina
Another question about master and slaves...

It is neccesary to address the slave Leopard, in a similar way as with the expansion modules? I mean, using the function Auto Addressing from CMAX and pressing the addres button on the module board.

Thanks again!

Top
#21615 - 02/05/10 12:30 PM Re: Master and slave [Re: Ariel]
Guy Lavoie Administrator Offline
Beyond All Hope
*****

Registered: 12/21/02
Posts: 6548
Loc: Montreal, QC, Canada
No. A slave controller's address is set by connecting to it with C-Max and editing its controller parameter 14.



Parameter 14: Master or Slave Address

* 0 = Master
* 1 or higher = Slave address

(Note: All slaves must have an address unique from the other slaves or modules)
_________________________
"If you don't know what you're doing, do it neatly..."

Top
#21620 - 02/06/10 07:16 AM Re: Master and slave [Re: Guy Lavoie]
Ariel Offline
newbie


Registered: 09/12/07
Posts: 23
Loc: Argentina
Ok,

I am going to use the second Leopard as a slave. I will create its touch screen layout to monitor the buttons from the master, in order to use only one PSC05 interface. What can I program for the slave controller? Is it possible the answer to this question be NOTHING? Will I not have code for the slave? Only buttons and icons?

Thanks!

Top
#21621 - 02/06/10 07:29 AM Re: Master and slave [Re: Ariel]
Guy Lavoie Administrator Offline
Beyond All Hope
*****

Registered: 12/21/02
Posts: 6548
Loc: Montreal, QC, Canada
Yes, you could have a slave Leopard with no program at all.
_________________________
"If you don't know what you're doing, do it neatly..."

Top
#21622 - 02/06/10 01:03 PM Re: Master and slave [Re: Guy Lavoie]
Ariel Offline
newbie


Registered: 09/12/07
Posts: 23
Loc: Argentina
Ive been writing a couple of code lines for the master Leopard. The goal is to turn on or off a light from both master and slave controllers, according to the current X10 module state. Having into account the precedence of logic tests in CMAX software, are these lines correct?

IF TOUCH OBJECT #26, BUTTON LEOPARD IS PRESSED
OR TOUCH OBJECT #1, BUTTON MODULE #3 -SLAVE LEOPARD IS PRESSED
AND X-10 HOUSE A/UNIT 1, IS OFF
THEN X-10 HOUSE A/UNIT 1, TURN ON
THEN SKIP TO LINE xxx
IF TOUCH OBJECT #26, BUTTON LEOPARD IS PRESSED
OR TOUCH OBJECT #1, BUTTON MODULE #3 -SLAVE LEOPARD IS PRESSED
AND X-10 HOUSE A/UNIT 1, IS ON
THEN X-10 HOUSE A/UNIT 1, TURN OFF
THEN SKIP TO LINE xxx

Thanks!

Top
#21623 - 02/06/10 01:50 PM Re: Master and slave [Re: Ariel]
Guy Lavoie Administrator Offline
Beyond All Hope
*****

Registered: 12/21/02
Posts: 6548
Loc: Montreal, QC, Canada
Yes, that looks perfectly ok.

If you have lots of buttons on both Leopards that do the same thing, and many multiple condition tests (like you have here with "and house a/unit 1 is...) you might want to set a variable to represent the pressed button as a single value for both units at the top of the code, and then test that variable instead lower down. Any program pass will only have one button press valid through it so there is no risk of losing any button presses by setting a single variable and then testing it. For example your code about could be written like this (I'm naming variable #1 to "V1-Button Pressed" in the system map)

IF TOUCH OBJECT #26, BUTTON LEOPARD IS PRESSED
OR TOUCH OBJECT #1, BUTTON MODULE #3 -SLAVE LEOPARD IS PRESSED
THEN V1-Button Pressed = 1

IF V1-Button Pressed becomes = 1
AND X-10 HOUSE A/UNIT 1, IS OFF
THEN X-10 HOUSE A/UNIT 1, TURN ON
THEN SKIP TO LINE xxx

IF V1-Button Pressed becomes = 1
AND X-10 HOUSE A/UNIT 1, IS ON
THEN X-10 HOUSE A/UNIT 1, TURN OFF
THEN SKIP TO LINE xxx

(near the end)
IF V1-Button Pressed = V1-Button Pressed (always true)
THEN IF V1-Button Pressed = 0


If you used the same screens on both Leopards (so all button numbers are identical on both) then there are ways to make this even simpler.
_________________________
"If you don't know what you're doing, do it neatly..."

Top
#21624 - 02/07/10 12:22 PM Re: Master and slave [Re: Guy Lavoie]
Ariel Offline
newbie


Registered: 09/12/07
Posts: 23
Loc: Argentina
Guy,

I have not enough free variables in the master Leopard to do something like you suggest. Anyway, what is the advantage of working with variables?

Furthermore, both Leopards have identical touch screen layouts and buttons numbers. How do you think the programming could be even simpler?

Thanks again.

Top
#21625 - 02/07/10 07:15 PM Re: Master and slave [Re: Ariel]
Guy Lavoie Administrator Offline
Beyond All Hope
*****

Registered: 12/21/02
Posts: 6548
Loc: Montreal, QC, Canada
About variables, you only need one variable to do this, since there is only one button press that can be tested during any one program pass. So several buttons would all use the same variable, but setting it to a different value:

IF TOUCH OBJECT #26, BUTTON LEOPARD IS PRESSED
OR TOUCH OBJECT #1, BUTTON MODULE #3 -SLAVE LEOPARD IS PRESSED
THEN V1-Button Pressed = 1

IF TOUCH OBJECT #27, BUTTON LEOPARD IS PRESSED
OR TOUCH OBJECT #4, BUTTON MODULE #3 -SLAVE LEOPARD IS PRESSED
THEN V1-Button Pressed = 2

IF TOUCH OBJECT #28, BUTTON LEOPARD IS PRESSED
OR TOUCH OBJECT #6, BUTTON MODULE #3 -SLAVE LEOPARD IS PRESSED
THEN V1-Button Pressed = 3

etc.

At the end of the pass, the last routine in my example resets the variable to 0, meaning "no button pressed" for the next pass if no new buttons have been pressed.

If both Leopards use the same screens and buttons (ie: all object numbers are identical) then you can capture the actual button queue data, which has the module number (master or slave address) in the upper byte, and button number in the lower byte. The lower byte (0 to 255) then becomes your pressed button number, no matter which Leopard's screen was actually used. This is explained in the Leopard manual under "IF Touch Button Pressed". I copied the code for that here:

0001 - IF Touch Object #1, Button Leopard is pressed // if any button is pressed
0002 - THEN Load Data to: Variable #1 // capture in variable #1
0003 - ELSE Load Data to: Variable #1 // in either case
0004 - IF Variable #1 becomes NOT = 65535 // If there is a button code in input queue
0005 - THEN Variable #2 = Variable #1 // copy code to variable #2
0006 - THEN Variable #2 / 256 // get module number in var #2 (if you need the module number)
0007 - THEN Variable #1 % 256 // get button number in var #1
_________________________
"If you don't know what you're doing, do it neatly..."

Top
Page 1 of 1 1


Moderator:  Dan Smith, Monte G, ADI Tech Support, Guy Lavoie, Bobkat 
Hop to:
Who's Online
0 registered and 62 anonymous users online.
Recent Posts
Ocelot not working
by JPO
11/08/17 06:02 AM
Shout Box

Newest Members
brigiel, vevevie, zhutree, 416, saiqul
3003 Registered Users
Forum Stats
3003 Members
19 Forums
4004 Topics
23442 Posts

Max Online: 132 @ 11/13/16 10:07 AM
November
Su M Tu W Th F Sa
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30