Home AMX User Forum NetLinx Studio

Trouble Receiving from Keypad

Hey all,

I'm using the following code to call a keypad:
SEND_COMMAND dvTPANELS[nLAST_PANEL],"'@AKB-;Enter Name:'"
	    WAIT_UNTIL (!nPROPERTY_WAITING_ON_INPUT[nLAST_PANEL])
	    {
		sTEMP_LUTRON_INFO[nLAST_PANEL].cTITLE_OFF = sUSER_INPUT[nLAST_PANEL]
		sTEMP_LUTRON_INFO[nLAST_PANEL].cTITLE_ON = sUSER_INPUT[nLAST_PANEL]
	    }
	}

Then here is my string handler for the panels:
STRING:
    {
	STACK_VAR INTEGER nLAST_PANEL
	nLAST_PANEL = GET_LAST(dvTPANELS)
	
	IF(nPROPERTY_WAITING_ON_INPUT[nLAST_PANEL])
	{
	    sUSER_INPUT[nLAST_PANEL] = "sUSER_INPUT[nLAST_PANEL],DATA.TEXT"
	    
	    SELECT
	    {
		ACTIVE(FIND_STRING(sUSER_INPUT[nLAST_PANEL],'KEYB-',1)):
		    REMOVE_STRING(sUSER_INPUT[nLAST_PANEL],'KEYB-',1)
		
		ACTIVE(FIND_STRING(sUSER_INPUT[nLAST_PANEL],'KEYP-',1)):
		    REMOVE_STRING(sUSER_INPUT[nLAST_PANEL],'KEYP-',1)
	    }
	    
	    OFF[nPROPERTY_WAITING_ON_INPUT[nLAST_PANEL]]
	}
    }

Now I've placed breaks in the String event, but it's as if it's simply receiving nothing from the panel; the STRING event is never engaging, and therefore nothing is happening... I'm straight up confused, and certain there's likely something small or simple I'm forgetting. Please help.

Thanks all!

Comments

  • DHawthorneDHawthorne Posts: 4,584
    You have to make sure the text field (where the text displays when you enter a number) on the keypad is named "KEYP-" and that it outputs to the port you are looking at. This is not a built in value, it must be assigned.

    As part of my STRING events on panels, I do a "SEND_STRING 0, DATA.TEXT" while debugging just to see exactly what is coming in. If you get nothing, it's going to the wrong port. If you get something besides "KEYP-", the text field is misnamed.
  • I'm quite confident it's going to the correct port, as the file I'm presently working deals exclusively with port three on the panels.

    It's quite frustrating, however, as I'm pretty sure the STRING event of DATA_EVENT[dvTPANELS] is not happening at all. I know the DATA_EVENT is fine, though, as the ONLINE events within the same DATA_EVENT are working just fine.

    Any ideas on potential reasons why the keyboard would be displaying, yet nothing is getting to the Panel? I can show more code if it would help.
  • DHawthorneDHawthorne Posts: 4,584
    Ah, well the port is definitely your problem then if you are looking at port 3. String outputs always come in on port 1, no matter how it's assigned.
  • Oh... Well then.

    Is there a clever way to do a Data Event on the different port of the same device, without creating a whole new Device? For example, checking port 1 of a Device address of 10109:3:1?

    If not, then suck. But thanks! :)
  • DHawthorneDHawthorne Posts: 4,584
    Yes, there is. Let's say your panel is named dvPanel and is assigned to 10109:3:1. Create a new DEV variable, and call it dvPanelBase (or whatever), then assign it as follows:

    dvPanelBase.NUMBER = dvPanel.NUMBER
    dvPanelBase.PORT = 1
    dvPanelBase.SYSTEM = dvPanel.SYSTEM

    Then trap the STRING event for dvPanelBase.
  • Well, I think that's it for my questions; my code works now and I'm happy. Thanks very much, DHawthorne. :)
Sign In or Register to comment.