This API (Application Programming Interface) was designed to allow low-level hardware access to the RayComposer ILDA DAC devices (RayComposer USB and RayComposer NET) from your custom (or third-party) application software. The API functions only use simple data types to enable compatibility with a large number of programming languages.
Quick Example in plain C. This code enumerates all devices and displays a list. If a device is found the device will be opened, started and 1000 frames containing a circle will be display. Then the device will be stoped, closed and the program will exit.
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
int main(void){
int i;
int ret;
int count;
char deviceId[256];
int handle;
int frameCounter = 1;
if(ret < 0){
printf("Error initialising Library! Exit.\n"); return -1;
}
printf("API Version too old. Please use a newer dll/lib.\n"); return -2;
}
printf("API Version %d.%02d\n", ret >> 8, ret & 0xFF);
if(count < 0){
printf("Error enumerating devices! Exit.\n"); return -3;
}
if(count == 0){
printf("No devices found. Exit.\n"); return 0;
}
printf("Found %d device(s): \n", count);
for(i = 0; i < count; i++){
if(ret < 0){
printf("Error reading device id! Exit.\n"); return -4;
}
printf(" %d: %s\n", i, deviceId);
}
printf("\n");
if(ret < 0){
printf("Error reading device id! Exit.\n"); return -5;
}
printf("Opening device: %s\n", deviceId);
if(handle < 0){
printf("Error opening device: %d! Exit.\n", handle); return -6;
}
printf("Starting laser.\n");
printf("Error starting laser output: %d! Exit.\n", ret); return -7;
}
do{
unsigned int speed = 20000;
unsigned int pointCount =
sizeof(points) /
sizeof(
struct RCPoint);
unsigned int i;
for(i=0; i < pointCount; i++){
double phi = (double)i * M_PI * 2.0 / pointCount;
points[i].
x = (
signed short) (sin(phi) * 32767.5 - 0.5);
points[i].y = (signed short) (cos(phi) * 32767.5 - 0.5);
points[i].red = 65535;
points[i].green = 65535;
points[i].blue = 65535;
points[i].intensity = 65535;
points[i].user1 = 65535;
points[i].user2 = 65535;
}
printf("\nError waiting for free buffer: %d! Exit.\n", ret); return -8;
}
printf("Showing frame %d.\r", frameCounter);
printf("\nError writing frame to device: %d! Exit.\n", ret); return -9;
}
} while(frameCounter++ < 1000);
printf("\nStoping laser.\n");
printf("Error stoping laser output: %d! Exit.\n", ret); return -10;
}
printf("Closing device.\n");
printf("Error closing device: %d! Exit.\n", ret); return -11;
}
printf("Error closing Library: %d! Exit.\n", ret); return -12;
}
return 0;
}
Permission is granted to use this API, the provided samples and documentation free of charge als long as they are used for controling RayComposer devices.