Force monitoring related functions

Overview

This group contains functions for controlling the force monitoring, reading the force sensor and setting a custom force limit.

+ Collaboration diagram for Force monitoring related functions:

Functions

long NemV4EnableForceMonitoring (TNemesysV4 *Nemesys, int Enable)
 Enable / Disable force monitoring functionality. More...
 
long NemV4IsSafetyStopActive (TNemesysV4 *Nemesys)
 Reads the safety stop input. More...
 
long NemV4ReadForceSensor (TNemesysV4 *Nemesys, float *Force_kN)
 Reads the internal force sensor value scaled to kN. More...
 
long NemV4WriteForceLimit (TNemesysV4 *Nemesys, float ForceLimit_kN)
 Sets a custom force limit. More...
 

Function Documentation

long NemV4EnableForceMonitoring ( TNemesysV4 Nemesys,
int  Enable 
)

Enable / Disable force monitoring functionality.

Parameters
NemesysDevice pointer
Enable1 = enable, 0 = disable
Returns
Error code - ERR_NOERR indicates success
1199 {
1200  long Result;
1201  uint32_t InputsPolarity;
1202 
1203  Result = CsiDevReadObject(&Nemesys->Device, NemV4_OD_H3141_DIG_INPUTS_PROPERTIES,
1204  2, &InputsPolarity);
1205  CSI_RETURN_ON_ERROR(Result);
1206 
1207  InputsPolarity &= ~0x01;
1208  if (!Enable)
1209  {
1210  InputsPolarity |= 0x01;
1211  }
1212 
1213  return CsiDevWriteObject(&Nemesys->Device, NemV4_OD_H3141_DIG_INPUTS_PROPERTIES,
1214  2, InputsPolarity);
1215 }
struct CsiDev Device
CSI device object.
Definition: nem4_rs232_api.h:107
long CsiDevWriteObject(struct CsiDev *pDev, uint16_t ObjDicIdx, uint8_t ObjDicSub, uint32_t TxDWord)
This function writes up to 4 bytes of data into device object dictionary.
Definition: csi_dev.c:188
long CsiDevReadObject(struct CsiDev *pDev, uint16_t ObjDicIdx, uint8_t ObjDicSub, uint32_t *pRxDWord)
This function reads up to 4 bytes of data from device object dictionary.
Definition: csi_dev.c:157

+ Here is the call graph for this function:

long NemV4IsSafetyStopActive ( TNemesysV4 Nemesys)

Reads the safety stop input.

I case of a force overload, that means, if the measured force is higher than the force limit, the force monitoring sets the safety stop input and stops the pump. If this function returns true, then the pump is in a force overload situation. If safety stop is active, you can read the force sensor via NemV4ReadForceSensor() to get the current force value.

Parameters
NemesysThe device to query
Return values
<0 Error
0Safety stop inactive
1Safety stop active - force overload situation or force monitoring disabled.
1266 {
1268 }
Safety stop input - this input is set if force monitoring detects a too high force.
Definition: nem4_rs232_api.h:53
long NemV4ReadDigitalInput(TNemesysV4 *Nemesys, enum eNemV4DigitalInput Input)
Reads the state of one single digital input.
Definition: nem4_rs232_api.c:1231

+ Here is the call graph for this function:

long NemV4ReadForceSensor ( TNemesysV4 Nemesys,
float *  Force_kN 
)

Reads the internal force sensor value scaled to kN.

Parameters
NemesysThe device to read from
Force_kNReturns the force sensor value in kN
Returns
Error code - ERR_NOERR indicates success
1186 {
1187  int16_t Value_mV;
1188  long Result;
1189 
1190  Result = NemV4ReadAnalogInput(Nemesys, NEM4_ANALOG_IN_FORCE_SENSOR, &Value_mV);
1191  CSI_RETURN_ON_ERROR(Result);
1192  *Force_kN = Value_mV * Nemesys->ForceSensorScaling.Factor + Nemesys->ForceSensorScaling.Offset;
1193  return ERR_NOERR;
1194 }
long NemV4ReadAnalogInput(TNemesysV4 *Nemesys, enum eNemV4AnalogInput Input, int16_t *Value_mV)
Reads the analog input value of the given Input and returns it in Value_mV.
Definition: nem4_rs232_api.c:1170
float Factor
the scaling factor multiplied with the measured value
Definition: nem4_rs232_api.h:98
float Offset
the scaling offset added to the measured value
Definition: nem4_rs232_api.h:97
internal force sensor analog input
Definition: nem4_rs232_api.h:41
#define ERR_NOERR
No error.
Definition: err_codes.h:102
TNemV4Scaling ForceSensorScaling
scaling parameters for force sensor
Definition: nem4_rs232_api.h:118

+ Here is the call graph for this function:

long NemV4WriteForceLimit ( TNemesysV4 Nemesys,
float  ForceLimit_kN 
)

Sets a custom force limit.

Each device has a device specific force limit. After a call to NemV4DevInit the TNemesysV4 device type contains the maximum force in the MaxForce_kN member. This function allows you to reduce the maximum force below this maximum device force, if this is required for your application.

Parameters
NemesysThe device to configure
ForceLimit_kNThe force limit in kN. This value needs to be less than the device force limit and greater than 0.
Returns
Error code - ERR_NOERR indicates success
1247 {
1248  int32_t DeviceValue_mV;
1249 
1250  if (ForceLimit_kN < 0 || ForceLimit_kN > Nemesys->MaxForce_kN)
1251  {
1252  return -ERR_INVAL;
1253  }
1254 
1255  DeviceValue_mV = round((ForceLimit_kN - Nemesys->ForceLimitScaling.Offset) /
1256  Nemesys->ForceLimitScaling.Factor);
1257  return CsiDevWriteObject(&Nemesys->Device, NemV4_OD_H3182_ANALOG_OUT,
1258  2, DeviceValue_mV);
1259 }
struct CsiDev Device
CSI device object.
Definition: nem4_rs232_api.h:107
float Factor
the scaling factor multiplied with the measured value
Definition: nem4_rs232_api.h:98
long CsiDevWriteObject(struct CsiDev *pDev, uint16_t ObjDicIdx, uint8_t ObjDicSub, uint32_t TxDWord)
This function writes up to 4 bytes of data into device object dictionary.
Definition: csi_dev.c:188
float Offset
the scaling offset added to the measured value
Definition: nem4_rs232_api.h:97
TNemV4Scaling ForceLimitScaling
scaling parameters for setting force limit
Definition: nem4_rs232_api.h:119
#define ERR_INVAL
Invalid argument.
Definition: err_codes.h:124
float MaxForce_kN
the maximum force of the device - depends on device type
Definition: nem4_rs232_api.h:121

+ Here is the call graph for this function: