Home AMX User Forum NetLinx Studio

panasonic projector - lamp hour query

hi i have a project include to get the lamp hour from the projector. anyone know what is the command for that? i searched on the web and it seems only got the lamp status.

please post as well about the reply string format so i could work on it to get substring. thankyou very much !!!!!!!

Comments

  • ericmedleyericmedley Posts: 4,177
    hi i have a project include to get the lamp hour from the projector. anyone know what is the command for that? i searched on the web and it seems only got the lamp status.

    please post as well about the reply string format so i could work on it to get substring. thankyou very much !!!!!!!

    Please post the model number of the projector
  • dthorsondthorson Posts: 103
    Panasonic projectors protocol are pretty similar.

    VOLATILE INTEGER iPROJ_DEBUG
    
    NON_VOLATILE CHAR cPROJ_CMDS[60][25]
    VOLATILE CHAR cPROJ_RX[50]
    VOLATILE INTEGER iProjectorPower
    VOLATILE INTEGER iProjectorMute
    PERSISTENT CHAR cLAMP_HOURS_RX[3][2][6]
    PERSISTENT cLAMP_MINUTES_RX[3][2][2]
    INTEGER iLAMP_QUERY_SENT[2][3]
    INTEGER iPOWER_QUERY_SENT[3]
    
    
    NON_VOLATILE INTEGER iPROJ_WARMING[3]
    NON_VOLATILE INTEGER iPROJ_COOLING[3]
    NON_VOLATILE LONG 	 lPROJ_COOL_TIME  = 90000	//90 seconds	*THISE ARE ALSO SET INT THE TP-POPUP TIMEOUT AND BARGRAPH RANGE HIGH
    NON_VOLATILE LONG 	 lPROJ_WARM_TIME  = 45000	//45 seconds	*THISE ARE ALSO SET INT THE TP-POPUP TIMEOUT AND BARGRAPH RANGE HIGH
    NON_VOLATILE INTEGER iPROJ_COOL_SEC	  = 90		//90 seconds
    NON_VOLATILE INTEGER iPROJ_WARM_SEC	  = 45		//45 seconds
    NON_VOLATILE LONG 	 lPROJ_POWER_TIME = 5000	//Power Query every 5 Seconds
    NON_VOLATILE LONG 	 lPROJ_LAMP_TIME  = 360000	//Lamp Query every hour
    LONG 				 lPROJ_TIME_ARRAY[10]
    NON_VOLATILE INTEGER iPROJ_TIMELINE_TRACKER[]={1,2,3,4,5,6,7,8,9,10,11,12}		//3 PROJ, WARM/COOL/POWER/LAMP TIMELINES
    NON_VOLATILE INTEGER iPROJ_TIMER[3][2]							//3 PROJ, WARM/COOL
    NON_VOLATILE INTEGER iPROJ_INPUT_SEL[3]
    NON_VOLATILE INTEGER iPROJ_INPUT_SIZE[3]
    
    
    INTEGER _LAMP_1 	= 8
    INTEGER _LAMP_2 	= 9
    
    
    cPROJ_CMDS[_PROJ_LAMP1_QUERY]		= 'Q$L:1'      	// QUERY LAMP HOURS
    cPROJ_CMDS[_PROJ_LAMP2_QUERY]		= 'Q$L:2'      	// QUERY LAMP HOURS
    
    
    
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    DEFINE_EVENT //////////////////// Projector Control
    DATA_EVENT[dvPROJ]
    {
    	ONLINE:
    	{
    		SEND_COMMAND dvPROJ,'SET BAUD 9600,N,8,1 485 DISABLE'
    		SEND_COMMAND dvPROJ,'HSOFF'
    		lPROJ_TIME_ARRAY[1]= lPROJ_LAMP_TIME					//START LAMP QUERY TIMELINE
    		TIMELINE_CREATE(iPROJ_TIMELINE_TRACKER[_LAMP_1],lPROJ_TIME_ARRAY,1,TIMELINE_ABSOLUTE,TIMELINE_REPEAT)
    		lPROJ_TIME_ARRAY[1]= lPROJ_POWER_TIME					//START POWER QUERY TIMELINE
    		TIMELINE_CREATE(iPROJ_TIMELINE_TRACKER[_POWER],lPROJ_TIME_ARRAY,1,TIMELINE_ABSOLUTE,TIMELINE_REPEAT)
    		WAIT 50
    		{
    		  lPROJ_TIME_ARRAY[1]= lPROJ_LAMP_TIME					//START LAMP QUERY TIMELINE
    		  TIMELINE_CREATE(iPROJ_TIMELINE_TRACKER[_LAMP_2],lPROJ_TIME_ARRAY,1,TIMELINE_ABSOLUTE,TIMELINE_REPEAT)
    		}
    	}
    	STRING:
    	{
    		LOCAL_VAR char cTrash[50]
    		cPROJ_RX = DATA.TEXT
    
    		IF(FIND_STRING(cPROJ_RX,'PON',1))
    		{
    		  iProjectorPower = 1;
    		  CALL 'SEND_STRING_FEEDBACK'(vdvPROJ,'POWER',ITOA(iProjectorPower));		//FOR RMS Feedback
    		}
    		ELSE IF(FIND_STRING(cPROJ_RX,'POF',1))
    		{
    		  iProjectorPower = 0;
    		  CALL 'SEND_STRING_FEEDBACK'(vdvPROJ,'POWER',ITOA(iProjectorPower));		//FOR RMS Feedback
    		}
    
    		IF(FIND_STRING(cPROJ_RX,'OSH:1',1))		  	{iProjectorMute = 1 }
    		IF(FIND_STRING(cPROJ_RX,'OSH:0',1))		  	{iProjectorMute = 0	}
    
    		IF(LENGTH_STRING(cPROJ_RX >= 3) AND (iPOWER_QUERY_SENT[_PROJ1]=1) )  //Power Query Response
    		{
    			iPOWER_QUERY_SENT[_PROJ1]=0
    			cTrash = REMOVE_STRING(cPROJ_RX,"$02",1)	//Remove up to header
    			IF(LENGTH_STRING(cPROJ_RX) = 4)				//I got good data
    			{
    			  iProjectorPower = ATOI(MID_STRING(cPROJ_RX,3,1))
    			}
    
    		}
    		IF(LENGTH_STRING(cPROJ_RX >= 4) AND (iLAMP_QUERY_SENT[_PROJ1][iLAMP_1]=1) )  //Lamp Query Response
    		{
    			iLAMP_QUERY_SENT[_PROJ1][iLAMP_1]=0
    			cTrash = REMOVE_STRING(cPROJ_RX,"$02",1)
    			cLAMP_HOURS_RX[_PROJ1][iLAMP_1] = LEFT_STRING(cPROJ_RX,4)
    			SEND_LEVEL vdvPROJ,_TP_LVL_LAMP_HOURS1,ATOI(cLAMP_HOURS_RX[_PROJ1][iLAMP_1])
    			SEND_COMMAND vdvProj,"'LAMP 1 HOURS=',cLAMP_HOURS_RX[_PROJ1][iLAMP_1]"
    
    			CALL 'SEND_STRING_FEEDBACK'(vdvPROJ,'LAMPTIME_1',cLAMP_HOURS_RX[_PROJ1][iLAMP_1]);	//FOR RMS Feedback
    			//SEND_COMMAND 10001:1:1,"'^TXT-',10,',1&2,',cLAMP_HOURS_RX";	//-Update Lamp hours
    			//Send_Command vdvTP1,"'TEXT11-',ITOA(cLAMP_HOURS_RX[_PROJ1])"
    		}
    		IF(LENGTH_STRING(cPROJ_RX >= 4) AND (iLAMP_QUERY_SENT[_PROJ1][iLAMP_2]=1) )  //Lamp Query Response
    		{
    			iLAMP_QUERY_SENT[_PROJ1][iLAMP_2]=0
    			cTrash = REMOVE_STRING(cPROJ_RX,"$02",1)
    			cLAMP_HOURS_RX[_PROJ1][iLAMP_2] = LEFT_STRING(cPROJ_RX,4)
    			SEND_LEVEL vdvPROJ,_TP_LVL_LAMP_HOURS2,ATOI(cLAMP_HOURS_RX[_PROJ1][iLAMP_2])
    			SEND_COMMAND vdvProj,"'LAMP 2 HOURS=',cLAMP_HOURS_RX[_PROJ1][iLAMP_2]"
    
    			CALL 'SEND_STRING_FEEDBACK'(vdvPROJ,'LAMPTIME_2',cLAMP_HOURS_RX[_PROJ1][iLAMP_2]);	//FOR RMS Feedback
    			//SEND_COMMAND 10001:1:1,"'^TXT-',10,',1&2,',cLAMP_HOURS_RX";	//-Update Lamp hours
    			//Send_Command vdvTP1,"'TEXT11-',ITOA(cLAMP_HOURS_RX[_PROJ1])"
    		}
    	}
    }
    
    TIMELINE_EVENT[_LAMP_1] //////////////////// PROJECTOR LAMP QUERY *)
    {
      SWITCH(Timeline.Sequence)
      {
    	CASE 1:
    	  {Send_String dvProj,"$02,cPROJ_CMDS[_PROJ_LAMP1_QUERY],$03" iLAMP_QUERY_SENT[_PROJ1][iLAMP_1]=1}
      }
    }
    
    TIMELINE_EVENT[_LAMP_2] //////////////////// PROJECTOR LAMP QUERY *)
    {
      SWITCH(Timeline.Sequence)
      {
    	CASE 1:
    	  {Send_String dvProj,"$02,cPROJ_CMDS[_PROJ_LAMP2_QUERY],$03" iLAMP_QUERY_SENT[_PROJ1][iLAMP_2]=1}
      }
    }
    
Sign In or Register to comment.