
org.diirt.datasource.sample.formula.PvFunction Maven / Gradle / Ivy
/**
* Copyright (C) 2010-14 diirt developers. See COPYRIGHT.TXT
* All rights reserved. Use is subject to license terms. See LICENSE.TXT
*/
package org.diirt.datasource.sample.formula;
import org.diirt.datasource.ExpressionLanguage;
import org.diirt.datasource.PVManager;
import org.diirt.datasource.PVReader;
import org.diirt.datasource.PVReaderEvent;
import org.diirt.datasource.PVWriter;
import org.diirt.util.time.TimeDuration;
/**
* Indirect channel use through name passed as String.
*
* This examples shows the opening and closing of channels based on the name
* contained in another channel. For C programmers: it's a pointer.
*
* @author carcassi
*/
public class PvFunction {
public static void main(String[] args) throws Exception {
String indirectPv = "=pv('loc://name')";
String pvNamePv = "loc://name";
System.out.println("Starting channel " + indirectPv);
PVReader> reader = PVManager.read(org.diirt.datasource.formula.ExpressionLanguage.formula(indirectPv))
.readListener((PVReaderEvent
© 2015 - 2025 Weber Informatics LLC | Privacy Policy