>>I wonder if "ai" record is correct for asyInt64.
> Of course not ;-)
Actually the ai record works with asynInt64, and is documented here:
which says this:
A 64-bit integer is read from the driver and converted to a 64-bit float. The 64-bit float can exactly represent integers up to 52 bits. The value is read into the .VAL field, not the .RVAL field. Linear conversion is limited to .EOFF and .ESLO. Each time
the record is processed a new value is read. SCAN "I/O Intr" is supported.
Even if it does not do what Kaz wants because of the limited number of bits, it should not giving a 0 value.
Perhaps this problem is this line:
setInteger64Param(ADTimePixStartTime, 1661466046253);
Should that be:
setInteger64Param(ADTimePixStartTime, 1661466046253LL);
i.e. explicitly tell the compiler that is a long long constant.
If that does not work then please send the output of
asynReport 1 driver_name
That will show the values of all parameters in the parameter library, and we can see if it has the correct value there.
Mark
From: Torsten Bögershausen <Torsten.Bogershausen at ess.eu>
Sent: Friday, August 26, 2022 7:39 AM
To: Gofron, Kazimierz <kgofron at bnl.gov>; Mark Rivers <rivers at cars.uchicago.edu>
Cc: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: Re: setInteger64Param
Hej Kaz
>>I wonder if "ai" record is correct for asyInt64.
Of course not ;-)
Please try
record(int64in, "$(P)$(R)StartTime_RBV"){
field(DTYP, "asynInt64")
field(INP, "@asyn($(PORT),$(ADDR),$(TIMEOUT))TPX3_START_TIME")
field(SCAN, "I/O Intr")
}
/Torsten
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of "Gofron, Kazimierz via Tech-talk" <tech-talk at aps.anl.gov>
Reply-To: "Gofron, Kazimierz" <kgofron at bnl.gov>
Date: Friday, 26 August 2022 at 14:18
To: Mark Rivers <rivers at cars.uchicago.edu>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Subject: Re: setInteger64Param
Sorry, I copied a wrong record to the previous email.
record(ai, "$(P)$(R)StartTime_RBV"){
field(INP, "@asyn($(PORT),$(ADDR),$(TIMEOUT))TPX3_START_TIME")
}
setInteger64Param(ADTimePixStartTime,
1661466046253);
createParam(ADTimePixStartTimeString,
asynParamInt64, &ADTimePixStartTime);
The callParamCallbacks(); was
there. I added additional one just after the setInteger64Param()
I wonder if "ai" record is correct for asyInt64.
From: Mark Rivers <rivers at cars.uchicago.edu>
Sent: Thursday, August 25, 2022 11:56 PM
To: Gofron, Kazimierz <kgofron at bnl.gov>
Cc: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: Re: setInteger64Param
I just noticed that you created the parameter with Type asynInt64 but your record has DTYP asynFloat64. That is not correct, and should have produced an error message after iocInit.
You should either use an ai record with DTYP asynInt64 or an int64In record.
On Aug 25, 2022, at 6:42 PM, Gofron, Kazimierz via Tech-talk <tech-talk at aps.anl.gov> wrote:
I am writing an areaDetector driver that reads integer time in multiples of fractions of ns.
record(ai, "$(P)$(R)ElapsedTime_RBV"){
field(DTYP, "asynFloat64")
field(INP, "@asyn($(PORT),$(ADDR),$(TIMEOUT))TPX3_ELAPSED_TIME")
}
In the driver the value is set using (hard coded value here):
setInteger64Param(ADTimePixStartTime, 1661466046253);
However, the PV value does not change from 0.
createParam(ADTimePixStartTimeString,
asynParamInt64, &ADTimePixStartTime);
The caput changes the value of PV:
kgofron@myHP$ caput TPX3-TEST:cam1:StartTime_RBV 1661466046253
Old : TPX3-TEST:cam1:StartTime_RBV 0
New : TPX3-TEST:cam1:StartTime_RBV 1.66147e+12
=================
Any suggestions would be much appreciated.
|