Home AMX User Forum NetLinx Studio

Motorola DCT6200 Sending 3 Digit Channels

I am trying to send 3 digit channels (i.e. 363) to a DCT6200 and the box is only receiving the last two digits (63). I am using a numric keypad with 21 as the enter. I've the XCHM set to 1 with a CTON of 10. I've tried XCMH at 0 also. Same problem
Anybody else have the same problem?


DATA_EVENT[dvCable]
{
ONLINE:
{
SEND_COMMAND dvCable, "'SET MODE IR'"
//SEND_COMMAND dvCable, "'CARON'"
SEND_COMMAND dvCable,"'CTOF',6"
SEND_COMMAND dvCable,"'XCHM-1'"

}
}


BUTTON_EVENT[dvTP_CABLE,10]
BUTTON_EVENT[dvTP_CABLE,11]
BUTTON_EVENT[dvTP_CABLE,12]
BUTTON_EVENT[dvTP_CABLE,13]
BUTTON_EVENT[dvTP_CABLE,14]
BUTTON_EVENT[dvTP_CABLE,15]
BUTTON_EVENT[dvTP_CABLE,16]
BUTTON_EVENT[dvTP_CABLE,17]
BUTTON_EVENT[dvTP_CABLE,18]
BUTTON_EVENT[dvTP_CABLE,19]
BUTTON_EVENT[dvTP_CABLE,20]
BUTTON_EVENT[dvTP_CABLE,21]
{
PUSH:
{
LOCAL_VAR INTEGER TRACK
LOCAL_VAR INTEGER alpha

IF(BUTTON.INPUT.CHANNEL<20)
{
SWITCH(TRACK)
{
CASE 0:
{
alpha=2
nCBLCHNUM = BUTTON.INPUT.CHANNEL%10
SEND_COMMAND dvTP_CABLE,"'^TXT-1,0,',ITOA(nCBLCHNUM)"
TRACK ++
}
CASE 1:
{
nCBLCHNUM = (nCBLCHNUM*10) + (BUTTON.INPUT.CHANNEL%10)
SEND_COMMAND dvTP_CABLE,"'^TXT-1,0,',ITOA(nCBLCHNUM)"
TRACK ++
}
CASE 2:
{
nCBLCHNUM = (nCBLCHNUM*10) + (BUTTON.INPUT.CHANNEL%10)
SEND_COMMAND dvTP_CABLE,"'^TXT-1,0,',ITOA(nCBLCHNUM)"
TRACK ++
}
} }
ELSE
{
SELECT
{
ACTIVE (BUTTON.INPUT.CHANNEL==21):
{
SET_PULSE_TIME (10)
SEND_COMMAND dvCable, "'XCH',ITOA(nCBLCHNUM)"
SET_PULSE_TIME (5)
}
}
nCBLCHNUM = 0
SEND_COMMAND dvTP_CABLE, "'^TXT-1,0,'"
TRACK = 0
}
}
}

