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 whether you accept or reject these cookies being set.

FAN SPEEDS TO TEXT
#1
Hello guys.
I need your help.
I have a w4k and i need to convert the vrv speeds to text.
So the AUTO is 0
The LOW is 1 to 33
The MEDIUM is 34 to 67
The HIGH is 68 to 100.
The GA is 1byte unsigned integer.
The script that i want to create will have the 1 byte as an input and i will write the result in an other GA with the desired string/text.
I m attaching a photo of the visualization.    
Reply
#2
Code:
textobject ='1/1/1'
speed = event.getvalue()
if speed == 0 then
  grp.checkwrite(textobject, 'Auto')
elseif speed > 0 and speed =< 33 then
  grp.checkwrite(textobject, 'Low')
elseif speed > 33 and speed <= 67 then
  grp.checkwrite(textobject, 'Medium')
elseif speed > 67 then
  grp.checkwrite(textobject, 'High')
end
Reply
#3
Thank you Erwin again for your quick reply!
You are a life saver!
Your script works like a charm!!!!
Reply
#4
Another option is to generate text labels via a script and use them as Custom values (enums):
Code:
text = {}

text[ 0 ] = 'Auto'

for i = 1, 33 do
  text[ i ] = 'Low'
end

for i = 34, 67 do
  text[ i ] = 'Medium'
end

for i = 68, 100 do
  text[ i ] = 'High'
end

-- must be an existing object
grp.create({
  address = '32/1/20',
  enums = text
})
Reply
#5
Thank you very much admin!
Reply


Forum Jump: