Home AMX General Discussion

Define Constants (DVD ir functions) Axcent program

KouyaKouya Junior MemberPosts: 60
What's a simpler way? I made constants out of all the IR functions for a dvd player (example zoom, AB, subtitle...etc)

In Define Program I assigned some buttons as

PUSH[TP,230] (*AXT-EL+ *)
PUSH[RCVR_1,133] (*TXC-16*)
PUSH[RCVR_2,197] (*TXC-16*)
PUSH[RCVR_2,229] (*TXC-16*)
{
PULSE[3,dvd_MenuReturn]
}

I want to assign all the contants to buttons on a new page I built for the TP.

Do I have too write PUSH and PULSE statements for each function?

Thanks
Brian

Comments

  • DHawthorneDHawthorne Junior Member Posts: 4,584
    For IR devices, I use a direct mappig from the IR channel to the button channel. So the simplified version in an Axcent system is:
    IF((PUSH_DEVICE = TP) AND (PUSH_CHANNEL > 0) AND (PUSH_CHANNEL < 100))
    {
        PULSE[DEVICE, PUSH_CHANNEL]
    }
    
    Then all you need do is adjust your panel buttons to have the same channel as the IR code they are meant to trigger.

    Of course, that's the simplified version. Typically, there are several IR devices, and I track in code which is being used so that the IR goes to the proper device; I also use the SEND_COMMAND DEVICE, "'SP', PUSH_CHANNEL version rather than PULSE to take advantage of CTON and queueing IR. In most systems, it's necessary to break the channel block up some too, because not all devices work the same - some may require a TO instead of a PULSE because of the way the fast forward works, for example. So instead of testing for a PUSH_CANNEL between 1 and 100, I'll break it into transports (1-8), numeric buttons (10-19), what I call system buttons (22-26 for volume/mute, 27, 28 for discrete power), and then all the rest up to 100. I put all my source selection and other non-device control buttons over 100.

    It's even simpler in NetLinx. You make an array for your channel ranges (iIR_Buttons here), and your button event can say:
    BUTTON_EVENT [dvTP, iIR_Buttons]
    {
        SEND_COMMAND dvDeck, "'SP', BUTTON.INPUT.CHANNEL" ;
    }
    
    In this example, dvDeck is a DEV variable that holds the currently controlled device. If anything needs special processing, I just break it out in a SELECT/ACTIVE, and use the above line for the default "ACTIVE(TRUE) :" .
  • Chip MoodyChip Moody Junior Member Posts: 727
    Since you're working in Axcess, trying to keep your TP buttons in sequential numerical order is your friend. Forget about constants - load your IR channels into an array, and do something like this:
    DEFINE_VARIABLE
    
    DVDCmd[18]
    
    
    DEFINE_START
    
    (* Example - these are the IR channels from a Panasonic PVD-4745 *)
    (* Command order is Play,Stop,Pause,Chap+,Chap-,Scan+,Scan-,     *)
    (*                  Title,Menu,Return,Up,Down,Left,Right,Enter   *)
    DVDCmd = "1,2,3,54,55,4,5,63,57,53,58,59,60,61,62"
    
    
    DEFINE_PROGRAM
    
    PUSH [TP,21]
    (* ... PUSHes for 22 - 34 here ...*)
    PUSH [TP,35]
    {
      TO [DVD,DVDCmd[PUSH_CHANNEL-20]]
    }
    

    For the RF buttons, it's a bit different as you can't just order the button channels the way you want. In this case, make a "DVDRFCmd" array large enough to cover the span of buttons on the remote, put the IR channel numbers in the array in the right order/positions to match up with the button channel order, putting in zeros in array elements that represent buttons that either aren't used or are used for other functions. When you make your PUSH list for this, make sure to leave out buttons that are used for other functions. Since doing a TO or PULSE of an IR driver channel 0 won't hurt anything, you can probably get away with forgetting to leave PUSHes out...
    PUSH [RF,128]
    (* ... More pushes here ... *)
    PUSH [RF,160]
    {
      TO [DVD,DVDRFCmd[PUSH_CHANNEL-127]]
    }
    

    For the next button remote, do DVDRFCmd2 or something similar, and make another batch of PUSH statements.


    - Chip
  • KouyaKouya Junior Member Posts: 60
    Define Constants (DVD ir functions) Axcent program

    Thanks Dave and Chip,

    I updated the program and got rid of the list constants. I'll load it this week

    It looks alot better without all the push statements

    brian
Sign In or Register to comment.