/** * Read value. * Fills-in DBR, sets timestamp (time when value was written) and copies value from local memory (array). * No status and severity (alarms) are set - to be done in <code>fillInDBR</code> method (extending it). * @see gov.aps.jca.cas.ProcessVariable#read(gov.aps.jca.dbr.DBR, gov.aps.jca.cas.ProcessVariableReadCallback) */ public synchronized CAStatus read(DBR value, ProcessVariableReadCallback asyncReadCallback) throws CAException { // fill fillInDBR(value); // given DBR is always at least TIME ((TIME)value).setTimeStamp(timestamp); int minCount = Math.min(count, value.getCount()); System.arraycopy(this.value, 0, value.getValue(), 0, minCount); return CAStatus.NORMAL; }
/** * Read value. * Fills-in DBR, sets timestamp (time when value was written) and copies value from local memory (array). * No status and severity (alarms) are set - to be done in <code>fillInDBR</code> method (extending it). * @see gov.aps.jca.cas.ProcessVariable#read(gov.aps.jca.dbr.DBR, gov.aps.jca.cas.ProcessVariableReadCallback) */ public synchronized CAStatus read(DBR value, ProcessVariableReadCallback asyncReadCallback) throws CAException { // fill fillInDBR(value); // given DBR is always at least TIME ((TIME)value).setTimeStamp(timestamp); int minCount = Math.min(count, value.getCount()); System.arraycopy(this.value, 0, value.getValue(), 0, minCount); return CAStatus.NORMAL; }
if (inDBR.getType() != dataType || inDBR.getCount() != dataCount) throw new IllegalArgumentException("Encoded DBR and expected DBR are not consistant.");
if (inDBR.getType() != dataType || inDBR.getCount() != dataCount) throw new IllegalArgumentException("Encoded DBR and expected DBR are not consistant.");