DCS_SDK  2.0.0
TCP/IP control library for Ai DCS-100E and DCS-103E
DCS-100 C++ SDK

This is a software development kit (SDK) for creating software that interacts with the Advanced illumination DCS-100E and DCS-103E devices. It is written using the 2011 ISO Standard for C++ (C++ 11).

Binary distribution

This release was compiled using the GNU toolchain version 9.3.0. Releases are available for Windows x86 and x64, and Linux x64.

See the changelog for more history.

Example Code

This example code queries each DCS device that is online and communicable, prints the ones it finds, and then connects to each and does the following:

For every channel:

  • Sets channel to Continuous mode
  • Pauses 200 milliseconds
  • Sets the current on the channel to half of the light's continuous maximum
  • Pauses 2 seconds
  • Sets 0 current
  • Sets the channel to Pulsed mode
  • Sets the current on the channel to 1.2 A
  • Sets pulse width to 10ms
  • Sets pulse delay to 5us
  • Sets trigger input to Input 3
  • Pulses the light three times (500 ms between each)
  • Sets the channel to 0 current

It then sets the device name to "Tested" and disconnects from the device.

#include "DCS100.h"
#include "DCS_Info.h"
#include <iostream>
#include <chrono>
#include <thread>
using namespace std;
namespace ai = AdvancedIllumination;
int main()
{
auto list = ai::DCS_Info::findAllInNetwork(false);
if(list.size() == 0) {
cout << "No DCS units found.\n";
return 0;
}
try
{
for (const ai::DCS_Info& dcs : list)
{
std::cout << "Found DCS: " << dcs.name() << " at " << dcs.host() << "\n";
ai::DCS_100 device;
device.connect(dcs.host());
size_t N = device.ChannelCount();
for (int i = 0; i < N; i++)
{
if (device[i].maxContinuous() == 0) continue;
printf("Setting channel %d mode 1\n", i+1);
device[i].mode(ai::Mode::Continuous);
this_thread::sleep_for(chrono::milliseconds(200));
double cc = 0.5*device[i].maxContinuous();
printf("Setting channel %d current %.3f\n", i+1, cc);
device[i].current(cc);
this_thread::sleep_for(chrono::seconds(2));
printf("Setting 0 current\n");
device[i].current(0);
printf("Setting strobe mode\n");
device[i].mode(ai::Mode::Pulsed);
printf("Setting 1.2A\n");
device[i].current(1.2);
printf("Setting PW 10ms\n");
device[i].pulseWidth(10E-3);
printf("Setting PD 5us\n");
device[i].pulseDelay(5E-6);
printf("Setting trigger input CH3\n");
device[i].triggerInput(ai::Channel::Three);
for (int j = 0; j < 3; j++)
{
printf("(blink)\t");
device[i].trigger();
this_thread::sleep_for(chrono::milliseconds(500));
}
printf("\n");
device[i].current(0);
this_thread::sleep_for(chrono::milliseconds(500));
}
device.name("Tested");
//device.ipAddress("10.1.103.50");
device.webConfigEnabled(true);
device.disconnect();
}
}
catch (const ai::DeviceError& e)
{
cout << "Error: " << e.what() << "\n";
return EXIT_FAILURE;
}
catch (const ai::DeviceWarning& e)
{
cout << "Warning: " << e.what() << "\n";
return 1;
}
catch (const std::exception& e)
{
cout << "Exception: " << e.what() << "\n";
return 1;
}
return 0;
}
DCS_Info.h
DCS100.h
AdvancedIllumination
Namespace containing AI-created functions and classes.
Definition: DCS100.h:20