EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  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  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: EpicsSharp issues
From: "Christopher J. Pendleton" <[email protected]>
To: "'Bertrand Alain Gregor'" <[email protected]>
Cc: [email protected]
Date: Mon, 25 Nov 2013 15:48:33 -0500

Hi Alain.

 

The new code works. I appreciate your efforts and quick response. I was wondering if there were any plans to expose some other PV information such as timestamp, units, limits, etc. in a future version of EpicsSharp?

 

Thanks,

Chris

 

From: Christopher J. Pendleton [mailto:[email protected]]
Sent: Monday, November 25, 2013 10:51 AM
To: 'Bertrand Alain Gregor'
Cc: '[email protected]'
Subject: RE: EpicsSharp issues

 

Thanks Alain! I will try the new version today.

 

Regards,

Chris

 

From: Bertrand Alain Gregor [mailto:[email protected]]
Sent: Monday, November 25, 2013 2:37 AM
To: Christopher J. Pendleton
Cc: [email protected]
Subject: RE: Rejected email

 

Hi Chris,

 

Good news I reproduced the bug on my side (and in the mean time fixed a bug with the C# channel access server as well) and I think I fixed the bug too. The latest version can be found on sourceforge.

 

For more details about this issue, somehow I didn't handled the arrays correctly and wasn't looking for the base type requested by the user of the library.

 

In case something doesn't work, let me know and I shall try to help you.

 

Sincerely,

 

Alain Bertrand

 


From: Christopher J. Pendleton [mailto:[email protected]]
Sent: Saturday, November 23, 2013 07:37
To: Bertrand Alain Gregor
Subject: RE: Rejected email

 

Hi Alain.

 

I apologize for the rejection. I have added psi.ch to our whitelist so I don’t think this will happen again. Please reply to make sure.

 

Thanks for the response on the C# issue. I will try double[] this weekend.

 

Regards,

Chris

 

From: Alain Bertrand [mailto:[email protected]]
Sent: Friday, November 22, 2013 11:42 PM
To: [email protected]
Subject: Rejected email

 

Hi,

My mail have been rejected by your system. Sure thing it wasn't a spam:

---------------------------

Hi Christopher,

You should be able to work with floats indeed. However it could be that I didn't tested it correctly. I will do some trials next week and let you know. In the mean time, can you please try to grab it as double[] instead of float[] and see if it works?

Sincerely,

Alain Bertrand

On 11/22/2013 4:10 PM, Christopher J. Pendleton wrote:

Hello. Let me start by saying that I started using EPICS to interface to our
company's devices (http://ptcusa.com/) earlier this year and it has been a
pleasure to work with. You guys are doing great work and I hope I can
contribute to the cause.

One of my colleagues is a big fan of C#, so I pointed him to the EpicsSharp
library. I started using it to help him sort through some issues he was
having. The major one I am seeing is with float arrays (arrays in general?)
while using the MonitorChanged event.

Details:

I have a channel access server running, serving up a float array PV. Both
Python (PyEpics) and LabVIEW (CA Lab) client interfaces see this PV and
recognize it as a float array. No problems here. When I use EpicsSharp, I
can get the float array by using the synchronous call Get<float[]>() on the
channel object. Also no problems here. I see unexpected behavior when I use
the MonitorChanged event. My code:

///
     static class Program
     {
         [STAThread]
         static void Main()
         {
             EpicsClient client = new EpicsClient();
             EpicsChannel<float[]> record =
client.CreateChannel<float[]>("r_I128_channels_test");
             record.MonitorChanged += new
EpicsDelegate<float[]>(record_MonitorChanged);
             Console.ReadKey();
         }

         static void record_MonitorChanged(EpicsChannel<float[]> sender,
float[] newValue)
         {
             Console.WriteLine("Help!");
         }
     }
///

I would expect to see an event fire into my handler, but I don't. What I do
see is an exception in my console window:

///
System.Collections.Generic.KeyNotFoundException: The given key was not
present i
n the dictionary.
    at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
    at PSI.EpicsClient2.EpicsChannel`1.<Disconnect>b__3(EpicsChannel action)
in D
:\Projects\epicsC#\client\EpicsGenericChannel.cs:line 99
///

I dug into the client library code and found that the exception was
happening in EpicsGenericChannel.cs, line 99.

//
p.DataType = (ushort) TypeHandling.Lookup[typeof (TType)];
//

typeof (TType) evaluates to Single[], which isn't in TypeHandling
Dictionary, so an exception is thrown.

Do you expect this behavior? Is there a problem in my client program code? I
found another example on techtalk by Alain Bertrand
(http://www.aps.anl.gov/epics/tech-talk/2011/msg01584.php) that shows almost
the same code with an int[], so I am a little lost. Thanks in advance for
your help!

Regards,
Chris

Christopher J. Pendleton
Director, Software Development
Pyramid Technical Consultants, Inc.
Office: +1 781-402-1700 x114
Cell: +1 781-249-3031

 

 


Replies:
Re: EpicsSharp issues Alain Bertrand

Navigate by Date:
Prev: RE: Breakpoint tables: Raw value must be integer?!? Emmanuel Mayssat
Next: Re: Breakpoint tables: Raw value must be integer?!? Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: EpicsSharp issues Christopher J. Pendleton
Next: Re: EpicsSharp issues Alain Bertrand
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·