19 #include "rt_pwr_msg.h"
58 int mh_send(
const char* text, mh_eEventPrio prio);
68 &subid[subid_cnt++],
sizeof(*dv1_p));
73 &subid[subid_cnt++],
sizeof(*dv2_p));
78 &subid[subid_cnt++],
sizeof(*av1_p));
84 mh_eEvent_Info, mh_eEventPrio_A,
86 mh_mEventFlags_Bell | mh_mEventFlags_Ack | mh_mEventFlags_Return),
87 "ra_appl aborted", &active_messages);
95 for (
int i = 0; i < subid_cnt; i++)
107 if (*dv2_p && !dv2_old)
108 mh_send(
"Pump is stopped", mh_eEventPrio_A);
123 memset(&msg, 0,
sizeof(msg));
129 mh_mEventFlags_Returned | mh_mEventFlags_NoObject | mh_mEventFlags_Bell);
131 msg.
SupInfo.SupType = mh_eSupType_None;
146 appl.register_appl(
"Nodes-opg7-ra_appl");
149 }
catch (co_error e) {
150 errh_Fatal(
"Application exception, %s", e.what().c_str());
A simple c++ application example.
ra_appl()
Pointer to database value Av1.
Baseclass for applications.
Include file for Time management.
void errh_SetStatus(pwr_tStatus sts)
Set application status. The application status is showed in the Node graph. The application can set t...
void errh_Fatal(const char *msg,...)
Log a fatal message. The function has a variable argument list similar to sprintf.
pwr_tStatus gdh_UnrefObjectInfo(pwr_tSubid subid)
Terminates the subscription defined by the subscription identity.
pwr_tStatus gdh_RefObjectInfo(char *attributeName, void **objectData, pwr_tSubid *subid, unsigned int sizeOfObjectData)
The routine returns an address to the data that is denoted by Name. The name can be either an object ...
mh_mApplFlags
Flags governing how mh interacts with the application.
pwr_tStatus mh_ApplMessage(pwr_tUInt32 *Id, mh_sApplMessage *Message)
This routine is called by an application to create and send a message.
pwr_tStatus mh_ApplConnect(pwr_tObjid ApplObject, mh_mApplFlags Flags, const pwr_tString80 AbortEventName, mh_eEvent AbortEventType, mh_eEventPrio AbortEventPrio, mh_mEventFlags AbortEventFlags, const pwr_tString80 AbortEventText, pwr_tUInt32 *NoOfActMessages)
Connects this application to the local Handler.
int time_GetTime(pwr_tTime *ts)
Get current time.
void close()
Closes the application.
void scan()
Cyclic function.
void open()
Initialize the application.
int mh_send(const char *text, mh_eEventPrio prio)
Send alarm.
Basic type definitions. This include file contains the Proview basic type definitions.
#define EVEN(a)
Check if value is even.
unsigned int pwr_tUInt32
32-bit unsigned integer type.
unsigned int pwr_tBoolean
Boolean type.
pwr_tRid pwr_tSubid
Subscription identity type.
int pwr_tStatus
Status type.
float pwr_tFloat32
32-bit float.
Include file for the rt_appl class.
Include file for Gdh Global Data Handler.
Include file for MhAppl MessageHandler API.
The structure describing an application message.
mh_mEventFlags EventFlags