Home AMX User Forum AMX Technical Discussion

Plasma FWD-42 Sony

Hi,
Can you help me!!!
I control a Plasma Sony FWD-42PV1 in rs-232, for control power and input with feedback i don't have problem, but
How I can control a volume up and down with feedback in the plasma sony? with a AXT-CP pannel
I would control volume up and down with a button and see a feedback in the bargraph

Command Format
1 Header
2 Category
3 Fuction
4 Data1(Length)
5 Data2(Data1)
Check Sum

Check Sum: The total from ?1 to ?5, when value exceeds 255, 1byte of data is confirmed the bottom.

Volume Command Data

command control "$8c,$10,$30,$02, $00-$64 ,check sum"

command enquiry "$83,$10,$30,$ff,$ff,check sum"




thanks for your help

Comments

  • Hi,
    I know this is ugly but maybe it is a start point for you (one of those times when they say "O by the way you need to control volume and you have an hour to do it").

    this is for a NEC so you be able to just change the Hex string in the code below.

    Button_Event [vdvTP,232] //Plasma 1 VOL UP
    {
    HOLD[2,REPEAT]:
    {
    PLAS1VOLLEV = COUNTERLEV1
    PLAS1CKSUM = COUNTERSUM1
    Send_String dvPlas1,"$DF,$80,$60,$7F,$03,$05,$01,(PLAS1VOLLEV),(PLAS1CKSUM)"
    PLAS1DISPLEV = (PLAS1DISPLEV + 1)
    COUNTERLEV1 = (COUNTERLEV1 + $01)
    COUNTERSUM1 = (COUNTERSUM1 + $01)
    }
    }

    Button_Event [vdvTP,233] //Plasma 1 VOL DN
    {
    HOLD[2,REPEAT]:
    {
    PLAS1VOLLEV = COUNTERLEV1
    PLAS1CKSUM = COUNTERSUM1
    Send_String dvPlas1,"$DF,$80,$60,$7F,$03,$05,$01,(PLAS1VOLLEV),(PLAS1CKSUM)"
    PLAS1DISPLEV = (PLAS1DISPLEV - 1)
    COUNTERLEV1 = (COUNTERLEV1 - $01)
    COUNTERSUM1 = (COUNTERSUM1 - $01)
    }
    }


    and in mainline:

    SEND_LEVEL vdvTP,2,PLAS1DISPLEV
  • thanks

    thanks thousand for the help
    and to good to make
  • sorry for another help!!!

    PLAS1VOLLEV
    COUNTERLEV1
    PLAS1CKSUM
    COUNTERSUM1

    This is a variable and so I define in define_variable!?!
    Because I don't understand how the clac cheksum a volume up and down they work..

    Thanks so much
  • dthorsondthorson Posts: 103
    ///////////////////////////////////////////////////////////////////
    // Calculate the checksum that is sent to the plasma
    ///////////////////////////////////////////////////////////////////
    DEFINE_FUNCTION CHAR fnGetCheckSum(CHAR strInput[])
    {
      LOCAL_VAR INTEGER iCommandLength;
      LOCAL_VAR INTEGER iCommandSum;
      LOCAL_VAR INTEGER i;
      LOCAL_VAR CHAR strOutput;
      
      i = 0;
      strOutput = $00;
      iCommandSum = 0;
      iCommandLength = 0;
      
      iCommandLength=LENGTH_STRING(strInput);
      
      FOR(i=1; i<=iCommandLength; i++)	//Add the bytes together
      {
    	iCommandSum = iCommandSum + strInput[i];
      }
      //iCommandSum BAND 255;	//Take the twos compliment, (cut off the extra leading digit, if the checksum is 3 digits long I only need the last two digits, IE 12F = 2F)
      strOutput = type_cast(iCommandSum BAND 255);
      
      RETURN strOutput;
    }
    
    DEFINE_FUNCTION INTEGER fnSonyVolumeRaise(DEV vPlasma, INTEGER iLvl)
    {
      IF(iLvl < iVolMax)
      {
    	iLvl = iLvl + iVolStep
    	fnSonyVolumeSend(vPlasma,iLvl)
      }
      IF([vdvPlasma,ichVolUp]) 
      {
    	WAIT iVolRepeat
    	{
    	  iSonyVolLevel[1] = fnSonyVolumeRaise(vPlasma,iLvl)
    	}
      }
      RETURN iLvl;
    }
    
    DEFINE_FUNCTION INTEGER fnSonyVolumeLower(DEV vPlasma, INTEGER iLvl)
    {
      IF(iLvl > iVolMin)
      {
    	iLvl = iLvl - iVolStep
    	fnSonyVolumeSend(vPlasma,iLvl)
      }
      IF([vdvPlasma,ichVolDn]) 
      {
    	WAIT iVolRepeat
    	{
    	  iSonyVolLevel[1] = fnSonyVolumeLower(vPlasma,iLvl)
    	}
      }
      RETURN iLvl;
    }
    
    
    DEFINE_FUNCTION INTEGER fnSonyVolumeSend(DEV vPlasma, INTEGER iLvl)
    {
      LOCAL_VAR INTEGER  iLOOP, iCHKSUM 
      
      IF(iLvl > iVolMin AND iLvl < iVolMax)
      {
    	iLOOP = 1
    	iCHKSUM = 0
    	
    	
    	cSonyVolCmd = "cSonyVolCmdHdr,iSonyVolLevel[1]"
    	cCheckSum = fnGetCheckSum(cSonyVolCmd)
    	
    	IF(iSonyPlasmaDebugOn) SEND_STRING 0,"'Sony PlasmaDebug: Full VolCmd: ',fnPrintHex("cSonyVolCmd,cCheckSum")" ;
    	
    	SEND_STRING dvPlasma,"cSonyVolCmd,cCheckSum"
    	
    	SEND_LEVEL vPlasma,ilvlVolume,iLvl
    	
    	//SEND_STRING dvPlasma,cSonyVolumeQuery
    	//iSonyQueryFlag = 3
      }
      RETURN iLvl;
    }
    
  • Other typical way to "cut" the upper bits of checksum:
    CHAR ChkByte
    INTEGER ChkSum // may be >255
    ...
    ChkByte = TYPE_CAST(ChkSum % 256) // modulo
    
    // btw - if you need the High and Low bytes of a checksum
    ChkByteHigh = ChkSum / 256
    ChkByteLow = ChkSum % 256
    
Sign In or Register to comment.