Home AMX User Forum NetLinx Studio
Options

Confused: TP Buffers

jjamesjjames Posts: 2,908
Okay, so I had page tracking on an 8400, and uploaded the same pages to a 12in, and then combined the two devices. Now, page tracking isn't working for either of them. When I combine two devices, can't you get page tracking? If you can, how so?

Comments

  • Options
    AFAIK, the

    DATA_EVENT[Panel]
    {
    STRING:
    {
    DATA.TEXT
    }
    }

    Will work with combined devices for the specific device, too (ONLINE/OFFLINE does).
  • Options
    DHawthorneDHawthorne Posts: 4,584
    I've always done it like so:

    Create a virtual device. Make the virtual the first device in the combine statement, then the physical devices to be combined after, or combine an array of physical devices with he virtual.

    Done like that, the STRING handler for the DATA_EVENT on the virtual contains all your message from all the panels combined with it. Likewise all references to the virtual will act on and get feedback from any and all of the physical devices combined with it.

    However, a great deal of COMBINE functionality can be done without actually combining anything. Just make an array of all your physical devices, and actions performed with the array name will act on all the devices, and you can also get feedback exactly as if they were combined. The advantage of doing it this way is that you can still act on individual devices by referencing the device directly, it's only references to the array that act on all of them. Also, a single DATA_EVENT block on the array can handle all your responses as a group, and if you need to handle something slightly differently for various devices, you can use GET_LAST on the array name to see precisely which device triggered the event. I am moving more and more towards using arrays rather than combines, and find few situations where it doesn't work better for me.
  • Options
    jjamesjjames Posts: 2,908
    Being relatively new to all this, I don't quite follow. Here's an issue that I'm having right now. Whenever I push one button on Panel-1, Panel-2 does the same thing. I want them to have the same functions, but be compltely independent of eachother. So you're saying a device array could accomplish this? I've already written all the code for Panel-1, how time consuming will it be to have Panel-2 act the same as 1, but be independent?
  • Options
    GSLogicGSLogic Posts: 562
    jjames

    Setup your TP devices in a DEV array
    DEFINE_DEVICE
    dvTP1 = 10001:1:0
    dvTP2 = 10002:1:0
    dvTP3 = 10003:1:0

    DEFINE_VARIABLE
    DEV dMAIN[] = { dvTP1, dvTP2, dvTP3 }

    Now if you want to talk to all of them:
    SEND_COMMAND to dMAIN,

    If you only want to talk to the third panel:
    SEND_COMMAND to dMIAN[3]

    If you setup an array to hold locations of your panels, you can use FOR loops to see which panels are viewing what sections of your code (security, lights, ect.).
  • Options
    Thomas HayesThomas Hayes Posts: 1,164
    Gary's example works very well. I use it when I want the ability to talk to a certain panel. By using the 'define_combine' I believe that from that point on all devices combined will act as one. The thing that you have to remember when using the 'Dev' array is that each panel's buttons have to setup in the 'mutually exculsive' separtely.There maybe a way around this but I am not sure.
    ex:
    ([tp1,1]..[tp1,5])
    ([tp2,1]..[tp2,5])
    ([tp3,1]..[tp3,5])
  • Options
    jjamesjjames Posts: 2,908
    Okay - I'm probably WAY off, but tell me if I'm headed in the right direction. When I combined the two TPs, they did act as one. So when TP1 hit a specific button, it opened a pop-up on both. So this is what I have, but isn't working:
    BUTTON_EVENT[TPS[],911]		// LIGHTING NAVIGATION EXIT BUTTON
    {
    PUSH:
        {
        Index = GET_LAST(TPS)
        OFF[TPS[Index],899]		// 1ST FLOOR MAP RESTORATION - RETURNS FULL COLOR TO MAP
        WAIT 15
    	{
    	SEND_COMMAND TPS[Index], "'^SHO-91,1'"		// RETURNS FULL BRIGHTNESS TO BULBS
    	SEND_COMMAND TPS[Index], "'^SHO-92,1'"
    
    etc,etc,etc.
    
    
    BUTTON_EVENT[TPS[],913]		// SCROLL RIGHT BUTTON
    {
    PUSH:
        {
        Index = GET_LAST(TPS)
        OFF[TPS[Index],912]
        ON[TPS[Index],913]
        ON[TPS[Index],898]
        }
    }
    
  • Options
    jjamesjjames Posts: 2,908
    Okay - got it working, was pretty simple too.
    BUTTON_EVENT[TPS,912]		// SCROLL LEFT BUTTON
    {
    PUSH:
        {
        Index = GET_LAST(TPS)
        OFF[TPS[Index],913]
        ON[TPS[Index],912]
        OFF[TPS[Index],898]
        }
    }
    

    this works just fine. Thanks for everyone's help.
  • Options
    GSLogicGSLogic Posts: 562
    You will have to use either combine or a DEV array. Once you combine panels they receive everything as if it was one panel.

    Also, I would try to stay away from using ''mutually exculsive" and do your feedback in the Define_Program.

    And lastly, instead of always using
    Index = GET_LAST(TPS)
    OFF[TPS[Index],899]
    you can use
    OFF[Button.Input.Device,899]
  • Options
    jjamesjjames Posts: 2,908
    Ok - i'll keep that in mind. I'm still having some issues, but I just need to go through my coding. Thanks again for all your help everyone!!
Sign In or Register to comment.