1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 <2020> 2021 2022 2023 2024 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 <2020> 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | usage of Java Channel Access Client |
From: | 吴煊 via Tech-talk <[email protected]> |
To: | tech-talk <[email protected]> |
Date: | Wed, 22 Jan 2020 18:11:30 +0800 (GMT+08:00) |
Hi all,
I use ca library to put PV value, there are about 300 PVs. Follow the instruction, I used descriptor to create and connect the PVs at once:
List<ChannelDescriptor<?>> descriptors = new ArrayList<> ();
List<Channel<?>> channels;
for (Entry<String, String> ip_entry : ipMap.entrySet()) {
String ip = ip_entry.getValue();
for (Entry<Integer, String> port_entry : portMap.entrySet()) {
String port = port_entry.getValue();
String pv_name = "ACC_RCS_CO:" + port + ":" + ip + ":StartTime";
descriptors.add(new ChannelDescriptor<String>(pv_name, String.class));
pv_name = "ACC_RCS_CO:" + port + ":" + ip + ":NextWriteTime";
descriptors.add(new ChannelDescriptor<String>(pv_name, String.class));
pv_name = "ACC_RCS_CO:" + port + ":" + ip + ":AvgProcDelay";
descriptors.add(new ChannelDescriptor<String>(pv_name, String.class));
pv_name = "ACC_RCS_CO:" + port + ":" + ip + ":WritePeriod";
descriptors.add(new ChannelDescriptor<String>(pv_name, String.class));
pv_name = "ACC_RCS_CO:" + port + ":" + ip + ":WriteDuration";
descriptors.add(new ChannelDescriptor<String>(pv_name, String.class));
pv_name = "ACC_RCS_CO:" + port + ":" + ip + ":PVNum";
descriptors.add(new ChannelDescriptor<Integer>(pv_name, Integer.class));
pv_name = "ACC_RCS_CO:" + port + ":" + ip + ":Connected";
descriptors.add(new ChannelDescriptor<Integer>(pv_name, Integer.class));
pv_name = "ACC_RCS_CO:" + port + ":" + ip + ":Disconnect";
descriptors.add(new ChannelDescriptor<Integer>(pv_name, Integer.class));
pv_name = "ACC_RCS_CO:" + port + ":" + ip + ":WriteCount";
descriptors.add(new ChannelDescriptor<Integer>(pv_name, Integer.class));
}
}
channels = Channels.create(context, descriptors);
My question is how to use each channel to put value? I've not found any example. I have tried: channels.get(0).put("test"), it's not correct.(error info:The method put(capture#1-of ?) in the type Channel<capture#1-of ?> is not applicable for the arguments (String))
Any advice or suggestions would be appreciated.