PulsarAPI
USB and TCP/IP control library for Pulsar 320E
PulsarAPI

Introduction

This is a Dynamic Link Library (DLL) / Shared Object (SO) to control the Advanced illumination Pulsar 320E Controller from native code such as C/C++.

See the changelog for revision history.

Usage

The only header you need to include in your own code is PulsarAPI.h. The functions and data structures inside are documented in the included PDF.

Example: USB

To connect to a controller over USB (Port 0 in this case) and setting Output 1 to 5A, 350µs pulsewidth.

int PORT = 0;
const char* PRODUCT_NAME = "Ai Pulsar 320 Controller";
err = api_init(PORT, PRODUCT_NAME, NULL);
if(err) {
reportError(err);
}
else {
info.current = 5.0; //Amps
info.width = 350; //microseconds
err = api_set_channel_config(PORT, API_CHAN_1, API_CHAN_CONFIG_ACTIVE, &info);
if (err) {
reportError(err);
}
}
ERRCODE_T api_init(UINT8_T port, const INT8_T *product_name, const INT8_T *serial_num)
Initializes the connection to a specific Pulsar.
@ API_TRIG_1
Trigger input 1.
Definition: PulsarAPI.h:198
INT16_T ERRCODE_T
API Error Code type – error codes documented in separate "ecodes.ini" file.
Definition: PulsarAPI.h:128
ERRCODE_T api_shutdown(UINT8_T port)
Shuts down the connection to a specific Pulsar.
ERRCODE_T api_set_channel_config(UINT8_T port, UINT8_T chan, UINT8_T type, API_CHAN_CONFIG_STRUCT_T *config_data)
Sets the configuration data for one drive channel.
@ API_MODE_PULSED
Pulse mode.
Definition: PulsarAPI.h:164
Channel/output configuration struct.
Definition: PulsarAPI.h:136
UINT8_T trigger
Trigger input.
Definition: PulsarAPI.h:138
UINT32_T width
Pulse width (microseconds)
Definition: PulsarAPI.h:152
UINT8_T mode
Operating mode.
Definition: PulsarAPI.h:143
FLOAT32_T current
Pulse current (Amps)
Definition: PulsarAPI.h:150

Example: TCP

To connect to a controller over TCP (default static IP) and setting Output 1 to 5A, 350µs pulsewidth.

int PORT = 25; //Use port 25+ for TCP
const char* PRODUCT_NAME = "Ai Pulsar 320 Controller";
err = api_connect(PORT, PRODUCT_NAME, "192.168.1.80");
if(err) {
reportError(err);
}
else {
info.current = 5.0; //Amps
info.width = 350; //microseconds
err = api_set_channel_config(PORT, API_CHAN_1, API_CHAN_CONFIG_ACTIVE, &info);
if (err) {
reportError(err);
}
}
ERRCODE_T api_connect(UINT8_T port, const INT8_T *product_name, const INT8_T *ip_addr)
Initializes the connection to a specific Pulsar.