Barco FLM R20+ User guide

Category
Projectors
Type
User guide
Co mmunicating with a Barco projector over
network
Technical note
MED20080612/00
12/06/2008
Barco nv Media & Entertainment Division
Noordlaan 5, B-8520 Kuurne
Phone: +32 56.36.89.70
Fax: +32 56.36.883.86
Visit us at the web: www.barco.com
Printed in Belgium
1. General
1. GENERAL
1.1 Introduction
Introduction
This technical note explains how you can setup and c omm unicate with a Barco pro jector using the LCD/
DLP protocol over a TCP/IP
network. This technical n ote focuses on Barco Events projector series that support network communication: XLM, FLM, CLM, and
SLM.
Copyright
This document is Copyright © 2008 by Barc o Media & Entertainment. No part of this doc ument may be copied, reproduced or
translated. It shall not otherwise be recorded, transmitted or stored in a retrieval system without the prior consent of Barco.
Disclaimer
Barco provides this technical n ote ’as is’ without warranty of any kind, either expressed or implied, including but not lim ited to the
implied warranties or mercha ntability and tness f or a particular purpose. Barco may make improvem ents and/or changes to the
product(s) and/or the program(s) described in this publication at any time without notice.
This publication could contain technical inaccuracies or typographical errors. Changes are periodically made to the information in
this publication; these changes are incorporated in new editions of this publication.
Audience
This technical note is intended for software programmers and system integrators that want to be able to control a Barco projector
from their ow n application, ov er a TCP/IP network.
This document expects a basic knowledge of T CP/IP networking and some knowledge of programm ing language. The ex amples in
this documen t are written in Java.
Feedback
Feedback is most certainly welcom e for this document. P lease send your additions, comments and criticisms to the following E-mail
address: e
vents.techsupport@barco.com.
Trademarks
Java is a registered trademark of Sun Microsystems, Inc.
MED20080612 COMMUNICATING WITH A BARCO PROJECTOR OVER NETWORK 12/06/2008
1
1. General
2 MED20080612 COMMUNICATING WITH A BARCO PROJECTOR OVER NETWORK 12/06/2008
2. An introduction to the Barco LCD/DLP protocol
2. AN INTRODUCTION TO THE BARCO LCD/DLP
PROTOCOL
Intro
The base for all comm unication is the Barco LCD/DLP protocol. T his protocol has been us ed on serial communic ation but is now
also used for network based communication. This section explains this protocol in brief. More information about the protocol itself
can be found in the document "Serial Communication LCD-DLP P rojector" (see "Further informat
ion", page 15).
2.1 Command structure
Overview command structure
Each comm and is pac kaged in this structure:
0xFE
Start byte (1 byte)
ADDR Device address
(1 byte)
PREFIX
Prex (0..n bytes)
CMD Comm and (1..n bytes)
DATA Data (0..n bytes)
CHK Checksum (1 byte)
0xFF Stop byte (1 byte)
Explanation
•Thestart and stop byte are used to let the receiver know that a command is starting or has stopped.
Device ad dress is used when m ultiple devices are c onnected on the sam e physical connection. This is typically used with
serial connections. In case of Ethernet connections this should be set to 0.
Prex bytes: for som e special comm ands it is possible to use prex bytes before the actual command bytes. It depends on
the actual protocol implementation which prexes are available and when they can be used.
Command bytes: there will be at least one byte per comm and. The command bytes actually tell the devic e what to do.
Data bytes: this is optional and depend s on the command that will be sent. See also Data bytes chapter.
Checksum byte: this byte is used to detect errors in the transmission or reception of the command.
2.2 Bytes mark up
Overview and examples
Any c omm and byte, data byte or checksum byte that equals 0x80, 0xFE or 0xFF, has to be mark ed up for transmission with a
leading 0x80.
Example 1 : By te to send: 0x80
Actual bytes to send after m ark up: 0x80 0x00
Example 2 : By te to send: 0xFE
Actual bytes to send after m ark up: 0x80 0x7E
Example 3 : By te to send: 0xFF
Actual bytes to send after m ark up: 0x80 0x7F
Example 4 : Bytes to send: 0xFE 0xFF 0x80 0x00
Actual bytes to send after mark up: 0x80 0x7E
0x80 0x7F 0x80 0x00 0x00
MED20080612 COMMUNICATING WITH A BARCO PROJECTOR OVER NETWORK 12/06/2008
3
2. An introduction to the Barco LCD/DLP protocol
2.3 Characters and character strings
Overview
When characters need to be sent in the data section of a command, we use ANSI encoding (ASCII) for sending each character as
abyte.
Formatting
Character strings can be formatted in two ways:
C-style strings
Pascal-style strings
C-style format
An array of one or more characters which is terminated by a NULL ch aracter (0x00). The pos ition of the NULL character determines
the length of the string.
Example: f’’o’’o’’’’b’’a’’r’0x00
Pascal-style format
An array of one or more characters. The rst byte of the string indicates the length of the string. Therefore
pascal-sty le string s a re
limited to 255 characters.
Example: 0x07’f’’o’’o’’’’b’’a’r
2.4 Multi-byte va l ues
Overview
A multi-byte value consists of more than one byte w here the rst byte is the M ost Signicant Byte (M SB).
Example of a 4-byte value: 0x01 0x20 0x50 0x30
= (0x01 * 256^3) + (0x20 * 256^2) + (0x50 * 256) + (0x30)
= (1 * 16777216) + (32 * 65536) + (80 * 25 6) + 4 8
= 16 777216 + 2097152 + 20480 + 48
= 18894896
2.5 Checksum
Overview
The checksum value for a command is calculated by doing a modulo
256 on the sum of the by te values of all bytes between start of
the comm and and the checksum byte.
Checksum calculation
Checksum = (AD DR value + PREFIX v alues + CM D values + DATA va lues) mod 256
2.6 Acknowledgement (ACK and NACK)
Overview
If a c omm and is received, the receiver will chec k the validity and correctness of the command before processing it. If the command
is understood, the receiver will rst acknowledge the command before doing the actual processing of the command.
This command is called the ACK:
ACK (ACKno wledge)
Command[0]
0x00
Command[1]
0x06
4
MED20080612 COMMUNICATING WITH A BARCO PROJECTOR OVER NETWORK 12/06/2008
2. An introduction to the Barco LCD/DLP protocol
An ACK is sent when these conditions are met::
The command format is correct
The c omm and and its parameters are valid
The checksum is correct
If one of these tests fail, the receiver will send a NACK:
NACK (Not ACKnow ledge)
Command[0]
0x00
Command[1]
0x15
2.7 Command response
Overview
A lot of commands do not only return an ACK or NACK, but also return a response or reply. This reply will be sent after processing
the command. The answer will have the same c omm and bytes as the request, but typically the data bytes will contain the response
information. It depends on the protocol implementation whether a command requires a reply or not. This will be dened per com-
mand in the protocol.
Example 1: the c lient wants to know the type of the projector. It sends the ’projector, read type’ command. The projector will
acknowledge the co mm and and then s end the type in response.
Client
Projector
ACK
Read type
Response
Image 2-1
Request::
Start byte:
0xFE
Device address:
0x00
Command[0]:
0x6b
Che cksum:
0x6b
Stop by te:
0xFF
Acknowledge:
Start byte:
0xFE
Device address:
0x00
Command[0]:
0x00
Command[1]:
0x06
Che cksum:
0x06
Stop by te:
0xFF
Reply:
Start byte:
0xFE
Devi ce address
0x00
Command[0]:
0x6b
Data[0]: 0x42 =’B
Data[1]: 0x41 =’A
Data[2]: 0x52 =’R
MED20080612 COMMUNICATING WITH A BARCO PROJECTOR OVER NETWORK 12/06/2008
5
2. An introduction to the Barco LCD/DLP protocol
Data[3]:
0x43 =’C
Data[4]:
0x4f =’O
Data[5]: 0x20 =’’
Data[6]: 0x46 =’F
Data[7]: 0x4c =’L
Data[8]: 0x4d =’M
Data[9]: 0x20 =’’
Data[10]: 0x48 =’H
Data[11]: 0x31 =’1
Data[12]: 0x38 =’8
Data[13]:
0x00
Che cksum:
0xA2
Stop by te:
0xFF
Example 2: the client sends a c omm and with a w rong checksum. The projector w ill reject the command by sending a NACK .
Client
Projector
NACK
Unknown cmd
Image 2-2
Request::
Start byte:
0xFE
Device address:
0x00
Command[0]:
0x6b
Che cksum:
0x00
Stop by te:
0xFF
Not acknowledge:
Start byte:
0xFE
Device address:
0x00
Command[0]:
0x00
Command[1]:
0x15
Che cksum:
0x15
Stop by te:
0xFF
Example 3: client sends an update of the brightness. The projector will acknow ledge but as this command does not have a re-
sponse, that’s where the c omm unication stops.
Request::
Start byte:
0xFE
Device address:
0x00
Command[0]:
0x20
Command[1]:
0x02
Che cksum:
0x22
Stop by te:
0xFF
6
MED20080612 COMMUNICATING WITH A BARCO PROJECTOR OVER NETWORK 12/06/2008
2. An introduction to the Barco LCD/DLP protocol
Acknowledge:
Start byte:
0xFE
Device address:
0x00
Command[0]:
0x00
Command[1]:
0x15
Che cksum:
0x15
Stop by te:
0xFF
MED20080612 COMMUNICATING WITH A BARCO PROJECTOR OVER NETWORK 12/06/2008
7
2. An introduction to the Barco LCD/DLP protocol
8 MED20080612 COMMUNICATING WITH A BARCO PROJECTOR OVER NETWORK 12/06/2008
3. Communicating with the projector over network
3. COMMUNICATING WITH THE PR OJECTOR OVER
NETWORK
Introduction
When s upported by the projector, it is possible to communicate with a projector over a T CP /IP network. The communication follows
a C lient/Server model where the p rojector is the server. This m eans that the projector responds on requests that are sent by a client.
The projector will not send out requests on its own initiative.
The c omm unication is blocking wh ich means that when a request is sent to the projector, no other requests c an be sent until the
projector has responded on the rst request. The comm unication blocks for each request.
3.1 Making con nection w ith the projector
Overview
The projector is listening on TCP port 0xAAA0 (43680) for incoming connections. The I P ad dress can be retrieved using the local
user interface of the projector or the OSD menu.
To make a connection, you need to create a TCP socket connection with the projector on port 0xAAA0.
Note that for Digital Cinema projector based on TI Series II, this will be a different port.
3.2 Sending a message
How to send
Messages should be send in the LCD/DLP p rotocol format. This means that each c omm and needs to be structured in the correct
way, before it is being sent to the projector:
The p rojector a ddress must be set to 0.
A correct checksum value mus t be generated for the command, based o n all the bytes between the start byte and the chec ksum
byte.
3.3 Receiving an answer
Overview
When receiving the answer from the pro jector, you s hould always rst r ead the acknowledgement of the request. Only when the
request has been acknowledged, you can exp ect the actual response (if any).
MED20080612 COMMUNICATING WITH A BARCO PROJECTOR OVER NETWORK 12/06/2008
9
3. Communicating with the projector over network
10 MED20080612 COMMUNICATING WITH A BARCO PROJECTOR OVER NETWORK 12/06/2008
4. Advanced communication techniques
4. ADVANCED COMMUNICATION TECHNIQU ES
4.1 Projector discovery
How to discover
It is possible to discover all the projectors on the network using a UDP broadcast. UDP br oadcast on
ly works on IP networks and
requires a special socket connection: the datagram connection.
Client
Projector 1
LAN
Projector 2
Projector n
Image 4-1
To discover the projectors, send a datagram packet to the broadcast address 255.255.255.255 and port 0xA001.
The packet should contain 1 byte: \\x3F, which is the A SCII character ‘?’.
All the devices that support UDP broadcast discovery, w ill answer on the request by sending an array of (C-language) strings on the
same socket. Each s tring is represents a key -value pair with spe cic information ab out the pro jector that has been discovered.
Typically, following strings will be returned:
hostname=value: the hostnam e of the projector
ip-address=value: the IP address of the projector
mac-address=value: the M AC address of the NIC on the projector
type=value: the projector type ( not for DP90/DP100 projectors)
Remarks:
The broadcast does not follow the typical LCD/DLP protocol formatting: the request is just o ne byte (not marked u p as LCD/DLP
command) and the devices answer back without sending an ACK and without formatting their response in the protocol command
format.
The size of the array is undetermined, but in most cases it will contain 4 strings. However, this is open to future expansion, so
more strings m ay be added later.
The strings normally appe ar in this order: hostname, ip-address, mac-address and type, but this canno t be guaranteed.
The broadca st that is used is a limited broadcast. This mean s that the broad cast m es sage is transmitted to
all network interface cards (NIC’s) w hich are o n the same IP seg ment as the client. This type of broadcast is
not forwarded by routers so it will not detect devices w hich are on another segment.
MED20080612 COMMUNICATING WITH A BARCO PROJECTOR OVER NETWORK 12/06/2008 11
4. Advanced communication techniques
4.2 Answer prex
Overview
The projector alway s responds when a question is asked (query or read operation) but in case of write operation the projector will not
send back a response. If you want to get an answer about whether the write operation was OK or not, you should add the ’answer ’
prex to the command.
Prex code
Prex[0]:
0x00
Prex[1]
0x03
Prex[2] Answ er parameters. Currently there’s only one used 0x02: return result
When this prex is used, the projector will respond with the prex as comm and and a data byte to indicate the result.
Response on a com mand with answer prex:
Command[0]:
0x00
Command[1]
0x03
Data[0]:
0x00 =nosuccess
0x01 = s u cce s s
This technique is frequen tly used by commands that take some time to process f.i. switching lam ps on or off, moving lens , shutter, ...
Example
This example shows the request and responses when sending a ’brightness, write’ command with the answe r prex.
Request :
Prex[0]:
0x00
Prex[1]
0x03
Prex[2]
0x02
Command[0]:
0x20
Command[1]
0x02
Acknowledge:
Command[0]:
0x00
Command[1]
0x06
Reply:
Command[0]:
0x00
Command[1]
0x02
Data[0]:
0x01
12
MED20080612 COMMUNICATING WITH A BARCO PROJECTOR OVER NETWORK 12/06/2008
5. Code sample
5. CODE SAMPLE
5.1 Java code sample
Overview
This code sample in Java c ontains a small program that will connect to a projector and send the comman
d to switch the lamps on
(lamp status, write).
Java code
/*
* SimpleConnect.java
*
* Copyright 2008 Barco NV. All rights reserved.
* BARCO PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.barco.connect;
import java.io.*;
import java.net.Socket;
/**
* Sample code shows how to connect to a projector and switch the lamps on.
*/
public class SimpleConnect
{
private static final int PORT = 0xAAA0;
private Socket connection;
private OutputStream out;
private InputStream in;
public static void main(String[] args)
{
SimpleConnect sc = new SimpleConnect();
try
{
// make connection with projector
sc.connect("192.168.100.1");
// send command to switch lamps on
byte[] arr = new byte[9];
arr[1] = 0x00; // device address
arr[2] = 0x00; // answer prefix (1)
arr[3] = 0x03; // answer prefix (2)
arr[4] = 0x02; // answer prefix data (send result)
arr[5] = 0x76; // command byte (1)
arr[6] = 0x1A; // command byte (2)
arr[7] = 0x01; // data byte (0x01 = switch lamps on)
arr[8] = sc.generateChecksum(arr);
arr[0] = (byte) 0xFE;
arr[9] = (byte) 0xFF;
// write request
sc.writeBytes(arr);
System.out.println("Sent command to switch lamps on");
// wait for acknowledgement
if (!sc.readAcknowledge())
{
System.out.println("Command not ACK’ed");
return;
}
System.out.println("Command acknowledged.");
// wait for answer result
int result = sc.readAnswerResult();
System.out.println("Command result="+result);
if (result == 0x01)
{
System.out.println("Lamps successfully switched on.");
}
} catch (IOException e)
{
System.err.println("Communication error: " + e.getMessage());
} finally
{
MED20080612 COMMUNICATING WITH A BARCO PROJECTOR OVER NETWORK 12/06/2008
13
5. Code sample
try
{
sc.disconnect();
} catch (IOException e)
{
// failed to disconnect
}
}
}
/**
* Connects with the projector on the supplied address
*
* @param address
* The IP address of the projector
*/
public void connect(String address) throws IOException
{
// make connection
connection = new Socket(address, PORT);
out = connection.getOutputStream();
in = connection.getInputStream();
}
/**
* Breaks the connection with the projector.
*/
public void disconnect() throws IOException
{
if (connection != null && connection.isConnected())
{
out.close();
in.close();
connection.close();
}
}
/**
* Writes all the bytes in the array to the device.
*
* @param arr
* The byte array
* @throws IOException
* When writing data to the stream failed
*/
public void writeBytes(byte[] arr) throws IOException
{
if (connection != null && connection.isConnected())
{
out.write(arr, 0, arr.length);
}
}
/**
* Reads data until an ACK or NACK is received
*
* @return true if the command has been acknowledged, false if the command
* is not acknowledged or if there’s no connection.
* @throws IOException
* When reading data from the stream failed.
*/
public boolean readAcknowledge() throws IOException
{
if (connection != null && connection.isConnected())
{
int c = in.read();
while (c != -1)
{
if (c == 0xFE)
{
// start reading command
int deviceAddress = in.read();
int cmd1 = in.read(); // should be 0x00
int cmd2 = in.read(); // is either 0x06 or 0x15
if (cmd2 == 0x06)
{
// got ACK
return true;
} else if (cmd2 == 0x15)
{
// got NACK
return false;
}
} else
{
// read next byte
c = in.read();
14
MED20080612 COMMUNICATING WITH A BARCO PROJECTOR OVER NETWORK 12/06/2008
5. Code sample
}
}
}
return false;
}
/**
* Reads data until an answer response is sent by the device.
*
* @return The result of the answer response, -1 if no (valid) answer has
* been received or when there’s no connection.
* @throws IOException
* When reading of data from the stream failed.
*/
public int readAnswerResult() throws IOException
{
if (connection != null && connection.isConnected())
{
// read response
int result = -1;
int c = in.read();
while (c != -1)
{
if (c == 0xFE)
{
// start reading command
int deviceAddress = in.read();
int cmd1 = in.read(); // should be 0x00
int cmd2 = in.read(); // should be 0x03
result = in.read(); // the result data byte
return result;
} else
{
// read next byte
c = in.read();
}
}
}
return -1;
}
/**
* Generates a checksum of all the bytes in the array.
*
* @param arr
* The array of bytes
* @return The checksum.
*/
public byte generateChecksum(byte[] arr)
{
int sum = 0;
for(inti=0;i<arr.length; i++)
{
sum += arr[i];
}
return (byte) (sum % 256);
}
}
5.2 Further information
Overview
More information about the LCD/DLP protocol and the list of specic commands for each projector, can be found on the Barco
PartnerZone.
Here are some titles and a rticle numbers of the m ost frequently used m anuals:
Serial Communication LCD-DLP Projector (R5975236)
RS232 Commands for C LM R10+ (R59770203)
RS232 Commands for FLM R20+ (R59770107)
RS232 Commands for XLM and DP series (R5976919 )
MED20080612 COMMUNICATING WITH A BARCO PROJECTOR OVER NETWORK 12/06/2008
15
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17

Barco FLM R20+ User guide

Category
Projectors
Type
User guide

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI