Home AMX User Forum AMX Technical Discussion

Dms Difficulties

hi guys, im having a problem..had to reprogram a house(NXI) that kept falling offline(too many acrobatics in code)

there is a sony 300 disc changer and it has to be controlled via DMS...
the specific application is pressing a "hundreds" button to increment/cycle the hundreds digit from 0 to 3, and so on for tens and ones.. after each increment it will(should but its not) update the dms display with the new digits.

im pulling my hair out cause i cant seem to make it work..
DEFINE_VARIABLE

char DMS8SelectedDisc[] = {0,0,0}  //hundred,tens,ones
sinteger nDMS8hundreds = 0
sinteger nDMS8tens = 0
sinteger nDMS8ones = 0


//////////////////////////////////////////////////
define_event

button_event [vdvDMS8,DMS8_CDJUKE_HUNDREDS]
{	
    Push:
    {
        if (nDMS8hundreds == 3)
	{
	    nDMS8hundreds = -1 
	}
	nDMS8hundreds = nDMS8hundreds+1
	DMS8SelectedDisc[1]= itoa(nDMS8hundreds)
	//SEND_COMMAND vdvDMS8, "'@TXT',itoa(DMS8_CDJUKE_DISC_NUM_SELECT_DISPLAY),'Play #',',',DMS8SelectedDisc[0],DMS8SelectedDisc[1],DMS8SelectedDisc[2]"
	SEND_COMMAND vdvDMS8, "'TEXT',itoa(DMS8_CDJUKE_DISC_NUM_SELECT_DISPLAY),'-Play #',DMS8SelectedDisc[1],DMS8SelectedDisc[2],DMS8SelectedDisc[3]"
			    //"'TEXT<vt channel>-<text>'"
	send_string 0,itoa(nDMS8hundreds)
	send_string 0,ITOA(DMS8SelectedDisc[])
	
	WAIT 3
	SEND_COMMAND vdvDMS8, 'PAGE-(CURRENT)'

    }
}

//do not put any code after this line
(*cat5coaxrgb*)

any suggestions, pointers? please
thanx in advance
Paul

