External Buttons on MVP8400i will not fire IR commands
canuck
Posts: 3
I am having and issue with communication from am MVP8400i using the external buttons (right and select) to an IRL file(from amx database). All the other commands (left, up,down, and the four buttons on the left of the panel all work). The code looks correct as well. I have tried a number of different scenarios to work around this issue in the code but haven’t had any luck. The notification of the push in Netlinx shows the push active and the correct port:channel from both touchpanels.
The external page is on port 8 and the buttons and devices are defined as followed:
(*******************DEFINED DEVICES************************************)
dvSAT_ROOM1 = 5001:15:0 //7
dvDVD_ROOM1 = 5001:14:0 //6
dvSAT_ROOM2 = 5001:16:0 //8
dvDVD_ROOM2 = 5001:13:0 //5
TP1_DEV8 = 10001:8:0 //Theater-1 MVP8400i
TP2_DEV8 = 10002:8:0 //Theater-2 MVP8400i
(*******************DEFINED VARIABLES**********************************)
DEV DEV8_ARRAY[] = {TP1_DEV8,TP2_DEV8}
PERSISTENT INTEGER EXTERNAL_COMMANDS[] = {1,2,22,23,45,46,47,48,49} (* The buttons 48 & 49 are the ones not working, which on the TP is cursor right and select to the DVD and SAT *)
DEFINE_CALL 'FIRE IR' (CURRENT_PANEL,CURRENT_ROOM,CURRENT_BUTTON)
{
SWITCH(CURRENT_ROOM)
{
CASE 1:
{
SEND_STRING 0, "'FIRING CODE IN ROOM 1 FOR DEVICE ',ITOA (TP_ROOM_SOURCE[TP_ROOM_NUMBER[CURRENT_PANEL]])"
SEND_COMMAND ROOM_1_DEVICE_ARRAY[TP_ROOM_SOURCE[TP_ROOM_NUMBER[CURRENT_PANEL]]], "'SP',CURRENT_BUTTON"
}
CASE 2:
{
SEND_STRING 0, "'FIRING CODE IN ROOM 2 FOR DEVICE ',ITOA (TP_ROOM_SOURCE[TP_ROOM_NUMBER[CURRENT_PANEL]])"
SEND_COMMAND ROOM_2_DEVICE_ARRAY[TP_ROOM_SOURCE[TP_ROOM_NUMBER[CURRENT_PANEL]]], "'SP',CURRENT_BUTTON"
}
}
}
Any help would be greatly appreciated. These two buttons are the last items needed to complete the project.
-Peter
The external page is on port 8 and the buttons and devices are defined as followed:
(*******************DEFINED DEVICES************************************)
dvSAT_ROOM1 = 5001:15:0 //7
dvDVD_ROOM1 = 5001:14:0 //6
dvSAT_ROOM2 = 5001:16:0 //8
dvDVD_ROOM2 = 5001:13:0 //5
TP1_DEV8 = 10001:8:0 //Theater-1 MVP8400i
TP2_DEV8 = 10002:8:0 //Theater-2 MVP8400i
(*******************DEFINED VARIABLES**********************************)
DEV DEV8_ARRAY[] = {TP1_DEV8,TP2_DEV8}
PERSISTENT INTEGER EXTERNAL_COMMANDS[] = {1,2,22,23,45,46,47,48,49} (* The buttons 48 & 49 are the ones not working, which on the TP is cursor right and select to the DVD and SAT *)
DEFINE_CALL 'FIRE IR' (CURRENT_PANEL,CURRENT_ROOM,CURRENT_BUTTON)
{
SWITCH(CURRENT_ROOM)
{
CASE 1:
{
SEND_STRING 0, "'FIRING CODE IN ROOM 1 FOR DEVICE ',ITOA (TP_ROOM_SOURCE[TP_ROOM_NUMBER[CURRENT_PANEL]])"
SEND_COMMAND ROOM_1_DEVICE_ARRAY[TP_ROOM_SOURCE[TP_ROOM_NUMBER[CURRENT_PANEL]]], "'SP',CURRENT_BUTTON"
}
CASE 2:
{
SEND_STRING 0, "'FIRING CODE IN ROOM 2 FOR DEVICE ',ITOA (TP_ROOM_SOURCE[TP_ROOM_NUMBER[CURRENT_PANEL]])"
SEND_COMMAND ROOM_2_DEVICE_ARRAY[TP_ROOM_SOURCE[TP_ROOM_NUMBER[CURRENT_PANEL]]], "'SP',CURRENT_BUTTON"
}
}
}
Any help would be greatly appreciated. These two buttons are the last items needed to complete the project.
-Peter
0
Comments
However, on a completely different topic, I would advise against using the PERSISTENT keyword on a button channel array. CONSTANT would be a better choice, but even that is unecessary ... VOLATILE is more than sufficient since the array is initialized when it's declared. Not only is PERSISTENT entirely unnecessary, but there is far less memory available for persistent and non-volatile variables, and if you are in the habit of doing this, you might run out.
In fact, it's entirely possible, now that I think about it, that this is your problem. Once you declare a variable PERSISTENT, it won't change even if you re-declare the values. So, if your original button array had other values for those buttons, and you edited them, the PERSISTENT keyword will keep them at the original value. Only if you change the size of a PERSISTENT array will it be re-initialized. You can check it easily enough by putting the array in a WATCH list in debug, and seeing if the values are correct there.
Dave - thank you very much for the info. Your detail is very much appreciated. I'll give it a try.
Dave,
Thank you so much for your assistance. I explained your solution to my programmer, he implemented the use of 'volatile' in place of 'persistent', and was successful. 6-8 hours of troubleshooting solved in minutes with the assistance of my fellow members on AMX forums. What a relief.
Thanks again.
-Todd