Noobie needs help, friends!

Can't copy an example of my code, because I'm using hotels pc, but still hope you could help me.

How to change the color of button by clicking on it?

I have something like this:

button_event

push{ send_comand [actual comand to cd player]
send_comand [touchpannel] ^btSomethin-0.50,0,color

}
still not working

also how to track from netlinx is my panel 5200 is on. I need to turn all devices on, then the pannel is turned on.

Thanks a lot!

Comments

  • Joe HebertJoe Hebert Junior Member Posts: 2,154
    How to change the colour of button by clicking on it?

    ...also how to track from netlinx is my panel 5200 is on. I need to turn all devices on, then the pannel is turned on.
    You can use the ^BMF command to change colors as follows:
    DEFINE_DEVICE
    
    dvTP = 10001:1:0
    
    DEFINE_EVENT
    
    BUTTON_EVENT[dvTP,1] {
    
       PUSH: {
          //change fill color to red for a button with address code 1
          SEND_COMMAND dvTP,'^BMF-1,0,%CF RED'
       }
    
    }
    
    BUTTON_EVENT[dvTP,2] {
    
       PUSH: {
          //change fill color to green for a button with address code 1
          SEND_COMMAND dvTP,'^BMF-1,0,%CF GREEN'
       }
    
    }
    

    You can tell if a panel is online or offline by monitoring the DATA event for the touch panel.
    DATA_EVENT[dvTP] {
    
       ONLINE: {
          //panel is online
       }
       OFFLINE: {
          //panel is offline
       }
    
    }
    

    You can?t turn a panel on or off from code other than sending it a reboot command.

    HTH
  • DHawthorneDHawthorne Junior Member Posts: 4,584
    I prefer in cases like that to set the button up as a multi-state bargraph, and send it a level command to change the color. That way you can use color palettes and swap color themes without re-writing any code. Granted, setting up the palettes is a much work or more, but I like the idea of keeping all the panel design elements in the panel itself. That way, two years down the road, I (or whoever else might need to work on the job) don't have a raw spot from scratching my head trying the figure out why that button keeps changing color.
  • mex_lithuaniamex_lithuania Junior Member Posts: 31
    Thank you very much, guys.
    Now I see where my silly mistake was - I messed address code with channel code.
  • mex_lithuaniamex_lithuania Junior Member Posts: 31
    Realy don't want bother you all, but have few more questions.

    1. How to reboot NI(3100) master using netlinx code? [command_send /netlinx/, "reboot"] did nothing
    2. How to disable 5200i panel menu while connection to netlinx master is off? For example I want to output message "please wait, connecting..." and when connection is established - let user to use touch buttons.
    3. How to check netlinx master buffer and processor usage? I used some comands by telnet from "help", but it always output me same 86% processor usage. Any other perfomance monitoring tricks?
    4. How to output low battery warning message using only tp4 programming?

    Best regards
  • Joe HebertJoe Hebert Junior Member Posts: 2,154
    1. How to reboot NI(3100) master using netlinx code? [command_send /netlinx/, "reboot"] did nothing
    2. How to disable 5200i panel menu while connection to netlinx master is off? For example I want to output message "please wait, connecting..." and when connection is established - let user to use touch buttons.
    3. How to check netlinx master buffer and processor usage? I used some comands by telnet from "help", but it always output me same 86% processor usage. Any other perfomance monitoring tricks?
    4. How to output low battery warning message using only tp4 programming?
    1) Reboot (0) will reboot the NI master as per the Netlinx help file.

    2) You can’t stop a user from touching any buttons on the panel when a connection to the Netlinx master isn’t established. There are several ways to notify the user. One is to take a copy of the connection status button from the system template page in TP4 and put it in your pages, however, that only updates every 3 seconds or so. A simple way is to have a button which has an off state that informs the user there is no connection and have the on state display a valid connection. Then just turn the button on in mainline.

    3) I’m not sure how helpful that CPU usage command is but if you are always getting 86% that sounds awfully high. You can get a good idea of what’s going on if you monitor Notifications and Diagnostics in NS3. If you telnet in you can do a msg on to see any runtime errors or other messages and you can do a show max buffers which will indicate the high water mark and show buffers which will show the current levels. You can also look at the input and output lights on the Netlinx master, if they are always on solid that’s usually not a good thing.

    4) Again the system template page is your friend. Take a copy of the battery stuff and paste it into your pages. You can take anything in the setup pages and use those buttons in your own pages. Feel free to change the look and feel to match your interface, just leave the address/channel/level codes as is.

    HTH
  • Joe HebertJoe Hebert Junior Member Posts: 2,154
    There is one other helpful telnet command that I forgot to mention. If you do a show mem that will display the amount of free memory available.
  • mex_lithuaniamex_lithuania Junior Member Posts: 31
    Thanks, Joe, you are the best :]

    I tried to copy battery and connection indication from system template page, but it did not worked on my pages, even I did not any changes in indicators properties.
  • Joe HebertJoe Hebert Junior Member Posts: 2,154
    I tried to copy battery and connection indication from system template page, but it did not worked on my pages, even I did not any changes in indicators properties.
    Make sure you grab everything when you make the copy. The connection status is actually two buttons stacked on top of each other. If the buttons work in the setup pages they will work in your pages.
  • MaracaerMaracaer Junior Member Posts: 25
    anyone worked with Akira monitors?

    Just wondering if anyone has had any experience working with Akira monitors. I've got 4 of the 70" going in an install and need a lil help....thx
Sign In or Register to comment.