Home AMX User Forum NetLinx Studio

NEC E424 RS232 Not working

I've created this module in efforts of adding on to it, but I can't even get the power to work. I've tried using ASCII, Hex, and a combination of both. The power codes, directly from thier manual, don't work. When I power the TV on manually, the HDMI input code works fine.
MODULE_NAME='NEC E424' (DEV dvTV, DEV vdvTV)
(***********************************************************)
(*  FILE CREATED ON: 08/03/2015  AT: 10:25:19              *)
(***********************************************************)
(*  FILE_LAST_MODIFIED_ON: 09/23/2015  AT: 11:40:50        *)
(***********************************************************)


DEFINE_CONSTANT // TV Channels and Levels

// TV Channels
POWER                  = 9     // Momentary: Cycle power
DIGIT_0                = 10    // Momentary: Press menu button digit 0
DIGIT_1                = 11    // Momentary: Press menu button digit 1
DIGIT_2                = 12    // Momentary: Press menu button digit 2
DIGIT_3                = 13    // Momentary: Press menu button digit 3
DIGIT_4                = 14    // Momentary: Press menu button digit 4
DIGIT_5                = 15    // Momentary: Press menu button digit 5
DIGIT_6                = 16    // Momentary: Press menu button digit 6
DIGIT_7                = 17    // Momentary: Press menu button digit 7
DIGIT_8                = 18    // Momentary: Press menu button digit 8
DIGIT_9                = 19    // Momentary: Press menu button digit 9
MENU_PLUS_10           = 20    // Momentary: Press menu button plus_10
MENU_ENTER             = 21    // Momentary: Press menu button enter
CHAN_UP                = 22    // Momentary: Next station preset
CHAN_DN                = 23    // Momentary: Previous station preset
VOL_UP                 = 24    // Ramping:   Ramp volume up
VOL_UP_FB              = 24    // Feedback:  Volume ramp up feedback
VOL_DN                 = 25    // Ramping:   Ramp volume down
VOL_DN_FB              = 25    // Feedback:  Volume ramp down feedback
VOL_MUTE               = 26    // Momentary: Cycle volume mute
PWR_ON                 = 27    // Momentary: Set power on
PWR_OFF                = 28    // Momentary: Set power off
SOURCE_TV1             = 30    // Momentary: *deprecated Input Source in favor of Input Select* TV 1 source select
SOURCE_VIDEO1          = 31    // Momentary: *deprecated Input Source in favor of Input Select* Video 1 source select
SOURCE_VIDEO2          = 32    // Momentary: *deprecated Input Source in favor of Input Select* Video 2 source select
SOURCE_VIDEO3          = 33    // Momentary: *deprecated Input Source in favor of Input Select* Video 3 source select
SOURCE_TAPE1           = 34    // Momentary: *deprecated Input Source in favor of Input Select* Tape 1 source select
SOURCE_TAPE2           = 35    // Momentary: *deprecated Input Source in favor of Input Select* Tape 2 source select
SOURCE_CD1             = 36    // Momentary: *deprecated Input Source in favor of Input Select* CD 1 source select
SOURCE_TUNER1          = 37    // Momentary: *deprecated Input Source in favor of Input Select* Tuner 1 source select
SOURCE_PHONO1          = 38    // Momentary: *deprecated Input Source in favor of Input Select* Phono 1 source select
SOURCE_AUX1            = 39    // Momentary: *deprecated Input Source in favor of Input Select* Auxiliary 1 source select
TUNER_BAND             = 40    // Momentary: Cycle tuner band
MENU_CANCEL            = 43    // Momentary: Press menu button cancel
MENU_FUNC              = 44    // Momentary: Press menu button menu
MENU_UP                = 45    // Momentary: Press menu up button
MENU_DN                = 46    // Momentary: Press menu down button
MENU_LT                = 47    // Momentary: Press menu left button
MENU_RT                = 48    // Momentary: Press menu right button
MENU_SELECT            = 49    // Momentary: Press menu Select button (select current item under cursor)
MENU_EXIT              = 50    // Momentary: Press menu button exit
MENU_UP_LT             = 51    // Momentary: Press menu up left button
MENU_UP_RT             = 52    // Momentary: Press menu up right button
MENU_DN_LT             = 53    // Momentary: Press menu down left button
MENU_DN_RT             = 54    // Momentary: Press menu down right button
MENU_VIDEO             = 57    // Momentary: Press menu button video
MENU_THUMBS_DN         = 58    // Momentary: Press menu button thumbs down
MENU_THUMBS_UP         = 59    // Momentary: Press menu button thumbs up
MENU_ACCEPT            = 60    // Momentary: Press menu button accept
MENU_REJECT            = 61    // Momentary: Press menu button reject
MENU_LIVE_TV           = 62    // Momentary: Press menu button live TV
MENU_SLEEP             = 63    // Momentary: Press menu button sleep
MENU_PPV               = 64    // Momentary: Press menu button PPV
MENU_FUNCTION          = 65    // Momentary: Press menu button function
MENU_SETUP             = 66    // Momentary: Press menu button setup
MENU_XM                = 77    // Momentary: Press menu button xm
MENU_FM                = 78    // Momentary: Press menu button fm
MENU_AM                = 79    // Momentary: Press menu button am
MENU_CLEAR             = 80    // Momentary: Press menu button clear
MENU_BACK              = 81    // Momentary: Press menu button back
MENU_FORWARD           = 82    // Momentary: Press menu button forward
MENU_ADVANCE           = 83    // Momentary: Press menu button advance
MENU_DIMMER            = 84    // Momentary: Press menu button dimmer
MENU_HOLD              = 85    // Momentary: Press menu button hold
MENU_LIST              = 86    // Momentary: Press menu button list
MENU_LT_PAREN          = 87    // Momentary: Press menu button left paren
MENU_RT_PAREN          = 88    // Momentary: Press menu button right paren
MENU_UNDERSCORE        = 89    // Momentary: Press menu button underscore
MENU_DASH              = 90    // Momentary: Press menu button dash
MENU_ASTERISK          = 91    // Momentary: Press menu button asterisk
MENU_DOT               = 92    // Momentary: Press menu button dot
MENU_POUND             = 93    // Momentary: Press menu button pound
MENU_COMMA             = 94    // Momentary: Press menu button comma
MENU_DIAL              = 95    // Momentary: Press menu button dial
MENU_CONFERENCE        = 96    // Momentary: Press menu button conference
MENU_PLUS_100          = 97    // Momentary: Press menu button plus_100
MENU_PLUS_1000         = 98    // Momentary: Press menu button plus_1000
MENU_DISPLAY           = 99    // Momentary: Press menu button display
MENU_SUBTITLE          = 100   // Momentary: Press menu button subtitle
MENU_INFO              = 101   // Momentary: Press menu button info
MENU_FAVORITES         = 102   // Momentary: Press menu button favorites
MENU_CONTINUE          = 103   // Momentary: Press menu button continue
MENU_RETURN            = 104   // Momentary: Press menu button return
MENU_GUIDE             = 105   // Momentary: Press menu button guide
MENU_PAGE_UP           = 106   // Momentary: Press menu button page up
MENU_PAGE_DN           = 107   // Momentary: Press menu button page down
MENU_DECK_A_B          = 108   // Momentary: Press menu button deck AB
MENU_TV_VCR            = 109   // Momentary: Press menu button TV VCR
MENU_RECORD_SPEED      = 110   // Momentary: Press menu button record speed
MENU_PROGRAM           = 111   // Momentary: Press menu button program
MENU_AB_REPEAT         = 112   // Momentary: Press menu button AB repeat
MENU_HELP              = 113   // Momentary: Press menu button help
MENU_TITLE             = 114   // Momentary: Press menu button title
MENU_TOP_MENU          = 115   // Momentary: Press menu button top menu
MENU_ZOOM              = 116   // Momentary: Press menu button zoom
MENU_ANGLE             = 117   // Momentary: Press menu button angle
MENU_AUDIO             = 118   // Momentary: Press menu button audio
MENU_PREVIEW_INPUT     = 129   // Momentary: Press menu button preview input
MENU_SEND_INPUT        = 130   // Momentary: Press menu button send input
MENU_SEND_GRAPHICS     = 131   // Momentary: Press menu button send graphics
VOL_PRESET             = 138   // Momentary: Cycle volume preset
ASPECT_RATIO           = 142   // Momentary: Cycle aspect ratio
BRIGHT_UP              = 148   // Momentary: Increment brightness
BRIGHT_DN              = 149   // Momentary: Decrement brightness
COLOR_UP               = 150   // Momentary: Increment color
COLOR_DN               = 151   // Momentary: Decrement color
CONTRAST_UP            = 152   // Momentary: Increment contrast
CONTRAST_DN            = 153   // Momentary: Decrement contrast
SHARP_UP               = 154   // Momentary: Increment sharpness
SHARP_DN               = 155   // Momentary: Decrement sharpness
TINT_UP                = 156   // Momentary: Increment tint
TINT_DN                = 157   // Momentary: Decrement tint
PIP_POS                = 191   // Momentary: Cycle pip position
PIP_SWAP               = 193   // Momentary: Swap pip
PIP                    = 194   // Momentary: Cycle pip
PIP_ON                 = 195   // Discrete:  Set pip on
PIP_FB                 = 195   // Feedback:  Pip feedback
SOURCE_CYCLE           = 196   // Momentary: *deprecated Input Source in favor of Input Select* Cycle source select
VOL_MUTE_ON            = 199   // Discrete:  Set volume mute
VOL_MUTE_FB            = 199   // Feedback:  Volume mute feedback
MENU_FLASH             = 203   // Momentary: Press menu button flash
PIC_MUTE               = 210   // Momentary: Cycle picture/video mute
PIC_MUTE_ON            = 211   // Discrete:  Set picture/video mute on
PIC_MUTE_FB            = 211   // Feedback:  Picture/video mute feedback
PIC_FREEZE             = 213   // Momentary: Cycle freeze
PIC_FREEZE_ON          = 214   // Discrete:  Set freeze on
PIC_FREEZE_FB          = 214   // Feedback:  Freeze feedback
MENU_RESET             = 215   // Momentary: Press menu button reset
MENU_INSTANT_REPLAY    = 218   // Momentary: Press menu button instant replay
TUNER_PRESET_GROUP     = 224   // Momentary: Cycle station preset group
TUNER_STATION_UP       = 225   // Momentary: Increment tuner station
TUNER_STATION_DN       = 226   // Momentary: Decrement tuner station
TUNER_SCAN_FWD         = 227   // Momentary: Station scan forward
TUNER_SCAN_REV         = 228   // Momentary: Station scan backward/reverse
TUNER_SEEK_FWD         = 229   // Momentary: Station seek forward
TUNER_SEEK_REV         = 230   // Momentary: Station seek backward/reverse
TUNER_OSD              = 234   // Momentary: Cycle on-screen or front panel display info
TUNER_PREV             = 235   // Momentary: Goto previous tuner station
DEVICE_COMMUNICATING   = 251   // Feedback:  Device online event
DATA_INITIALIZED       = 252   // Feedback:  Data initialized event
POWER_ON               = 255   // Discrete:  Set power
POWER_FB               = 255   // Feedback:  Power feedback

