Valve Control

Overview

This group defines all required functions for valve control, configuration and reading of valve states.

+ Collaboration diagram for Valve Control:

Functions

uint8_t NemIsValveInstalled (TNemesys *Nemesys)
 Checks the device configuration if a valve is installed. More...
 
uint32_t NemIsValveStateDispense (TNemesys *Nemesys)
 Check if valve is switched to dispense state (output). More...
 
long NemSwitchValve (TNemesys *Nemesys, uint8_t SwitchToDispense)
 Switch the integrated three way valve (if one is installed). More...
 

Function Documentation

uint8_t NemIsValveInstalled ( TNemesys Nemesys)

Checks the device configuration if a valve is installed.

Parameters
[in]NemesysDevice to query
Return values
1valve is installed 0 no valve is installed
1208 {
1209  uint32_t ValveCfgBit = CFGBIT_VALVE_INSTALLED;
1210  if (Nemesys->DevCfg & CFGBIT_NEW_CONFIG)
1211  {
1212  ValveCfgBit = CFGBIT_VALVE_INSTALLED_NEW;
1213  }
1214 
1215  if (Nemesys->DevCfg & ValveCfgBit)
1216  {
1217  return 1;
1218  }
1219  else
1220  {
1221  return 0;
1222  }
1223 }
uint32_t DevCfg
contains configuration for gear, spindle slope, encoder and valve
Definition: nem_rs232_api.h:44
#define CFGBIT_VALVE_INSTALLED_NEW
test bit for valve for new configuration word
Definition: nem_rs232_api.c:28
#define CFGBIT_NEW_CONFIG
if bit 31 is set, then this device contains a new configuration
Definition: nem_rs232_api.c:26
#define CFGBIT_VALVE_INSTALLED
test bit for valve for old configuration word
Definition: nem_rs232_api.c:27
uint32_t NemIsValveStateDispense ( TNemesys Nemesys)

Check if valve is switched to dispense state (output).

Parameters
[in]NemesysDevice to query
Return values
1Valve state is dispense (output)
0Valve state is aspirate (input)
<0Error code (function call failed with error code)
1230 {
1231  return Nemesys->ValveStateDisp;
1232 }
int8_t ValveStateDisp
valve state: 1 = dispense, 0 = aspirate
Definition: nem_rs232_api.h:47
long NemSwitchValve ( TNemesys Nemesys,
uint8_t  SwitchToDispense 
)

Switch the integrated three way valve (if one is installed).

Parameters
[in]NemesysDevice to switch valve
[in]SwitchToDispense1 - switch valve to output for dispensing 0 - switch valve to input for aspiration
Returns
Error code - ERR_NOERR indicates success
1181 {
1182  uint32_t dwDigOutState;
1183  long Result;
1184 
1185  //
1186  // Now switch valve
1187  //
1188  if (SwitchToDispense)
1189  {
1190  dwDigOutState = DIG_OUT_VALVE_SWITCH | DIG_OUT_VALVE_8V;
1191  }
1192  else
1193  {
1194  dwDigOutState = 0;
1195  }
1196 
1197  Nemesys->ValveStateDisp = SwitchToDispense;
1198  Result = CsiDevWriteObject(&Nemesys->Device, NEM_OD_H2078_DIGITAL_OUT_FUNC,
1199  SUB_01_DIG_OUT_STATE, dwDigOutState);
1200  return Result;
1201 }
int8_t ValveStateDisp
valve state: 1 = dispense, 0 = aspirate
Definition: nem_rs232_api.h:47
Digital out for lowering the valve voltage.
Definition: nem_rs232_api.c:212
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
struct CsiDev Device
CSI device object.
Definition: nem_rs232_api.h:41
Digital out for switching the valve.
Definition: nem_rs232_api.c:211

+ Here is the call graph for this function: