Home AMX User Forum NetLinx Studio

levels: problems when I reboot only central unit

Hi at all!
I have a problem with send_level.
If I reboot the central unit ( ni700) the levels on 8400 go to 0. It's ok. But When the central unti come back online they don't work. I need to reboot the 8400 touch panel.
It's correct?
Thank you
Alessandro Tettamanti

Comments

  • ondrovicondrovic Posts: 217
    How is the level being sent to the panel? Do you have it setup so when the panel goes online to send the current level?
  • eddymouseeddymouse Posts: 67
    ondrovic wrote: »
    How is the level being sent to the panel? Do you have it setup so when the panel goes online to send the current level?

    Yes. I have a redraw function but the level do not refresh and do not change the value.
  • ericmedleyericmedley Posts: 4,177
    eddymouse wrote: »
    Yes. I have a redraw function but the level do not refresh and do not change the value.

    Okay, next question. What ARE the values for the levels you are sending when the panel comes online.

    Can you show us the code you use at startup?
  • annuelloannuello Posts: 294
    I tend to put any online "syncing" of panels in a wait. I've found that although panels may come online, they will ignore commands for the first few seconds. This might also apply to levels.
    data_event[dvTp]{
     online:{
      wait 50{
       //...  Do your setup code here.
      }
     }
    }
    

    Given that both the master has been offline for approx 30 seconds (due to reboot), a few extra seconds won't make a huge difference to the end user.

    Roger McLean
    Swinburne University
  • eddymouseeddymouse Posts: 67
    annuello wrote: »
    I tend to put any online "syncing" of panels in a wait. I've found that although panels may come online, they will ignore commands for the first few seconds. This might also apply to levels.
    data_event[dvTp]{
     online:{
      wait 50{
       //...  Do your setup code here.
      }
     }
    }
    

    Given that both the master has been offline for approx 30 seconds (due to reboot), a few extra seconds won't make a huge difference to the end user.

    Roger McLean
    Swinburne University

    The problem is not to wait online, or to wait the system come back up.
    The problem is thatI send a level command ( send_level tp,list_fdbList,2 ) and the multistate bargraph do not change his state. This happen when I upload new netlinx program to Central unit and do not reboot the panel (8400). If I upload tp4 files and program files the system work good!
    Thanks
  • eddymouseeddymouse Posts: 67
    Solved.
    The problem is the level number.
    I have ten levels from 120 to 130.
    I use set_virtual_level_count(tp,130) and now work!
    Thank you at all
  • viningvining Posts: 4,368
    Now you have a 130 levels defined and using resources. Why not just use levels 1-10? Then use set_virtual_level_count to 16. (levels come in blocks of 8 and by default each virtual port starts off with 8)
  • eddymouseeddymouse Posts: 67
    How can I monitor this resource usage? where can I see how many port is used? By Diagnostic?
    thank you
  • DHawthorneDHawthorne Posts: 4,584
    Rather than jumping through hoops, I reboot my panels when the master reboots. It solves a whole raft of issues, like properly refreshing dynamic images and making sure what the panel is displaying is in sync with what the master is doing. For example, many media servers need a context to work properly, and if the panel is left displaying one of their pages when the master reboots, that context will be invalid and the data wrong. Sure, you could set the proper page on the master reboot, but if the panel does a lot of other things, that can require a great deal of tracking. Simpler (and therefore less likely to get goofed up) to reboot the panel.
    DEFINE_CONSTANT
    
    NUMBER_PANELS = 2
    
    DEFINE_VARIABLE 
    
    VOLATILE DEV dvPanels[] = {dvPanel1, dvPanel2} ;
    
    DATA_EVENT dvPanels[]
    {
        ONLINE :
        {
            LOCAL_VAR bResetFlag[NUMBER_PANELS] ;
            STACK_VAR CHAR nPanelIdx ;
            
            nPanelIdx = GET_LAST(dvPanels) ;
    
            IF(!bResetFlag[nPanelIdx])
            {
                   SEND_COMMAND dvPanels[nPanelIdx], "'REBOOT'" ;
                   bResetFlag[nPanelIdx = TRUE] ;
            }
        }
    }
    
Sign In or Register to comment.