Home AMX User Forum AMX General Discussion
Options

RS 232 to control Optoma EX765W

hi this is my first time controling a device using RS232, I dont know if theres a problem with the device or am i doing the wrong thing.. I have NI-2100 and Optoma EX765W connected via RS232 from Port 1 of NI-2100, i used RS232 cable that comes with the package of Optoma.

this is my source code, is there anything that i missed or done something wrong or should have done?? thanks..

DEFINE_DEVICE

dvNexia2 = 5001:1:1


DEFINE_START

SEND_COMMAND dvProj,'SET BAUD 9600,N,8,1'


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


BUTTON_EVENT[dvMET13,1]

{
PUSH:
{
[dvMET13,1] = ![dvMET13,1]
SEND_STRING dvProj,"'~0071 4',$0D,$0A"
}
}

Comments

  • Options
    AuserAuser Posts: 506
    arvinnino wrote: »
    I have NI-2100 and Optoma EX765W connected via RS232 from Port 1 of NI-2100, i used RS232 cable that comes with the package of Optoma.

    this is my source code, is there anything that i missed or done something wrong or should have done?? thanks..

    A couple of things I would personally do differently:

    1 - Use a custom made cable with just pins 2, 3 and 5 (ie. TX, RX and ground) connected. Molded cables usually have most if not all conductors connected internally which can cause communications not to work on Netlinx serial ports (which are far from a standard port).

    2 - I don't like the look of using DATA_EVENT[0] to set the baud rate of the serial port. It would be better if you change that line to DATA_EVENT[dvProj].

    3 - You don't need the SET BAUD send command in DEFINE_START

    Importantly, is the control system TX light for the serial port flashing when you press the keypad button?
  • Options
    i double check the cable that i used and the pin assignment is conrrect so i think there is no problem with the cable.

    where can i find the "control system TX light" ?
  • Options
    viningvining Posts: 4,368
    arvinnino wrote: »
    i double check the cable that i used and the pin assignment is conrrect so i think there is no problem with the cable.
    So your only using pins 2, 3 & 5 on the connectors and the other wires aren't connected as Auser suggested?
    where can i find the "control system TX light" ?
    On the front of the controller (master/NI-x???) the leds that say TX. Look for the TX that's for your serial port and it should flash when you press a button.

    If it doesn't flash when you push the button then look at your button channel in your TP design and make sure the channel port assignments match your code and check your dev declaration and make sure you're 5001: port used:0. And use send_string 0's to ensure your button event fires when you push the KP's button cuz that needs proper addressing too.

    If it does flash but you get no RX light flashing then check your cable, your port settings and your string format and commands.
  • Options
    Yeah that pins 2,3,5 thing is pretty important. I can't remember on the Optomas but a lot of times that included serial cable is for firmware updates. Here's a funny (well, funny now) story about how we wiped out firmware on a device by using a full-pinned cable http://www.amxforums.com/showthread.php?1150-Key-Digital-HD1080P-and-AMX

    Another thing you can do is to open up your "control a device" console in Netlinx, enable notifications and diagnostics and shoot commands at the device there to see if there's any response. Put in some line that sends the data_events data.txt from the projector so you can see it.
  • Options
    Arvinnino.

    Check your define device section...

    You named port 1 as dvNexia2


    Kenneth K
  • Options
    ericmedleyericmedley Posts: 4,177
    This was already said but a little explanation might be in order seeing that you didn't catch it on your own...

    Putting the send command baud rate stuff in a Data_Event[0] basically says when the NI Master controller is officially online send the baud rate command. Bear in mind, the serial port device (which is device 5001, ports 1-6 has not yet officially come online to receive the baud rate command. So it probably is still on whatever baud rate it was set to last time.

    The way your code is written the serial port will never get the baud crate command.

    The same thing is true for putting it in define_Start. The serial port isn't online yet to receive the command.

    Hope that helps.
    E
  • Options
    vining wrote: »
    So your only using pins 2, 3 & 5 on the connectors and the other wires aren't connected as Auser suggested?

    On the front of the controller (master/NI-x???) the leds that say TX. Look for the TX that's for your serial port and it should flash when you press a button.

    If it doesn't flash when you push the button then look at your button channel in your TP design and make sure the channel port assignments match your code and check your dev declaration and make sure you're 5001: port used:0. And use send_string 0's to ensure your button event fires when you push the KP's button cuz that needs proper addressing too.

    If it does flash but you get no RX light flashing then check your cable, your port settings and your string format and commands.


    Thanks for the help... Yes i check on the manual of projector, the included RS232 cable in the projector only uses pin 2 3 & 5.

    i tried this:

    BUTTON_EVENT[dvMET13,1]

    {
    PUSH:
    {
    [dvMET13,1] = ![dvMET13,1]
    SEND_STRING dvProj,"'~0071 4 <CR>'"
    SEND_STRING 0,"'~0071 4 <CR>'"
    }
    }

    and im receiving the String in diagnostic window but the TX LED is not turning on..

    i declare the device like this " dvProj = 5001:1:0" but the LED is not turning on everytime im pressing button 1 of MET13.
  • Options
    kennethk wrote: »
    Arvinnino.

    Check your define device section...

    You named port 1 as dvNexia2


    Kenneth K

    sorry its typo error.. but in my program its correct..
  • Options
    ericmedley wrote: »
    This was already said but a little explanation might be in order seeing that you didn't catch it on your own...

    Putting the send command baud rate stuff in a Data_Event[0] basically says when the NI Master controller is officially online send the baud rate command. Bear in mind, the serial port device (which is device 5001, ports 1-6 has not yet officially come online to receive the baud rate command. So it probably is still on whatever baud rate it was set to last time.

    The way your code is written the serial port will never get the baud crate command.

    The same thing is true for putting it in define_Start. The serial port isn't online yet to receive the command.

    Hope that helps.
    E



    Thanks for the info i fully understand it now.
  • Options
    aksyalaksyal Posts: 21
    arvinnino wrote: »
    Thanks for the help... Yes i check on the manual of projector, the included RS232 cable in the projector only uses pin 2 3 & 5.

    i tried this:

    BUTTON_EVENT[dvMET13,1]

    {
    PUSH:
    {
    [dvMET13,1] = ![dvMET13,1]
    SEND_STRING dvProj,"'~0071 4 <CR>'"
    SEND_STRING 0,"'~0071 4 <CR>'"
    }
    }

    and im receiving the String in diagnostic window but the TX LED is not turning on..

    i declare the device like this " dvProj = 5001:1:0" but the LED is not turning on everytime im pressing button 1 of MET13.

    BUTTON_EVENT[dvMET13,1]
    {
    push:
    {
    send_string dvproj,"'~XX00 1',$0d" //for swich on projector
    }
    }

    SEND_STRING dvProj,"'~0071 4 <CR>'"

    I think <CR> is "Carriage Return" I usually use this with $0D in hexa or 13 in in ASCII
    and device you use is dvNexia2 not dvProj

    hopefully this can solve your problem
Sign In or Register to comment.