versadac  1
versadac - Scalable Recorder Firmware
eiot2srdo8.h
1 /*******************************************************************************
2 FILE : eiot2srdo8.h
3 VERSION : $Id$
4 AUTHOR : Richard Hine
5 SYSTEM : Diab C for PowerPC under vxWorks
6 DESCRIPTION : This file contains The t2500 module class for representing 8 channel
7  digital output modules run in the fast mode.
8 
9  Modification for 8Hz execution (for Scalable Recorder)
10 
11 *******************************************************************************/
12 #ifndef __EIOT2SRDO8_H
13 #define __EIOT2SRDO8_H
14 
15 #ifdef __cplusplus
16 #include "prjParams.h"
17 #include "eio.h"
18 #include "eio_t25srm.h"
19 #include "eio_vp.h"
20 #include "eio_tp.h"
21 #include "do8_ssm.h"
22 #include "msg_try.h"
23 
24 extern "C" {
25 #endif
26 
27 /* Relay 8 has a restriction on min on time */
28 /* If the relay is switched faster than this the drive will be higher
29  and the board could overheat */
30 #define EIO_RLY8_MIN_PULSE_TIME_US (200000)
31 
32 /* The following is C++ only */
33 #ifdef __cplusplus
34 enum EioT2500Do8RunStates
35 {
36  EIO_T2500_DO8_STATE_JUST_CREATED,
37  EIO_T2500_DO8_STATE_JUST_CREATED_2,
38  EIO_T2500_DO8_STATE_MODULE_HAS_CHANGED,
39  EIO_T2500_DO8_STATE_START_RUNTIME,
40  EIO_T2500_DO8_STATE_RUNTIME,
41  EIO_T2500_DO8_STATE_DELETE_1,
42  EIO_T2500_DO8_STATE_DELETE_2,
43  EIO_T2500_DO8_STATE_ERROR,
44  EIO_T2500_DO8_STATE_ERROR_2,
45  EIO_T2500_DO8_STATE_SECONDARY_ENABLING,
46  EIO_T2500_DO8_STATE_SECONDARY_ENABLED,
47  EIO_T2500_DO8_STATE_SECONDARY_DISABLING,
48  EIO_T2500_DO8_STATE_SECONDARY_DISABLED
49 };
50 
51 class EioT2500Do8Module:public EioT2500Module
52 {
53  public:
54  EioT2500Do8Module(unsigned char z_moduleNumber, EioModuleType z_type,
55  unsigned char z_tpoMultiple, EioT2500CycleEnum z_cycleNumber);
56  virtual ~EioT2500Do8Module();
57 
58  protected:
59  virtual void updateFast(unsigned short slot);
60  virtual void update62_5mS();
61  virtual void update125mS();
62  virtual void updateFastBuffers(unsigned int z_thisSlot);
63  virtual void updateBuffers125ms();
64  virtual void cycleComplete125mS();
65  virtual void cycleCompleteFast(unsigned int z_thisSlot);
66 
67  private:
68  MsgRetryCounter m_retry;
69  void configureUpdateMessage(unsigned int slot);
70  void setUpdateMessagesSafe();
71  void updateBuffers(unsigned int z_thisSlot);
72  EioT2500Do8RunStates m_state;
73  DigitalOutput8SpiScheduledMessage *m_fastUpdateMessage[EUROTHERM_SPI_MESSAGE_SCHEDULER_NUMBER_OF_SLOTS];
74  unsigned char * m_slotData;
75  static const int MAX_NUMBER_OF_OUTPUTS_PER_MODULE = 8;
76  static const int MAX_NUMBER_OF_VP_OUTPUTS_PER_MODULE = MAX_NUMBER_OF_OUTPUTS_PER_MODULE/2;
77  EioDoPointConfig m_pointConfig[MAX_NUMBER_OF_OUTPUTS_PER_MODULE];
78  EioDoPointRuntime m_pointRuntime[MAX_NUMBER_OF_OUTPUTS_PER_MODULE];
79  EioValvePositioningOutput m_vpo[MAX_NUMBER_OF_VP_OUTPUTS_PER_MODULE];
80  EioTimeProportioningOutput m_tpo[MAX_NUMBER_OF_OUTPUTS_PER_MODULE];
81  bool m_badConfig[MAX_NUMBER_OF_OUTPUTS_PER_MODULE];
82  EioDOStatus m_status[MAX_NUMBER_OF_OUTPUTS_PER_MODULE];
83  bool m_hadHardwareError[MAX_NUMBER_OF_OUTPUTS_PER_MODULE];
84  bool m_messagesScheduled;
85  bool m_runFast;
86  unsigned char m_tpoMultiple;
87  unsigned char m_ticks_per_tpo;
88  bool *m_valveLower;
89 
90 };
91 #endif
92 
93 #ifdef __cplusplus
94 } /* extern "C" */
95 #endif
96 #endif /*__EIOT2SRDO8_H */
97 
Definition: eio_t25srm.h:58
Definition: eio_tp.h:21
Definition: do8_ssm.h:29
Definition: eio_do.h:89
Definition: msg_try.h:21
Definition: eio_do.h:102
Definition: eio_vp.h:25