This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Delay for DALI !
#24
Hello, in the Dali controls, having a minimum physical regulation value, the regulation bar is always at very high values, since I have a status object associated with it.
To fix this, I have created a script to fool my client.

In this case, I have a ballast with a minimum physical value of 161 which is 63%. This tells us that we have 37% regulation.

1- I made this script so that my control object, when I send 1%, actually send the value 63% and from there the final result would increase until it reaches 100%.

2- I have created another status script, which does the same calculation but in reverse.

My problem here is that the calculations are not exactly identical in one script and the other, with a minimal difference due to the decimals.

Surely there is another way to achieve this ... can you help me?


Control object% visu (1/3/9)
Status object% visu (1/4/9)
Ballast control object (1/5/9)
Ballast Status Object (1/6/9)





Control script (1/3/9)
Code:
--Minimum physical value of ballast
VFM = 63

--Regulation output object
VReg= '1/5/9'

------------------------------------
value = event.getvalue()

OP1 = (100-VFM)/100
OP2 = (value*OP1)+VFM

if value==0 then
  grp.write(VReg, 0)
elseif value>=1 then
  grp.write(VReg, OP2)
end


State script (1/6/9)
Code:
--Minimum physical value of ballast
VFM = 63

--Regulation output object
VReg= '1/4/9'

------------------------------------
value = event.getvalue()

OP1 = (100-VFM)/100
OP2 = (value-VFM)/OP1

if value == VFM then
  grp.write(VReg, 1)
elseif value ~= VFM then
  grp.write(VReg, OP2)
end
Reply


Messages In This Thread
Delay for DALI ! - by phongvucba - 01.06.2020, 06:31
RE: Delay for DALI ! - by admin - 01.06.2020, 06:52
RE: Delay for DALI ! - by phongvucba - 02.06.2020, 03:55
RE: Delay for DALI ! - by admin - 02.06.2020, 07:44
RE: Delay for DALI ! - by phongvucba - 02.06.2020, 08:06
RE: Delay for DALI ! - by admin - 02.06.2020, 11:28
RE: Delay for DALI ! - by phongvucba - 02.06.2020, 16:08
RE: Delay for DALI ! - by phongvucba - 03.06.2020, 03:32
RE: Delay for DALI ! - by admin - 03.06.2020, 06:11
RE: Delay for DALI ! - by davidchispas - 04.01.2021, 09:59
RE: Delay for DALI ! - by phongvucba - 14.11.2020, 07:17
RE: Delay for DALI ! - by admin - 14.11.2020, 08:05
RE: Delay for DALI ! - by phongvucba - 14.11.2020, 09:15
RE: Delay for DALI ! - by Daniel - 16.11.2020, 08:40
RE: Delay for DALI ! - by phongvucba - 01.12.2020, 11:27
RE: Delay for DALI ! - by davidchispas - 24.11.2020, 10:46
RE: Delay for DALI ! - by admin - 24.11.2020, 10:48
RE: Delay for DALI ! - by admin - 24.11.2020, 10:58
RE: Delay for DALI ! - by davidchispas - 24.11.2020, 11:12
RE: Delay for DALI ! - by Daniel - 01.12.2020, 11:30
RE: Delay for DALI ! - by admin - 04.01.2021, 10:58
RE: Delay for DALI ! - by davidchispas - 05.01.2021, 09:34
RE: Delay for DALI ! - by admin - 05.01.2021, 09:36
RE: Delay for DALI ! - by davidchispas - 13.01.2021, 10:47
RE: Delay for DALI ! - by Daniel - 13.01.2021, 11:00

Forum Jump: