Home AMX User Forum NetLinx Studio

Denon 2309 via RS232 for Newbie

Hey guys, I'm a recent Programmer I, but this is my first real world implementation of a serial controlled device and I feel like I'm loosing this tiny, little battle.

I'm running this in a basic dev environment, so its just an NI-700 connected to Serial port 1, with a 8400 panel for human input. I've made the control cable, but verified it at least a half dozen times: Pin 5 is ground, Pins 2/3 are Tx/Rx and they do crossover in between, so pin 2 becomes pin 3 and vice versa.

When sending strings, I see both the Tx and Rx LEDs of the 700 light-up, indicating communication, but the receiver remains unresponsive, regardless of its powered state, Standby or On.

I've attached my code.

Thanks for any insight you guys can provide,

--Jack

DEFINE_DEVICE
Master			= 	0:1:0				// NI-700 Controller
dvReceiver1		=	5001:1:0			// RS-232, Receiver, Denon 2309-CI, 9600, N, 8, 1
dvTP			=	10001:1:0			// MVP-8400

DEFINE_VARIABLE

DEFINE_EVENT

// Initialize Denon Receiver
DATA_EVENT[dvReceiver1]
{
    ONLINE:
    {
	SEND_COMMAND dvReceiver1,"'SET BAUD 9600,N,8,1'"
	SEND_COMMAND dvReceiver1,"'RXON'"
    }
}

// Receiver Transports
BUTTON_EVENT[dvTP,20]
BUTTON_EVENT[dvTP,21]
BUTTON_EVENT[dvTP,22]
BUTTON_EVENT[dvTP,23]
{
	PUSH:
	{
	   SWITCH(BUTTON.INPUT.CHANNEL)
	   {
		CASE 20: SEND_STRING dvReceiver1,"'PWON',$0D"		// ON  
		CASE 21: SEND_STRING dvReceiver1,"'PWSTANDBY',$0D"	// OFF 
		CASE 22: SEND_STRING dvReceiver1,"'MVUP',$0D"		// VOL +
		CASE 23: SEND_STRING dvReceiver1,"'MVDOWN',$0D"		// VOL -
	   }
      	}
}                 

DEFINE_PROGRAM

Comments

  • jweatherjweather Posts: 320
    Denon receivers sometimes turn off their RS232 port when they're off. Try turning it on manually, then turning it off via RS232.

    Otherwise, use diagnostics to see what strings are coming back from the receiver, and/or try to talk to it manually via Hyperterminal to make sure your cable is good.
  • Yeah, I had read that, so I added the "Vol +" and "Vol -" buttons to the program, figuring I would try to power it ON manually, but just control the volume via the TP to see if things worked, but it was still a "no go."

    I referenced this in the post, "...the receiver remains unresponsive, regardless of its powered state, Standby or On...", but perhaps that statement hadn't come out as clear as I had intended. My apologies.

    Thanks for the quick response, though, I'd hadn't known about trying it via HyperTerminal, for both communication and checking the cable, but it makes sense.

    Thanks again.
  • I am not sure it matters, but you might try adding the carriage return:

    SEND_COMMAND dvRCVR,"'SET BAUD 9600,N,8,1',13"

    Another helpful trick is to monitor what message is being returned by the receiver:
    DEFINE_VARIABLE
    
    CHAR sTMP [20]
    
    DATA_EVENT[dvRCVR]		
    {
    ONLINE:
        {  
        SEND_COMMAND dvAVR2,"'SET BAUD 9600,N,8,1',13"  //
        }
    STRING:
        {
        sTMP = DATA.TEXT
        SEND_STRING 0, "'The Denon Receiver has returned the string: <',DATA.TEXT,'>.'"
        }
    }
    
    

    You will be able to view the returned string in the Netlinx Studio 2 output window, once you have connected to the master and enabled Netlinx internal diagnostics messages.

    Later you will be able to create parsing routines on the string feedback that you find!
  • Well, it was a total newbie issue, but its resolved.

    Avophile: Thanks for the response, the code I submitted was just a snippet, as I do parse the buffer and return it to the panel for some "instant gratification."

    Also, I was using the Notifications tab, but this time the receiver was just not responding. Actually, it technically never heard the request, so it had nothing to respond to.

    Jweather: Thanks for the HyperTerminal suggestion, as its what ultimately led to a working control system. As I was attaching my laptop to the receiver, I turned the receiver around to more accommodate the laptop and noticed the label on the receiver stating "RS232C Straight Cable." After I smacked my head, I fab'd up a new cable with no crossover, opened HyperTerminal, and immediately saw the Master Volume level being sent to my session. Total noob.

    Thanks guys.
  • Hey Jack

    Would you be willing to share your 2309 code ?

    I've just got the same unit - and have recently completed my Programmer 1 too, and would like to see some code for this.


    Thanks



    Dean.
  • a_riot42a_riot42 Posts: 1,624
    With Denons you will need to buffer commands. If the user hits the volume up button 20 times in a second, only a few of those commands will be responded to.
    Paul
    Avophile wrote: »
    I am not sure it matters, but you might try adding the carriage return:

    SEND_COMMAND dvRCVR,"'SET BAUD 9600,N,8,1',13"

    You don't need a carriage return for a send_command.
  • TurnipTruckTurnipTruck Posts: 1,485
    a_riot42 wrote: »
    With Denons you will need to buffer commands.

    I have one of the HD Radio Denon receivers at home (model number escapes me) It buffers its own commands. It has one of the friendliest serial ports I've ever met.
  • a_riot42 wrote: »
    If the user hits the volume up button 20 times in a second...
    Those are some fast fingers there ......

    :)

    --John
  • PhreaKPhreaK Posts: 966
    I've gotten into the habit of buffering all outgoing data to ensure I'm not flooding devices with more info than their protocol specifies. The main reason for this is not if you get some super human button pusher, but if another bit of code sends multiple commands to the device in quick succession (eg status calls etc.) they will all get through and play nice.
  • PhreaK wrote: »
    I've gotten into the habit of buffering all outgoing data to ensure I'm not flooding devices with more info than their protocol specifies.
    I agree, it's definitely good practice with a serial device, or any device for that matter for a variety of reasons. But still, 20 volume ups in a second... those are some fast fingers :). First thing I thought of, and many of you are probably too young to remember this one, is this arcade game from the '80s: Track and Field

    --John
  • a_riot42a_riot42 Posts: 1,624
    Those are some fast fingers there ......

    :)

    --John

    Not if there is a HOLD. Then strings can be sent multiple times a second depending on your repeat time.
    Paul
Sign In or Register to comment.