My first AMX program :)
adys
Junior Member
Hi all!
I just finished my first program
I get the input output leds on the NI300 to turn on when pushing some buttons on the TP (8400)
but I don't see the leds of the port ...
also when I connecting to the controller vis web browser I can see any devide on the devices list...
can someone have a look if my program is missing somthing crusial?
thanks a lot!
PROGRAM_NAME='room_1_program'
(***********************************************************)
(* System Type : NetLinx *)
(***********************************************************)
(* REV HISTORY: *)
(***********************************************************)
(***********************************************************)
(* DEVICE NUMBER DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_DEVICE
// my touch panel device
dvTP = 10001:1:0
// Denon DVD 2800 Device (controller:device:system)
dvDVD2800 = 5001:1:0
(***********************************************************)
(* CONSTANT DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_CONSTANT
DVD_PLAY = 1
DVD_PAUSE = 2
DVD_NEXT = 3
DVD_PREV = 4
DVD_FAST_BACKWARD = 5
DVD_FAST_FORWARD = 6
DVD_STOP = 7
DVD_PLAY_IR = 1
DVD_PAUSE_IR = 3
DVD_NEXT_IR = 4
DVD_PREV_IR = 5
DVD_FAST_BACKWARD_IR = 6
DVD_FAST_FORWARD_IR = 7
DVD_STOP_IR = 2
(***********************************************************)
(* DATA TYPE DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_TYPE
(***********************************************************)
(* VARIABLE DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_VARIABLE
VOLATILE INTEGER nDVDBtns []=
{
DVD_PLAY,
DVD_PAUSE,
DVD_NEXT,
DVD_PREV,
DVD_FAST_BACKWARD,
DVD_FAST_FORWARD,
DVD_STOP
}
(***********************************************************)
(* LATCHING DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_LATCHING
(***********************************************************)
(* MUTUALLY EXCLUSIVE DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_MUTUALLY_EXCLUSIVE
(***********************************************************)
(* SUBROUTINE/FUNCTION DEFINITIONS GO BELOW *)
(***********************************************************)
(* EXAMPLE: DEFINE_FUNCTION <RETURN_TYPE> <NAME> (<PARAMETERS>) *)
(* EXAMPLE: DEFINE_CALL '<NAME>' (<PARAMETERS>) *)
(***********************************************************)
(* STARTUP CODE GOES BELOW *)
(***********************************************************)
DEFINE_START
(* System Information Strings ******************************)
(* Use this section if there is a TP in the System! *)
(*
SEND_COMMAND TP,"'!F',250,'1'"
SEND_COMMAND TP,"'TEXT250-',__NAME__"
SEND_COMMAND TP,"'!F',251,'1'"
SEND_COMMAND TP,"'TEXT251-',__FILE__,', ',S_DATE,', ',S_TIME"
SEND_COMMAND TP,"'!F',252,'1'"
SEND_COMMAND TP,"'TEXT252-',__VERSION__"
SEND_COMMAND TP,"'!F',253,'1'"
(* Must fill this (Master Ver) *)
SEND_COMMAND TP,'TEXT253-'
SEND_COMMAND TP,"'!F',254,'1'"
(* Must fill this (Panel File) *)
SEND_COMMAND TP,'TEXT254-'
SEND_COMMAND TP,"'!F',255,'1'"
(* Must fill this (Dealer Info) *)
SEND_COMMAND TP,'TEXT255-'
*)
(***********************************************************)
(* THE EVENTS GO BELOW *)
(***********************************************************)
DEFINE_EVENT
BUTTON_EVENT[dvTP, nDVDBtns]
{
PUSH:
{
STACK_VAR INTEGER nBtnIndex
nBtnIndex = GET_LAST(nDVDBtns)
SWITCH(nBtnIndex)
{
CASE DVD_PLAY:
{
PULSE [dvDVD2800, DVD_PLAY_IR]
}
CASE DVD_PAUSE:
{
PULSE [dvDVD2800, DVD_PAUSE_IR]
}
CASE DVD_NEXT:
{
PULSE [dvDVD2800, DVD_NEXT_IR]
}
CASE DVD_PREV:
{
PULSE [dvDVD2800, DVD_PREV_IR]
}
CASE DVD_FAST_BACKWARD:
{
PULSE [dvDVD2800, DVD_FAST_BACKWARD_IR]
}
CASE DVD_FAST_FORWARD:
{
PULSE [dvDVD2800, DVD_FAST_FORWARD_IR]
}
CASE DVD_STOP:
{
PULSE [dvDVD2800, DVD_STOP_IR]
}
} // END OF - SWITCH
} // END OF - PUSH
} // END OF - button event MainSetup
(***********************************************************)
(* THE ACTUAL PROGRAM GOES BELOW *)
(***********************************************************)
DEFINE_PROGRAM
(***********************************************************)
(* END OF PROGRAM *)
(* DO NOT PUT ANY CODE BELOW THIS COMMENT *)
(***********************************************************)
I just finished my first program
I get the input output leds on the NI300 to turn on when pushing some buttons on the TP (8400)
but I don't see the leds of the port ...
also when I connecting to the controller vis web browser I can see any devide on the devices list...
can someone have a look if my program is missing somthing crusial?
thanks a lot!
PROGRAM_NAME='room_1_program'
(***********************************************************)
(* System Type : NetLinx *)
(***********************************************************)
(* REV HISTORY: *)
(***********************************************************)
(***********************************************************)
(* DEVICE NUMBER DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_DEVICE
// my touch panel device
dvTP = 10001:1:0
// Denon DVD 2800 Device (controller:device:system)
dvDVD2800 = 5001:1:0
(***********************************************************)
(* CONSTANT DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_CONSTANT
DVD_PLAY = 1
DVD_PAUSE = 2
DVD_NEXT = 3
DVD_PREV = 4
DVD_FAST_BACKWARD = 5
DVD_FAST_FORWARD = 6
DVD_STOP = 7
DVD_PLAY_IR = 1
DVD_PAUSE_IR = 3
DVD_NEXT_IR = 4
DVD_PREV_IR = 5
DVD_FAST_BACKWARD_IR = 6
DVD_FAST_FORWARD_IR = 7
DVD_STOP_IR = 2
(***********************************************************)
(* DATA TYPE DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_TYPE
(***********************************************************)
(* VARIABLE DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_VARIABLE
VOLATILE INTEGER nDVDBtns []=
{
DVD_PLAY,
DVD_PAUSE,
DVD_NEXT,
DVD_PREV,
DVD_FAST_BACKWARD,
DVD_FAST_FORWARD,
DVD_STOP
}
(***********************************************************)
(* LATCHING DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_LATCHING
(***********************************************************)
(* MUTUALLY EXCLUSIVE DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_MUTUALLY_EXCLUSIVE
(***********************************************************)
(* SUBROUTINE/FUNCTION DEFINITIONS GO BELOW *)
(***********************************************************)
(* EXAMPLE: DEFINE_FUNCTION <RETURN_TYPE> <NAME> (<PARAMETERS>) *)
(* EXAMPLE: DEFINE_CALL '<NAME>' (<PARAMETERS>) *)
(***********************************************************)
(* STARTUP CODE GOES BELOW *)
(***********************************************************)
DEFINE_START
(* System Information Strings ******************************)
(* Use this section if there is a TP in the System! *)
(*
SEND_COMMAND TP,"'!F',250,'1'"
SEND_COMMAND TP,"'TEXT250-',__NAME__"
SEND_COMMAND TP,"'!F',251,'1'"
SEND_COMMAND TP,"'TEXT251-',__FILE__,', ',S_DATE,', ',S_TIME"
SEND_COMMAND TP,"'!F',252,'1'"
SEND_COMMAND TP,"'TEXT252-',__VERSION__"
SEND_COMMAND TP,"'!F',253,'1'"
(* Must fill this (Master Ver) *)
SEND_COMMAND TP,'TEXT253-'
SEND_COMMAND TP,"'!F',254,'1'"
(* Must fill this (Panel File) *)
SEND_COMMAND TP,'TEXT254-'
SEND_COMMAND TP,"'!F',255,'1'"
(* Must fill this (Dealer Info) *)
SEND_COMMAND TP,'TEXT255-'
*)
(***********************************************************)
(* THE EVENTS GO BELOW *)
(***********************************************************)
DEFINE_EVENT
BUTTON_EVENT[dvTP, nDVDBtns]
{
PUSH:
{
STACK_VAR INTEGER nBtnIndex
nBtnIndex = GET_LAST(nDVDBtns)
SWITCH(nBtnIndex)
{
CASE DVD_PLAY:
{
PULSE [dvDVD2800, DVD_PLAY_IR]
}
CASE DVD_PAUSE:
{
PULSE [dvDVD2800, DVD_PAUSE_IR]
}
CASE DVD_NEXT:
{
PULSE [dvDVD2800, DVD_NEXT_IR]
}
CASE DVD_PREV:
{
PULSE [dvDVD2800, DVD_PREV_IR]
}
CASE DVD_FAST_BACKWARD:
{
PULSE [dvDVD2800, DVD_FAST_BACKWARD_IR]
}
CASE DVD_FAST_FORWARD:
{
PULSE [dvDVD2800, DVD_FAST_FORWARD_IR]
}
CASE DVD_STOP:
{
PULSE [dvDVD2800, DVD_STOP_IR]
}
} // END OF - SWITCH
} // END OF - PUSH
} // END OF - button event MainSetup
(***********************************************************)
(* THE ACTUAL PROGRAM GOES BELOW *)
(***********************************************************)
DEFINE_PROGRAM
(***********************************************************)
(* END OF PROGRAM *)
(* DO NOT PUT ANY CODE BELOW THIS COMMENT *)
(***********************************************************)
Comments
-
First and short view:
// my touch panel device
dvTP = 10001:1:0
// Denon DVD 2800 Device (controller:device:system)
dvDVD2800 = 5001:1:0
your Device is a RS 232 not a IR Interface
dvDVD2800 = 5001:9:0
thats your first IR Interface..
Don't forget: Load your *.IRL File to the Device 5001:9:0 -
Well...
5001:1:0 is a serial port, not an IR port. So that probably won't be helping much.
Try changeing your port to
If it is a 2XXX series, ports 5-8
or if its a 4XXX/3XXX ports 9-16 are the IR ports
A 700's IR port is port 3 and a 900 is ports 2-4,
Don't forget to upload an IR file to the port first !
Good Luck
-
Oppsi

now it working!
thanks guys
ady -
Also don't use PULSE to send IR, it's too messy to manage when you need different times of pulse between devices controlled through IR and also doesn't manage queue in IR commands on a same port.
Always use SEND_COMMAND with SP, or XCH (Very useful for control of cable or sat boxes), and set up each port with a SEND_COMMAND CTON and CTOF in online of each IR Port
Vinc
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