Home AMX User Forum NetLinx Studio

Rs-232 Impossible Control

I have three different devices to control using RS232:

1) Stage One Pre Amplifier (RECEIVER)
2) HomeWorks Lutron (ILUMINACAO)
3) Panasonic Plasma (PLASMA)

The port TX is turning ON when I push a button on my Touch Panel.

But there is no action on the RX LED.

My dealer said that my code is correct. He said it could be the cable. But I tried different cables, with and without crossover and nothing changed

My code is as folows:

DEFINE_DEVICE

RECEIVER = 5001:1:0
PLASMA = 5001:2:0
ILUMINACAO = 5001:3:0

DEFINE_CALL 'LigaReceiver'
{
SEND_STRING RECEIVER, "'POWER=1'"
ON [ RELE, RELE_RECEIVER ]
}

DEFINE_EVENT

(* CONFIGURANDO AS PORTAS RS-232 *)
DATA_EVENT [ RECEIVER ] { ONLINE:
{
SEND_COMMAND RECEIVER, 'SET BAUD 9600,N,8,1'
}}

DATA_EVENT [ PLASMA ] { ONLINE:
{
SEND_COMMAND PLASMA, 'SET BAUD 9600,N,8,1'
}}

DATA_EVENT [ ILUMINACAO ] { ONLINE:
{
SEND_COMMAND RECEIVER, 'SET BAUD 9600,N,8,1'
}}


DEFINE_PROGRAM

(* CONTROLE VIA RS-232 DO RECEIVER PRE AMPLIFICADOR *)

PUSH [ PAINEL, RCV_ON ]
CALL 'LigaReceiver'

PUSH [ PAINEL, RCV_OFF ]
{
SEND_STRING RECEIVER, 'POWER=0'
OFF [ RELE, RELE_RECEIVER ]
}
PUSH [ PAINEL, RCV_VolumeUP ]
SEND_STRING RECEIVER, 'VOLUME=+:1'

PUSH [ PAINEL, RCV_VolumeDN ]
SEND_STRING RECEIVER, 'VOLUME=-:1'

PUSH [ PAINEL, RCV_Mute ]
SEND_STRING RECEIVER, 'MUTE=T:1'

PUSH [ PAINEL, RCV_Computador ]
SEND_STRING RECEIVER, 'AUDIOINPUT=13:1'

PUSH [ PAINEL, RCV_DVD ]
SEND_STRING RECEIVER, 'AUDIOINPUT=6:1'

PUSH [ PAINEL, RCV_Tuner ]
SEND_STRING RECEIVER, 'AUDIOINPUT=1:1'

(* CONTROLE VIA RS-232 DO MONITOR DE PLASMA *)

PUSH [ PAINEL, Plasma_ON ]
SEND_STRING PLASMA, 'PON'

PUSH [ PAINEL, Plasma_OFF ]
SEND_STRING PLASMA, 'POFF'

PUSH [ PAINEL, Plasma_CFTV ]
SEND_STRING PLASMA, 'IIS:VID'

PUSH [ PAINEL, Plasma_DVD ]
SEND_STRING PLASMA, 'IIS:YP1'

PUSH [ PAINEL, Plasma_PC_HDTV ]
SEND_STRING PLASMA, 'IIS:RG1'

PUSH [ PAINEL, Plasma_Norm_4_3 ]
SEND_STRING PLASMA, 'DAM:NORM'

PUSH [ PAINEL, Plasma_Zoom ]
SEND_STRING PLASMA, 'DAM:ZOOM'

PUSH [ PAINEL, Plasma_Full_16_9 ]
SEND_STRING PLASMA, 'DAM:FULL'

PUSH [ PAINEL, Plasma_Norm_4_3 ]
SEND_STRING PLASMA, 'DAM:NORM'

PUSH [ PAINEL, Plasma_Just ]
SEND_STRING PLASMA, 'DAM:JUST'

PUSH [ PAINEL, Plasma_Auto ]
SEND_STRING PLASMA, 'DAM:SELF'

(* CONTROLE DE ILUMINACAO VIA RS-232*)

PUSH [ PAINEL, 89 ]
SEND_STRING ILUMINACAO, 'KBP, [01:06:01],1'

PUSH [ PAINEL, 90 ]
SEND_STRING ILUMINACAO, 'KBP, [01:06:01],2'

PUSH [ PAINEL, 91 ]
SEND_STRING ILUMINACAO, 'KBP, [01:06:01],3'

PUSH [ PAINEL, 92 ]
SEND_STRING ILUMINACAO, 'KBP, [01:06:01],4'


Sincerely,
Andr

