Two NI 700, One TP
pnaidoo1502
Junior Member
I have a system with two NI 700's and one TP. These are connected over IP. On a button push I need to be able to to send strings to the 232 port's of both the masters, like power on of plasma's, make a route on a switch, control a xap etc. Any idea's on how to do this.
Comments
-
I would use a dev array.
DEFINE_DEVICE dvDEVICE_1 = 5001:1:1 // Serial device on system 1 dvDEVICE_2 = 5001:1:2 // Serial device on system 2 dvTP = 10001:1:0 // Touch panel on system with the program DEFINE_VARIABLE // this is the dev array DEV dvDEVICE[]={dvDEVICE_1,dvDEVICE_2} DEFINE_EVENT BUTTON_EVENT[dvTP,1] { PUSH: { // This will send the string to both serial ports SEND_STRING dvDEVICE, "'STRING TO SEND TO BOTH'" } }
JB -
You also have to remember to set the masters up in master to master mode. It is obvious with Jeff's code below, but wanted to make sure you knew that...Jeff B wrote:I would use a dev array.
DEFINE_DEVICE dvDEVICE_1 = 5001:1:1 // Serial device on system 1 dvDEVICE_2 = 5001:1:2 // Serial device on system 2 dvTP = 10001:1:0 // Touch panel on system with the program DEFINE_VARIABLE // this is the dev array DEV dvDEVICE[]={dvDEVICE_1,dvDEVICE_2} DEFINE_EVENT BUTTON_EVENT[dvTP,1] { PUSH: { // This will send the string to both serial ports SEND_STRING dvDEVICE, "'STRING TO SEND TO BOTH'" } }
JB -
This code would allow for sending a serial string to each device individually.
DEFINE_DEVICE dvDEVICE_1 = 5001:1:1 // Serial device on system 1 dvDEVICE_2 = 5001:1:2 // Serial device on system 2 dvTP = 10001:1:0 // Touch panel on system with the program DEFINE_VARIABLE DEV dvDEVICE[]={dvDEVICE_1,dvDEVICE_2} INTEGER nBUTTON_ARRAY[]={2,3} DEFINE_EVENT BUTTON_EVENT[dvTP,nBUTTON_ARRAY] { PUSH: { STACK_VAR INTEGER nBtnIdx // select system to send serial string too nBtnIdx = GET_LAST(nBUTTON_ARRAY) // Send to serial device on selected system only SEND_STRING dvDEVICE[nBtnIdx], "'STRING TO SEND'" } }
JB -
Master to master mode
Thanks for the help, only one other question
How do you configure the masters for master to master mode? -
To set master to master mode:
Give each master a unique IP and system number. See tech note #348
In the URL list for one master, add the IP for the other master. See tech note #401
Done.
JB -
Thanks
Thanks for the help.
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