Privacy and Security Notice

Archived Messages for CDEV_1997@cebaf.gov: Re: cdev problem?

Re: cdev problem?

Walt Akers (akers@CEBAF.GOV)
Mon, 05 May 1997 08:55:16 -0400 (EDT)

MIME-version: 1.0
Content-type: TEXT/PLAIN; CHARSET=US-ASCII

>
> All,
> I've had problems with this before and I thought I had things working.
> The following program with the following .ddl produces no output for me -
> out.asciiDump doesn't print anything. What am I doing wrong?
> The record exists in the database although I don't think it matters.
>
> Thanks,
> Kim Gillies
> kgillies@gemini.edu
>
> --------------------- ddl file ------------------------
> service ca {
> tags { PV }
> }
>
> /* All items share these verbs and attributes */
> class Basic {
> verbs { get, set, monitorOn, monitorOff }
>
> attributes {
> value ca {PV=<>.VAL};
> }
> }
>
> Basic :
> diag1 { t10a:sad:test }
> ;

What is "{ t10a:sad:test }"? And why is it there?

>
> ------------------ program ------------------------------
>
>
> #include <cdevSystem.h>
> #include <cdevDevice.h>
> #include <cdevData.h>
> #include <stdio.h>
>
> void main()
> {
> cdevDevice *dir = cdevDevice::attachPtr("cdevDirectory");
> cdevData input, output;
>
> // ***********************************************************
> // * Insert the name of the device and message to be resolved.
> // ***********************************************************
> input.insert("device", "diag1");
> input.insert("message", "get value");
>
> // ***********************************************************
> // * Submit the request to the cdevDirectory object using the
> // * send command, and output the result (using asciiDump) if
> // * successful.
> // ***********************************************************
> if(dir->send("serviceData", input, output)==CDEV_SUCCESS)
> {
> output.asciiDump(stdout);
> } else {
> fprintf(stderr, "Send Failed\n");
> }
> }

The main problem that you are encountering is this... The PV tag is
not defined until the channel access service is loaded. Therefore,
when the cdevDirectory tries to stick a value into the PV tag of your
output data object - it's simply going into space...

This is a problem that we will have to look into, until then you might
try inserting the PV and RDONLY tags in advance... look at the
caService source code to determine the correct values, I believe they
are

PV = 0x1001
DEFAULT = 0x1002
RDONLY = 0x1003

Good Luck,

Walt
--
=============================================================
Walt Akers Voice: (757)269-7669 E-Mail: akers@cebaf.gov
Thomas Jefferson National Accelerator Facility
12000 Jefferson Avenue, MS 16A
Newport News, Va 23606
=============================================================