8-ID
  8-ID Beamline logbook mirror  Not logged in ELOG logo
Entry  Tue Sep 14 23:44:08 2021, Eric Dufresne, 8-ID General, Controls, limit of PV length in UserCalc record is 40 character for a PV UserCalc6-Bug.pngimage.png
    Reply  Wed Jul 27 12:43:16 2022, Eric Dufresne, 8-ID General, Controls, limit of PV length in UserCalc record is 40 character for a PV ADcam1-ImageCounter-Edited.png
Message ID: 806     Entry time: Tue Sep 14 23:44:08 2021     Reply to this: 854
Author: Eric Dufresne 
Type: 8-ID General 
Category: Controls 
Subject: limit of PV length in UserCalc record is 40 character for a PV 
[6:38 PM] Dufresne, Eric
Hi Joe, I need help with a userCalc record. I had a userCalc in the past which worked. Recently the PV changed name, it is longer,
and I cannot get userCalc to add it. Is there a maximum length for a PV in the userCalc calculation? Will show what I mean in a picture.

​[6:40 PM] Dufresne, Eric
The prefix has just changed (from 8LAMBDA2) to DP_LAMBDA250K_1 and I want to write in the B field
userCalc6.png

[6:46 PM] Dufresne, Eric
In the above image with the new prefix, I cannot enter the full PV name on the B parameter, it clips to _R instead of _RBV. It is as if
someone put a maximum record length for the string at 39 characters.

[6:55 PM] Sullivan, Joseph
I'm afraid there is a maximum string length of 40 characters in that epics version.

The PV is 41 character long: DP_LAMBDA250K_1:cam1:NumImagesCounter_RBV Smile
It is the number of images taken by Area Detector.

We wanted to use this field to control some sample conditions.
We're using python instead of a userCalc as a result of this limitation.

ED

P.S. The MSD user created a python script to run this instead.
See Sep 2021 in spec_data.

Re: Sample stage


Hi all,

unfortunately, the way I have programmed this no longer works.
It is caused by a limit of the string length provided to a userCalc record.
This length is limited to 40 characters and my PV is 41 characters!
DP_LAMBDA250K_1:cam1:NumImagesCounter_RBV
It use to work because it started with 8LLAMBDA2.
The above PV is too long, but tells you the number of image collected by AD.
I am not reprogramming the detector and beamline at this time by changing the name of the detector.

What I am proposing instead would be to ignore this altogether and write
a simple python script that detects the time elapsed since it started, and from the time,
you can program a periodic function to drive the amplitude of the Keithley.

The voltage to apply is this PV: epics_put('8ide:2400:setVoltAO',30) (epics_put is a spec command).
An idea is to get the time of day from the IOC, a useful PV would be: 8idd:HEARTBEAT (time in seconds since start up)
8idd:TOD is a string with the calendar time of day called Current Time in the IOC status screen attached.
This can be grabbed for documentation. The heartbeat is the useful data to make an arbitrary
function generator.

You can make a python script with the frequency and amplitude and call it in spec
before the padtimescan call, making sure it is put in the background and stops
after Nseconds as programmed in the padtimescan call.

Hope this helps,
Eric
Attachment 1: UserCalc6-Bug.png  52 kB  Uploaded Wed Sep 15 00:50:57 2021  | Hide | Hide all
UserCalc6-Bug.png
Attachment 2: image.png  69 kB  Uploaded Wed Sep 15 14:46:47 2021  | Hide | Hide all
image.png
ELOG V3.1.4-395e101