RS 232 to control Optoma EX765W
arvinnino
Junior Member
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"
}
}
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
-
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? -
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" ? -
So your only using pins 2, 3 & 5 on the connectors and the other wires aren't connected as Auser suggested?i double check the cable that i used and the pin assignment is conrrect so i think there is no problem with the cable.
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.where can i find the "control system TX light" ?
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. -
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. -
Arvinnino.
Check your define device section...
You named port 1 as dvNexia2
Kenneth K -
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 -
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. -
Arvinnino.
Check your define device section...
You named port 1 as dvNexia2
Kenneth K
sorry its typo error.. but in my program its correct.. -
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. -
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
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums
