Home AMX User Forum AMX Technical Discussion

Strange characters from DATA_EVENT

Ad_My_XperienceAd_My_Xperience Posts: 73
edited January 29 in AMX Technical Discussion

Hello Guys,

I control a lot of RS-232 devices for many years but I've never had this kind of problem.

I control a NAD amplifier with RS-232 with no problem. On the other hand, no matter the command, I only receive a series of strange characters coming from the buffer for each feedback :

There is my code :

DATA_EVENT[AMPLI_SER]
{
ONLINE:
{
SEND_COMMAND DATA.DEVICE,"'SET BAUD 115200,N,8,1 485 disable'"
SEND_COMMAND DATA.DEVICE,"'RXON'" // MAKE SURE RECEIVE MESSAGES ARE ON
SEND_COMMAND DATA.DEVICE,"'TPAGEON'"
}

STRING:
{
CHAR RETOUR_AMPLI[2000]
RETOUR_AMPLI=buff_AMPLI

Any idea ?

Comments

  • If you set the display to Hex, what values are these characters? Looks kind of wrong baudrate....

    btw, the RXON is automatically set if a CREATE_BUFFER() or DATA_EVENT..STRING is used, and the TPAGEON is no serial port command (but both should not affect the data received).

  • John NagyJohn Nagy Posts: 1,740

    Can't be baud - the device is responding to commands. Huh.

  • Just a long shot but did you by any change use a fully wired RS232 cable, that is all pins are connected? Judging by the 'SET BAUD' command it looks like you are using an NI-xxxx controller. Using a fully wired cable on these controllers could lead to strange results.

    NAD often has (simple) RS232 test programs for their products . Unfamiliar if these show feedback but you could check if that works?

  • Ad_My_XperienceAd_My_Xperience Posts: 73
    edited February 13

    richardherman,

    what do you mean with : Judging by the 'SET BAUD' command it looks like you are using an NI-xxxx controller

    I had a NI-3100 replaced by NX-3200. The syntax (AMX-PI2) seems to be same...

    You have something because I replaced DB-9 connector by direct connection and all my RS-232 devices don't respond anymore... Maybe it's the problem ? I've also test with TBAUD command

    For IR control I use syntax and my IR devices don't work anymore too... :

    ONLINE:
    {
       SEND_COMMAND DATA.DEVICE, "'SET MODE IR'"
       SEND_COMMAND DATA.DEVICE, "'CARON'"
    
       SEND_COMMAND DATA.DEVICE, "'CTON',2" // 0.2 SEC
       SEND_COMMAND DATA.DEVICE, "'CTOF',2" // 0.2 SEC
    
       SEND_COMMAND DATA.DEVICE, "'XCHM 0'" // NO LEADING ZEROS WITH ENTER
    }
    

    Is it ok with my NX-3200 ?

  • @Ad_My_Xperience said:
    richardherman,

    what do you mean with : Judging by the 'SET BAUD' command it looks like you are using an NI-xxxx controller

    I had a NI-3100 replaced by NX-3200. The syntax (AMX-PI2) seems to be same...

    >
    Not completely the same. There is no '485 Disable' for a NX controller. There is '485 Enable' and '422 Enable', both will disable RS232. Omitting both will enable RS232 (and disable 485/422). So:

    SEND_COMMAND DATA.DEVICE,"'SET BAUD 115200,N,8,1'"

    is enough for RS232. I do think that the '485 Disable' part will just be ignored, so that is probably not the cause. And these commands will only work on port 1 and 5 for a NX-3200, the only ones capable of RS485/422. On a NI-xxxx all ports could do that.

    As a sidenote: That is if you don't have one where there is no chip placed to do RS485 or RS422. Due to chip shortages there were probably quite a few affected controllers seeing the numbers I received without that chip.

    You have something because I replaced DB-9 connector by direct connection and all my RS-232 devices don't respond anymore... Maybe it's the problem ? I've also test with TBAUD command

    Don't really understand what you mean there. NX controllers don't have SUB D9 connectors, so I don't see how you could use a 'fully wired' cable here. Just use only GND, RXD, TXD for RS232 (rightmost 3 pins on both the 5 and 10 pin connectors. It could be that a device requires you to wire the CTS and RTS signal, but I never used them.

    For IR control I use syntax and my IR devices don't work anymore too... :

    ONLINE:
    {
     SEND_COMMAND DATA.DEVICE, "'SET MODE IR'"
     SEND_COMMAND DATA.DEVICE, "'CARON'"
    
     SEND_COMMAND DATA.DEVICE, "'CTON',2" // 0.2 SEC
     SEND_COMMAND DATA.DEVICE, "'CTOF',2" // 0.2 SEC
     
     SEND_COMMAND DATA.DEVICE, "'XCHM 0'" // NO LEADING ZEROS WITH ENTER
    }
    

    Is it ok with my NX-3200 ?

    >
    Probably a stupid remark, but you did notice that the port numbering changed on the NX controllers?

    IR ports used to be on port 9-16 on a NI-3100 and now are on 11-18. So if you didn't change your code from the NI-3100, IR ports 1 and 2 won't do anything.

    Did you test your NAD amp with the RS232 testprogram for NAD, by the way?

  • Thanks richardherman,

    I use SEND_COMMAND DATA.DEVICE,"'SET BAUD 115200,N,8,1'" with NI-3100 and NX-3200. It's working on NI but don't with NX.

    Regarding the DB9 connector, I meant that I cut the connector wires after removing them from the NI-3100 and plugged just use only GND, RXD, TXD for RS232 (rightmost 3 pins on the 5 pin connector)

    Despite what I mention in the previous 2 sentences, I am unable to control any device via RS-232.

    About your remark, it's not more stupid than my questions but I've changed my code according new port number. I can control 1 of my 3 IR devices only...

    I tried to test my NAD amp feedback with NAD test program but it was a failure. I don't have a serial port on any of my PC's so I use a device to silmulate a USB port as a serial one. Test program connect to amp by COM3 but nothing goes by or from amp... I'm not lucky at this time with my control system.

    I don't understant why programming is so different between NI and NX series...

    Thanks for helping!

  • @Ad_My_Xperience said:
    Thanks richardherman,

    I use SEND_COMMAND DATA.DEVICE,"'SET BAUD 115200,N,8,1'" with NI-3100 and NX-3200. It's working on NI but don't with NX.

    Does the above command don't work on an NX or does the NX doesn't control the attached device while the NI did? If the command doesn't work on a NX, something is wrong.

    Regarding the DB9 connector, I meant that I cut the connector wires after removing them from the NI-3100 and plugged just use only GND, RXD, TXD for RS232 (rightmost 3 pins on the 5 pin connector)

    Despite what I mention in the previous 2 sentences, I am unable to control any device via RS-232.

    You said in your first post 'I control a lot of RS-232 devices for many years' so this is probably another dumb remark, but you did swap RXD and TXD?

    About your remark, it's not more stupid than my questions but I've changed my code according new port number. I can control 1 of my 3 IR devices only...

    I'll just keep thinking out loud: You did load the IR drivers on the correct ports? Did the 2 devices that don't work now, worked before on the NI-3100?

    I tried to test my NAD amp feedback with NAD test program but it was a failure. I don't have a serial port on any of my PC's so I use a device to silmulate a USB port as a serial one. Test program connect to amp by COM3 but nothing goes by or from amp... I'm not lucky at this time with my control system.

    I've used laptops to do all of my programming for years now that don't have a serial port. I use a USB to Serial adapter for all my serial connections and never had any problems. There are differences on what chipset works best for such adapters. I mainly use the ones that have a FTDI chip in it. Those are natively supported by Windows 7/10/11, no need for separate drivers. Many brands make adapters with this chip.

    I don't understant why programming is so different between NI and NX series...

    It isn't. There ARE differences, but I'd say easily 90%+ is the same. If you feel comfortable, maybe post the code you are using here, or send through PM? All these little snippets don't clarify much.

    Thanks for helping!

Sign In or Register to comment.