Unit Conversion

Overview

This group contains functions for unit conversion between device specific position and velocity units into position and speed values in mm and mm/min and into volumes and flow rates in µl and ml/min.

+ Collaboration diagram for Unit Conversion:

Functions

double NemV4DevicePosToMicrolitres (TNemesysV4 *Nemesys, int32_t Pos)
 Converts a device position in increments in a volume in microlitres. More...
 
double NemV4DevicePosToMillimetres (TNemesysV4 *Nemesys, int32_t Pos)
 Converts a Nemesys position given in increments into millimeters. More...
 
double NemV4DeviceVelToMicrolitresPerMinute (TNemesysV4 *Nemesys, int32_t Velocity)
 Converts a device velocity into a flow rate in microlitres per minute (µl/min). More...
 
double NemV4DeviceVelToMillimetresPerMinute (TNemesysV4 *Nemesys, int32_t Velocity)
 Converts a device velocity value to a speed value in mm/min. More...
 
int32_t NemV4MicrolitresPerMinuteToDeviceVel (TNemesysV4 *Nemesys, double Flow_ul_min)
 Converts a flow rate in microlitres per minute (µl/min) into a device velocity. More...
 
int32_t NemV4MicrolitresToDevicePos (TNemesysV4 *Nemesys, double Volume_ul)
 Converts a volume in microlitres into a device position in increments. More...
 
int32_t NemV4MillimetresPerMinuteToDeviceVel (TNemesysV4 *Nemesys, double Speed_mm_min)
 Converts a velocity in mm/in into a device velocity. More...
 
int32_t NemV4MillimetresToDevicePos (TNemesysV4 *Nemesys, double Pos_mm)
 Converts a position in mm into a Nemesys position in increments. More...
 

Function Documentation

double NemV4DevicePosToMicrolitres ( TNemesysV4 Nemesys,
int32_t  Pos 
)

Converts a device position in increments in a volume in microlitres.

The function uses the configured syringe for volume calculation so ensure that you have properly configured the syringe via NemV4SetSyringe.

See also
NemV4SetSyringe
Parameters
NemesysDevice pointer.
PosDevice position in increments.
Returns
Volume value in microlitres (µl)

Converts a device position in increments in a volume in microlitres.

into a volume in microliters using the configured syringe parameters.

Referenced by NemV4GetMaxSyringeLevel(), and NemV4GetSyringeLevel().

290 {
291  Pos = (0 - Pos);
292  return NemV4DevicePosToMillimetres(Nemesys, Pos) * Nemesys->InnerSyringeArea_mm2;
293 }
double NemV4DevicePosToMillimetres(TNemesysV4 *Nemesys, int32_t Pos)
Convert device position in increments into position in mm.
Definition: nem4_rs232_api.c:252
double InnerSyringeArea_mm2
stores the calculated inner syringe area
Definition: nem4_rs232_api.h:116

+ Here is the call graph for this function:

double NemV4DevicePosToMillimetres ( TNemesysV4 Nemesys,
int32_t  Pos 
)

Converts a Nemesys position given in increments into millimeters.

Parameters
NemesysThe Nemesys the position value in Pos comes from
PosA position value in increments from the given Nemesys.
Returns
The position value in millimeters.

Converts a Nemesys position given in increments into millimeters.

Referenced by NemV4DevicePosToMicrolitres().

253 {
254  return Pos / Nemesys->PosUnitsPerRevolution;
255 }
double PosUnitsPerRevolution
conversion factor between Nemesys position units and revolutions
Definition: nem4_rs232_api.h:113
double NemV4DeviceVelToMicrolitresPerMinute ( TNemesysV4 Nemesys,
int32_t  Velocity 
)

Converts a device velocity into a flow rate in microlitres per minute (µl/min).

The function uses the configured syringe for flow calculation so ensure that you have properly configured the syringe via NemV4SetSyringe.

See also
NemV4SetSyringe
Parameters
NemesysDevice pointer
VelocityDevice velocity
Returns
Flow rate in microlitres per minute.

Converts a device velocity into a flow rate in microlitres per minute (µl/min).

Referenced by NemV4GetCurrentFlow(), and NemV4GetMaxFlow().

313 {
314  return NemV4DeviceVelToMillimetresPerMinute(Nemesys, Velocity) * Nemesys->InnerSyringeArea_mm2;
315 }
double NemV4DeviceVelToMillimetresPerMinute(TNemesysV4 *Nemesys, int32_t Velocity)
Converts a device velocity in device units (likely mrprm) into mm/min.
Definition: nem4_rs232_api.c:270
double InnerSyringeArea_mm2
stores the calculated inner syringe area
Definition: nem4_rs232_api.h:116

