Home AMX User Forum AMX Technical Discussion
Options

AMX NI-700 programming to control a projector

Hi there everyone im relatively new in the AMX programming world and we have an old solution that uses an ni-700 to turn a projector on with a ground t ground contact on input 1 and it will turn the projector off with a input on input 2 the old projector is on its last legs and we had different people do the programming years ago. Now though we purchased a new optoma zh-400 projector that has rs-232 capability i had even plugged it into my computer and was able to putty into it and send it the on command which is ~0000 1 and it worked but after doing some programming i havent been able to get the AMX device to power on the projector i was wondering if i have made any errors in my programming as i am new i can link it below

PROGRAM_NAME='Main-HH'
(***********************************************************)
(***********************************************************)
(* FILE_LAST_MODIFIED_ON: 03/06/2024 AT: 08:45:25 )
(***********************************************************)
(
System Type : NetLinx )
(***********************************************************)
(
REV HISTORY: )
(***********************************************************)
(

$History: $
)
(***********************************************************)
(
DEVICE NUMBER DEFINITIONS GO BELOW )
(***********************************************************)
DEFINE_DEVICE
dvMansionProj = 5001:1:0
dvIO = 5001:4:0
(***********************************************************)
(
CONSTANT DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_CONSTANT
ioPowerOn = 1
ioPowerOff = 2

(***********************************************************)
(* DATA TYPE DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_TYPE

(***********************************************************)
(* VARIABLE DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_VARIABLE

(***********************************************************)
(* LATCHING DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_LATCHING

(***********************************************************)
(* MUTUALLY EXCLUSIVE DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_MUTUALLY_EXCLUSIVE

(***********************************************************)
(* SUBROUTINE/FUNCTION DEFINITIONS GO BELOW )
(***********************************************************)
(
EXAMPLE: DEFINE_FUNCTION () )
(
EXAMPLE: DEFINE_CALL '' () *)

(***********************************************************)
(* STARTUP CODE GOES BELOW *)
(***********************************************************)
DEFINE_START

(***********************************************************)
(* THE EVENTS GO BELOW *)
(***********************************************************)
DEFINE_EVENT
DATA_EVENT[dvMansionProj]
{
ONLINE:
{
SEND_COMMAND dvMansionProj, "'SET BAUD 9600,N,8,1'"

}

}

CHANNEL_EVENT[dvIO,ioPowerOn]
{
ON:
{
SEND_STRING dvMansionProj, "'~0000 1'"
}
}
CHANNEL_EVENT[dvIO,ioPowerOff]
{
ON:
{
SEND_STRING dvMansionProj, "'~0000 0'"
}
}

(*****************************************************************)
(* )
(
!!!! WARNING !!!! )
(
)
(
Due to differences in the underlying architecture of the )
(
X-Series masters, changing variables in the DEFINE_PROGRAM )
(
section of code can negatively impact program performance. )
(
)
(
See “Differences in DEFINE_PROGRAM Program Execution” section )
(
of the NX-Series Controllers WebConsole & Programming Guide )
(
for additional and alternate coding methodologies. *)
(*****************************************************************)

DEFINE_PROGRAM

(*****************************************************************)
(* END OF PROGRAM )
(
)
(
!!! DO NOT PUT ANY CODE BELOW THIS COMMENT !!! )
(
*)
(*****************************************************************)

Comments

  • Options
    richardhermanrichardherman Posts: 389

    I think the commands to the projector should be terminated with a carriage return:

    SEND_STRING dvMansionProj, "'~0000 1',$0d"

  • Options
    HARMAN_ChrisHARMAN_Chris Posts: 598

    Agreed - the PC application is likely applying carriage return and possibly line feed without user intervention.

Sign In or Register to comment.