Comments

  • viningvining Posts: 4,368
    Using XCH commands isn't really appropriate for simulating a single numeric button push since its intended for preset channels where the channels number is stored and by a single button push you send the complete command with the complete channel number. It appears you're trying to store each button push in the code and then when a full channel number is reached you then send a string. Of course I didn't really study your code.

    Check out the thread listed beow and its use of the 'SP' command which is best suited for sending a single IR code. For pushing numeric buttons for direct channel selection it's best to issue the IR as each button is pushed just like the real remote. If you're trying to display a channel on a TP to store as a preset or to display on a TP and then pushing "select" or "Go To Channel" button then XCH would be fine but I think most folks here would still use the "SP" command as illustrated in the link.

    http://amxforums.com/showthread.php?t=125&highlight=sending+ir
  • davegrovdavegrov Posts: 114
    SP Does Not Work

    This piece of code lets me enter a know channel such, 363 (NBC Station HD) in a text box and then send the value of the text box to the Cable Box. When I enter 363 it enters the text box and when it goes to the Cable box it looses its first digit.
  • viningvining Posts: 4,368
    I think the problem may be the space missing after the 'XCH' command:
     "'XCH',ITOA(nCBLCHNUM)" 
    should be;
     "'XCH ',ITOA(nCBLCHNUM)" 
    

    If I were writing this and using XCH I would get rid of all the math and do it like this:
    {
    
    DATA_EVENT[dvCable]
         {
         ONLINE:
    	  {
    	  SEND_COMMAND dvCable,"'PTOF',1000" ;//time = 0 - 255. Given in 1/10ths of a second. Default is 15 (1.5 seconds).
    	  SEND_COMMAND dvCable,'SET MODE IR' ;  // sets IR port 7 to IR mode
    	  //SEND_COMMAND dvCable,'SET IO LINK 1' ;//1 sets IR port to link with I/O channel 1 (port 17)
    	  SEND_COMMAND dvCable,'CARON' ;   //Enable the IR carrier signals (default).
    	  SEND_COMMAND dvCable,"'CTON',2" ;//time = 0 - 255. Given in 1/10ths of a second. Default is 5 (0.5 seconds).
    	  SEND_COMMAND dvCable,"'CTOF',2" ;//time = 0 - 255. Given in 1/10ths of a second. Default is 5 (0.5 seconds).
    	  SEND_COMMAND dvCable,"'XCHM-1'" ;
    	  }
    
    
    
    
         PUSH:
    	  {
    	  LOCAL_VAR CHAR cAlpha[3] ;
    
    	  IF(BUTTON.INPUT.CHANNEL<20) 
    	       {
    	       CANCEL_WAIT 'TIME_OUT' ;
    	       cAlpha = "cAlpha,ITOA(BUTTON.INPUT.CHANNEL)" ; 
    	       SEND_COMMAND dvTP_CABLE,"'^TXT-1,0,',cAlpha" ;
    	       WAIT 40 'TIME_OUT'
    		    {
    		    cAlpha = '' ;
    		    SEND_COMMAND dvTP_CABLE,"'^TXT-1,0,',cAlpha" ;
    		    }
    	       }
    	  ELSE IF(BUTTON.INPUT.CHANNEL==21):
    	       {
    	       CANCEL_WAIT 'TIME_OUT' ;
    	       SEND_COMMAND dvCable, "'XCH ',cAlpha" ;
    	       WAIT 5
    		    {
    		    cAlpha = '' ;
    		    SEND_COMMAND dvTP_CABLE,"'^TXT-1,0,',cAlpha" ;
    		    }
    	       }
    	  } 
         }
    

    I would also add a button to clear the text field w/o actually selecting the channel and maybe a back button. But I would only do this for preset entries while for direct channel changing I'd do a single digit at a time just like a remote control.
  • I'll second the space after the XCH command being the culprit. Here's another thread from a couple of years ago where the same thing happened: http://www.amxforums.com/showthread.php?t=1250&highlight=xch

    When command was used without the space the first number wasn't being sent out, or 0 was being sent in it's place.

    --John
  • davegrovdavegrov Posts: 114
    Fixed the Issue

    After reading AMX PI and looking at the instructions I realized I needed the space. ("XCH ,") I made the changes but still no luck. I searched the Forum and found John's previous post and got it working. Thank You both. Looks like there are still some IR firmware issues.
  • davegrovdavegrov Posts: 114
    Ooops

    The SPACE worked also. Thank You both very much.
  • viningvining Posts: 4,368
    Also I think the use of SET_PULSE_TIME is not doing anything for you. AFAIK that just affects the lenght of time of the "PULSE" command and for XCH you should send CTON & CTOF in your ONLINE DATA_EVENT to set time time the IR signal is sent and the interval between each signal. These command are also port specific so you set it and forget.
Sign In or Register to comment.