Comments

  • Joe HebertJoe Hebert Posts: 2,159
    Andre,

    I assume you are talking directly to these devices and not using AMX modules. Correct?

    If this is the case then I can see a problem with your Lutron strings. Every command issued to Lutron must be terminated with a carriage return. CR = 13 or $0D

    So for example this send string:

    SEND_STRING ILUMINACAO, 'KBP, [01:06:01],1'

    Should be changed to this if you want to think in decimal terms:

    SEND_STRING ILUMINACAO, "'KBP, [01:06:01],1',13"

    Or this if you want to think hex:

    SEND_STRING ILUMINACAO, "'KBP, [01:06:01],1',$0D"

    Notice the use of single quotes and double quotes also.

    Other than that your code looks fine at first glance. I can't comment on your other two devices since I don't know what model numbers you are using.

    See if you start talking to Lutron once you change the strings.

    Cheers,
    Joe
  • Do you know the correct wiring to talk to Lutron?

    Is it:

    AMX PIN 5 GROUND GROUND PIN 5 LUTRON
    AMX PIN 3 TX RX PIN 2 LUTRON
    AMX PIN 2 RX TX PIN 3 LUTRON
    ???????

    The other devices are:

    Plasma Panasonic TH50 PHW5
    PreAmplifier Aragon Stage One

    I am at home now, monday I will try what you have said.

    Thank you,
    Andr
  • Joe HebertJoe Hebert Posts: 2,159
    Originally posted by andregabriel
    Do you know the correct wiring to talk to Lutron?
    Straight thru. Here's the cable drawing: FG # 10-752-04

    Joe
  • RS232 (Possible) Impossible Control

    Andre,

    Regarding Lutron, Joe is correct. Each request to HomeWorks must be terminated with a CR as a delimeter. He is also correct in that a straight-thru serial cable is required. Lutron has always insisted that a full 9-pin serial cable be used (includes DTR, DCD, CTS, ...) since Lutron uses hardware handshaking. A standard serial cable with only pins 2, 3, and 5 is not recommended for use with HomeWorks.

    If you have one of the new Lutron P5 processors, dispense with serial control altogether and use the native Ethernet interface on the processor (the protocol is the same).

    On the Panasonic plasma, in looking at the InConcert section of AMX and looking at your command set, it appears that you require a straight-thru serial cable for the plasma. Further, each protocol request must start with an STX (02H) prefix and be terminated with an ETX (03H). Modify your SEND_STRINGs accordingly and see the following for more detail (if the link does not work, check AMX InConcert).

    http://inconcert1.amx.com/amxnttrd/manuals/panasonic/th42pwd4u//rs232-th42pwd4uy.pdf

    Regarding the final component, which I assume is the Klipsch Aragon StageOne, the serial protocol document is not available for the device on InConcert although AMX does provide a module for the device. I would recommend you use the module which would eliminate the problem you are having with knowing the detailed specifics of the device protocol. If you decide to continue with your serial interface directly, the interface document provided by AMX for the module indicates that a CR is also required for all strings sent to the device directly. Modify your SEND_STRINGs accordingly for the preamp device and try again. The AMX module of course takes care of the details for you if you go that route instead of using your own protocol interface.

    Lastly, AMX has been recommending the use of the TSET command in ONLINE events in place of SET commands (has to do with the number of times you can write to the flash RAM on devices). Consider changing your SET commands to TSET per the AMX recommendation.

    Hope this helps.
  • DHawthorneDHawthorne Posts: 4,584
    I can'tr speak to the other two devices (I haven't used them), but the Homeworks has hardware flow control on by default, and that is why you need more than the TX, RX and SG lines connected. Furthermore, you will need to turn on hardware handshaking on the serial port (put SEND_COMMAND ILUMINACAO, "'HSON'" in your ONLINE event).
  • First of all, thank you all for all the help.

    I still can?t comunicate using RS-232.

    Just to remember, the three devices are:

    1) Aragon Stage One Pre Amplifier (RECEIVER)
    2) HomeWorks Lutron (ILUMINACAO)
    3) Panasonic Plasma TH-50PHW5(PLASMA)

    Actually, I couldn?t find any module or information about HomeWorks Lutron at http://inconcert1.amx.com/ .

    I have followed the instructions on http://www.amx.com/inconcert/Cbl/CableViewingFrame.asp?CblNo=1253&lk=2038d9c3191f87e4852fecae44b24932 which says:

    AMX PIN 2 RXD
    TXD PIN 2 LUTRON
    PIN 3 TXD
    RXD PIN 3
    PIN 5 GND
    GND PIN 5

    I didn?t find the wiring diagram connecting the other two RS-232 PINS... RTS and CTS pins necessary to talk to LUTRON Homeworks.

    I haven?t tried to comunicate with the Plasma yet.

    For the Aragon Stage One I tried the above configuration and the crossover configuration which connects PIN 2 to PIN 3 and PIN 3 to PIN 2. But both failed.

    The initialization of the ports are:

    DEFINE_EVENT
    DATA_EVENT [ RECEIVER ] { ONLINE:
    {
    SEND_COMMAND RECEIVER, 'SET BAUD 9600,N,8,1'
    }}
    DATA_EVENT [ PLASMA ] { ONLINE:
    {
    SEND_COMMAND PLASMA, 'SET BAUD 9600,N,8,1'
    }}
    DATA_EVENT [ ILUMINACAO ] { ONLINE:
    {
    SEND_COMMAND ILUMINACAO, 'SET BAUD 115200,N,8,1'
    SEND_COMMAND ILUMINACAO, "'HSON'"
    }}

    The commands sent to the Aragon Stage One are (copied from the Aragon Module from the ARAGON SITE):

    PUSH [ PAINEL, RCV_ON ]
    CALL 'LigaReceiver'

    PUSH [ PAINEL, RCV_OFF ]
    {
    SEND_STRING RECEIVER, 'POWER=0'
    OFF [ RELE, RELE_RECEIVER ]
    }
    PUSH [ PAINEL, RCV_VolumeUP ]
    SEND_STRING RECEIVER, 'VOLUME=+:1'

    PUSH [ PAINEL, RCV_VolumeDN ]
    SEND_STRING RECEIVER, 'VOLUME=-:1'

    PUSH [ PAINEL, RCV_Mute ]
    SEND_STRING RECEIVER, 'MUTE=T:1'

    PUSH [ PAINEL, RCV_Computador ]
    SEND_STRING RECEIVER, 'AUDIOINPUT=13:1'

    PUSH [ PAINEL, RCV_DVD ]
    SEND_STRING RECEIVER, 'AUDIOINPUT=6:1'

    PUSH [ PAINEL, RCV_Tuner ]
    SEND_STRING RECEIVER, 'AUDIOINPUT=1:1'

    To the Lutron HomeWorks:

    PUSH [ PAINEL, 89 ]
    SEND_STRING ILUMINACAO, "'KBP, [01:06:01],1',13"

    PUSH [ PAINEL, 90 ]
    SEND_STRING ILUMINACAO, "'KBP, [01:06:01],2',13"

    PUSH [ PAINEL, 91 ]
    SEND_STRING ILUMINACAO, "'KBP, [01:06:01],3',13"

    PUSH [ PAINEL, 92 ]
    SEND_STRING ILUMINACAO, "'KBP, [01:06:01],4',13"

    To the Plasma:

    PUSH [ PAINEL, Plasma_ON ]
    SEND_STRING PLASMA, "2,'PON',3"

    PUSH [ PAINEL, Plasma_OFF ]
    SEND_STRING PLASMA, "2,'POFF',3"

    PUSH [ PAINEL, Plasma_CFTV ]
    SEND_STRING PLASMA, "2,'IIS:VID',3"

    The LED TX goes on when I click the corresponding button but the RX LEDs does not go on, in other words, probably my wiring connections are the problem because even if my code is wrong the device should have returned an error string to NETLINX Controller.

    Sincerely,
    Andr
  • PANASONIC PLASMA THD-50PHW5

    If you get http://inconcert1.amx.com/amxnttrd/manuals/panasonic/th42pwd4u//rs232-th42pwd4uy.pdf from Inconcert, which is a copie of part of the manual (it?s the same part found in THD-50PHW5 manual), you can see that that PIN 7 and 8 need to be shorted.... But if they are shorted, they are not used, am I right ?
    And PIN 1 and 9 are NC. But what is NC ????

    Sincerely,
    Andr
  • DHawthorneDHawthorne Posts: 4,584
    An easier way around the Homeworks part of the problem is to go into Homeworks, and assign a driver to the RS-232 port that turns hardware handshaking off. This is almost certainly your problem with the Homeworks.
  • Originally posted by andregabriel
    PANASONIC PLASMA THD-50PHW5

    If you get http://inconcert1.amx.com/amxnttrd/manuals/panasonic/th42pwd4u//rs232-th42pwd4uy.pdf from Inconcert, which is a copie of part of the manual (it?s the same part found in THD-50PHW5 manual), you can see that that PIN 7 and 8 need to be shorted.... But if they are shorted, they are not used, am I right ?
    And PIN 1 and 9 are NC. But what is NC ????

    Sincerely,
    Andr?.

    Shorting PIN 7(RTS - Request To Send) and PIN 8 (CTS - Clear To Send), fakes the device into a constant state of readiness. A useful trick on any 232 device that uses hardware handshaking when all the wires are not available. NC means Not Connected

    Ian
  • Thank you for all your help!

    I managed to control Homeworks and my Plasma using RS-232. I haven't tried again with my Aragon Stage One. He is not working right now.

    So, finally, RS232 isn't that SO impossible to control! heheheh

    Sincerely,
    Andr
Sign In or Register to comment.