ProviewR Programmer's Reference Manual
V6.1.4
|
A simple c++ application example. More...
Public Member Functions | |
ra_appl () | |
Pointer to database value Av1. | |
void | open () |
Initialize the application. More... | |
void | close () |
Closes the application. More... | |
void | scan () |
Cyclic function. More... | |
int | mh_send (const char *text, mh_eEventPrio prio) |
Send alarm. More... | |
![]() | |
rt_appl (const char *name, errh_eAnix anix, double scantime=1.0, qcom_sQid qid=qcom_cNQid) | |
Constructor. More... | |
A simple c++ application example.
ra_appl is a subclass to rt_appl and implements the virtual functions open(), close(), and scan().
The open function fetches pointer to the digita value object Dv1 and Dv2, and to the alalog value object Av1. It also connects to the message handler.
The scan function is called cyclically and sets one value to Av1 if Dv1 is high and another value if Dv1 is low. When Dv2 goes high an alarm is sent.
The close function unreferences the fetched pointers.
Link the program with g++ -o $pwrp_exe/ra_appl ra_appl.cpp $pwr_obj/pwr_msg_rt.o $pwr_obj/pwr_msg_co.o -I$pwr_inc -L$pwr_lib -lpwr_rt -lpwr_co -lpwr_msg_dummy -lrt
Definition at line 43 of file ra_appl.cpp.