Home AMX User Forum NetLinx Studio

Lutron Radio RA and Level Events

I have been reading a lot of posts of levels and mulit-state bargraphs. I am controlling a Radio RA system, and I can't tell if some of things that I want to do are inherent weaknesses in the product line or my programming.

First, aside from using phantom buttons (there are only 16), I want to manually control zones, ramping the dimmer level up and down. The other reason I didn't want to use phantom buttons is because you can only get an on or off response, so I wouldn't be able to update a bargraph with the current light level. There seems to be no smooth way to do this because every Set Dimmer Level (SDL) command has a ramping time from state to state. Even if you set the ramping time to zero, it is not quite instantaneous. Is this just a problem in how the response times between the RA-RS-232 and the NI-xxxx, or is there some other commands that I haven't tried? Is Homeworks much more powerful in this regard?

Second, I want to institute a multi-state bargraph to set and display dimming levels. I saw DHawthorne saying that you have to be careful not to set up an infinite loop. I believe I did this, but I am still not happy with the results. I guess one thing I can't seem to do is get the level from the panel unless I am in a LEVEL_EVENT. In there I used the SEND_LEVEL along with the LEVEL.VALUE. How can I retrieve a level value without a LEVEL_EVENT? My example would be that I have a bargraph. As I press near the top, the bargraph begins to fill. When I let go is when I would want the use the current value to set the dimmer level. It seems in a LEVEL_EVENT it activates it the entire way, therby sending multiple commands to the Radio RA. With the Radio Ra, the dimmer can't keep up with it, so it is either very choppy and slow, or it just doesn't work.

I was thinking of using the BUTTON_EVENT, but how can I only read the level value once the multi-state bargraph is in the release state.

Third, how do I give a variable a definitve range? Eg, I declare nDimmerLevel of type Char, so it is 0-255. However, I want it to never go below zero or above 100. Doing a counter and using IF statements, I can limit when it is used, but it can still achieve an out of range value.

Comments

  • joelwjoelw Posts: 175
    Third, how do I give a variable a definitve range? Eg, I declare nDimmerLevel of type Char, so it is 0-255. However, I want it to never go below zero or above 100. Doing a counter and using IF statements, I can limit when it is used, but it can still achieve an out of range value.

    While this is not code intended for your device, the concept is the same. These functions could be called in a BUTTON HOLD event with repeat value set to create suitable ramp time. Define range low and high values in your bargraph object, to get proper scaling of channel value.

    The concept is the same for signed integer or float type audio levels.
    (***********************************************************)
    (*               CONSTANT DEFINITIONS GO BELOW             *)
    (***********************************************************)
    DEFINE_CONSTANT
    
    CH_INC          = 1
    
    MaxChLvl 	= 100
    MinChLvl 	= 0
    
    (***********************************************************)
    (*               VARIABLE DEFINITIONS GO BELOW             *)
    (***********************************************************)
    DEFINE_VARIABLE
    
    CHAR CH_LVL[8]
    
    (***********************************************************)
    (*        SUBROUTINE/FUNCTION DEFINITIONS GO BELOW         *)
    (***********************************************************)
    DEFINE_FUNCTION ChLvlUp(CHAR val)
    {
        IF(CH_LVL[val] <= (MaxChLvl-CH_INC))
        {
    	CH_LVL[val] = CH_LVL[val] + CH_INC
    	//AppendToQueue("ACK,'ingn(',ITOA(val),')=',format('%d',CH_LVL[val])")
        }
        ELSE
        {
    	CH_LVL[val] = MaxChLvl
        }
    }
    DEFINE_FUNCTION ChLvlDn(CHAR val)
    {
        IF(CH_LVL[val] >= (MinChLvl+CH_INC))
        {
    	CH_LVL[val] = CH_LVL[val] - CH_INC
    	//AppendToQueue("ACK,'ingn(',ITOA(val),')=',format('%d',CH_LVL[val])")
        }
        ELSE
        {
    	CH_LVL[val] = MinChLvl
        }
    }
    
  • Thanks. I had a feeling it would have to be something like that. I guess I was hoping there was a way to define the variable from the beginning and make it have a range.
  • joelwjoelw Posts: 175
    Read the section under help titled: "Level Control Parameters"

    When sending from controller to panel you have to ensure range matches that set in panel mult-state bargraph object. Button action from touch panel will be send in range of what is defined by multi-state bargraph object.

    Start by disabling ramp time with Lutron dimming. The level event rate should determine dim rate. If level changes is too "stepped" perhaps then play with the Lutron dim rate.
  • The range is fine. It is 0-100 which would be equal to the dimming level. With Radio RA, I don't think there is a way to stop ramping, so I am trying to find a workaround. The problem is that let's say a light is off. I press the bargraph at level 62. With the level_event tracking through notifications it sends multiple commands from 0-62 to the 232 module instead of just one command of 62. So how can I only read the level value and execute a single command once the bargraph button is released? It would basically be a LEVEL_EVENT that only triggers on the RELEASE of a BUTTON_EVENT. Is this possible?
  • viningvining Posts: 4,368
    HomeWorks and RA are night and day. I don't think RA returns light level values while HomeWorks does. Even on a small system (unless it's a retrofit) if your using with a RA Chronos a wired HomeWorks will be cheaper in material and in labor.

    If you want to both display and control levels of the same device you should create two level channels. The bargraph level for viewing should be behind the level for control and set to level function "display only" while the bargraph level for control should be transparent, level function set to "active" and above the on for viewing.
  • viningvining Posts: 4,368
    Here's some RA files I've had in the closet which is where I think RA should stay. Hopefully you'll get use out of it. There's an include and TPD4 files. I use a bargraph to set levels as well as raise and lower buttons. I have a row of button to select what you want to control verses if something is set a X values the need to turn off the device before haveing to go to a Y value which is normally what is done so the system knows this is now the dimmer device to change.

    I use a varaible nActiveRARoom which is not a physical room it relates to Lutron led logic of rooms verses scenes so don't get confused. It's not based of which touch panel it coming from but which button on the rooms keypad verses the scenes keypad.

    The "Lift" in the code was for a fixture lift to raise and lower the fixture on a cable. Ignore it!
  • joelwjoelw Posts: 175
    So how can I only read the level value and execute a single command once the bargraph button is released? It would basically be a LEVEL_EVENT that only triggers on the RELEASE of a BUTTON_EVENT. Is this possible?

    Sure. Assign channel code to the active multi-state bargraph. In level event handler update a global variable with incoming from panel. In button release handler send value of the global variable.
  • That's it Joel. Thanks. Boy, I am always so close. I kept a SEND_STRING in the LEVEL_EVENT, so it was sending way too much info to the RA-RS-232. But using the TP4 Range Time of 5 along with the inherent ramping time from Radio Ra, it works great and sends the level value once the bargraph is released.

    Thank you, Vining, also. I will take a look at that code more closely tomorrow. Yes, I have found the limitations of Ra pretty quickly. I am doing this more for both the experience in programming as well as trying to take a relatively limited interface like Ra and see how much I can exploit it by using AMX to make it better than the sum of its parts.

    Eric
Sign In or Register to comment.