Hello,
I’ve recently been in contact about creating and setting values to PVs with PvaPy, which is now working as expected when manually setting values and timestamps through the library and my own script.
However, when testing the program from the command line, I’ve noticed that calling a pvput on a PV created using my program does not automatically change the timestamp, instead the timestamp from the previous message is used. I’ve included
an example of the behaviour here:
When updating through my own manual pv.set(epics_message) calls in the program:
test::channel:match_alarm:integer 2021-06-22 12:36:41.038 -1 2
test::channel:match_alarm:integer 2021-06-22 12:36:43.041 -1 3 MAJOR DEVICE MATCH ALARM INT triggered
test::channel:match_alarm:integer 2021-06-22 12:36:45.043 -1 4
test::channel:match_alarm:integer 2021-06-22 12:36:47.046 -1 5
But when I call pvput from a different terminal to this channel with the following values you can see the timestamp does not update. Similarly, the alarm state logic is not called when the value 3 is entered (when previously it does).
test::channel:match_alarm:integer 2021-06-22 12:36:47.046 -1 9
test::channel:match_alarm:integer 2021-06-22 12:36:47.046 -1 10
test::channel:match_alarm:integer 2021-06-22 12:36:47.046 -1 3
My understanding is that this logic will need to be implemented manually within my classes (which I am inheriting from PvObject) to ‘set’ the value of the PV when a pvput is called. However, so far I can’t see where that logic should be
implemented, either on the server or in the PvObject itself, or if it should already be happening under the hood because I am not sure how to access the attributes of the PV object from the command line.
I’ve managed to get something working that updates the values and timestamps using a forced onWriteCallback but this seems to set the value twice at different timestamps, which isn’t the desired behaviour:
counter 2021-06-22 14:01:34.803 -1 6
counter 2021-06-22 14:01:37.803 -1 6
counter 2021-06-22 14:01:37.808 -1 7
counter 2021-06-22 14:01:40.808 -1 7
counter 2021-06-22 14:01:40.812 -1 8
counter 2021-06-22 14:01:43.812 -1 8
Do you have any suggestions for how else to get the external pvput to work with a PV created in PvaPy?
Kathryn Baker (she/her)
Software Development for Accelerator Control Systems Graduate
Science and Technology Facilities Council
k.baker at stfc.ac.uk