10. Example Programs

Types of Example Programs

Diamond Systems has prepared a number of example programs to demonstrate the use of our products and software. These examples are all available from our website as well as the product CD-ROM which is delivered with most product shipments.

Demo Programs

Each board has its own set of example programs packaged as a zip file in the Demos folder of the product CD-ROM. These are also available on our website in the software section. These demos come with source code and build files for each supported operating system. The demo programs are organized by the Universal Driver function they demostrate. You can run the program to see how the feature works, and then copy and paste the code into your own projects as as start to your own programming.

Compiling Demos on Windows

For compiling the demo programs on Windows, you would require the Visual Studio 2005 IDE from Microsoft along with the Platform Builder 6.0.
The Demo programs already have the required include file DSCUD.H included in the code. The project needs to statically link with the library file dscud_api.lib to create the application executable.
The driver DLL file DSCUD_API.DLL MUST be present in the final image of the platform to run the demo program. All the demo prgorams for Helios board are included in the runtime image provided by DSC.

Compiling Demos on Linux

A Makefile is included at the root of each demo package which can be used to compile all the demos for either Linux. Just type "make" at the base directory of the demos where you see the Makefile and it will compile all the demos for that board. You must have installed the Universal Driver before compiling. The driver must be installed at /usr/local/dscud-8.1.0 on Linuxfor the Makefile to find the files it requires.

Utility Programs

Utility programs with source code are available for checking or diagnosing various features on some boards.

Source Code Examples

We also have written example source code which demonstrates how to program Diamond Systems without using the Universal Driver. This is for customers who are using an operating system which is not supported, or for whatever reason are writing their own low level driver software instead of using the Universal Driver. These example programs use simple inp() and outp() type direct I/O calls to program the boards. To make use of the source code you'll need to port them to your own platform and find the local eqivalent of those functions before compiling.