// TV Levels
VOL_LVL                = 1     // Level: Volume level (0-255)
BRIGHT_LVL             = 10    // Level: Brightness level (0-255)
COLOR_LVL              = 11    // Level: Color level (0-255)
CONTRAST_LVL           = 12    // Level: Contrast level (0-255)
SHARP_LVL              = 13    // Level: Sharpness level (0-255)
TINT_LVL               = 14    // Level: Tint level (0-255)

//USER DEFINED CONSTANTS
SOURCE_VIDEO4           = 256
SOURCE_VIDEO5            = 257
SOURCE_VIDEO6            = 258
ASPECT_16            = 259
ASPECT_4            = 260
Auto_Size        = 261
Aspect_Zoom        = 262

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


DEFINE_TYPE

(***********************************************************)
(*               VARIABLE DEFINITIONS GO BELOW             *)
(***********************************************************)
DEFINE_VARIABLE
NON_VOLATILE CHAR cMsg[25]
(***********************************************************)
(*                 STARTUP CODE GOES BELOW                 *)
(***********************************************************)
DEFINE_START
CREATE_BUFFER dvTV, cMsg

(***********************************************************)
(*               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
(***********************************************************)
(*                THE EVENTS GO BELOW                      *)
(***********************************************************)
DEFINE_EVENT

DATA_EVENT[dvTV]
{
    ONLINE:
    {
        SEND_COMMAND dvTV, "'SET BAUD 9600,N,8,1'" //Sets baud rate
    SEND_COMMAND dvTV, "'RXON'" //starts serial port
    SEND_COMMAND dvTV, "'HSOFF'" //turns handshaking off
    ON[dvTV,DEVICE_COMMUNICATING]
    }
    OFFLINE:
    {
    OFF[dvTV, DEVICE_COMMUNICATING]
    }
    STRING:
    {
    SEND_STRING 0, "'FROM TV: ',cMsg"
    }
}

CHANNEL_EVENT[vdvTV, PWR_ON]
CHANNEL_EVENT[vdvTV, PWR_OFF]
CHANNEL_EVENT[vdvTV, SOURCE_VIDEO1]
{
    ON:
    {
        SWITCH(CHANNEL.CHANNEL)
    {
        CASE PWR_ON:         SEND_STRING dvTV, "$01,$30,$41,$30,$41,$30,$43,$02,$43,$32,$30,$33,$44,$36,$30,$30,$30,$31,$03,$73,$0d"
        CASE PWR_OFF:        SEND_STRING dvTV, "$01,$30,$41,$30,$41,$30,$43,$02,$43,$32,$30,$33,$44,$36,$30,$30,$30,$34,$03,$76,$0d"
        CASE SOURCE_VIDEO1:     SEND_STRING dvTV, "$01,$30,$41,$30,$45,$30,$41,$02,$30,$30,$36,$30,$30,$30,$31,$31,$03,$72,$0d" 
    }
    }
}

Comments

  • Joe HebertJoe Hebert Posts: 2,159
    If the input command is working then you know the baud rate and the cable is good.

    The power strings look correct. They are the same for many (if not all) of the NEC E series TVs.

    I had a power issue with one of the E4 series TV but I don?t remember exactly which model it was. Power ON didn?t work anymore and power OFF was actually doing a power TOGGLE. NEC confirmed it was a firmware bug. I don?t know if this is the same problem that you are experiencing but I would issue a power OFF command when the TV is OFF and see if it turns ON.

    I would also make sure the energy mode is turned off if it is not off already.

    And lastly I would cold boot the TV as that sometimes fixed the RS-232 comms.

    Good luck.
  • NEC e series com port is very problematic, you may want to disconnect your TV from power source then do factory reset.
    Also download PD comms tool (http://www.necdisplay.com/support-and-services/pdcommstool/downloads) to test rs-232 commands.
  • I've had nothing but trouble with the E series units. Even their own test program gets errors trying to control it. If it isn't ready it will reject your power codes. I finally started sending the power on/off codes 4 or 5 times with a wait between them to get them to turn on and off.
Sign In or Register to comment.