ProviewR Programmer's Reference Manual  V6.1.4
nmps_appl.h
Go to the documentation of this file.
1 /*
2  * ProviewR Open Source Process Control.
3  * Copyright (C) 2005-2025 SSAB EMEA AB.
4  *
5  * This file is part of ProviewR.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation, either version 2 of
10  * the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with ProviewR. If not, see <http://www.gnu.org/licenses/>
19  *
20  * Linking ProviewR statically or dynamically with other modules is
21  * making a combined work based on ProviewR. Thus, the terms and
22  * conditions of the GNU General Public License cover the whole
23  * combination.
24  *
25  * In addition, as a special exception, the copyright holders of
26  * ProviewR give you permission to, from the build function in the
27  * ProviewR Configurator, combine ProviewR with modules generated by the
28  * ProviewR PLC Editor to a PLC program, regardless of the license
29  * terms of these modules. You may copy and distribute the resulting
30  * combined work under the terms of your choice, provided that every
31  * copy of the combined work is accompanied by a complete copy of
32  * the source code of ProviewR (the version used to produce the
33  * combined work), being distributed under the terms of the GNU
34  * General Public License plus this exception.
35  */
36 
37 #ifndef ra_nmps_appl_h
38 #define ra_nmps_appl_h
39 
40 /* ra_nmps_appl.h -- <short description>
41  NMps API. */
42 
47 #if defined __cplusplus
48 extern "C" {
49 #endif
50 
51 
55 #define NMPSAPPL_CELLIST_MAX \
56  32 /* Max number of cells in a \
57  appl_init call */
58 #define NMPSAPPL_APPLSESS_MAX \
59  32 /* Max number of application \
60  sessions */
61 
62 #define nmpsappl_mOption_Remove (1 << 0)
63 #define nmpsappl_mOption_NamePath (1 << 1)
64 #define nmpsappl_mOption_ReverseOrder (1 << 2)
65 
71 typedef struct nmpsappl_s_cellist {
72  pwr_tString80 name;
73  pwr_tObjid objid;
74  pwr_tAddress object_ptr;
75  gdh_tDlid subid;
76  pwr_tClassId classid;
77  unsigned long index_mask[NMPSAPPL_APPLSESS_MAX];
78  int tmp_size;
79  void* tmp_cell;
80  struct nmpsappl_s_cellist* next;
82 
84 typedef struct {
85  pwr_tObjid objid;
87  pwr_tAddress object_ptr;
88  pwr_tBoolean select;
92  pwr_tBoolean front;
96  pwr_tBoolean back;
100  pwr_tBoolean newdata;
102  pwr_tBoolean removed;
105  unsigned long cell_mask;
111 
113 typedef struct nmpsappl_s_ctx {
114  nmpsappl_t_cellist* cellist[NMPSAPPL_CELLIST_MAX];
115  unsigned long options;
116  int index;
117  unsigned long index_mask;
118  int cellist_count;
119  int total_cellsize;
120  int data_count;
122  struct nmpsappl_s_ctx* next;
123 } * nmpsappl_t_ctx;
124 
133  pwr_tString80* cell_array, unsigned long options, nmpsappl_t_ctx* ctx);
134 
136  nmpsappl_t_ctx applctx, int* data_count, nmpsappl_t_datainfo** datainfo);
139  nmpsappl_t_ctx applctx, pwr_tObjid objid);
140 pwr_tStatus nmpsappl_SelectData(nmpsappl_t_ctx applctx, pwr_tObjid objid);
141 pwr_tStatus nmpsappl_TransportData(nmpsappl_t_ctx applctx, pwr_tObjid objid,
142  unsigned int from_cell_mask, unsigned int to_cell_mask);
143 pwr_tStatus nmpsappl_InsertData(
144  nmpsappl_t_ctx applctx, pwr_tObjid objid, unsigned int cell_mask);
145 pwr_tStatus nmpsappl_RemoveAndKeepData(
146  nmpsappl_t_ctx applctx, pwr_tObjid objid, unsigned int cell_mask);
147 
148 #if defined __cplusplus
149 }
150 #endif
151 #endif
152 
struct nmpsappl_s_cellist nmpsappl_t_cellist
struct nmpsappl_s_ctx * nmpsappl_t_ctx
pwr_tStatus nmpsappl_MirrorInit(pwr_tString80 *cell_array, unsigned long options, nmpsappl_t_ctx *ctx)
Initialize mirroring.
Definition: nmps_appl.c:245
pwr_tStatus nmpsappl_RemoveAndDeleteData(nmpsappl_t_ctx applctx, pwr_tObjid objid)
Removes and deletes a dataobject from one of the cells that are mirrored.
Definition: nmps_appl.c:720
pwr_tStatus nmpsappl_Mirror(nmpsappl_t_ctx applctx, int *data_count, nmpsappl_t_datainfo **datainfo)
Update mirroring.
Definition: nmps_appl.c:449
pwr_tStatus nmpsappl_RemoveData(nmpsappl_t_ctx applctx, pwr_tObjid objid)
Removes a dataobject from one of the cells that are mirrored.
Definition: nmps_appl.c:681
unsigned int pwr_tBoolean
Boolean type.
Definition: pwr.h:127
pwr_tCid pwr_tClassId
Class identity type.
Definition: pwr.h:274
char pwr_tString80[80]
80 byte string type.
Definition: pwr.h:412
int pwr_tStatus
Status type.
Definition: pwr.h:284
void * pwr_tAddress
Generic pointer type.
Definition: pwr.h:121
Object identity type.
Definition: pwr.h:263