ABS SCPI Driver 0.2.0
ABS SCPI driver library
Loading...
Searching...
No Matches
System Control

Functions for controlling the system, such as querying device info and updating the IP address. More...

+ Collaboration diagram for System Control:

Classes

struct  AbsDeviceInfo
 ABS device information structure. All strings are guaranteed to be null-terminated. More...
 
struct  AbsEthernetConfig
 ABS Ethernet address configuration. All strings are guaranteed to be null-terminated. More...
 

Functions

int AbsScpiClient_GetDeviceInfo (AbsScpiClientHandle handle, AbsDeviceInfo *info_out)
 Query basic information about the unit.
 
int AbsScpiClient_GetDeviceId (AbsScpiClientHandle handle, uint8_t *id_out)
 Query the ABS's device ID.
 
int AbsScpiClient_GetIPAddress (AbsScpiClientHandle handle, AbsEthernetConfig *addr_out)
 Query the device's IP address and subnet mask.
 
int AbsScpiClient_SetIPAddress (AbsScpiClientHandle handle, const AbsEthernetConfig *addr)
 Set the device's IP address and subnet mask.
 
int AbsScpiClient_GetCalibrationDate (AbsScpiClientHandle handle, char buf[], unsigned int len)
 Get the device's calibration date.
 
int AbsScpiClient_GetErrorCount (AbsScpiClientHandle handle, int *count_out)
 Query the number of error's in the device's error queue.
 
int AbsScpiClient_GetNextError (AbsScpiClientHandle handle, int16_t *err_code_out, char msg_buf[], unsigned int msg_buf_len)
 Query the next error from the device's error queue.
 
int AbsScpiClient_ClearErrors (AbsScpiClientHandle handle)
 Clear the device's error queue.
 
int AbsScpiClient_GetAlarms (AbsScpiClientHandle handle, uint32_t *alarms_out)
 Query the alarms raised on the device.
 
int AbsScpiClient_GetInterlockState (AbsScpiClientHandle handle, bool *interlock_out)
 Query the system interlock state.
 
int AbsScpiClient_AssertSoftwareInterlock (AbsScpiClientHandle handle)
 Assert the software interlock (a recoverable alarm).
 
int AbsScpiClient_ClearRecoverableAlarms (AbsScpiClientHandle handle)
 Clear recoverable alarms.
 
int AbsScpiClient_Reboot (AbsScpiClientHandle handle)
 Reboot the device, resetting it to its POR state.
 

Detailed Description

Functions for controlling the system, such as querying device info and updating the IP address.

Function Documentation

◆ AbsScpiClient_AssertSoftwareInterlock()

int AbsScpiClient_AssertSoftwareInterlock ( AbsScpiClientHandle  handle)

Assert the software interlock (a recoverable alarm).

The interlock may be cleared using the ClearRecoverableAlarms() function.

Parameters
[in]handleSCPI client
Returns
0 on success or a negative error code.

◆ AbsScpiClient_ClearErrors()

int AbsScpiClient_ClearErrors ( AbsScpiClientHandle  handle)

Clear the device's error queue.

Parameters
[in]handleSCPI client
Returns
0 on success or a negative error code.

◆ AbsScpiClient_ClearRecoverableAlarms()

int AbsScpiClient_ClearRecoverableAlarms ( AbsScpiClientHandle  handle)

Clear recoverable alarms.

This also clears a software interlock.

Parameters
[in]handleSCPI client
Returns
0 on success or a negative error code.

◆ AbsScpiClient_GetAlarms()

int AbsScpiClient_GetAlarms ( AbsScpiClientHandle  handle,
uint32_t *  alarms_out 
)

Query the alarms raised on the device.

Parameters
[in]handleSCPI client
[out]alarms_outpointer to an integer to store the bitmask of alarms
Returns
0 on success or a negative error code.

◆ AbsScpiClient_GetCalibrationDate()

int AbsScpiClient_GetCalibrationDate ( AbsScpiClientHandle  handle,
char  buf[],
unsigned int  len 
)

Get the device's calibration date.

Note
The returned string will always be null-terminated. If this function fails, the buffer will not be modified.
Parameters
[in]handleSCPI client
[out]bufpointer to the buffer into which a null-terminated string will be written
[in]lenthe length of the buffer
Returns
0 on success or a negative error code.

◆ AbsScpiClient_GetDeviceId()

int AbsScpiClient_GetDeviceId ( AbsScpiClientHandle  handle,
uint8_t *  id_out 
)

Query the ABS's device ID.

Parameters
[in]handleSCPI client
[out]id_outpointer to the resulting ID
Returns
0 on success or a negative error code.

◆ AbsScpiClient_GetDeviceInfo()

int AbsScpiClient_GetDeviceInfo ( AbsScpiClientHandle  handle,
AbsDeviceInfo info_out 
)

Query basic information about the unit.

Parameters
[in]handleSCPI client
[out]info_outpointer to a device information structure to populate
Returns
0 on success or a negative error code.

◆ AbsScpiClient_GetErrorCount()

int AbsScpiClient_GetErrorCount ( AbsScpiClientHandle  handle,
int *  count_out 
)

Query the number of error's in the device's error queue.

Parameters
[in]handleSCPI client
[out]count_outpointer to an integer to store the error count
Returns
0 on success or a negative error code.

◆ AbsScpiClient_GetInterlockState()

int AbsScpiClient_GetInterlockState ( AbsScpiClientHandle  handle,
bool *  interlock_out 
)

Query the system interlock state.

When in interlock, the unit will be put into its PoR state and cannot be controlled until the interlock is lifted.

Parameters
[in]handleSCPI client
[out]interlock_outpointer to the interlock state
Returns
0 on success or a negative error code.

◆ AbsScpiClient_GetIPAddress()

int AbsScpiClient_GetIPAddress ( AbsScpiClientHandle  handle,
AbsEthernetConfig addr_out 
)

Query the device's IP address and subnet mask.

Parameters
[in]handleSCPI client
[out]addr_outpointer to an Ethernet configuration structure to populate
Returns
0 on success or a negative error code.

◆ AbsScpiClient_GetNextError()

int AbsScpiClient_GetNextError ( AbsScpiClientHandle  handle,
int16_t *  err_code_out,
char  msg_buf[],
unsigned int  msg_buf_len 
)

Query the next error from the device's error queue.

Note
The returned message will always be null-terminated. If this function fails, the values of the outputs are undefined.
Parameters
[in]handleSCPI client
[out]err_code_outpointer to an integer to store the error code
[out]msg_bufpointer to a buffer to store the null-terminated error message
[in]msg_buf_lenlength of the buffer
Returns
0 on success or a negative error code.

◆ AbsScpiClient_Reboot()

int AbsScpiClient_Reboot ( AbsScpiClientHandle  handle)

Reboot the device, resetting it to its POR state.

Rebooting takes about 8-10 seconds. If using TCP, you'll need to re-open the connection after the device has rebooted.

Parameters
[in]handleSCPI client
Returns
0 on success or a negative error code.

◆ AbsScpiClient_SetIPAddress()

int AbsScpiClient_SetIPAddress ( AbsScpiClientHandle  handle,
const AbsEthernetConfig addr 
)

Set the device's IP address and subnet mask.

Note
For UDP and TCP connections, after changing the IP, you should call the corresponding Open*() function again to reconnect. Note that it may take a moment for the unit to complete the change.
Parameters
[in]handleSCPI client
[in]addrdesired Ethernet configuration
Returns
0 on success or a negative error code.