Home AMX User Forum NetLinx Studio

Integera DTR volume level problem

This is the section of code that handles the volume feedback from the Integra DTR-9.9 that I am using.
Active(Find_String(cData,'!1MVL',1)):		/// Volume Level
	    {
		debug("'Found volume level status message'")
		Remove_String(cData,'!1MVL',1)
		cVol = Left_String(cData,2)
		sReceiver.Volume = Atoi(cVol)
		Send_Level aTPS,1,sReceiver.Volume
	    }

The problem is when I do a Hold[1,Repeat]: the volume level updates fine for a second or two then it drops down to a to 0 or 2.

Any ideas on what I am doing wrong?

Comments

  • mpullinmpullin Posts: 949
    The Integra delivers its volume level in ASCII hexadecimal format, from $00 to $64. ($64 = 100)

    You want to use hextoi() when storing its volume, not atoi().

    What probably happens is the volume you're getting back is at something like '27', then goes up to '28', then goes up to '29', then it gets to '2A', which the atoi() function interprets as 2 and not 42.
  • ondrovicondrovic Posts: 217
    Matt,

    You are the man, that is exactly what is happening. Thanks for the quick response. I will try changing it and see what happens.


    Thanks

    Chris Ondrovic
Sign In or Register to comment.