versadac  1
versadac - Scalable Recorder Firmware
instances_interface.h
1 #ifndef INSTANCES_INTERFACE_H
2 #define INSTANCES_INTERFACE_H
3 /*****************************************************************************
4 * Copyright (c) 2001 Eurotherm Controls Ltd.
5 *
6 * FILENAME : instances_interface.h
7 * AUTHORS : Paul Sayers
8 * CREATED : September 2001
9 * DESCRIPTION : Provides the public interface to the instances block.
10 * DESIGN SPEC :
11 *****************************************************************************/
12 #include "template.h"
13 
14 /* Public references */
15 
16 #if __cplusplus
17 extern "C"
18 {
19 #endif
20 
21 /* Define the list of string_t parameters - used by the UI user string code */
22 extern const CISP_t * string_parameters[];
23 
24 /* Define a translation macro to get from an external class number to a cl[] array index number */
25 extern const uint8 class_translate[];
26 #define CLASS_TRANSLATE(x) class_translate[(x)]
27 
28 /* ********************* */
29 /* Class List :- */
30 /* ********************* */
31 typedef struct {
32  uint8 NumInsts; /* Number of instances used for the class */
33 #ifdef EXTENDED_TEMPLATE
34  /* The next two values will only be used to check if MaxInsts = 1, in which case */
35  /* we will not use the instance number in the OPC name */
36  uint8 MinInsts; /* The minimum number of instances which we should ever have / create */
37  uint8 MaxInsts; /* The maximum number of instances which we should ever have / create */
38 #endif
39  ClassInfo_t *ci_p; /* Pointer to the class info */
40 } Class_t;
41 
42 /* External references */
43 extern const Class_t cl[];
44 extern uint8 s_cold_start;
45 
46 /* Function prototypes */
47 extern uint8 GetMaxInstances (uint8 z_class);
48 extern uint8 GetMaxClasses (void);
49 extern uint16 GetModbusTabSize(void);
50 
51 extern void exe_Request_Wiring_Mode_Change(uint8 z_mode);
52 extern uint8 exe_Get_Wiring_Mode();
53 extern bool exe_Wiring_In_Load_Mode();
54 extern void exe_init_programmer_wiring(); /* Cached until end of exec */
55 extern bool exe_BlockIsWired(CI_t z_Block);
56 extern void exe_changeWire(bool remove, CISP_t src, CISP_t dest, uint8 z_task);
57 extern bool exe_modify_wiring(CISP_t src, CISP_t dest, uint8 z_task);
58 extern uint8 exe_modify_wires(CISP_t src, CISP_t dst, uint8 act, uint8 z_task, CISP_t* existing, bool replace);
59 extern bool exe_is_src_wired_to_dest(CISP_t src, CISP_t dst);
60 extern void do_cold_start(void);
61 #ifdef WIN32
62 extern void control_task(void);
63 #else
64 extern bool invalid_nvol_parameter_storage(void);
65 #endif
66 
67 
68 /* Definition of the MODBUS Base address for the CISP parameter address space */
69 #define PARAMETER_MODBUS_BASE_ADDRESS 0x5000
70 
71 /**** THESE ENUMERATIONS MUST MATCH THOSE USED ON THE OPTIONS FBLOCK ****/
72 #define EXE_WIRING_MODE_FAILED 0
73 #define EXE_WIRING_MODE_RUN 1
74 #define EXE_WIRING_MODE_RESET 2
75 #define EXE_WIRING_MODE_LOADING 3
76 #define EXE_WIRING_MODE_VALIDATE 4
77 #define EXE_WIRING_MODE_NO_CHANGE 5
78 #define EXE_WIRING_MODE_VALIDATE_AND_INIT 6
79 
80 extern uint16 g_Requested_FBlock_Mode;
81 extern uint8 Actual_FBlock_Mode;
82 #define MODE_SET_FBLOCK_INIT() (g_Requested_FBlock_Mode |= MODE_INIT)
83 #define MODE_CLR_FBLOCK_INIT() (g_Requested_FBlock_Mode &=~ MODE_INIT)
84 
85 #define MODE_SET_FBLOCK_REINIT() (g_Requested_FBlock_Mode |= MODE_REINIT)
86 
87 #define MODE_SET_FBLOCK_ERRORLOG_STANDBY() (g_Requested_FBlock_Mode |= MODE_ERRORLOG_STANDBY)
88 #define MODE_CLR_FBLOCK_ERRORLOG_STANDBY() (g_Requested_FBlock_Mode &=~ MODE_ERRORLOG_STANDBY)
89 
90 #define MODE_SET_FBLOCK_TELEMETRY() (g_Requested_FBlock_Mode |= MODE_TELEMETRY)
91 #define MODE_CLR_FBLOCK_TELEMETRY() (g_Requested_FBlock_Mode &=~ MODE_TELEMETRY)
92 
93 #define MODE_SET_FBLOCK_STARTUP() (g_Requested_FBlock_Mode |= MODE_STARTUP)
94 
95 #define MODE_IS_FBLOCK_STARTUP() (g_Requested_FBlock_Mode & MODE_STARTUP)
96 #define MODE_IS_FBLOCK_STANDBY() (Actual_FBlock_Mode & MODE_STANDBY)
97 #define MODE_IS_FBLOCK_INIT() (Actual_FBlock_Mode & MODE_INIT)
98 
99 #define MODE_IS_FBLOCK_STANDBY_STARTUP() ((Actual_FBlock_Mode & (MODE_STANDBY | MODE_STARTUP)) == (MODE_STANDBY | MODE_STARTUP))
100 #define MODE_IS_FBLOCK_STANDBY_REINIT() ((Actual_FBlock_Mode & (MODE_STANDBY | MODE_REINIT)) == (MODE_STANDBY | MODE_REINIT))
101 
102 #if __cplusplus
103 }
104 #endif
105 
106 #endif
Definition: instances_interface.h:31