+ Here is the call graph for this function:

double NemV4DeviceVelToMillimetresPerMinute ( TNemesysV4 Nemesys,
int32_t  Velocity 
)

Converts a device velocity value to a speed value in mm/min.

Parameters
NemesysDevice pointer
VelocityDevice velocity
Returns
Velocity in mm/min.

Converts a device velocity value to a speed value in mm/min.

Referenced by NemV4DeviceVelToMicrolitresPerMinute().

271 {
272  return Velocity / Nemesys->VelUnitsPerRPM;
273 }
double VelUnitsPerRPM
conversion factor between Nemesys velocity units and RPM
Definition: nem4_rs232_api.h:114
int32_t NemV4MicrolitresPerMinuteToDeviceVel ( TNemesysV4 Nemesys,
double  ul_min 
)

Converts a flow rate in microlitres per minute (µl/min) into a device velocity.

The function uses the configured syringe for flow calculation so ensure that you have properly configured the syringe via NemV4SetSyringe.

See also
NemV4SetSyringe
Parameters
NemesysDevice pointer
Flow_ul_minFlow rate in microlitres per minute
Returns
Device velocity

Converts a flow rate in microlitres per minute (µl/min) into a device velocity.

Referenced by NemV4DoseVolume(), NemV4GenerateFlow(), and NemV4SetSyringeLevel().

322 {
323  double mm_min = ul_min / Nemesys->InnerSyringeArea_mm2;
324  return NemV4MillimetresPerMinuteToDeviceVel(Nemesys, mm_min);
325 }
int32_t NemV4MillimetresPerMinuteToDeviceVel(TNemesysV4 *Nemesys, double mm_min)
Converts a velocity in mm/min into a device velocity (likely mrpm).
Definition: nem4_rs232_api.c:279
double InnerSyringeArea_mm2
stores the calculated inner syringe area
Definition: nem4_rs232_api.h:116

+ Here is the call graph for this function:

int32_t NemV4MicrolitresToDevicePos ( TNemesysV4 Nemesys,
double  ul 
)

Converts a volume in microlitres into a device position in increments.

The function uses the configured syringe for volume calculation so ensure that you have properly configured the syringe via NemV4SetSyringe.

See also
NemV4SetSyringe
Parameters
NemesysDevice pointer.
Volume_ulVolume value in microliters
Returns
Device position in increments

Converts a volume in microlitres into a device position in increments.

Referenced by NemV4DoseVolume(), and NemV4SetSyringeLevel().

301 {
302  double mm = ul / Nemesys->InnerSyringeArea_mm2;
303  int32_t Pos = NemV4MillimetresToDevicePos(Nemesys, mm);
304  return 0 - Pos;
305 }
int32_t NemV4MillimetresToDevicePos(TNemesysV4 *Nemesys, double mm)
Converts a position in mm into a device position in inc.
Definition: nem4_rs232_api.c:261
double InnerSyringeArea_mm2
stores the calculated inner syringe area
Definition: nem4_rs232_api.h:116

+ Here is the call graph for this function:

int32_t NemV4MillimetresPerMinuteToDeviceVel ( TNemesysV4 Nemesys,
double  mm_min 
)

Converts a velocity in mm/in into a device velocity.

Parameters
NemesysDevice pointer
Speed_mm_minVelocity in mm_min
Returns
Device velocity in a device specific unit.

Converts a velocity in mm/in into a device velocity.

Referenced by NemV4MicrolitresPerMinuteToDeviceVel().

280 {
281  return round(mm_min * Nemesys->VelUnitsPerRPM);
282 }
double VelUnitsPerRPM
conversion factor between Nemesys velocity units and RPM
Definition: nem4_rs232_api.h:114
int32_t NemV4MillimetresToDevicePos ( TNemesysV4 Nemesys,
double  mm 
)

Converts a position in mm into a Nemesys position in increments.

Parameters
NemesysDevice pointer
Pos_mmPosition value in mm
Returns
The position value in device increments.

Converts a position in mm into a Nemesys position in increments.

Referenced by NemV4MicrolitresToDevicePos().

262 {
263  return round(mm * Nemesys->PosUnitsPerRevolution);
264 }
double PosUnitsPerRevolution
conversion factor between Nemesys position units and revolutions
Definition: nem4_rs232_api.h:113