Home AMX User Forum AMXForums Archive Threads AMX Hardware

4-digit XCH

'Bout time

... Device Firmware

Dependencies:

* Requires master firmware 3.50.430 or later.

Changes in this Release:

* Fixed issue where serial ports would sometimes drop data.
* Fixed missing button release on MIO-IRRX.
* Fixed issue where serial ports would not receive data.
* Resolved serial port lock ups.
* Fixed some 485 tx/rx problems.
* Support for XCH command for 4 digit channel. New XCH modes 5 & 6 added. These are equivalent to the current modes 1 & 2 except for 4 digit channel numbers.
* Increased speed of I/O detection.
* Added command to enable/disable check for escape sequences in strings being transmitted. Commands are ESCSEQOFF and ESCSEQON. The default behavior is now off (used to be on).
* Fixed IR LED #7.
* Fixed some issues with XCH command.
* Fixed states of IO ports after a reboot.

KIT | 33.11 MB | v. 1.20.7 | 2009-11-06

Comments

  • jazzwyldjazzwyld Posts: 199
    here here. I have a couple lines of code that have been handling that, but it'll be nice to clean it up.
  • ericmedleyericmedley Posts: 4,177
    Tru Dat,

    I've just bypassed the whole thing in favor of my own routine. It'll be nice to go back to using it again.
  • 4 digit channels don't work for me. For example, I send 1804 and my sat receiver display 04 (the firts 2 digit are not received).

    I have firmware 3.50.430 in my master.

    What's wrong in my code :

    DATA_EVENT [SAT_IR]
    {
    ONLINE:
    {
    SEND_COMMAND DATA.DEVICE, "'SET MODE IR'"
    SEND_COMMAND DATA.DEVICE, "'CARON'"

    SEND_COMMAND DATA.DEVICE, "'CTON',2"
    SEND_COMMAND DATA.DEVICE, "'CTOF',2"

    SEND_COMMAND DATA.DEVICE, "'XCHM-5'"
    }
    }

    ...

    BUTTON_EVENT[TP,1804]
    {
    PUSH:
    {
    SEND_COMMAND SAT_IR, "'XCH ', ITOA( BUTTON.INPUT.CHANNEL )"
    }
    }

    Thanks!
  • TurnipTruckTurnipTruck Posts: 1,485
    The device firmware on your NI must be updated to 1.20.07
  • Still not working

    Hey my device firmware is updated to 1.20.7 but still i am not able to fire. Here is my code below
    DATA_EVENT[dvASTVMain]
    {
    ONLINE:
    {
    SEND_COMMAND dvASTVMain,'CARON' //Carrier On
    SEND_COMMAND dvASTVMain,'SET MODE IR' //mode ir
    SEND_COMMAND dvASTVMain,"'CTON',3"

    SEND_COMMAND dvASTVMain,"'CTOF',2"
    SEND_COMMAND dvASTVMain,"'XCHM-5'"



    }

    }
    BUTTON_EVENT [dvTPASTVMainRmsArray,nASTVMainFavbutton]
    {
    PUSH:
    {


    SWITCH(GET_LAST(nASTVMainFavbutton))
    {
    case 1:
    {

    SEND_COMMAND dvASTVMain,"'XCH 40'"

    }
    case 2:
    {

    SEND_COMMAND dvASTVMain,"'XCH 42'"

    }
    case 3:
    {
    SEND_COMMAND dvASTVMain,"'XCHM-5'"
    wait 10
    SEND_COMMAND dvASTVMain,"'XCH 1589'"
    }
    case 4:
    {
    SEND_COMMAND dvASTVMain,"'XCHM-5'"
    wait 10
    SEND_COMMAND dvASTVMain,"'XCH 1590'"
    }
    case 5:
    {
    SEND_COMMAND dvASTVMain,"'XCHM-6'"
    wait 10
    SEND_COMMAND dvASTVMain,"'XCH 1591'"
    }
    case 6:
    {
    SEND_COMMAND dvASTVMain,"'XCHM-6'"
    wait 10
    SEND_COMMAND dvASTVMain,"'XCH 1592'"
    }
    case 7:
    {
    SEND_COMMAND dvASTVMain,"'XCHM 5'"
    wait 10
    SEND_COMMAND dvASTVMain,"'XCH 1593'"
    }
    case 8:
    {
    SEND_COMMAND dvASTVMain,"'XCHM 5'"
    wait 10
    SEND_COMMAND dvASTVMain,"'XCH 1594'"
    }
    }
    }

    }
  • DHawthorneDHawthorne Posts: 4,584
    Perhaps you know this, but please don't be offended if you do; it hasn't come up and surely someone is unaware: the device firmware is only half of the equation. You have to update the master firmware as well.
  • Dave,

    I had made sure that the master firmware is 3.50.439 then upgraded the device firmware but still no luck
  • free code samples

    Hey guys,

    Could someone post some code samples where they have used 4 digit XCH, also the ir file, if its not too much trouble.

    Thanks
  • DHawthorneDHawthorne Posts: 4,584
    I can't say I've tried it yet. The few times I needed it, it wasn't available in the firmware yet, and I just made my own. I haven't seen fit to go back and remove that from my modules that use it yet.
  • Hey Dave,

    Could you send me your function so that i can have a look at it
  • XCH behaving weird in two different masters

    I am trying to understand why XCH is behaving differently in two different masters. Both masters have the same master and device firmware, same include file for the ir device and the same ir file. But in one, the ir devices gets the command as 0001 and in the other one as 1. What's going on

    DATA_EVENT[dvShowBox]
    {
    ONLINE:
    {
    SEND_COMMAND dvShowBox,'CARON' //Carrier On
    SEND_COMMAND dvShowBox,'SET MODE IR' //mode ir
    SEND_COMMAND dvShowBox,"'CTON',3"

    SEND_COMMAND dvShowBox,"'CTOF',2"
    SEND_COMMAND dvShowBox,"'XCHM 6'"



    }

    }

    BUTTON_EVENT [dvTPArrayShowBox,nOSN1P1Btns]
    {
    PUSH:
    {


    SWITCH(GET_LAST(nOSN1P1Btns))
    {
    case 1:
    {

    SEND_COMMAND dvShowBox,"'XCH 44'"

    }
    XCH.PNG 127.6K
  • DHawthorneDHawthorne Posts: 4,584
    Your XCHM syntax is wrong, it needs a dash.

    SEND_COMMAND dvShowBox,"'XCHM-6'"
  • Thanks Dave,

    But somehow even without the dash its working in both the controllers now. I just did a lot of hard power reboots
  • Broken on IRS4?

    Hi,

    I just updated a site to the current master and device firmware in order to accommodate a new cable channel lineup using four digits. Sending IR from internal ports on the NIs works correctly but none of the NXC-IRS4s work, whether in the master's card cage or in a shell. There are two masters in the system: a NI-2000 and an NI-4100. They're now running 3.60.453 and device 1.30.8.

    Before today's update, the XCH command would send digits 2,3,4 of a four digit number. After today's update, the IRS4 cards don't send anything at all for four digit numbers. I can see the command being sent out to the card in Device Notifications so I know it's getting that far. Two and three digit numbers work fine.

    I updated one of the cards to 1.0.15 (from 1.00.13) but there is no change. All the other cards are still running 1.00.13. All the IRS4s are either inside the NI-4100 or on its ICSnet bus.

    XCHM-0 is the mode being used.

    If anyone has any idea how to fix this I would greatly appreciate it.

    -Garrett McWilliams
  • viningvining Posts: 4,368
    Hi,

    I just updated a site to the current master and device firmware in order to accommodate a new cable channel lineup using four digits. Sending IR from internal ports on the NIs works correctly but none of the NXC-IRS4s work, whether in the master's card cage or in a shell. There are two masters in the system: a NI-2000 and an NI-4100. They're now running 3.60.453 and device 1.30.8.

    Before today's update, the XCH command would send digits 2,3,4 of a four digit number. After today's update, the IRS4 cards don't send anything at all for four digit numbers. I can see the command being sent out to the card in Device Notifications so I know it's getting that far. Two and three digit numbers work fine.

    I updated one of the cards to 1.0.15 (from 1.00.13) but there is no change. All the other cards are still running 1.00.13. All the IRS4s are either inside the NI-4100 or on its ICSnet bus.

    XCHM-0 is the mode being used.

    If anyone has any idea how to fix this I would greatly appreciate it.

    -Garrett McWilliams

    Do the card slots show up in the "Online Tree"? I don't know if this is your problem but there is a known issue with cardslots not coming online every once in a while after a prog upload or reboot. You'll have to do some forum searching to find what the theory is why they don't. I don't recall offhand.

    Here's the code I use as a crude fix until this problem is addressed by a firmware update. This is similar to what most folks do that have butted heads with this problem. Just create a .axi and modify as needed and make sure you that CARDSLOTS_NUM_DEVS reflects the number of cards installed and change dvCardSlot_Arry accordingly. Obviously if a card doesn't exist it won't be seen online and the master will get reboooted. You could add virtuals in place of empty slots if you want since virtuals will always come online.
    PROGRAM_NAME='VAV_CardSlots_Verify'
    
    DEFINE_DEVICE
    
    //defined in main
    #IF_NOT_DEFINED NI4100_CARD_SLOTS
    dvCardSlot_1_1		= 1021:1:0 ;
    dvCardSlot_1_2          = 1021:2:0 ;
    dvCardSlot_2_1          = 1022:1:0 ;
    dvCardSlot_2_2          = 1022:2:0 ;
    dvCardSlot_3_1		= 1023:1:0 ;
    dvCardSlot_3_2          = 1023:2:0 ;
    dvCardSlot_4_1          = 1024:1:0 ;
    dvCardSlot_4_2          = 1024:2:0 ;
    #END_IF
    
    DEFINE_CONSTANT //WAIT TIME TO CHECK FOR ONLINE STATUS AND REBOOT IF REQUIRED
    
    INTEGER CARDSLOTS_NUM_DEVS	= 8 ;	
    INTEGER CARDSLOTS_MAX_REBOOTS	= 2 ;	
    INTEGER CARDSLOTS_VERIFY_WAIT	= 900 ; //1-1/2 MINUTES
    
    DEFINE_VARIABLE //CARD SLOT ARRAY, DEBUG, ONLINE & REBOOT VARS
    
    VOLATILE INTEGER nCardSlots_Debug = 0 ;
    //#WARN 'nCardSlots_Debug = 1 in VAV_CardSlots_Verify.axi'
    
    VOLATILE DEV dvCardSlot_Arry[CARDSLOTS_NUM_DEVS] = 
    		    {
    		    dvCardSlot_1_1,
    		    dvCardSlot_1_2,
    		    dvCardSlot_2_1,
    		    dvCardSlot_2_2,
    		    dvCardSlot_3_1,
    		    dvCardSlot_3_2,
    		    dvCardSlot_4_1,
    		    dvCardSlot_4_2
    		    }
    
    VOLATILE INTEGER   nCardSlots_Online[CARDSLOTS_NUM_DEVS] = {0,0,0,0,0,0,0,0} ;
    PERSISTENT INTEGER nCardSlots_Reboots = 0 ;
    
    DEFINE_FUNCTION fnCardSlots_DeBug(CHAR iStr[])
    
         {
         if(nCardSlots_Debug)
    	  {
    	  STACK_VAR CHAR cCopyStr[1024] ;
    	  STACK_VAR INTEGER nLineCount ;
    	  
    	  cCopyStr = iStr ;
    	  
    	  nLineCount ++ ;
    	  WHILE(length_string(cCopyStr) > 100)
    	       {
    	       SEND_STRING 0,"'CardSlot Verify (',itoa(nLineCount),'): ',get_buffer_string(cCopyStr,80)" ;
    	       nLineCount ++ ;
    	       }
    	  if(length_string(cCopyStr))
    	       {
    	       SEND_STRING 0,"'CardSlot Verify (',itoa(nLineCount),'): ',cCopyStr" ;
    	       }
    	  }
       
         RETURN ;
         }
         
    DEFINE_FUNCTION fnCardSlots_Verify() 
    
         {
         if(nCardSlots_Reboots <= CARDSLOTS_MAX_REBOOTS)
    	  {
    	  STACK_VAR INTEGER i ;
    	   
    	  for(i = 1 ; i <= CARDSLOTS_NUM_DEVS ; i++)
    	       {
    	       if(!nCardSlots_Online[i])
    		    {
    		    fnCardSlots_DeBug("'ONE OR ALL CARDS OFFLINE! First failed index position = ',itoa(i),', REBOOTING (attempt ',itoa(nCardSlots_Reboots),'). :DEBUG <',ITOA(__LINE__),'>'") ;
    		    
    		    nCardSlots_Reboots++ ;
    		    REBOOT(0:0:0) ;
    		    
    		    RETURN ;
    		    }
    	       }
    	  fnCardSlots_DeBug("'ALL CARDS ONLINE! No Reboot required! Number of attempts required = ',itoa(nCardSlots_Reboots),'. :DEBUG <',ITOA(__LINE__),'>'") ;
    	  //nCardSlots_Reboots = 0 ; //this will clear only if it passes. Subsequent prog uploads will not attemp reboots if this fails
    	  }
         else
    	  {
    	  fnCardSlots_DeBug("'ONE OR ALL CARDS OFFLINE! Maximum Reboot attempts exceeded.  Aborting further attempts! :DEBUG <',ITOA(__LINE__),'>'") ;
    	  }
    	  
         nCardSlots_Reboots = 0 ;//this will start again after next prog upload or reboot. 
    	  
         RETURN ;
         }
         
    DEFINE_START 
    
    WAIT CARDSLOTS_VERIFY_WAIT 'CARDSLOTS_VERIFY'
         {
         fnCardSlots_Verify() ;
         }
         
    DEFINE_EVENT   //DATA_EVENT [dvCardSlot_Arry]
    
    DATA_EVENT [dvCardSlot_Arry]
         
         {
         ONLINE:
    	  {
    	  STACK_VAR INTEGER nDev_Indx ;
    	  
    	  nDev_Indx = GET_LAST(dvCardSlot_Arry) ;
    	  fnCardSlots_DeBug("'ONLINE. Index Position-',itoa(nDev_Indx),', D:P:S-',fnDEV_TO_STRING(DATA.DEVICE),'. :DEBUG <',ITOA(__LINE__),'>'") ;
    	  nCardSlots_Online[nDev_Indx] = 1 ;
    	  }
         OFFLINE:
    	  {
    	  STACK_VAR INTEGER nDev_Indx ;
    	  
    	  nDev_Indx = GET_LAST(dvCardSlot_Arry) ;
    	  fnCardSlots_DeBug("'OFFLINE. Index Position-',itoa(nDev_Indx),', D:P:S-',fnDEV_TO_STRING(DATA.DEVICE),'. :DEBUG <',ITOA(__LINE__),'>'") ;
    	  nCardSlots_Online[nDev_Indx] = 0 ;
    	  }
         }
    
Sign In or Register to comment.