Home AMX User Forum AMX Design Tools

Page Tracking?

Hi there

I am just learning how to track pages on G3 panels with Axcess... Really cool!

Do anyone of you have an Axcess code piece for page tracking to serve me as an example, or have any advice for me? I have already activated all panels to send page track info back to the controllers. I have 2 CA10 and 3 VPNs and in order to save bus bandwidth, I would like to send mp3 tag and other info to each panel only if the panel is on the appropriate page.

I already have a ZONE and DECK variable in my code, but guess that I need to expand them to arrays to hold the ZONE and DECK selections for each of the panels, or is there a better solution for this?

Many thanks in advance!

Greetings,
Bob.

Comments

  • DHawthorneDHawthorne Posts: 4,584
    If you are going to use page tracking this way, you have to keep in mind it's not an instantaneous update - since it's a string coming in to the master from the panel, it is necessarily much slower than a channel event would be, especially after parsing. This can create timing issues if you aren't aware of it. Also, keep in mind the panel going offline is going to change your page without any such tracking string going through - I use the ONLINE and OFFLINE events to track this, and send a page flip if necessary to make sure my variable agrees with what is on the panel.

    As far as the state variable itself, I generally make a set of arrays. One array holds all my panels, and I use this in my DATA_EVENT for the page tracking and STRING events. I use GET_LAST to determine which panel the event applies to. Tehn I have another array of the same dimension for the tracking variables, and use the value from the GET_LAST to set the index of the variable I am changing.
  • bobbob Posts: 296
    Dave, could yuo please post some sample code? Thanks!
  • bobbob Posts: 296
    I am sending the mp3 tag info to the panels only when a track changes. When a CA10 panels go to sleep and after it is touched again it has the updated info. But when a VPN-CP goes to sleep, it bypasses all the updates and when it is touched, there is the wrong info shown from before it went to sleep. When the next track change occurs it gets again the right mp3 tag data.

    Is it possible to detect when the VPN wakes up, and if the selected page is the mp3 page, to send the tag data on the WAKEUP event? Some code will be greatly appreciated.

    Thanks,
    Bob.
  • Netlinx generates an online event for the VPN panel when it wakes up, put your update code there.
    In Axcess you can use the DEVICE_ID keyword to detect if the panel is on- or offline. Something like;

    IF (DEVICE_ID(YourPanelDevNumber) AND !SomeVar)
    {
    SomeVar = 1
    (* your panel update code *)
    }

    IF (!DEVICE_ID(YourPanelDevNumber))
    {
    SomeVar = 0
    }
  • frthomasfrthomas Posts: 176
    bob wrote:
    I am sending the mp3 tag info to the panels only when a track changes. When a CA10 panels go to sleep and after it is touched again it has the updated info. But when a VPN-CP goes to sleep, it bypasses all the updates and when it is touched, there is the wrong info shown from before it went to sleep.

    Well, the CA10 goes to sleep and stays ONLINE, whereas the VPN-CP goes to sleep and OFFLINE. That is, sleep is not the issue, it is going OFFLINE that is.

    You need to refresh the panel when it comes ONLINE.

    Fred
  • bobbob Posts: 296
    When the VPN goes online how long does it need to build the connection to the AXR-NWS? I am not sure, but it seems to me that it takes a little bit longer, then say a VPT/AXR-RF combo, which is a bit of annouying.
  • Takes approx. 1-2 seconds, but there is no need to delay any code since online means that the panel woke up AND the connection has been made.
  • DHawthorneDHawthorne Posts: 4,584
    I can't find any existing code snippets that illustrate what I do with page tracking without includuing a bunch of junk that would just complicate the issue. So I hope this made-up example is helpful:
    DEFINE_DEVICE
    
    dvPanel1 = 10001:1:0 ;
    dvPanel2 = 10002:1:0 ;
    
    DEFINE_CONSTANT
    
    STATE_IDLE = 0 ;
    STATE_AUDIO = 1 ;
    STATE_VIDEO = 2 ;
    
    NUMBER_PANELS = 2  // Makes it easier to add/delete panels if all references can be changed in one spot
    
    DEFINE_VARIABLE
    
    VOLATILE DEV dvPanels[] = {dvPanel1, dvPanel2} ;
    VOLATILE CHAR nPanelState[NUMBER_PANELS] ;
    
    DEFINE_EVENT
    
    DATA_EVENT [dvPanels]
    {
         OFFLINE :
         {
              STACK_VAR CHAR nPanelIndex ;
              nPanelIndex = GET_LAST(dvPanels) ; 
              
              nPanelState[nPanelIndex] = STATE_IDLE ;
         }
         ONLINE :
         {
              STACK_VAR CHAR nPanelIndex ;
              nPanelIndex = GET_LAST(dvPanels) ; 
              
              nPanelState[nPanelIndex] = STATE_IDLE ;
              SEND_COMMAND dvPanels[nPanelIndex], "'PAGE-Main'" ;
         }
         STRING :
         {
              STACK_VAR CHAR nPanelIndex ;
              nPanelIndex = GET_LAST(dvPanels) ; 
              
              SELECT
              {
                   ACTIVE(FIND_STRING(DATA.TEXT, "'PAGE-Main", 1)) : nPanelState[nPanelIndex] = STATE_IDLE ;
                   ACTIVE(FIND_STRING(DATA.TEXT, "'PAGE-Audio", 1)) : nPanelState[nPanelIndex] = STATE_AUDIO ;
                   ACTIVE(FIND_STRING(DATA.TEXT, "'PAGE-Video", 1)) : nPanelState[nPanelIndex] = STATE_VIDEO ;       
              }
         }
    }
    

    There are lots of variations, and you can track pops (@PPN and @PPF instead of PAGE), but that's the general idea.
  • bobbob Posts: 296
    Thanks, Dave! AFAIK I am using Axcess, but the idea is clear!

    Greetings,
    Bob.
  • Chip MoodyChip Moody Posts: 727
    bob wrote:
    When the VPN goes online how long does it need to build the connection to the AXR-NWS? I am not sure, but it seems to me that it takes a little bit longer, then say a VPT/AXR-RF combo, which is a bit of annouying.

    For what it's worth, the VPT-xx never appears as being "offline" to a control system, as it's the AXR-RF that appears on the bus, unlike the 2-way versions.

    - Chip
  • bobbob Posts: 296
    Chip Moody wrote:
    For what it's worth, the VPT-xx never appears as being "offline" to a control system, as it's the AXR-RF that appears on the bus, unlike the 2-way versions.

    - Chip

    Exactly what I have found out - this makes the VPT behave more like a "normal" remote which actually never goes to "sleep" and is instantly ready to use. Although the VPN is two way which also has its charm for seeing status feedback of remote equipment and displaying track infos about playing CDs titles or mp3's...

    Bob.
  • mixumixu Posts: 31
    Bob,

    I am just curious to know what MP3 player do you use to get the artist/track information. I am looking for a hard drive MP3 player that could send the data to an AMX controller. Something cheaper than Elan systems.

    Mixu
  • bobbob Posts: 296
    mixu wrote:
    Bob,

    I am just curious to know what MP3 player do you use to get the artist/track information. I am looking for a hard drive MP3 player that could send the data to an AMX controller. Something cheaper than Elan systems.

    Mixu

    I am using iTunes running on winXP with a self programmed solution. I have implemented only simple transport functions and playlist selections. Each time a track changes the software is sending me those tags over the RS232 to the controller, who is displaying them on the panels.

    The PC is a black box, 19". I have programmed the PC's BIOS to go to standby if it is running and the power buttons is pressed - I have build in a relay in parallel to the power switch, which is basically a closure contact powerig it on and off remotely. For sensing the status I am using a contact closure relay connected to the PCs 12v going to an INP8 port. Pretty simple but works good. And it needs less than a second to go from standby to full operation.

    Bob.
  • bobbob Posts: 296
    DHawthorne wrote:
    I can't find any existing code snippets that illustrate what I do with page tracking without includuing a bunch of junk that would just complicate the issue.

    There are lots of variations, and you can track pops (@PPN and @PPF instead of PAGE), but that's the general idea.

    Hmm... I was wondering how can I use page tracking, if I have combined panels? PUSH_DEVICE always shows me the first device in the DEFINE_COMBINE list so that I can not get the ID of the actual device being pushed. Any ideas how to do this without uncombining the devices?

    I am using two VPNs with the same layout file, but during operation one VPN may be on a different DECK and ZONE page, than the second panel. Using one single DECK and ZONE variable in the code is a no go, because the more recently used VPN sets them incorrectly for the first one and disabling its operation.

    Any ideas?

    Bob.
  • frthomasfrthomas Posts: 176
    mixu wrote:
    Bob,

    I am just curious to know what MP3 player do you use to get the artist/track information. I am looking for a hard drive MP3 player that could send the data to an AMX controller. Something cheaper than Elan systems.

    Mixu

    Forum members (including me) have been working on an AMX interface to the SlimDevice server & devices. See <http://www.slimdevices.com/>.

    Fred
  • DHawthorneDHawthorne Posts: 4,584
    bob wrote:
    Hmm... I was wondering how can I use page tracking, if I have combined panels? PUSH_DEVICE always shows me the first device in the DEFINE_COMBINE list so that I can not get the ID of the actual device being pushed. Any ideas how to do this without uncombining the devices?

    I am using two VPNs with the same layout file, but during operation one VPN may be on a different DECK and ZONE page, than the second panel. Using one single DECK and ZONE variable in the code is a no go, because the more recently used VPN sets them incorrectly for the first one and disabling its operation.

    Any ideas?

    Bob.
    I don't believe you can. Once combined, the master only sees the virtual you combined them with. Use an array as in my example instead.
  • bobbob Posts: 296
    DHawthorne wrote:
    I don't believe you can. Once combined, the master only sees the virtual you combined them with. Use an array as in my example instead.

    Thanks Dave! But is it ok then to use PUSHes for all the other panels throughout the master_code.axs, like

    PUSH[dvTp1]:
    PUSH[dvTp2]:
    PUSH[dvTp3]:
    ... code ...

    I now have only the first PUSH, and have to extend everywhere to include the PUSHes for the other panels which are combined at the moment? This might also eat up some more memory, but I will do this if this the best practice. I was anyway little bit unhappy with the combine thing...

    Thanks,
    Bob.
  • DHawthorneDHawthorne Posts: 4,584
    bob wrote:
    Thanks Dave! But is it ok then to use PUSHes for all the other panels throughout the master_code.axs, like

    PUSH[dvTp1]:
    PUSH[dvTp2]:
    PUSH[dvTp3]:
    ... code ...

    I now have only the first PUSH, and have to extend everywhere to include the PUSHes for the other panels which are combined at the moment? This might also eat up some more memory, but I will do this if this the best practice. I was anyway little bit unhappy with the combine thing...

    Thanks,
    Bob.
    You can, but it's better to do this:
    DEFINE_VARIABLE
    
    DEV dvPanels[] = {dvTP1, dvTP2, dvTP3,<...etc.>}
    INTEGER iButtons[]= {<button channels here>}
    
    BUTTON_EVENT[dvPanels, iButton]
    {
         PUSH :
         { <code here> }
    }
    

    Using PUSH[DEV, CHAN] in mainline in a NetLink system is inefficient in many ways. You can use the BUTTON_EVENT to do the same thing, and it will take an array of devices as the first parameter just as easily as a single panel device, and do the same action no matter which panel initiated the event. You could also do a simple GET_LAST on the array to determine which panel triggered the event in case you need to do something slightly different with different panels.
  • bobbob Posts: 296
    Using PUSH[DEV, CHAN] in mainline in a NetLink system is inefficient in many ways. You can use the BUTTON_EVENT to do the same thing, and it will take an array of devices as the first parameter just as easily as a single panel device, and do the same action no matter which panel initiated the event. You could also do a simple GET_LAST on the array to determine which panel triggered the event in case you need to do something slightly different with different panels.

    Thanks, Dave - I still have an Axcess master and have not upgraded to Netlinx. I will upgrade tough to a ME260 in the near future but at the moment I only have axcess.

    Greetings,
    Bob.
  • DHawthorneDHawthorne Posts: 4,584
    bob wrote:
    Thanks, Dave - I still have an Axcess master and have not upgraded to Netlinx. I will in the near future upgrade to a ME260 but at the moment I only have axcess.

    Greetings,
    Bob.
    Heh, you have to keep reminding me of that, you'd think I would remember. I saw the word "combine" in your post and immediately thought "NetLinx," forgetting combines are possible in Axcent as well.
Sign In or Register to comment.