48 #include "rt_pwr_msg.h"
49 #include "rt_qcom_msg.h"
50 #include "rt_ini_event.h"
52 #include "pwr_baseclasses.h"
56 : m_anix(anix), m_scantime(scantime), m_maxdelay(5), m_qid(qid)
86 qAttr.type = qcom_eQtype_private;
102 void rt_appl::register_appl(
const char* name)
105 pwr_sClass_Application* op;
119 void rt_appl::mainloop()
126 bool first_scan =
true;
130 }
catch (co_error& e) {
143 tmo = (int)(m_scantime * 1000 - 1);
146 get.maxSize =
sizeof(mp);
149 if (sts == QCOM__TMO || sts == QCOM__QEMPTY) {
155 ini_mEvent new_event;
158 new_event.m = ep->mask;
159 if (new_event.b.oldPlcStop && !swap) {
163 }
else if (new_event.b.swapDone && swap) {
167 }
else if (new_event.b.terminate) {
175 double rt_appl::scantime()
180 void rt_appl::set_scantime(
double time)
virtual void close()
Closes the application.
virtual void open()
Initialize the application.
rt_appl(const char *name, errh_eAnix anix, double scantime=1.0, qcom_sQid qid=qcom_cNQid)
Constructor.
virtual void scan()
Cyclic function.
pwr_tStatus aproc_TimeStamp(float scantime, float maxdelay)
Set application timestamp. The timestamp is supervised by the event monitor and if the timestamp is d...
pwr_tStatus aproc_RegisterObject(pwr_tOid)
Register Application object. The Application object is stored in the $Node object and be opened from ...
void errh_Error(const char *msg,...)
Log an error message. The function has a variable argument list similar to sprintf.
pwr_tStatus errh_Init(const char *programName, errh_eAnix anix)
Initialize errh. Set up a queue to write to, set application name.
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_ObjidToPointer(pwr_tObjid object, void **objectData)
Gets the address of the data of an object, given its object identity.
pwr_tStatus gdh_Init(const char *name)
Initialize the process to the Proview runtime environment.
pwr_tStatus gdh_NameToObjid(const char *objectName, pwr_tObjid *objid)
Get the object identity of an object with name 'name'.
pwr_tBoolean qcom_Bind(pwr_tStatus *sts, const qcom_sQid *myQ, const qcom_sQid *toQ)
Bind one queue to another.
pwr_tBoolean qcom_CreateQ(pwr_tStatus *sts, qcom_sQid *myQ, qcom_sQattr *attr, const char *qname)
Create a queue and make an implicit connect to it.
void * qcom_Get(pwr_tStatus *sts, const qcom_sQid *myQ, qcom_sGet *get, int tmo_ms)
Get a new message.
pwr_tBoolean qcom_Init(pwr_tStatus *sts, qcom_sAid *aid, const char *aname)
Connect to QCom.
#define EVEN(a)
Check if value is even.
int pwr_tStatus
Status type.
#define ODD(a)
Check if value is odd.
Include file for the rt_appl class.
Include file for AProc Application process interface.
Include file for Gdh Global Data Handler.