Smooth light regulation
[Deleted User]
Posts: 0
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.
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
0
Comments
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).
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?).
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.
- Chip