RSS

Category Archives: Serial Port Commands

Serial Port Commands for an LCD Projector

This is a short blog about using a computer to control a projector via sending serial port commands. The computer and the projector are connected via a serial cable (RS-232C cable). The commands and syntax will vary with each projector.

Notes

Set the serial port settings for the computer

  • Signal Format: Conforms to RS-232C standard. (look this up)
  • Baud rate: 9,600 bps
  • Data Length: 8 bits
  • Parity bit: NON
  • Stop bit: 1 bit
  • Flow control: None

Command Syntax

I want the projector to do four functions; turn on, turn off, switch-input-to-1 and switch-input-to-2. Depending on the projector you must format your commands based on the syntax specified in the projectors manual.

  • The syntax for my projector is very simple.
  • The commands are 8 characters long, the first 4 specifies the command, and the last 4 specifies the parameter.
  • A good example of this is the mute command.
  • Turn mute on.
    MUTE   1
  •  Turn mute off.
    MUTE   0
  • Note: there are 3 spaces between the mute command and its parameter.

Creating Commands

  1. Make and Navigate to the “C:\video” folder.
  2. Create four text files called “power_on.txt”, “power_off.txt”, “input1_on.txt” and “input2_on.txt”.
  3. Place the following code in power_on.txt.
    POWR   1
  4. Place the following code in power_off.txt.
    POWR   0
  5. Place the following code in input1_on.txt.
    IRGB   1
  6. Place the following code in input2_on.txt.
    IRGB   2

Creating Command Batch files

  1. In your “C:\video” folder, make four batch files called “power_on.bat”, “power_off.bat”, “Switch_To_Input_1..bat” and “Switch_To_Input_2.bat”.
  2. Place the following code in power_on.bat
    mode com1: BAUD=9600 PARITY=n DATA=8 STOP=1 xon=off odsr=off octs=off dtr=off rts=off idsr=off
    copy c:\video\power_on.txt COM1:
  3. Place the following code in power_off.bat
    mode com1: BAUD=9600 PARITY=n DATA=8 STOP=1 xon=off odsr=off octs=off dtr=off rts=off idsr=off
    copy c:\video\power_off.txt COM1:
  4. Place the following code in Switch_To_Input_1..bat
    mode com1: BAUD=9600 PARITY=n DATA=8 STOP=1 xon=off odsr=off octs=off dtr=off rts=off idsr=off
    copy c:\video\input1_on.txt COM1:
  5. Place the following code in Switch_To_Input_2..bat
    mode com1: BAUD=9600 PARITY=n DATA=8 STOP=1 xon=off odsr=off octs=off dtr=off rts=off idsr=off
    copy c:\video\input2_on.txt COM1:
  6. Your “C:\video” folder should look like this.

Test the Serial Port Commands

  1. Double click the “power_on.bat”. A command prompt will pop up that will look like this and the projector will turn on.


  2. Double click the “Switch_To_Input_2.bat”. A command prompt will pop up that will look like this and the projector will switch its input to 2.

  3. Double click the “Switch_To_Input_1.bat”. A command prompt will pop up that will look like this and the projector will switch its input to 1.

  4. Double click the “power_off.bat”. A command prompt will pop up that will look like this and the projector will turn off.

 
1 Comment

Posted by on May 4, 2012 in Serial Port Commands

 

Tags: , ,