xCPS
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Sensor Class Reference

#include <Sensor.h>

Collaboration diagram for Sensor:
Collaboration graph

Public Member Functions

 Sensor (int sensornumber)
 
void initComm (CommSystem *communication)
 
bool isUp ()
 

Public Attributes

int number
 

Protected Attributes

int _mask
 
int _card
 
CommSystemcomm
 

Detailed Description

Author
Max Houwing
Contact: m.hou.nosp@m.wing.nosp@m.@stud.nosp@m.ent..nosp@m.tue.n.nosp@m.l / maxho.nosp@m.uwin.nosp@m.g@gma.nosp@m.il.c.nosp@m.om
Date
November 23rd, 2015

This class handles all of the sensors that are (usually) not connected to any other component of the xCPS machine. These include for example the optical sensor and position sensors that can be used for the index tables. The method isUp() (sensor_isUp in the xCPS class) allows checking of individual sensors. Since the call in the xCPS class requires a sensor number, enums are used to somewhat simply these calls. A full list of these enums can be found in the "Useful information" document that can be found near the xCPS machine or on the wiki, or in the documentation. In general though, it hold for the optical sensor that the enum has the following form: "band#nr#", where # after the band is the number of band (belt) where the sensor is located, with the # after 'nr' is the number of the sensor, which can be found on the schematic of the machine. Furthermore, the position sensor usually have the format "positionx", where x indicates the location, for example "positionswitchband2" and "positionpickplace".

Constructor & Destructor Documentation

Sensor::Sensor ( int  sensornumber)

The initialization of this class needs to account for all the sensors that are present in the system (except for the ones that are already part of a different class, e.g. Turner sensors). Note that whenever a number is listed (as a comment) behind a band number, this means the number the sensor has on the schematic of the machine! Enums can be used instead of the integer sensor numbers, since this greatly simplifies the initialization. Finally, the actual sensor numbers on which these enums are based are the IDI (Channel) number which are listed in the Excel sheet of the machine. A printed version should be available around the computer somewhere (no guarantees)

Member Function Documentation

void Sensor::initComm ( CommSystem communication)

Initializes the commmunication between the sensors and the xCPS system. This function is called in the init() function of the xCPS class, and should otherwise only be used if the usage is known!

bool Sensor::isUp ( )

Function that returns true if the sensor is up (high / 1), and returns false if it is down (low / 0). Note: Some optical sensors are permanently high, unless an object 'breaks the beam'! Carefully check the documentation or the machine to ensure correct usage.


The documentation for this class was generated from the following files: