Privacy and Security Notice

Archived Messages for CDEV@cebaf.gov: Re: Asynchronouse send?

Re: Asynchronouse send?

Miroslaw Dach (Miroslaw.Dach@cern.ch)
Mon, 09 Mar 1998 10:47:10 +0100 (MET)

Thank you very much for your advice.
It means that I must specify a number for "fd" in sys.pend(fd).
In the CDEV manual is written that "fd" does not have to be specified.

Miroslaw Dach

On Mon, 9 Mar 1998, Chip WATSON wrote:

> Miroslaw,
>
> EPICS is fast, but 0.1 second is perhaps too demanding. Try increasing the
> time interval to 1.0 and see if that fixes the problem, and then reduce it
> to see how fast you can go. If you want to write the fastest possible
> program, you will need to use the callback style. In any case, don't
> use too small a time value in send() or you risk failure (unless you
> put the pend into a loop).
>
> The sys.pend(fd) style of call is mostly intended for internal use, and should
> not generally be used by application programmers, so make sure
> you always pass a float, not an int. (This ambiguity may be removed
> in a future version of CDEV).
>
> Chip
>
>
> Miroslaw Dach wrote:
>
> > Hi,
> >
> > I am just a beginner in CDEV. I wrote my first program in C++
> > using CDVE to communicate with the EPICS server. When I use synchronous
> > send command to read one datum from the EPICS server using Channel Access
> > service all was fine. Unfortunately I do not know why it does not work
> > for asynchronous send (i.e. sendNoBlock ). Actually when I use
> > sys.pend(fd) ( to flush all pending output )
> > with the "fd" argument set to any number it does work. If the
> > argument fd is not specified it does not work.
> >
> > Does anyone have an idea what could be wrong?
> >
> > Bellow there is a source of my small program:
> > //-------------------------------------------------------
> > /* $Id$ */
> >
> > #include "cdevSystem.h"
> > #include "cdevDevice.h"
> > #include "cdevData.h"
> > #include <sys/types.h>
> > #include <sys/timeb.h>
> > #include <stdio.h>
> > #include <stdlib.h>
> >
> > void main(int argc, char **argv) {
> >
> > cdevData result;
> >
> > cdevSystem &sys = cdevSystem::defaultSystem();
> > cdevDevice &mydev = cdevDevice::attachRef("magnet13");
> >
> > if(mydev.sendNoBlock("get VAL",NULL,result)!=CDEV_SUCCESS){
> > puts("sendNoBlock failed");
> > exit(0);
> > }
> >
> > sys.pend(0.1);
> >
> > result.asciiDump();
> >
> > }
> >
> > //--------------------------------------------------------------
> >
> > Regards
> >
> > Miroslaw Dach
>
>
>
>