DCSModulesAPI  1.0.0
DCS sub project containing all the control modules as libraries.
Functions
Remote Server Callables

A module containing all the API functions callable via TCP/IP. More...

Functions

DCS_API void DCS::Control::IssueGenericCommand (UnitTarget target, DCS::Utils::BasicString full_command)
 Issue a generic command to the specified target. More...
 
DCS_API DCS::Utils::BasicString DCS::Control::IssueGenericCommandResponse (UnitTarget target, DCS::Utils::BasicString full_command)
 Issue a generic command to the specified target, waiting for a response. More...
 
const DCS_API u16 DCS::Threading::GetMaxHardwareConcurrency ()
 Get current machine maximum hardware concurrency (Number of physical threads supported by the current implementation).
 
DCS_API void DCS::DAQ::NewAIVChannel (DCS::Utils::BasicString name, DCS::Utils::BasicString channel_name, ChannelRef ref, ChannelLimits lim)
 Creates a new voltage channel to add to the acquisition stage. More...
 
DCS_API void DCS::DAQ::DeleteAIVChannel (DCS::Utils::BasicString name)
 Deletes an existing voltage channel from the acquisition stage. More...
 
DCS_API void DCS::DAQ::StartAIAcquisition (DCS::f64 samplerate)
 Starts the AI (Analog Input) data acquisition. More...
 
DCS_API void DCS::DAQ::StopAIAcquisition ()
 Stops the AI (Analog Input) data acquisition. More...
 

Detailed Description

A module containing all the API functions callable via TCP/IP.

An example syntax to call a function is:

unsigned char buffer[1024];
// Register the message
auto size_written = DCS::Registry::SVParams::GetDataFromParams(buffer,
SV_CALL_FUNC_NAME_WITH_SCOPE,
3, DCS::Utils::BasicString{ "Hello server!" }
);
// Send the message and wait for response
auto ret_val = Message::SendSync(Message::Operation::REQUEST, buffer, size_written);
// Or dont wait...
Message::SendAsync(Message::Operation::REQUEST, buffer, size_written);

Function Documentation

void DCS::DAQ::DeleteAIVChannel ( DCS::Utils::BasicString  name)

Deletes an existing voltage channel from the acquisition stage.

The new deleted channel will only take effect when a new acquisition is started via StartAIAcquisition.

Parameters
nameThe friendly name given to this channel.
void DCS::Control::IssueGenericCommand ( UnitTarget  target,
DCS::Utils::BasicString  full_command 
)

Issue a generic command to the specified target.

This function sends a command to a controller using its commands. See the ESP301-3G and PMC8742 controller manuals for the raw commands to send via this function.

Separate commands for the ESP301-3G controller's using semicolons. The PMC8742 only supports non separated commands.

Todo:
Create a wrapper to emulate PMC8742 command separator via (;).
Parameters
targetThe stage to target.
full_commandThe ASCII command to send to the unit.
DCS::Utils::BasicString DCS::Control::IssueGenericCommandResponse ( UnitTarget  target,
DCS::Utils::BasicString  full_command 
)

Issue a generic command to the specified target, waiting for a response.

This function sends a command to a controller using its commands. See the ESP301-3G and PMC8742 controller manuals for the raw commands to send via this function.

Separate commands for the ESP301-3G controller's using semicolons. The PMC8742 only supports non separated commands.

Todo:
Create a wrapper to emulate PMC8742 command separator via (;).

The part of the command responsible for requesting data can be anywhere in the command chain.

Parameters
targetThe stage to target.
full_commandThe ASCII command to send to the unit.
Returns
A string containing the raw target controller's response.
void DCS::DAQ::NewAIVChannel ( DCS::Utils::BasicString  name,
DCS::Utils::BasicString  channel_name,
ChannelRef  ref,
ChannelLimits  lim 
)

Creates a new voltage channel to add to the acquisition stage.

Adding multiple channels will cause the selected acquisition sample rate (Selected in StartAIAcquisition) to be divided by all channels. E.g. create two new channels via DCS::DAQ::NewAIVChannel with a total of 1000 S/s will retsult in a total of 500 S/s per channel being offseted in the SV_EVT_DCS_DAQ_VoltageEvent event.

The new added channel will only take effect when a new acquisition is started via StartAIAcquisition.

Parameters
nameThe frindly name to give to this channel.
channel_nameThe hardware name of the channel in the DAQ (e.g. PXI_slot2/ai0).
refThe channel reference settings. Refer to the ChannelRef enum.
limThe channel voltage limits. Refer to the ChannelLimits enum.
void DCS::DAQ::StartAIAcquisition ( DCS::f64  samplerate)

Starts the AI (Analog Input) data acquisition.

All the added channels will start to acquire its value to the SV_EVT_DCS_DAQ_VoltageEvent event. All other events related to this, such as the main engine-detector setup for energy analisys will also start to acquire when this function is called.

Parameters
samplerateThe sample rate to use for all channels combined.
void DCS::DAQ::StopAIAcquisition ( )

Stops the AI (Analog Input) data acquisition.

All the added channels will stop from acquiring its value to the SV_EVT_DCS_DAQ_VoltageEvent event. All other events related to this, such as the main engine-detector setup for energy analisys will also stop from acquiring when this function is called.