Cable Box weirdness
Joe
Posts: 99
Okay, I am totally clueless on this one. I have a friend with a new cable box (don't know the make/model, but I captured the IRs myself). I have close to 70 presets on the touchpanel (MVP-8400) and some work, some do not. To clarify, here's the call, an example of a favorite channel and the processing code:
Call based on button press:
BUTTON_EVENT[TP,DSS_CHANNELS]
{
PUSH:
{
SELECT_DSS_VID (BUTTON.INPUT.CHANNEL-300)
}
}
A favorite channel:
DSS_VIDEO[12].CH_NUM = 1355 // CNBC
And the function:
DEFINE_FUNCTION SELECT_DSS_VID (INTEGER DSS_I)
{
STACK_VAR CHAR DSS_SELECT[4]
STACK_VAR INTEGER DSS_NUM
DSS_SELECT = ITOA(DSS_VIDEO[DSS_I].CH_NUM)
DSS_NUM = DSS_VIDEO[DSS_I].CH_NUM
dvI1=LEFT_STRING(DSS_SELECT,1)
SEND_STRING 0,"'DSS IDX DIGIT 1 = ',dvI1"
REMOVE_STRING(DSS_SELECT,(dvI1),1)
dvI2=LEFT_STRING(DSS_SELECT,1)
SEND_STRING 0,"'DSS IDX DIGIT 2 = ',dvI2"
REMOVE_STRING(DSS_SELECT,(dvI2),1)
dvI3=LEFT_STRING(DSS_SELECT,1)
SEND_STRING 0,"'DSS IDX DIGIT 3 = ',dvI3"
REMOVE_STRING(DSS_SELECT,(dvI3),1)
dvI4=LEFT_STRING(DSS_SELECT,1)
SEND_STRING 0,"'DSS IDX DIGIT 4 = ',dvI4"
IF (DSS_NUM<10)
{
PULSE[DSS, 10]
WAIT 3
PULSE[DSS, 10]
WAIT 6
PULSE[DSS, 10]
WAIT 9
PULSE[DSS, (ATOI(dvI1)+10)]
}
ELSE IF ((DSS_NUM>=10) AND (DSS_NUM<100))
{
PULSE[DSS, 10]
WAIT 3
PULSE[DSS, 10]
WAIT 6
PULSE[DSS, (ATOI(dvI1)+10)]
WAIT 9
PULSE[DSS, (ATOI(dvI2)+10)]
}
ELSE IF ((DSS_NUM>=100) AND (DSS_NUM<1000))
{
PULSE[DSS, 10]
WAIT 3
PULSE[DSS, (ATOI(dvI1)+10)]
WAIT 6
PULSE[DSS, (ATOI(dvI2)+10)]
WAIT 9
PULSE[DSS, (ATOI(dvI3)+10)]
}
ELSE
{
PULSE[DSS, (ATOI(dvI1)+10)]
WAIT 3
PULSE[DSS, (ATOI(dvI2)+10)]
WAIT 6
PULSE[DSS, (ATOI(dvI3)+10)]
WAIT 9
PULSE[DSS, (ATOI(dvI4)+10)]
}
}
Now the strange part...If the cable channel has 2 identical digits next to each other, it only pulses it once. The channel above will result in 135. Channel 1003 will give me 103. If all digits are different, or don't have identical consecutive numbers, it takes just fine. Even stranger, if I watch the diagnostics and telnet, it shows all 4 pulses going out, and the variables all change according to the selected channel.
I've tried adjusting the waits between digits, no luck. I can go to the keypad, press '1111' very quickly, and it will work.
Any ideas?
Thanks,
Joe
Call based on button press:
BUTTON_EVENT[TP,DSS_CHANNELS]
{
PUSH:
{
SELECT_DSS_VID (BUTTON.INPUT.CHANNEL-300)
}
}
A favorite channel:
DSS_VIDEO[12].CH_NUM = 1355 // CNBC
And the function:
DEFINE_FUNCTION SELECT_DSS_VID (INTEGER DSS_I)
{
STACK_VAR CHAR DSS_SELECT[4]
STACK_VAR INTEGER DSS_NUM
DSS_SELECT = ITOA(DSS_VIDEO[DSS_I].CH_NUM)
DSS_NUM = DSS_VIDEO[DSS_I].CH_NUM
dvI1=LEFT_STRING(DSS_SELECT,1)
SEND_STRING 0,"'DSS IDX DIGIT 1 = ',dvI1"
REMOVE_STRING(DSS_SELECT,(dvI1),1)
dvI2=LEFT_STRING(DSS_SELECT,1)
SEND_STRING 0,"'DSS IDX DIGIT 2 = ',dvI2"
REMOVE_STRING(DSS_SELECT,(dvI2),1)
dvI3=LEFT_STRING(DSS_SELECT,1)
SEND_STRING 0,"'DSS IDX DIGIT 3 = ',dvI3"
REMOVE_STRING(DSS_SELECT,(dvI3),1)
dvI4=LEFT_STRING(DSS_SELECT,1)
SEND_STRING 0,"'DSS IDX DIGIT 4 = ',dvI4"
IF (DSS_NUM<10)
{
PULSE[DSS, 10]
WAIT 3
PULSE[DSS, 10]
WAIT 6
PULSE[DSS, 10]
WAIT 9
PULSE[DSS, (ATOI(dvI1)+10)]
}
ELSE IF ((DSS_NUM>=10) AND (DSS_NUM<100))
{
PULSE[DSS, 10]
WAIT 3
PULSE[DSS, 10]
WAIT 6
PULSE[DSS, (ATOI(dvI1)+10)]
WAIT 9
PULSE[DSS, (ATOI(dvI2)+10)]
}
ELSE IF ((DSS_NUM>=100) AND (DSS_NUM<1000))
{
PULSE[DSS, 10]
WAIT 3
PULSE[DSS, (ATOI(dvI1)+10)]
WAIT 6
PULSE[DSS, (ATOI(dvI2)+10)]
WAIT 9
PULSE[DSS, (ATOI(dvI3)+10)]
}
ELSE
{
PULSE[DSS, (ATOI(dvI1)+10)]
WAIT 3
PULSE[DSS, (ATOI(dvI2)+10)]
WAIT 6
PULSE[DSS, (ATOI(dvI3)+10)]
WAIT 9
PULSE[DSS, (ATOI(dvI4)+10)]
}
}
Now the strange part...If the cable channel has 2 identical digits next to each other, it only pulses it once. The channel above will result in 135. Channel 1003 will give me 103. If all digits are different, or don't have identical consecutive numbers, it takes just fine. Even stranger, if I watch the diagnostics and telnet, it shows all 4 pulses going out, and the variables all change according to the selected channel.
I've tried adjusting the waits between digits, no luck. I can go to the keypad, press '1111' very quickly, and it will work.
Any ideas?
Thanks,
Joe
0
Comments
I would recommend to use either manual pulsing by 'CP' and 'SP' commands (see attached code), or using the 'XCHM' and 'XCH' commands.
SEND_COMMAND dvIr,"'XCHM 6'" // XCH mode 6; send always 4 digits, use '0' to fill leading digits
...
SEND COMMAND dvIr,"'XCH 234'" // pulses 0-2-3-4 based on CTON and CTOF settings
!!! XCHM requires that the remote numbers 0..9 are saved on ir file channels 10..19 !!!
Details see NI controller manual or AMX-PI
Both have tha advantage that the time of sending the IR and the pause between the commands can be adjusted individually.
SEND_COMMAND dvIr,"'CTON',3" // send IR code 300ms
SEND_COMMAND dvId,"'CTOF',5" // wait 500ms to the next IR command
The timing can be adjusted at runtime. This timing is handled for each IR port individually.
One last note is that you need the most current device firmware to support the 4-digit XCH mode.
Well, it worked. Thanks Marc, Pete and Dave. I appreciate the help. I found that the 'CTON' and 'CTOF' commands are pretty much necessary to use the 'SP' command. Once I figured that out, it worked perfectly.
Thanks again!
Joe