Overview

This group defines all required functions for execution of different dosing tasks like dosing a certain volume or generating a constant flow.

+ Collaboration diagram for Dosing:

Functions

long NemDoseVolume (TNemesys *Nemesys, uint32_t dwVolume, int32_t dwFlowRate)
 Dose a certain volume with a certain flowrate. More...
 
long NemGenerateConstantFlow (TNemesys *Nemesys, int32_t dwFlowRate)
 Generate a constant flow rate. More...
 
long NemSetSyringeLevel (TNemesys *Nemesys, uint32_t dwSyringeLevel, uint32_t dwFlowRate)
 Set syringe to a certain fill level. More...
 
long NemStop (TNemesys *Nemesys)
 Stops actual dosing move. More...
 

Function Documentation

long NemDoseVolume ( TNemesys Nemesys,
uint32_t  dwVolume,
int32_t  dwFlowRate 
)

Dose a certain volume with a certain flowrate.

This call moves the pusher to a target position until the target volume is dosed or until the upper or lower limit is reached.

Parameters
[in]NemesysDevice to move
[in]dwVolumeVolume (relative position range) to dose. The value is given in increments
[in]dwFlowRateThe flow rate (speed) in mrpm (milli revolutions per second). The sign of the flowrate value defines the direction: flowrate < 0 = aspiration flowrate > 0 = dispense
Returns
Error code - ERR_NOERR indicates success
1000 {
1001  long Result;
1002  int32_t dwPosIs;
1003  int32_t dwTargetPos;
1004 
1005  Nemesys->LastVelocity = dwFlowRate;
1006  //
1007  // First read the actual position - this is our starting point
1008  //
1009  Result = Nem_GetPosIs(Nemesys, &dwPosIs);
1010  if (Result != ERR_NOERR)
1011  {
1012  return Result;
1013  }
1014 
1015  //
1016  // Now calculate target position - target position depends on the
1017  // dwVolume value and on the sign of the dwFlowRate - a negative flowrate
1018  // indicates aspiration and a positive flowrate indicates dispension
1019  // The drive only uses positive flow rates so we invert the flow rate
1020  // if it is negative.
1021  //
1022  if (dwFlowRate < 0)
1023  {
1024  dwFlowRate = 0 - dwFlowRate;
1025  dwTargetPos = dwPosIs + dwVolume;
1026  }
1027  else
1028  {
1029  dwTargetPos = dwPosIs - dwVolume;
1030  }
1031 
1032  //
1033  // Finally execute a simple absolut position move
1034  //
1035  return Nem_MoveToPos(Nemesys, dwTargetPos, dwFlowRate);
1036 }
static long Nem_MoveToPos(TNemesys *Nemesys, int32_t dwPosAbs, uint32_t dwVelocity)
Move pusher to a certain position.
Definition: nem_rs232_api.c:902
int32_t LastVelocity
last flowrate value
Definition: nem_rs232_api.h:46
#define ERR_NOERR
No error.
Definition: err_codes.h:102
static long Nem_GetPosIs(TNemesys *Nemesys, int32_t *pdwPosIs)
Query actual device position value.
Definition: nem_rs232_api.c:765

+ Here is the call graph for this function:

long NemGenerateConstantFlow ( TNemesys Nemesys,
int32_t  dwFlowRate 
)

Generate a constant flow rate.

The pusher moves until the upper or lower limit is reached or until the user manually halts the movement.

