Home AMX User Forum AMX Technical Discussion

RS-232 with NI-700 ?

Hi there

The RS-232 ports of the NI-700 are software programmable and each time the master is rebooted their setup get lost, so I have put the command

SEND_STRING dvSerialDevice1, "'SET BAUD 9600,N,8,1 485 DISABLE'"

in my STARTUP section of the program but it does nothing! When I telnet to the NI-700 and execute

send_string [dvSerialDevice1, 'SET BAUD 9600,N,8,1 485 DISABLE']

then everything is fine and the serial device can be controlled fine.

Do anyone know what I am doing wrong and how can I setup these ports permanently?

Many thanks!

Comments

  • PhreaKPhreaK Posts: 966
    You need to use SEND_COMMAND rather than SEND_STRING. SEND_STRING sends the string 'through' the port to the device, whereas SEND_COMMAND will send it to the actual port (amx device).

    Generally I put the baud rate setting in the online event of the device as well, just keeps everything a bit neater, also if you are using an external serial box it will ensure everything will always play nice.
    DATA_EVENT[dvDEVICE]
    {
        ONLINE:	// Initialize coms
        {
    	SEND_COMMAND dvDEVICE, 'SET BAUD 9600 N,8,1 485 DISABLE'
        }
    }
    
  • bobbob Posts: 296
    Kim, thanks much!
  • HedbergHedberg Posts: 671
    it's important to do send_command for a device in the data_event: online rather than in define_start because the code in define_start typically runs before the devices are on line and a command sent to a device which is not on line will have no effect. Also, I think that the SET BAUD command should stick -- that is, if you set it correctly, it should stay set even through a power cycle. It's common to include a send command to SET BAUD in the online portion of the data_event anyway, even though it might not be technically necessary.
  • bobbob Posts: 296
    Harold, for some reasons the settings would not stick when I was setting the baud rate while in telent on the master. However I was using send_string there too... Switching now to ONLINE event and SEND_COMMAND. Thanks much for your help!

    Edit: now it works as it should!
Sign In or Register to comment.