Home AMX User Forum NetLinx Studio

Lutron RA-RS232

Hi

I tried to control 4 Grafik eyes RA RA-GRX-4-T-WH and I get no change in my system..

for begining, Im trying to control master control who controls a Grafik eyes trought a RA RS232 unit.

I tried this code
SEND_STRING dvLGE, "'MBP,01,2,ON ',13"

Master button press command without succes

Comminacation setting is good and master controler is set to #1

any cue?

Comments

  • viningvining Posts: 4,368
    This is from along time ago so it may not be current with today's RA protocol but it worked pretty good back in the day. I noticed I didn't use any "MBP" but "BP" instead. So if anything in here is of any use go for it. I wrote this back when I first started programming, used it once and that was it.
    DEFINE_CONSTANT
    
    DEFINE_COMBINE
    
    DEFINE_TYPE
    
    DEFINE_VARIABLE
    
    integer nRADebug ;
    char cRA_Security [3] ;
    char cRA_LMPString [15] ;
    char cRA_ZMPString [32] ;
    integer nActiveRA_Room ;
    integer nRAStringFinder ;
    integer nRA_Level ;
    char cRA_Buff [255] ;
    integer nActiveRA_Scene ;
    
     INTEGER nBTN_RA_ARRAY[] =   //LUTRON RADIO RA  TOUCH PANEL BUTTONS (NU = NOT USED)
        {
            1,      //  LINK LED
            2,      //  COMMAND LED
            3,      //  USED FOR "TO" ING PAGE UP    
            4,      //  USED FOR "TO" ING PAGE DOWN
    	5,	//  LOWER
            6,      //  RAISE
            7,      //  SECURITY ON
            8,      //  SECURITY OFF
            9,      //  ALL ON
            10,     //  ALL OFF
            
            11,     //  LED FEEDBACK FOR DIMMER/SWITCH -10
            12,     //  LED FEEDBACK FOR DIMMER/SWITCH -10
            13,     //  LED FEEDBACK FOR DIMMER/SWITCH -10
            14,     //  LED FEEDBACK FOR DIMMER/SWITCH -10
            15,     //  LED FEEDBACK FOR DIMMER/SWITCH -10
            16,     //  LED FEEDBACK FOR DIMMER/SWITCH -10
            17,     //  LED FEEDBACK FOR DIMMER/SWITCH -10
            18,     //  LED FEEDBACK FOR DIMMER/SWITCH -10
            19,     //  LED FEEDBACK FOR DIMMER/SWITCH -10
            20,     //  LED FEEDBACK FOR DIMMER/SWITCH -10
            
            21,     //  LED FEEDBACK FOR DIMMER/SWITCH -10
            22,     //  LED FEEDBACK FOR DIMMER/SWITCH -10
            23,     //  LED FEEDBACK FOR DIMMER/SWITCH -10
            24,     //  LED FEEDBACK FOR DIMMER/SWITCH -10
            25,     //  LED FEEDBACK FOR DIMMER/SWITCH -10
            26,     //  LED FEEDBACK FOR DIMMER/SWITCH -10
            27,     //  LED FEEDBACK FOR DIMMER/SWITCH -10
            28,     //  LED FEEDBACK FOR DIMMER/SWITCH -10
            29,     //  LED FEEDBACK FOR DIMMER/SWITCH -10
            30,     //  LED FEEDBACK FOR DIMMER/SWITCH -10
            
            31,    //  LED FEEDBACK FOR DIMMER/SWITCH -10
            32,    //  LED FEEDBACK FOR DIMMER/SWITCH -10
            33,    //  LED FEEDBACK FOR DIMMER/SWITCH -10
            34,    //  LED FEEDBACK FOR DIMMER/SWITCH -10
            35,    //  LED FEEDBACK FOR DIMMER/SWITCH -10
            36,    //  LED FEEDBACK FOR DIMMER/SWITCH -10
            37,    //  LED FEEDBACK FOR DIMMER/SWITCH -10
            38,    //  LED FEEDBACK FOR DIMMER/SWITCH -10
            39,    //  LED FEEDBACK FOR DIMMER/SWITCH -10
            40,    //  LED FEEDBACK FOR DIMMER/SWITCH -10
            
            41,    //  LED FEEDBACK FOR DIMMER/SWITCH -10
            42,    //  LED FEEDBACK FOR DIMMER/SWITCH -10
            257,   //  NU
            257,   //  NU
            257,   //  NU
            257,   //  NU
            47,    //  LED FEEDBACK FOR SECURITY ON
            48,    //  LED FEEDBACK FOR SECURITY OFF
            257,   //  NU
            257,   //  NU
            
            51,    //  PHANTOM SCENE LED FEEDBACK -50
            52,    //  PHANTOM SCENE LED FEEDBACK -50
            53,    //  PHANTOM SCENE LED FEEDBACK -50
            54,    //  PHANTOM SCENE LED FEEDBACK -50
            55,    //  PHANTOM SCENE LED FEEDBACK -50
            56,    //  PHANTOM SCENE LED FEEDBACK -50
            57,    //  PHANTOM SCENE LED FEEDBACK -50
            58,    //  PHANTOM SCENE LED FEEDBACK -50
            59,    //  PHANTOM SCENE LED FEEDBACK -50
            60,    //  PHANTOM SCENE LED FEEDBACK -50
            
            61,     // PHANTOM SCENE LED FEEDBACK -50
            62,     // PHANTOM SCENE LED FEEDBACK -50
            63,     // PHANTOM SCENE LED FEEDBACK -50  
            64,     // PHANTOM SCENE LED FEEDBACK -50
            65,     // PHANTOM SCENE LED FEEDBACK -50
            257,    // NU
            257,    // NU
            257,    // NU
            257,    // NU
    	257,    // NU
            
            257,    // NU
            257,    // NU
            257,    // NU
            257,    // NU
            257,    // NU
            257,    // NU
            257,    // NU
            257,    // NU
            257,    // NU
            257,    // NU
            
            81,     // DIMMER/SWITCH - 80
            82,     // DIMMER/SWITCH - 80
            83,     // DIMMER/SWITCH - 80
            84,     // DIMMER/SWITCH - 80
            85,     // DIMMER/SWITCH - 80
            86,     // DIMMER/SWITCH - 80
            87,     // DIMMER/SWITCH - 80
            88,     // DIMMER/SWITCH - 80
            89,     // DIMMER/SWITCH - 80    
            90,     // DIMMER/SWITCH - 80
            
            
            91,    //  DIMMER/SWITCH - 80
            92,    //  DIMMER/SWITCH - 80
            93,    //  DIMMER/SWITCH - 80
            94,    //  DIMMER/SWITCH - 80
            95,    //  DIMMER/SWITCH - 80
            96,    //  DIMMER/SWITCH - 80
            97,    //  DIMMER/SWITCH - 80
            98,    //  DIMMER/SWITCH - 80
            99,    //  DIMMER/SWITCH - 80
            100,   //  DIMMER/SWITCH - 80
            
            
            101,    //  DIMMER/SWITCH - 80
            102,    //  DIMMER/SWITCH - 80
            103,    //  DIMMER/SWITCH - 80
            104,    //  DIMMER/SWITCH - 80
            105,    //  DIMMER/SWITCH - 80
            106,    //  DIMMER/SWITCH - 80
            107,    //  DIMMER/SWITCH - 80
            108,    //  DIMMER/SWITCH - 80
            109,    //  DIMMER/SWITCH - 80
            110,    //  DIMMER/SWITCH - 80
            
            111,    //  DIMMER/SWITCH - 80
            112,    //  DIMMER/SWITCH - 80
            257,    //  NU
            257,    //  NU
            257,    //  NU
            257,    //  NU
            257,    //  NU
            257,    //  NU
            257,    //  NU
            257,    //  NU
            
            121,    //  PHANTOM SCENE BUTTON - 120
            122,    //  PHANTOM SCENE BUTTON - 120
            123,    //  PHANTOM SCENE BUTTON - 120
            124,    //  PHANTOM SCENE BUTTON - 120
            125,    //  PHANTOM SCENE BUTTON - 120
            126,    //  PHANTOM SCENE BUTTON - 120
            127,    //  PHANTOM SCENE BUTTON - 120
            128,    //  PHANTOM SCENE BUTTON - 120
            129,    //  PHANTOM SCENE BUTTON - 120
            130,    //  PHANTOM SCENE BUTTON - 120
            
            131,    //  PHANTOM SCENE BUTTON - 120
            132,    //  PHANTOM SCENE BUTTON - 120
            133,    //  PHANTOM SCENE BUTTON - 120
            134,    //  PHANTOM SCENE BUTTON - 120
            135,    //  PHANTOM SCENE BUTTON - 120
    	257,	//  NU 
    	257,	//  NU 
    	257,	//  NU 
    	257,	//  NU
    	257,	//  NU 
    	
    	141,     //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE" -140
            142,     //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            143,     //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            144,     //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            145,     //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            146,     //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            147,     //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            148,     //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            149,     //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            150,     //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            
            151,     //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            152,     //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            153,     //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            154,     //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            155,     //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            156,     //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            157,     //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            158,     //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            159,     //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            160,     //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            
            161,    //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            162,    //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            163,    //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            164,    //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            165,    //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            166,    //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            167,    //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            168,    //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            169,    //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            170,    //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            
            171,    //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140
            172,    //  LED FEEDBACK & LIGHT SELECT FOR DIMMER/SWITCH "ZONE"-140 
    	200,    //  Fixture Lift button for pop up page
    	201,    //  Fixture Lift Lower
    	202     //  Fixture Lift Raise
            }
    char cLMP_RA_ARRAY [15]=
        {
        1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
        }
    char cZMP_RA_ARRAY [32]=
        {
        1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32
        }
        
    DEFINE_LATCHING	
    
    DEFINE_MUTUALLY_EXCLUSIVE
    //RADIO RA below
    ([dvTPRA, 3] .. [dvTPRA, 5])
    ([dvTPRA, 6] .. [dvTPRA, 7])
    ([dvTPRA, 51]..[dvTPRA, 65])
    ([dvTPRA, 141]..[dvTPRA,172])
    ([dvTPRA,201]..[dvTPRA,202])
    
    DEFINE_START  
    create_buffer dvRA, cRA_Buff
    create_level dvTPRA,1,nRA_Level
    
    DEFINE_EVENT
    
    DATA_EVENT   [dvRA]//Radio RA w/ 232 interface
         {
         online:
    	  {
    	  send_command dvRA,'SET BAUD 9600,N,8,1 485 DISABLE'
    	  send_string dvRA,"'RSMI',13"//INQUIRES RA SYSTEM MODE STATUS//
    	  wait 1
    	       send_string dvRA,"'ZMPI',13"//INQUIRES RA ZONE MAP STATUS//
    	  wait 1
    	       send_string dvRA,"'LMPI',13"//INQUIRES RA LED MAP STATUS//
    	  }
         string:
    	  { 
    	  local_var char cZMP_LED
    	  local_var char cLMP_LED
    	  local_var integer n
    	  local_var integer i
    	  if (find_string (cRA_Buff,"'ZMP,'",1))
    	       {
    	       nRAStringFinder = find_string(cRA_Buff,"'ZMP,'",1)
    	       cRA_ZMPString = mid_string(cRA_Buff,nRAStringFinder + 4,32)
    	       for (n = 1; n <= 32; n++)
    		    {
    		    cZMP_LED = get_buffer_char (cRA_ZMPString)
    		    cZMP_RA_ARRAY[n] = cZMP_LED
    		    if (cZMP_RA_ARRAY[n] == '1')
    			 on [dvTPRA,n+10] 
    		    else
    			 off[dvTPRA,n+10]
    		    }
    	       }
    	  if (find_string (cRA_Buff,"'LMP'",1))
    	       {
    	       nRAStringFinder = find_string(cRA_Buff,"'LMP,'",1)
    	       cRA_LMPString = mid_string(cRA_Buff,nRAStringFinder + 4,15)
    	       for (i = 1; i <= 15; i++)
    		    {
    		    cLMP_LED = get_buffer_char (cRA_LMPString)
    		    cLMP_RA_ARRAY[i] = cLMP_LED
    		    if (cLMP_RA_ARRAY[i] =='1')
    			 on [dvTPRA,i+50]
    		    else
    			 off[dvTPRA,i+50]
    		    }
    	       }
    	  if (find_string (cRA_Buff,"'RSM,SSM,'",1))//Button feedback in Define Program
    	       {
    	       nRAStringFinder = find_string(cRA_Buff,"'RSM,SSM,'",1)
    	       cRA_Security = mid_string(cRA_Buff,nRAStringFinder + 8,3)
    	       if (cRA_Security == 'ENT')
    		    {
    		    send_command dvTPRA,"'PPON-Security Mode Warning'"
    		    //on [dvTPRA, 47]
    		    //off [dvTPRA, 48]
    		    }
    	       else if (cRA_Security == 'EXT')
    		    {
    		    send_command dvTPRA,"'PPOFF-Security Mode Warning'"
    		    cancel_wait 'RA_SECURITY'
    		    //off [dvTPRA, 47]        
    		    //on [dvTPRA, 48]
    		    }
    	       }
    	  if (find_string (cRA_Buff,"'REV,'",1))
    	       {
    	       pulse [dvTPRA,2]
    	       cancel_wait 'RALINK'
    	       on [dvTPRA,1]
    	       wait 600 'RALINK'
    		    off [dvTPRA,1]
    	       }
    	  clear_buffer cRA_Buff
    	  }
         }
    
    BUTTON_EVENT [dvTPRA, nBTN_RA_ARRAY]
    
         {
         PUSH:
    	  {   
    	  local_var INTEGER nBTN
    	  local_var integer n
    	  local_var integer nLiftBTN 
    	  nLiftBTN = (button.input.channel) 
    	  nBTN = GET_LAST(nBTN_RA_ARRAY)
    	  if (nRADebug)
    	       {
    	       SEND_STRING 0,"'VAV_Email ',itoa(button.input.device.number),
    					':',itoa(button.input.device.port),
    					':',itoa(button.input.device.system),
    					'-CHANNEL ',itoa(BUTTON.INPUT.CHANNEL),', PUSHED.',
    					' Line-<',ITOA(__LINE__),'>',crlf" ;
    	       }
    	  if ((nBTN >= 3 && nBTN <= 10)|| (nBTN >=81 && nBTN <=137))// to ing selected buttons
    	       to [dvTPRA,nBTN]
    	  if (nBTN >= 81 && nBTN <= 112) 
    	       nActiveRA_Room = nBTN - 80
    	  on [dvTPRA, nActiveRA_Room + 140]
    	  if (nBTN >= 121 && nBTN <= 137)
    	       nActiveRA_Scene = nBTN - 120
    	    
    	  SELECT
    	       {
    	       ACTIVE (nBTN == 3):
    		    {
    		
    		    }
    	       ACTIVE (nBTN == 4): {}
    	       ACTIVE (nBTN == 5): // lower for phantom scene buttons
    		    {
    		    send_string dvRA,"'Lower,',itoa(nActiveRA_Scene),13"
    		    }
    	       ACTIVE (nBTN == 6)://raise for phantom scene buttons
    		    {
    		    send_string dvRA,"'Raise,',itoa(nActiveRA_Scene),13"
    		    }
    	       ACTIVE (nBTN == 7): {send_string dvRA,"'SSM,',itoa(nActiveRA_Scene),',ON',13"}//SECURITY MODE ACTIVE SCENE ON
    	       ACTIVE (nBTN == 8): {send_string dvRA,"'SSM,',itoa(nActiveRA_Scene),',OFF',13"}//SECURITY MODE ACTIVE SCENE ON OFF
    	       ACTIVE (nBTN == 9): {send_string dvRA,"'BP,16,ON,10',13"}//ALL ON 
    	       ACTIVE (nBTN == 10):{send_string dvRA,"'BP,17,OFF,10',13"}//ALL OFF
    	       ACTIVE (nBTN >= 81 && nBTN <= 112):
    		    {
    		    nBTN = nBTN-80
    		    on [dvTPRA,nBTN + 140]
    		    if (cZMP_RA_ARRAY [nBTN] == '1')
    			 send_string dvRA,"'SDL,',itoa(nBTN),',0',13"     //',itoa(nBTN-80),'ON',$0D"
    		    else if (cZMP_RA_ARRAY [nBTN] == '0')
    			 send_string dvRA,"'SDL,',itoa(nBTN),',75',13" 
    		    }
    	       ACTIVE (nBTN >= 121 && nBTN <= 137):
    		    {
    		    nBTN = nBTN-120
    		    send_String dvRA,"'BP,',itoa(nBTN),',TOG',13"          //,itoa(nBTN-120),'ON',$0D"
    		    }
    	       ACTIVE (nBTN >= 141 && nBTN <= 172):
    		    {
    		    nActiveRA_Room = nBTN - 140
    		    on [dvTPRA,nBTN]
    		    }
    	       }
    	  }
         HOLD [70]:
    	  {
    	  send_command dvTPRA,"'PPON-Lift_Control'"
    	  }
         RELEASE:
    	  {
    	  local_var INTEGER nBTN
    	  nBTN = GET_LAST(nBTN_RA_ARRAY)
    	  if (nBTN == 5 || nBTN==6)
    	       send_string dvRA,"'STOPRL',13"
    	  }
         }
         
    LEVEL_EVENT  [dvTPRA,1]//RA Level Controlcast
    
         {
         send_string dvRA,"'SDL,',itoa(nActiveRA_Room),',',itoa(nRA_Level),',3',13"
         }
    
    DEFINE_PROGRAM
    
    if (Time == cTimerTime)
    		    {
    		    wait 20
    			send_string dvRA,"'SSM,',itoa(nActiveRA_Scene),',ON',13"
    		    }
    
    ////////////create timeline for feedback  !!!!!!!!!!!!!!!
    
    wait 40//LINK POLLING TO VERIFY COMM LINK UP EVENT, SEE RA DATA EVENT
         {
         SEND_STRING dvRA,"'VERI',13" ;
         if (nRADebug)
    	  {
    	  SEND_STRING 0,"'VAV_RADIO_RA Polling "VERI" >-Line-<',ITOA(__LINE__),'>',crlf" ;
    	  }
         }
    
    if (cRA_Security == 'EXT')
         {
         off [dvTPRA, 47]
         on [dvTPRA, 48]
         }    
    
    //RESEND SECURITY "ON" TO RA DEVICE TO KEEP FROM TIMING OUT AT 5 MIN. 
    if (cRA_Security == 'ENT')
         {
         on [dvTPRA, 47]
         off [dvTPRA, 48]
         wait 240 'RA_SECURITY'
    	  send_string dvRA,"'SSM,16,ON',13" 
         }
    
  • DenisDenis Posts: 163
    Gluph!

    ouain ,I'm a little boy in this world...

    I tried summary to do works wath you gave me, I create TP 10001:1:0 device and RA 5001:6:0 device, when try to compile I got two things.

    1) crlf not defined

    2) ctimertime not defined

    I suppose as are variable, wich kind?

    MBP is Main button press, in doc is specified as a command to emulate a master button press. (see page 22 in doc)

    In this job, I have only 8 buttons to do works, (may be more) , but I tried to give direct command without fantom button.

    My Lutron rep said I can control hole house by RS232 module, but if I use fantom button I think as I can control only one zone, if my understanding is good
  • viningvining Posts: 4,368
    CRLF was a constant:
    CRLF[2] = {$0D,$0A}
    

    cTimerTime was just a char with a time set for something to happen. Comment it out, I can't imagine it doing much except control a scene for the evening or morning or something.

    I try to avoid looking at my old code cuz I tend to want to re-write it and I don't have time to go backwards.

    I did notice in the pdf file that the MBP command (what you used) was a feedback command while BP (what I used) is a device command. (Command outline table)


    There's a PPON-Lift in there somewhere which can come out too since it was control for an Alladdin fixture lift for rasing/lowering a chandelier which was controlled through a RA device on the job this was written for.
Sign In or Register to comment.