Home AMX User Forum NetLinx Studio

Smooth light regulation

Hello, I use touch panel NXD-CV7 to regulate light with RADIA rdd-dm6, relying on levels connection. There is a bargraph which displays current light level. Brightness itself is regulated with two buttons - "up" and "down" - which increase or decrease brightness level, so bargraph is "display only". But the problem is that when i press button, bargraph displays "jerks", probably because every time, when brightness level on RADIA changes, it sends it's level value to panel, and this value is not synchronized with current panel's level value. How to make this displaying be smooth?
The simple code follows.
PROGRAM_NAME='test_smooth'

DEFINE_DEVICE
dvPanel = 10001:1:1 	//Panel
dvLTS = 2:1:1 	//Radia rdd-dm6 lighting system
dvVirtual = 33001:1:0	//Virtual device

DEFINE_CONNECT_LEVEL
(dvVirtual,1,dvPanel,1,dvLTS,1)
(dvVirtual,2,dvPanel,2,dvLTS,2)
(dvVirtual,3,dvPanel,3,dvLTS,3)
(dvVirtual,4,dvPanel,4,dvLTS,4)
(dvVirtual,5,dvPanel,5,dvLTS,5)
(dvVirtual,6,dvPanel,6,dvLTS,6)

DEFINE_VARIABLE
CHAR DIM1,DIM2,DIM3,DIM4,DIM5,DIM6

DEFINE_START
CREATE_LEVEL dvLTS,1,DIM1
CREATE_LEVEL dvLTS,2,DIM2
CREATE_LEVEL dvLTS,3,DIM3
CREATE_LEVEL dvLTS,4,DIM4
CREATE_LEVEL dvLTS,5,DIM5
CREATE_LEVEL dvLTS,6,DIM6

CREATE_LEVEL dvPanel,1,DIM1
CREATE_LEVEL dvPanel,2,DIM2
CREATE_LEVEL dvPanel,3,DIM3
CREATE_LEVEL dvPanel,4,DIM4
CREATE_LEVEL dvPanel,5,DIM5
CREATE_LEVEL dvPanel,6,DIM6

Comments

  • DHawthorneDHawthorne Posts: 4,584
    Did you try COMBINE_LEVEL instead of CONNECT_LEVEL? It's not clear to me what the difference is, to be honest; there may not be one.

    I think there may be a problem with the fact you are linking two seperate levels with the same variable. You may be causing a loop in there. Give your light levels and panel levels different variables - heck, from what I see in your code, you don't even need the CREATE_LEVEL lines at all, unless you are using those variables elsewhere. But in any event, you don't need them for the panel levels, it's redundant. CREATE_LEVEL only links a variable to the value of the level, it's not actuially needed to use a level, just an easy way to read it. And it's one way ... changing the variable does not change the level.

    The way I do such things is not to use an automatic link at all. You have a variable already associated with the light level, just put a SEND_LEVEL to the panel level in your panel update code (which I always do in a seperate function, called by a timeline to limit update message traffic).
  • Ok, thank you, i can remove automatic link, but what to do after that? Can you (or anybody) show me an example, or explain principle, how to keep brightness and panel's levels synchronized? It seems to be tricky.
    I need:
    1) to regulate light from panel without any jerks on displaying bargraph, i.e., smothly;
    2) to display brithness level changes, i.e. after PROLink command like "to change brightness from 10% to 90% for 30 seconds" (btw, what AXLink command can i use for such action?).
  • See if this works any better.
    DEFINE_DEVICE
    dvPanel = 10001:1:1 	//Panel
    dvLTS = 2:1:1 	//Radia rdd-dm6 lighting system
    
    Define_Event
    Button_Event[dvPanel,101] // Ramps Dimmer 1 to 90% in 30 seconds
    {
      Push:
      {
        Send_Command dvLTS,'P1L90T30'
      }
    }
    
    // Level feedback to touch panel
    Define_Event
    
    Level_Event[dvLTS,1] // Update bargragph 1 on touch panel
      Send_Level dvPanel,1,Level.Value
    
    Level_Event[dvLTS,2] // Update bargragph 2 on touch panel
      Send_Level dvPanel,2,Level.Value
    
    Level_Event[dvLTS,3] // Update bargragph 3 on touch panel
      Send_Level dvPanel,3,Level.Value
    
    Level_Event[dvLTS,4] // Update bargragph 4 on touch panel
      Send_Level dvPanel,4,Level.Value
    
    Level_Event[dvLTS,5] // Update bargragph 5 on touch panel
      Send_Level dvPanel,5,Level.Value
    
    Level_Event[dvLTS,6] // Update bargragph 6 on touch panel
      Send_Level dvPanel,6,Level.Value
    
  • Here is my test code.. :)
    DEFINE_DEVICE
    dvPanel = 10001:1:1 	//Panel
    dvLTS = 2:1:1 		//Radia rdd-dm6 lighting system
    
    DEFINE_EVENT
    BUTTON_EVENT [dvPanel,1]
    {
        SEND_STRING dvLts,"'1-6L100T60',13" //all dimmers down for 60 seconds (PROLink command)
    }
    BUTTON_EVENT [dvPanel,7]
    {
        Push: To[dvLTS,129] //ramp dimmer up
    }
    BUTTON_EVENT [dvPanel,13]
    {
        Push: To[dvLTS,135]	//ramp dimmer down
    }
    
    LEVEL_EVENT [dvlts,1]
    {
        send_level dvPanel,1,level.value
    }
    
    And i have a problem, described in the first post - when i press "ramp up" or "ramp down" button, i get jerks on panel... Probably because levels change very fast to be displayed properly in real-time.
  • DHawthorneDHawthorne Posts: 4,584
    By all rights, that should work. It may very well be the problem is not you your code, but in the way the Radia module is updating it's feedback level. If you use CREATE_LEVEL to attach a variable to level 1 on your dvlts, then watch that variable in a debug window, does the variable increment smoothly, or in jerks? If it is updating RS-232, it might just be an inherent limit in how fast the device is sending status feedback, or it may be the way the module is coded. It's even possible there are port overruns and not all the feedback is getting to the module, so it is only updating in jerks when it catches up. But in any case, I don't think the problem is in your code, at least what I have seen.
  • Chip MoodyChip Moody Posts: 727
    I've never had a unit on hand long enough to really torture, but I have to say, using basic, straightforward programming like this that works fine with devices like AMX volume controls, I have also had "jerky" feedback from Radia units that we've installed at clients. I think it's the nature of the beast when it comes to those...

    - Chip
Sign In or Register to comment.