Comments

  • HARMAN_icraigieHARMAN_icraigie Technical Trainer II, Harman Professional University Posts: 610
    Do you have DMS8_CDJUKE_DISC_NUM_SELECT_DISPLAY defined within the range of the array of VT channel numbers that gets passed into the module? I was also going to add that you need to refresh the page but your already doing that.
  • paradigmpaulparadigmpaul Junior Member Posts: 24
    solution

    as it turns out i did not have my array declared properly...


    char DMS8SelectedDisc[3][1] = {'0','0','0'} //hundred,tens,ones is how it should have been..

    cheers
  • paradigmpaulparadigmpaul Junior Member Posts: 24
    Stuck on my learning curve

    This is a follow up on my dms difficulties post from the other day...
    for my cd juke interface i have the text updating on the DMS...
    by using the klugy dms interface the user can press hundreds, tens or ones to increment the display with "play#_ _ _" then when they press that button if selected disc was 123 , I need to send ir pulses as follows,

    "Disc-Del"//puts CDJUKE into #entry mode
    "1"//hundreds digit
    "2"//tens digit
    "3"//ones digit
    "Enter"//plays the selected

    DEFINE_CONSTANT
    // {{NSX_DEFINE_CONSTANT
    IR_MEDIA_SONY_CD_cd1_play           = 1
    IR_MEDIA_SONY_CD_cd1_stop           = 2
    IR_MEDIA_SONY_CD_cd1_pause          = 3
    IR_MEDIA_SONY_CD_cd1_ams_1            = 4
    IR_MEDIA_SONY_CD_cd1_ams_2          = 5
    IR_MEDIA_SONY_CD_cd1_NEXT                = 6
    IR_MEDIA_SONY_CD_cd1_PREV                = 7
    IR_MEDIA_SONY_CD_cd1_power          = 9
    IR_MEDIA_SONY_CD_cd1_100            = 10
    IR_MEDIA_SONY_CD_cd1_1              = 11/////////
    IR_MEDIA_SONY_CD_cd1_2_abc          = 12//////////
    IR_MEDIA_SONY_CD_cd1_3_def          = 13//////////////
    IR_MEDIA_SONY_CD_cd1_4_ghi          = 14////////////////
    IR_MEDIA_SONY_CD_cd1_5_jkl          = 15//////////////
    IR_MEDIA_SONY_CD_cd1_6_mno          = 16/////////////////
    IR_MEDIA_SONY_CD_cd1_7_qrs          = 17/////////////////
    IR_MEDIA_SONY_CD_cd1_8_tuDN         = 18/////////////
    IR_MEDIA_SONY_CD_cd1_9_wxy          = 19/////////////
    IR_MEDIA_SONY_CD_cd1_10             = 20////////////////////
    IR_MEDIA_SONY_CD_cd1_enter          = 21/////////////////
    IR_MEDIA_SONY_CD_cd1_disc_skip_UP   = 43
    IR_MEDIA_SONY_CD_cd1_disc_skip_DN   = 44
    IR_MEDIA_SONY_CD_cd1_memo_scan      = 45
    IR_MEDIA_SONY_CD_cd1_highlight      = 46
    IR_MEDIA_SONY_CD_cd1_memo_input     = 47
    IR_MEDIA_SONY_CD_cd1_repeat         = 48
    IR_MEDIA_SONY_CD_cd1_check          = 49
    IR_MEDIA_SONY_CD_cd1_clear          = 50
    IR_MEDIA_SONY_CD_cd1_disc_del       = 51///////////////////////////
    IR_MEDIA_SONY_CD_cd1_group_space    = 52
    IR_MEDIA_SONY_CD_cd1_timetextcaps   = 53
    IR_MEDIA_SONY_CD_cd1_mega_xfade     = 54
    IR_MEDIA_SONY_CD_cd1_mega_no_delay  = 55
    IR_MEDIA_SONY_CD_cd1_mega_hit_list  = 56
    IR_MEDIA_SONY_CD_cd1_continue       = 57
    IR_MEDIA_SONY_CD_cd1_shuffle        = 58
    IR_MEDIA_SONY_CD_cd1_program        = 59
    // }}NSX_DEFINE_CONSTANT
    
    DMS8_CDJUKE_MEMPRESET_1 =111
    DMS8_CDJUKE_MEMPRESET_2 =112
    DMS8_CDJUKE_MEMPRESET_3 =113
    DMS8_CDJUKE_MEMPRESET_4 =114
    DMS8_CDJUKE_MEMPRESET_5 =115
    DMS8_CDJUKE_HUNDREDS    =116
    DMS8_CDJUKE_TENS	=117
    DMS8_CDJUKE_ONES	=118
    DMS8_CDJUKE_PLAY_DISC_NUM=119
    DMS8_CDJUKE_TRACK_NEXT	=120
    DMS8_CDJUKE_TRACK_PREV	=121
    DMS8_CDJUKE_DISC_NEXT	=122
    DMS8_CDJUKE_DISC_PREV	=123
    DMS8_CDJUKE_PLAY_PAUSE_TOGGLE=124
    DMS8_CDJUKE_STOP	=125
    DMS8_CDJUKE_RANDOM	=126
    
    DMS8_CDJUKE_DISC_NUM_SELECT_DISPLAY = 130  //vt 
    DEFINE_VARIABLE
    
    
    char DMS8SelectedDisc[3][1] = {'0','0','0'}  //hundred,tens,ones
    sinteger nDMS8hundreds = 0
    sinteger nDMS8tens = 0
    sinteger nDMS8ones = 0
    
    DEFINE_EVENT
    
    
    button_event [vdvDMS8,DMS8_CDJUKE_HUNDREDS]
    {	
        Push:
        {
            if (nDMS8hundreds == 3)
    	{
    	    nDMS8hundreds = -1 
    	}
    	nDMS8hundreds = nDMS8hundreds+1
    	DMS8SelectedDisc[1]= itoa(nDMS8hundreds)
    	SEND_COMMAND vdvDMS8, "'TEXT',itoa(DMS8_CDJUKE_DISC_NUM_SELECT_DISPLAY),'-Play #',DMS8SelectedDisc[1],DMS8SelectedDisc[2],DMS8SelectedDisc[3]"
    	//send_string 0,itoa(nDMS8hundreds)
    	//send_string 0,ITOA(DMS8SelectedDisc[1]
    	//send_string 0,ITOA(DMS8SelectedDisc[2]
    	//send_string 0,ITOA(DMS8SelectedDisc[3]
    	WAIT 3
    	SEND_COMMAND vdvDMS8, 'PAGE-(CURRENT)'
    
        }
    }
    button_event [vdvDMS8,DMS8_CDJUKE_TENS]
    {	
        Push:
        {
            if (nDMS8tens == 10)
    	{
    	    nDMS8tens = -1 
    	}
    	nDMS8tens = nDMS8tens+1
    	DMS8SelectedDisc[2]= itoa(nDMS8tens)
    	//SEND_COMMAND vdvDMS8, "'@TXT',itoa(DMS8_CDJUKE_DISC_NUM_SELECT_DISPLAY),'Play #',',',DMS8SelectedDisc[0],DMS8SelectedDisc[1],DMS8SelectedDisc[2]"
    	SEND_COMMAND vdvDMS8, "'TEXT',itoa(DMS8_CDJUKE_DISC_NUM_SELECT_DISPLAY),'-Play #',DMS8SelectedDisc[1],DMS8SelectedDisc[2],DMS8SelectedDisc[3]"
    			    //"'TEXT<vt channel>-<text>'"
    	//send_string 0,itoa(nDMS8hundreds)
    	//send_string 0,ITOA(DMS8SelectedDisc[1]
    	//send_string 0,ITOA(DMS8SelectedDisc[2]
    	//send_string 0,ITOA(DMS8SelectedDisc[3]
    	WAIT 3
    	SEND_COMMAND vdvDMS8, 'PAGE-(CURRENT)'
    
        }
    }
    button_event [vdvDMS8,DMS8_CDJUKE_ONES]
    {	
        Push:
        {
            if (nDMS8ones == 10)
    	{
    	    nDMS8ones = -1 
    	}
    	nDMS8ones = nDMS8ones+1
    	DMS8SelectedDisc[3]= itoa(nDMS8ones)
    	SEND_COMMAND vdvDMS8, "'TEXT',itoa(DMS8_CDJUKE_DISC_NUM_SELECT_DISPLAY),'-Play #',DMS8SelectedDisc[1],DMS8SelectedDisc[2],DMS8SelectedDisc[3]"
    	//send_string 0,itoa(nDMS8hundreds)
    	//send_string 0,ITOA(DMS8SelectedDisc[1]
    	//send_string 0,ITOA(DMS8SelectedDisc[2]
    	//send_string 0,ITOA(DMS8SelectedDisc[3]
    	WAIT 3
    	SEND_COMMAND vdvDMS8, 'PAGE-(CURRENT)'
    
        }
    }
    ///////////////
    button_event [vdvDMS8,DMS8_CDJUKE_PLAY_DISC_NUM]
    {	
        Push:
        {
    	integer digit
            integer d;
    	
    	pulse[dvARCDJUKE,51]//disc  button
    	send_string 0,"'cd select number-h:',DMS8SelectedDisc[1][1]"
    	send_string 0,"'cd select number-t:',DMS8SelectedDisc[2][1]"
    
    	send_string 0,"'cd select number-o:',DMS8SelectedDisc[3][1]"
    
    	    digit=(DMS8SelectedDisc[1][1])
    	    send_string 0,"'digit-h:',digit"
    
    	    switch(digit)
    	    {
    		case '1':
    		{
    		pulse[dvARCDJUKE,IR_MEDIA_SONY_CD_cd1_1]
    		}
    		case '2':
    		{
    		pulse[dvARCDJUKE,IR_MEDIA_SONY_CD_cd1_2_abc]
    
    		}
    		case '3':
    		{
    		pulse[dvARCDJUKE,IR_MEDIA_SONY_CD_cd1_3_def]
    
    		}
    		
    	    
    	    }
    	    digit=(DMS8SelectedDisc[2][1])
    	     send_string 0,"'digit-t:',digit"
    	    switch(digit)
    	    {
    		case '1':
    		{
    		pulse[dvARCDJUKE,IR_MEDIA_SONY_CD_cd1_1]
    		}
    		case '2':
    		{
    		pulse[dvARCDJUKE,IR_MEDIA_SONY_CD_cd1_2_abc]
    
    		}
    		case '3':
    		{
    		pulse[dvARCDJUKE,IR_MEDIA_SONY_CD_cd1_3_def]
    
    		}
    		case '4':
    		{
    		pulse[dvARCDJUKE,IR_MEDIA_SONY_CD_cd1_4_ghi]
    
    		}
    		case '5':
    		{
    		pulse[dvARCDJUKE,IR_MEDIA_SONY_CD_cd1_5_jkl]
    
    		}
    		case '6':
    		{
    		pulse[dvARCDJUKE,IR_MEDIA_SONY_CD_cd1_6_mno]
    
    		}
    		case '7':
    		{
    		pulse[dvARCDJUKE,IR_MEDIA_SONY_CD_cd1_7_qrs]
    
    		}
    		case '8':
    		{
    		pulse[dvARCDJUKE,IR_MEDIA_SONY_CD_cd1_8_tuDN]
    
    		}
    		case '9':
    		{
    		pulse[dvARCDJUKE,IR_MEDIA_SONY_CD_cd1_9_wxy]
    
    		}
    		case '0':
    		{
    		pulse[dvARCDJUKE,IR_MEDIA_SONY_CD_cd1_10]
    
    		}
    	    }
    	    digit=(DMS8SelectedDisc[3][1])
    	    send_string 0,"'digit-o:',digit"
    	    switch(digit)
    	    {
    		case '1':
    		{
    		pulse[dvARCDJUKE,IR_MEDIA_SONY_CD_cd1_1]
    		}
    		case '2':
    		{
    		pulse[dvARCDJUKE,IR_MEDIA_SONY_CD_cd1_2_abc]
    
    		}
    		case '3':
    		{
    		pulse[dvARCDJUKE,IR_MEDIA_SONY_CD_cd1_3_def]
    
    		}
    		case '4':
    		{
    		pulse[dvARCDJUKE,IR_MEDIA_SONY_CD_cd1_4_ghi]
    
    		}
    		case '5':
    		{
    		pulse[dvARCDJUKE,IR_MEDIA_SONY_CD_cd1_5_jkl]
    
    		}
    		case '6':
    		{
    		pulse[dvARCDJUKE,IR_MEDIA_SONY_CD_cd1_6_mno]
    
    		}
    		case '7':
    		{
    		pulse[dvARCDJUKE,IR_MEDIA_SONY_CD_cd1_7_qrs]
    
    		}
    		case '8':
    		{
    		pulse[dvARCDJUKE,IR_MEDIA_SONY_CD_cd1_8_tuv]
    
    		}
    		case '9':
    		{
    		pulse[dvARCDJUKE,IR_MEDIA_SONY_CD_cd1_9_wxy]
    
    		}
    		case '0':
    		{
    		pulse[dvARCDJUKE,IR_MEDIA_SONY_CD_cd1_10]
    
    		}
    	    }
    	    
    	    
    	wait 5
    	PULSE[dvARCDJUKE,21]//enter
    	
        
        }
    }
    
    

    while watching my diagnostics and notifications i see the strings i am send to the master for "DMS8SelectedDisc[3][1]" and the "digit" currently being evaluated.

    but for some reason(probably inexperience/sloppy code) it never fires

    "Disc-Del"//puts CDJUKE into #entry mode
    "1"//hundreds digit
    "2"//tens digit
    "3"//ones digit
    "Enter"//plays the selected

    any advice would be most appreciated..
    cheers
    Paul
  • paradigmpaulparadigmpaul Junior Member Posts: 24
    Problem solved..

    I changed the type of array from char to integer...and fixed my single quotes..
    end result, it works...
Sign In or Register to comment.