APR3-PRT3 Printer Module
pfr
Posts: 4
Has anybody dealt with integrating a Paradox Alarm System? I seem to be having some trouble to get it to work with an ni700..
The system is connected to the APR3-PRT3 Printer Module, which then is set up for Home Automation mode (all done by the guys from Paradox). This enables it to send the different zone statuses via serial. I have used a portion of Matlab code directly on the printer module to check the format of the output and also to confirm all the serial settings and it works 100%. I've also done the same with the ni700, feeding in the output that I recieved from the printer module via Matlab, and it also works 100%.
However, when I connect the two together, I can't get the ni700 to recieve anything! I'm sure most likely a fundamental problem between the two, as individually they are working. Being relatively new to this, is there anything about serial communication that I might be doing fundamentally wrong? A portion of the very simplified code is shown below;
//Start Code
DEFINE_DEVICE
//dvNI700 = 5001:0:0 //default setting for controller
dvPROJECTOR = 05001:1:0 //RS232 communication used for projector
dvSERIALCOMMS = 05001:2:0 //RS232 communication paradox
dvIR = 05001:3:0 //IR port out
etc..
DEFINE_START
CREATE_BUFFER dvPROJECTOR,PROJECTOR_BUFFER //PROJECTOR COMMUNICATIONS
CREATE_BUFFER dvSERIALCOMMS,SWITCH_BUFFER //PARADOX SYSTEM COMMUNICATIONS
SET_PULSE_TIME (3) //Set up pulse time for IR
SEND_COMMAND dvPROJECTOR,'SET BAUD 19200,N,8,1,485 DISABLE' //Set up projector for interface
SEND_COMMAND dvSERIALCOMMS,'SET BAUD 9600,N,8,1,485 DISABLE' //Set up PARADOX
etc..
DEFINE_EVENT
DATA_EVENT[dvSERIALCOMMS]
{
STRING:
{
SWITCH_BUFFER = "SWITCH_BUFFER, DATA.TEXT"
SELECT
{
ACTIVE(FIND_STRING(SWITCH_BUFFER,"71,48,48,49,78,48,50,52",1)):
{
ON[dvSWITCH1,1]
SWITCH_TEMP = REMOVE_STRING(SWITCH_BUFFER, "71,48,48,49,78,48,50,52",1)
}
(* SECOND TWO ACTIVE STATES ARE FOR TEST ONLY
ACTIVE(FIND_STRING(SWITCH_BUFFER,"71,48,48,49",1)):
{
ON[dvSWITCH1,1]
SWITCH_TEMP = REMOVE_STRING(SWITCH_BUFFER, "71,48,48,49",1)
}
ACTIVE(FIND_STRING(SWITCH_BUFFER,"$00,$00,$01",1)):
{
ON[dvSWITCH1,1]
SWITCH_TEMP = REMOVE_STRING(SWITCH_BUFFER, "$00,$00,$01",1)
}
*)
}
WAIT 50
{
OFF[dvSWITCH1,1]
}
}
}
//CHECK PARADOX ZONES IF NIGHT/AUTO MODE ON
WAIT 10
{
IF(PARADOX_FLAG|PARADOX_FLAG_2)
{
//REQUEST ZONE STATUS
SEND_STRING dvSERIALCOMMS, "82,90,0,0,1,13" //REQUEST ZONE 1 STATUS
}
}
The system is connected to the APR3-PRT3 Printer Module, which then is set up for Home Automation mode (all done by the guys from Paradox). This enables it to send the different zone statuses via serial. I have used a portion of Matlab code directly on the printer module to check the format of the output and also to confirm all the serial settings and it works 100%. I've also done the same with the ni700, feeding in the output that I recieved from the printer module via Matlab, and it also works 100%.
However, when I connect the two together, I can't get the ni700 to recieve anything! I'm sure most likely a fundamental problem between the two, as individually they are working. Being relatively new to this, is there anything about serial communication that I might be doing fundamentally wrong? A portion of the very simplified code is shown below;
//Start Code
DEFINE_DEVICE
//dvNI700 = 5001:0:0 //default setting for controller
dvPROJECTOR = 05001:1:0 //RS232 communication used for projector
dvSERIALCOMMS = 05001:2:0 //RS232 communication paradox
dvIR = 05001:3:0 //IR port out
etc..
DEFINE_START
CREATE_BUFFER dvPROJECTOR,PROJECTOR_BUFFER //PROJECTOR COMMUNICATIONS
CREATE_BUFFER dvSERIALCOMMS,SWITCH_BUFFER //PARADOX SYSTEM COMMUNICATIONS
SET_PULSE_TIME (3) //Set up pulse time for IR
SEND_COMMAND dvPROJECTOR,'SET BAUD 19200,N,8,1,485 DISABLE' //Set up projector for interface
SEND_COMMAND dvSERIALCOMMS,'SET BAUD 9600,N,8,1,485 DISABLE' //Set up PARADOX
etc..
DEFINE_EVENT
DATA_EVENT[dvSERIALCOMMS]
{
STRING:
{
SWITCH_BUFFER = "SWITCH_BUFFER, DATA.TEXT"
SELECT
{
ACTIVE(FIND_STRING(SWITCH_BUFFER,"71,48,48,49,78,48,50,52",1)):
{
ON[dvSWITCH1,1]
SWITCH_TEMP = REMOVE_STRING(SWITCH_BUFFER, "71,48,48,49,78,48,50,52",1)
}
(* SECOND TWO ACTIVE STATES ARE FOR TEST ONLY
ACTIVE(FIND_STRING(SWITCH_BUFFER,"71,48,48,49",1)):
{
ON[dvSWITCH1,1]
SWITCH_TEMP = REMOVE_STRING(SWITCH_BUFFER, "71,48,48,49",1)
}
ACTIVE(FIND_STRING(SWITCH_BUFFER,"$00,$00,$01",1)):
{
ON[dvSWITCH1,1]
SWITCH_TEMP = REMOVE_STRING(SWITCH_BUFFER, "$00,$00,$01",1)
}
*)
}
WAIT 50
{
OFF[dvSWITCH1,1]
}
}
}
//CHECK PARADOX ZONES IF NIGHT/AUTO MODE ON
WAIT 10
{
IF(PARADOX_FLAG|PARADOX_FLAG_2)
{
//REQUEST ZONE STATUS
SEND_STRING dvSERIALCOMMS, "82,90,0,0,1,13" //REQUEST ZONE 1 STATUS
}
}
0
Comments
DEFINE_PROGRAM
//CHECK PARADOX ZONES IF NIGHT/AUTO MODE ON
WAIT 10
{
IF(PARADOX_FLAG|PARADOX_FLAG_2)
{
//REQUEST ZONE STATUS
SEND_STRING dvSERIALCOMMS, "82,90,0,0,1,13" //REQUEST ZONE 1 STATUS
}
}
1) Make sure the cable is correct. Check out the first 2 questions in the forum FAQ.
http://amxforums.com/showthread.php?t=4085
2) The baud rate SEND_COMMANDs should be moved from DEFINE_START to the ONLINE: handler of the DATA_EVENT for your serial devices. The RS-232 ports may not be ready to accept a command when DEFINE_START triggers. If you wait for the ONLINE event you?ll know the ports are ready.
HTH
Thanks!