Home AMX User Forum NetLinx Studio

How do I configure a Serial Port?

Where do I need to look in order to find information on how to configure a serial port (i.e. set the baud rate, parity bit, etc.) on a NI-3100?

Searching the forums have turned up that I should use a send_command from an online handler from a data_event that's tied to the serial port I want to setup. But I can't find anything in the help files or my AMX Programmer I&II book that tells me what commands I can send using the send_command or how to even format them.

I'd expect something like this to be written done somewhere... I figure I must just be looking in the wrong places.

Thanks for the help,
Derek.

Comments

  • ericmedleyericmedley Posts: 4,177
    There are a couple places to find it quickly.

    One is Software History which is located in the Tools menu of Netlinx Studio.

    Another is to go to the AMX website and go to the NI-3100 product page. There you'll find the programming manual. It'll have that information there as well.

    One thing to remember: put the configuration command in a DATA_EVENT, not at program startup.

    something like
    DEFINE_DEVICE
    my_NI-3100_serial_port_1 = 5001:01:0
    
    DEFINE_EVENT
    
    DATA_EVENT[my_NI-3100_serial_port_1]
    {
    ONLINE:
      {
      SEND_COMMAND my_NI-3100_serial_port_1,'command goes here'
      }
    }
    
    
  • alvinyowalvinyow Posts: 27
    Hi Derek you must be new to AMX programming.
    Here is an example how to set the serial port

    DATA_EVENT[LCD_LEFT]
    {
    ONLINE:SEND_COMMAND DATA.DEVICE,'SET BAUD 9600,N,8,1'
    }

    Or you could use the Diagnostic Tools to set the serial port by using the send_command

    Hope this will help

    Cheers
  • AHH! A Programming Guide! That's exactly what I was looking for...

    Thanks for the help,
    Derek.
  • Yeah... I'm still pretty green. I was sent to the Programmer I course 3 years ago, and we've been doing nothing but ******** systems ever since. Recently, we picked up an "AMX Experience" package to try out AMX in our conference room so I've been trying to get back up to speed.

    Gotta, say, it sure is nice to actually get to use an actual programming language instead of the drag and drop hell of Simpl Windows. Plus, it's nice that we can actually do diffs and merges in our source code versioning system becasue axs is a simple ascii file and not a crazy markup language looking pile of... oh nevermind.

    Thanks for the help guys,
    Derek.
  • Joe HebertJoe Hebert Posts: 2,159
    ericmedley wrote:
    There are a couple places to find it quickly.

    One is Software History which is located in the Tools menu of Netlinx Studio.

    Another is to go to the AMX website and go to the NI-3100 product page. There you'll find the programming manual. It'll have that information there as well.
    There is also AMX-PI which is the new and way improved version of Software History.
  • ericmedleyericmedley Posts: 4,177
    Joe Hebert wrote:
    There is also AMX-PI which is the new and way improved version of Software History.

    True dat,

    it is also a great resource and is much nicer than Software History.

    thanks for reminding me of it.

    ejm
  • Chip MoodyChip Moody Posts: 727
    Yeah, and pick up all the other bullcrap that goes with dealing with AMX systems that don't exist on Cre$tron.

    It's all a trade-off one way or the other...

    - Chip

    Gotta, say, it sure is nice to actually get to use an actual programming language instead of the drag and drop hell of Simpl Windows.
  • alvinyow wrote:
    Hi Derek you must be new to AMX programming.
    Here is an example how to set the serial port

    DATA_EVENT[LCD_LEFT]
    {
    ONLINE:SEND_COMMAND DATA.DEVICE,'SET BAUD 9600,N,8,1'
    }

    Or you could use the Diagnostic Tools to set the serial port by using the send_command

    Hope this will help

    Cheers


    I do
    ONLINE:
    {
    SEND_COMMAND dvDevice,'SET BAUD 9600,N,8,1 485 DISABLE';
    WAIT 3 SEND_COMMAND dvDevice,'HSOFF';
    }
    in every of my module files.

    so even if RS-485 or handshaking has been used on that port, these are disabled. there is also a
    SEND_COMMAND <DEV>,'XOFF'
    command that disables software handshaking, if somebody uses this one frequently...
  • PyroGuyPyroGuy Posts: 121
    clarify - device vs port for ONLINE EVENT

    Further to the thread - (I think I'm a step above newbie - certainly no expert but questioning that right now - sleep depravation is wonderful)

    I want to ensure the port on the NI2100 is set correctly every time they system boots.

    I used code as posted previously in the thread

    DEFINE_DEVICE
    dvSwitch = 5001:1:0 // Autopatch Precis LT w DSP (9600, N,1,8)

    DATA_EVENT [dvSwitch]
    {
    ONLINE:
    {
    //Set baud rate for RS232 port 1 N-1-8
    SEND_COMMAND DATA.DEVICE,'SET BAUD 9600,N,8,1' PULSE [dvRelay,1]
    }

    The relay pulse is in just to know it was getting there, however it appears to be triggering when the port itself on the NI comes online, NOT the switcher.

    I tested this by having the switcher unplugged from the RS232 port and still heard the relay fire.

    What am I missing please?

    Cheers!
  • Joe HebertJoe Hebert Posts: 2,159
    PyroGuy wrote:
    ,,,it appears to be triggering when the port itself on the NI comes online, NOT the switcher.

    I tested this by having the switcher unplugged from the RS232 port and still heard the relay fire.

    What am I missing please?
    You're not missing anything. The ONLINE event is for the port itself, not for any device connected to it.
  • NMarkRobertsNMarkRoberts Posts: 455
    PyroGuy wrote:
    The relay pulse is in just to know it was getting there, however it appears to be triggering when the port itself on the NI comes online, NOT the switcher.
    Maybe the point of confusion is that the switcher does not in any sense come online. Well it might - but the controller doesn't know that. Your software might.
Sign In or Register to comment.