Home AMX User Forum AMX Technical Discussion

Help with bargraphs

I'm trying to update a theatre we have here.
I have only limited programming experience and am trying to get back into it.
I have a prodigy light system controlled through rs232.
I can get the lights to go to presets and ramp up or down.
I'm having a problem getting the bargraph on the TP.
The presets display the correct ranges, but the up down is only displays around 30%.
I tried * 4 and it throws it out of whack.
here is my program.

DEFINE_DEVICE
dvPRODIGY = 5001:7:2
dvTP_1 = 10010:1:2

DEFINE_VARIABLE
HOUSE

DEFINE_EVENT
BUTTON_EVENT[dvTP_1,150] (*House lights On*)
{
PUSH:
{
SEND_STRING dvPRODIGY, "'AL100T5',13"
HOUSE = 100
SEND_LEVEL dvTP_1,6,(HOUSE)
}
}
BUTTON_EVENT[dvTP_1,151] (*House lights 75%*)
{
PUSH:
{
SEND_STRING dvPRODIGY, "'AL75T5',13"
HOUSE = 75
SEND_LEVEL dvTP_1,6,(HOUSE)
}
}
BUTTON_EVENT[dvTP_1,152] (*House lights On 50%*)
{
PUSH:
{
SEND_STRING dvPRODIGY, "'AL50T5',13"
HOUSE = 50
SEND_LEVEL dvTP_1,6,(HOUSE)
}
}
BUTTON_EVENT[dvTP_1,153] (*House lights Off*)
{
PUSH:
{
SEND_STRING dvPRODIGY, "'AL0T5',13"
HOUSE = 0
SEND_LEVEL dvTP_1,6,(HOUSE)
}
}

BUTTON_EVENT[dvTP_1,2] (*House lights Up*)
{
PUSH:
{
SEND_STRING dvPRODIGY, "'AU'"
IF(HOUSE < 100)
{
HOUSE++
SEND_LEVEL dvTP_1,6,(HOUSE)
}
ELSE
{
HOUSE = 100
SEND_LEVEL dvTP_1,6,(HOUSE)
}
}
HOLD [2,REPEAT] :
{
IF(HOUSE < 100)
{
HOUSE++
SEND_LEVEL dvTP_1,6,(HOUSE)
}
ELSE
{
HOUSE = 100
SEND_LEVEL dvTP_1,6,(HOUSE)
}
}
RELEASE:
{
SEND_STRING dvPRODIGY, "13"
}
}

BUTTON_EVENT[dvTP_1,5] (*House lights Dn*)
{
PUSH:
{
SEND_STRING dvPRODIGY, "'AD'"
IF(HOUSE > 0)
{
HOUSE--
SEND_LEVEL dvTP_1,6,(HOUSE)
}
ELSE
{
HOUSE = 0
SEND_LEVEL dvTP_1,6,(HOUSE)
}
}
HOLD [2,REPEAT] :
{
IF(HOUSE > 0)
{
HOUSE--
SEND_LEVEL dvTP_1,6,(HOUSE)
}
ELSE
{
HOUSE = 0
SEND_LEVEL dvTP_1,6,(HOUSE)
}
}
RELEASE:
{
SEND_STRING dvPRODIGY, "13"
}
}

Any tips would be greatly appreciated.

Comments

  • Joe HebertJoe Hebert Posts: 2,159
    What is the range low and range high settings of the bargraph?
    By default they are 0 and 255.
    Try changing the high range from 255 to 100 and see if that gets you the results you are looking for.
  • I already changed them.
    The presets work in 0 - 100, but the ramp up/down acts like it is 0 - 255.
    When I try to times the ramps, it makes it go off the bargraph.
    thx, though.
  • During your ramps, there is no correlation between what is actually going on in the Prodigy and your bargraph feedback. You are telling the prodigy to ramp up, at its own rate, but faking the feedback in code. You can get close enough, but it's not 100% It is possible to get the exact values from a prodigy by polling the device. See http://www.amx.com/techdocs/0431090.pdf for info on the commands. It is trickier than fake feedback, but should give accurate results.

    As far as the bargraphs being accurate for presets but not ramps, if the range high is set to 100 as you state, there shouldn't be a difference since your code limits the HOUSE var to 100.
  • I'll check it out,
    thanks for the help.
Sign In or Register to comment.