ProviewR Programmer's Reference Manual  V7.0.0
rt_sevcli.h
Go to the documentation of this file.
1 /*
2  * ProviewR Open Source Process Control.
3  * Copyright (C) 2005-2026 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 rt_sevcli_h
38 #define rt_sevcli_h
39 
40 /* rt_sevcli.h -- Storage client */
41 
49 #include "rt_qcom.h"
50 #include "rt_mh_net.h"
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
63 typedef struct {
66  unsigned int msg_id;
68 
72 typedef struct {
74  pwr_eType type;
75  unsigned int size;
76  unsigned int elem;
79 
83 typedef struct {
87  pwr_tTime creatime;
88  pwr_tTime modtime;
93  unsigned int attrnum;
94  sevcli_sHistAttr attr[1];
96 
97 typedef struct {
98  pwr_tOid oid;
99  pwr_tAName oname;
100  pwr_tDeltaTime storagetime;
101  pwr_tTime creatime;
102  pwr_tString80 description;
103  pwr_tMask options;
104 } sevcli_sEventsItem;
105 
106 typedef struct {
107  pwr_tTime Time;
108  pwr_tUInt32 EventType;
109  pwr_tUInt32 EventPrio;
110  pwr_tOid SupObjectOid;
111  pwr_tUInt32 SupObjectOffset;
112  pwr_tUInt32 SupObjectSize;
113  pwr_tString80 EventText;
114  pwr_tOName EventName;
115  mh_sEventId EventId;
116  pwr_tUInt32 EventStatus;
117 } sevcli_sEvents;
118 
125 int sevcli_init(pwr_tStatus* sts, sevcli_tCtx* ctx);
126 int sevcli_close(pwr_tStatus* sts, sevcli_tCtx ctx);
128 int sevcli_set_servernode(pwr_tStatus* sts, sevcli_tCtx ctx, char* nodename);
130  sevcli_sHistItem** list, unsigned int* cnt);
132  char* aname, pwr_tTime starttime, pwr_tTime endtime, int numpoints,
133  pwr_tTime** tbuf, void** vbuf, int* rows, pwr_eType* vtype,
134  unsigned int* vsize);
136  pwr_tStatus* sts, sevcli_tCtx ctx, pwr_tOid oid, char* aname);
138  char* aname, pwr_tTime starttime, pwr_tTime endtime, int numpoints,
139  pwr_tTime** tbuf, void** vbuf, int* rows, sevcli_sHistAttr** histattr,
140  int* numattributes);
142  sevcli_sEventsItem** list, unsigned int* cnt);
144  pwr_tTime starttime, pwr_tTime endtime, pwr_tUInt32 eventtypemask,
145  pwr_tUInt32 eventpriomask, pwr_tString80 eventtext, pwr_tOName eventname,
146  unsigned int maxevents, sevcli_sEvents **list, unsigned int* cnt);
147 void sevcli_store_ctx(sevcli_tCtx ctx);
149 
150 #ifdef __cplusplus
151 }
152 #endif
153 
158 #endif
int sevcli_get_itemdata(pwr_tStatus *sts, sevcli_tCtx ctx, pwr_tOid oid, char *aname, pwr_tTime starttime, pwr_tTime endtime, int numpoints, pwr_tTime **tbuf, void **vbuf, int *rows, pwr_eType *vtype, unsigned int *vsize)
Fetch stored historical data for an attribute.
Definition: rt_sevcli.c:357
int sevcli_get_events(pwr_tStatus *sts, sevcli_tCtx ctx, pwr_tOid oid, pwr_tTime starttime, pwr_tTime endtime, pwr_tUInt32 eventtypemask, pwr_tUInt32 eventpriomask, pwr_tString80 eventtext, pwr_tOName eventname, unsigned int maxevents, sevcli_sEvents **list, unsigned int *cnt)
Fetch stored historical events for an events item.
Definition: rt_sevcli.c:748
int sevcli_set_servernode(pwr_tStatus *sts, sevcli_tCtx ctx, char *nodename)
Set server from node name. This function is called to state which server node you want to communicate...
Definition: rt_sevcli.c:118
int sevcli_init(pwr_tStatus *sts, sevcli_tCtx *ctx)
Initialization of the client. Creates a context and opens a Qcom queue for the communication....
Definition: rt_sevcli.c:62
void sevcli_store_ctx(sevcli_tCtx ctx)
Store context.
Definition: rt_sevcli.c:882
int sevcli_delete_item(pwr_tStatus *sts, sevcli_tCtx ctx, pwr_tOid oid, char *aname)
Removes all data for a stored attribute in the storage database.
Definition: rt_sevcli.c:592
int sevcli_get_eventsitemlist(pwr_tStatus *sts, sevcli_tCtx ctx, sevcli_sEventsItem **list, unsigned int *cnt)
Fetches a list with the stored eventlists of the server.
Definition: rt_sevcli.c:658
int sevcli_close(pwr_tStatus *sts, sevcli_tCtx ctx)
Close the communication. Removes the Qcom queue and frees the context.
Definition: rt_sevcli.c:86
void sevcli_set_servernid(sevcli_tCtx ctx, pwr_tNid nid)
Set server from node id. This function is called to state which server node you want to communicate w...
Definition: rt_sevcli.c:105
sevcli_tCtx sevcli_get_stored_ctx(void)
Get stored context.
Definition: rt_sevcli.c:890
int sevcli_get_objectitemdata(pwr_tStatus *sts, sevcli_tCtx ctx, pwr_tOid oid, char *aname, pwr_tTime starttime, pwr_tTime endtime, int numpoints, pwr_tTime **tbuf, void **vbuf, int *rows, sevcli_sHistAttr **histattr, int *numattributes)
Fetch stored historical data for an object item.
Definition: rt_sevcli.c:476
int sevcli_get_itemlist(pwr_tStatus *sts, sevcli_tCtx ctx, sevcli_sHistItem **list, unsigned int *cnt)
Fetches a list with the stored attributes of the server.
Definition: rt_sevcli.c:156
unsigned int pwr_tUInt32
32-bit unsigned integer type.
Definition: pwr.h:233
char pwr_tAName[399+1]
Full Aref Name type.
Definition: pwr.h:397
char pwr_tString80[80]
80 byte string type.
Definition: pwr.h:416
int pwr_tStatus
Status type.
Definition: pwr.h:284
char pwr_tOName[199+1]
Full Object Name type.
Definition: pwr.h:396
char pwr_tString16[16]
16 byte string type.
Definition: pwr.h:432
pwr_tVolumeId pwr_tNid
Node identity type.
Definition: pwr.h:297
pwr_tUInt32 pwr_tMask
Mask type.
Definition: pwr.h:248
float pwr_tFloat32
32-bit float.
Definition: pwr.h:131
Include file for QCOM Queue Communication.
Delta time type.
Definition: pwr.h:369
Object identity type.
Definition: pwr.h:263
Queue identity.
Definition: rt_qcom.h:125
qcom_sQid qid
Definition: rt_sevcli.h:64
pwr_tNid server
Definition: rt_sevcli.h:65
unsigned int msg_id
Definition: rt_sevcli.h:66
unsigned int size
Definition: rt_sevcli.h:75
pwr_tAName aname
Definition: rt_sevcli.h:73
pwr_tString16 unit
Definition: rt_sevcli.h:77
pwr_eType type
Definition: rt_sevcli.h:74
unsigned int elem
Definition: rt_sevcli.h:76
pwr_tFloat32 scantime
Definition: rt_sevcli.h:90
pwr_tTime creatime
Definition: rt_sevcli.h:87
pwr_tAName oname
Definition: rt_sevcli.h:85
unsigned int attrnum
Definition: rt_sevcli.h:93
pwr_tString80 description
Definition: rt_sevcli.h:89
pwr_tDeltaTime storagetime
Definition: rt_sevcli.h:86
pwr_tMask options
Definition: rt_sevcli.h:92
pwr_tOid oid
Definition: rt_sevcli.h:84
pwr_tTime modtime
Definition: rt_sevcli.h:88
pwr_tFloat32 deadband
Definition: rt_sevcli.h:91