bargraph question
udi
Posts: 107
I communicate between the iLight and the amx and in the TPDesign I draw a multi-state bargraph, I want that when I raise or lower it's level it would change the light. I defined a level code in the software but I don't know how to do the push event of the bargraph.
0
Comments
Perhaps you can elongate on the problem you are experiencing. Don't you know how to send a level to a device from the bargraph or vise versa?
I'm assuming it's the first one.
omit the send_string dv_sound and compile and upload that to see what values it gives you. the send_string would be dependent on the protocol of your device.
Assuming this is what you're asking. If you can give us more information it will be easier to help you.
Jorde
The level event is enough.
You get this event everytime you change the value of the bargraph so you can use this event to send the new value of the bargraph to the iLight.
I set the level code of the bargraph to 1 and the range to 0-100.
I have a bargraph with 10 states and I want that when I slide up and down the light will change correspondingly.
I tried this code:
level_event[g_dvaTouchPanels,1]
{
send_command vLight, "'L:[01:01]:',LEVEL.VALUE"
}
But it didn't precisely work the light raise only when I get to state 9 and when I lower
The bargraph down the light turn off already in state 9 also.
Nerieru, I didn't a understand what you mean in the code you wrote what it will do? What is dv_sound device? What the commands do? And did you meant by upload?
That was a general example. You would need to do it to your light system.
Why are you using a multi-state bargraph? Just use a regular one.
I use a multi-state bargraph because I have a dimmer light and I want that when I raise the bargraph for example in 50% the light will also turn on in 50%.
The light device is an iLight device. And I think that these commands don't work on this device I tried and it didn't work. They have some command of there own like N:K[AREA], L:[]..
Why the code I wrote didn't work?
Did I need to do the command K:P[01] :M in the level_event to store the scene level .
I suggest you follow an AMX Programming Course, that should help you getting started with this.
For what you want to do you can use a normal bargraph and have it from 1-100%. If you can post the RS232/IP Protocol for an iLight I might be able to help you further.
I post the doc file I have for the iLight
Looking at the doc you posted, it seems that the level should be ascii, not an integer value. Try:
send_command vLight, "'L:[01:01]:',itoa(LEVEL.VALUE)"
the format is:
the module expects you to send it a string, so it's not expecting an integer thrown in there. So the command you need is like Hedberg posted:
Which turns your integer into an ascii value, so that the module understands it.
If possible you should follow a course, because this is all stuff you do in the training.
How can I register to AMX Programming Course?
I need to be a dealer?
I'm trying the opposite process.
I want that when the level change in an area the bargraph will change correspondingly I wrote the command:
data_event[vLight]
{
string:
{
if (find_string(data.text, 'L:',1))
{
send_level g_dvaTouchPanels,1,(Chan[1][1]*255/100)
}
}
}
But it didn’t work.
You will have to strip the string to the level value, you're also getting an ascii value while the bargraph needs an integer. So after stripping the string and saving the ascii lvl in a variable you will need to convert it with an ATOI.
I don't know what your device has as a return string though.