Parameters
[in]NemesysDevice to move
[in]dwFlowRateThe flow rate (speed) in mrpm (milli revolutions per second). The sign of the flowrate value defines the direction: flowrate < 0 = aspiration flowrate > 0 = dispense
Returns
Error code - ERR_NOERR indicates success
See also
NemStop()
1043 {
1044  int32_t TargetPos;
1045 
1046  Nemesys->LastVelocity = FlowRate;
1047  //
1048  // Now calculate target position - target position depends on the
1049  // dwVolume value and on the sign of the dwFlowRate
1050  //
1051  if (FlowRate < 0)
1052  {
1053  FlowRate = 0 - FlowRate;
1054  TargetPos = Nemesys->MaxPos; // move to upper limit
1055  }
1056  else
1057  {
1058  TargetPos = 0; // move to lower limit
1059  }
1060 
1061  //
1062  // Finally execute a simple absolut position move
1063  //
1064  return Nem_MoveToPos(Nemesys, TargetPos, FlowRate);
1065 }
static long Nem_MoveToPos(TNemesys *Nemesys, int32_t dwPosAbs, uint32_t dwVelocity)
Move pusher to a certain position.
Definition: nem_rs232_api.c:902
uint32_t MaxPos
maximum position of pusher
Definition: nem_rs232_api.h:42
int32_t LastVelocity
last flowrate value
Definition: nem_rs232_api.h:46

+ Here is the call graph for this function:

long NemSetSyringeLevel ( TNemesys Nemesys,
uint32_t  dwSyringeLevel,
uint32_t  dwFlowRate 
)

Set syringe to a certain fill level.

This call moves the pusher to a certain position.

Parameters
[in]NemesysDevice to move
[in]dwSyringeLevelThe fill level (absolut position) in increments
[in]dwFlowRateThe flow rate (speed) in mrpm (milli revolutions per minute)
Returns
Error code - ERR_NOERR indicates success
See also
NemGetSyringeLevel()
964 {
965  long Result;
966  int32_t dwPosIs;
967 
968 
969  //
970  // First read the actual position
971  //
972  Result = Nem_GetPosIs(Nemesys, &dwPosIs);
973  if (Result != ERR_NOERR)
974  {
975  return Result;
976  }
977 
978  //
979  // We save last flow rate now - if the syringe level is > the is position
980  // the we know that we aspirate and flowrate is < 0. If the syringe level is
981  // < then the is position then we know that we dispense and flowrate is > 0
982  //
983  if ((int32_t)dwSyringeLevel > dwPosIs)
984  {
985  Nemesys->LastVelocity = 0 - dwFlowRate;
986  }
987  else
988  {
989  Nemesys->LastVelocity = dwFlowRate;
990  }
991 
992  return Nem_MoveToPos(Nemesys, dwSyringeLevel, dwFlowRate);
993 }
static long Nem_MoveToPos(TNemesys *Nemesys, int32_t dwPosAbs, uint32_t dwVelocity)
Move pusher to a certain position.
Definition: nem_rs232_api.c:902
int32_t LastVelocity
last flowrate value
Definition: nem_rs232_api.h:46
#define ERR_NOERR
No error.
Definition: err_codes.h:102
static long Nem_GetPosIs(TNemesys *Nemesys, int32_t *pdwPosIs)
Query actual device position value.
Definition: nem_rs232_api.c:765

+ Here is the call graph for this function:

long NemStop ( TNemesys Nemesys)

Stops actual dosing move.

This function immediatelly stops the actual dosing move.

Parameters
[in]NemesysDevice to stop
Returns
Error code - ERR_NOERR indicates success
1081 {
1082  long Result;
1083  uint16_t ControlWord = CW_OP_EN | CWBIT_HALT;
1084 
1085  Result = Nem_SetControlWord(Nemesys, ControlWord);
1086  if (ERR_NOERR == Result)
1087  {
1088  Nemesys->LastVelocity = 0;
1089  }
1090 
1091  return Result;
1092 }
#define CWBIT_HALT
controlword bit halt
Definition: nem_rs232_api.c:39
set device operational
Definition: nem_rs232_api.c:161
int32_t LastVelocity
last flowrate value
Definition: nem_rs232_api.h:46
#define ERR_NOERR
No error.
Definition: err_codes.h:102
static long Nem_SetControlWord(TNemesys *Nemesys, uint16_t wControlWord)
Transmits the controlword to the device.
Definition: nem_rs232_api.c:711

+ Here is the call graph for this function: