Experimental Physics and
| |||||||||||||||
|
Dear all, I have two questions when using pv.read() and pv.write() as shown in the following code snippet, import org.epics.vtype.VType; import org.phoebus.pv.PV; import org.phoebus.pv.PVPool; public class WriteTest { public void pvWrite() throws IOException, Exception { PV pv = PVPool.getPV("calcExample"); Thread.sleep(2000); // Delay for PV connection VType oldValue = pv.read(); pv.write(100); Thread.sleep(2000); // Delay for PV writing VType newValue = pv.read(); System.out.println("Old value: " + oldValue); System.out.println("New value: " + newValue); } } 1. pv.read() after pv.write() always returns the old value instead of the new value without a delay, what is the proper way other than sleep() to get the updated value after pv.write()? 2. Another delay is also needed after PVPool.getPV() to wait for PV connection, is there any elegent way like pendIO stuff to wait other than sleep()? Thanks, Lin
| ||||||||||||||
ANJ, 11 Sep 2024 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |