Using the pan-tilt-zoom features of Sony cameras EVI-D30 (NSTC) and EVI-D31 (PAL), through the Visca protocol.

Introduction

What this is about

This is about using the pan-tilt-zoom features of the Sony camera, models EVI-D30 and EVI-D31.

Those cameras are controlled using VISCA, a protocol invented by Sony, on a serial line.

The code here is developped with Linux, and may work with any Unix out-of-the-box. Windows users will have to adjust the code that sets up the serial port. Alternatively, they can use Cygwin which allows compiling and running Unix-targeted programs with windows.

What this is not about

This is not about using the video flow coming from the camera. No video, framegrabbing, etc... issues here.

Summary

Information source

Connection pinout

Though the camera connector uses minidin-8 plugs, it is not exactly the same as the Apple Macintosh serial port.

The Sony technical document, include a pin layout and wiring diagram (PNG, 88kb).
They are wrong somehow. At the bottom half of the page, instead of "Windows" you should read "RS-232" in the table titles.

The software

The base for this software was a driver by Thomas Moeslund, that was sufficient for his purpose.
It assumes one camera (i.e. no daisy chain feature), and transactions are synchronous (i.e. the program is blocked until the camera movement is done).

The fact that I could not query the camera while it was moving was a problem for my purpose.

I did the following modifications to the code:

technical modifications
  • corrected a few mistakes, and submitted them back to the author
  • changed the style (originally: one .c source file per function)
  • added a Makefile with automatic dependencies. Just extract the archive and do a make, it should work.
  • added header files
  • included (and corrected) a simple example extracted from Thomas' postscript doc
  • added debug facilities (depending on NDEBUG being defined) with multiple verbose levels
  • substantial modification of the reply reception code (see just below)
feature added
  • added the possibility that queries to the camera return immediatly, instead of waiting until the motion is finished. This allows to query the camera position and give other orders while it is moving, including cancelling the motion. This feature was allowed by the VISCA protocol but had to be dealt with by the driver. This was the reason that made this work necessary.

Download

The author of the original code, Thomas Moeslund says in its documentation:

If some errors are located in the code or in the documentation then please report this to the author personally or by E-mail. Comments and questions should also be reported to the author and if someone decides to expand the code/documentation then please report this so this report can be updated.
Both the documentation and code can freely be used if a reference to this tech report is clearly stated.

You may download the latest version or browse the other versions.

What do you do with this ?

See my research program

A few links to other resources


Return to AnimatLab home
Return to my home