Hi Mark,
Thank you for the valuable information, I'll try to implement the code
ASAP, when I come back from the business trip!
Best regards,
Hinko
On 08/23/10 15:21, Mark Rivers wrote:
> It is still possible to make the EPICS records be I/O Intr scanned, i.e. processed only when there is new information from the device, even though the device does not send "unsolicited messages" when that happens.
>
> If you write an asyn port driver that polls the device rapidly, it can parse the replies and do interrupt callbacks to device support when the values have changed. This can be particularly efficient if your device sends multiple values in one response. If you make your driver inherit from the asynPortDriver C++ class then most of the details of how to accomplish this are taken care of for you.
>
> Here is an (incomplete and untested) code snippet:
>
> void myPortDriver::pollThread()
> {
> while(1) {
> status = pasynOctetSyncIO->writeRead(pasynUserHMS, sendMessage, numSend,
> receiveMessage, sizeof(receiveMessage),
> WRITE_READ_TIMEOUT, &numSent, responseLen, &eomReason);
> sscanf(receiveMessage, "TEMP=%f,CURRENT=%f", &temperature, ¤t);
> setDoubleParam(temperatureParam, temperature);
> setDoubleParam(currentParam, current);
> callParamCallbacks();
> epicsThreadSleep(POLL_DELAY);
> }
> }
>
> This sets the values in a "parameter library" and then does callbacks to device support if the values have changed. The records can then be I/O Intr scanned, and will then only process when the values have changed. The records can also be periodically scanned, and will then just get the latest values from the parameter library, i.e. without actually doing I/O to the device.
>
> Mark
>
>
>
>
>
> ________________________________
>
> From: [email protected] on behalf of Hinko Kocevar
> Sent: Mon 8/23/2010 5:19 AM
> To: Eric Norum
> Cc: [email protected]
> Subject: Re: Asyn and I/O intr scanning
>
>
>
> Hi,
>
> On 08/20/10 17:41, Eric Norum wrote:
>> On Aug 19, 2010, at 11:37 PM, Hinko Kocevar wrote:
>>
>>> Hi,
>>>
>>> On 08/19/10 21:35, Eric Norum wrote:
>>>> What low-level driver are you using? i.e. what drvAsyn.......Configure command are you using to create the port in question?
>>>
>>> I'm using drvAsynIPPortConfigure() to configure access to my network
>>> device that implements SCPI interface. This is not a hardware GPIB device.
>>
>> The devGpib device support above an ASYN IP Port driver does not handle SRQ processing nor unsolicited input of any kind.
>
> OK then. I think this is my problem, since my device is accessible only
> by 'telnet like' protocol, no other interface is possible. I'm not sure
> if any SRQs are sent out at all by the device..
>
>> The devGpib device support above the VXI-11 driver driver does handle SRQs. Does your device provide a VXI-11 interface?
>>
>> An alternative solution might be to switch to streamDevice device support which does provide support for I/O Intr operations.
>>
>>
>> Can you provide some more details of the communication protocol that you're using? How does the device send SRQs? What I/O Intr operations do you want to implement?
>>
>
> The device has a simple network access (via e.g. telnet) that allows for
> sending and receiving the SCPI messages.
>
> Now that you explained a bit what is needed to make I/O Intr work, I
> don't think it is possible to get the I/O Intr SRQ.
>
> I basically want to monitor a set of values via EPICS monitor mechanism,
> so my initial goal was make them refresh on timely basis.
>
> Thanks for the help!
>
> Best regards,
> Hinko
>
>
> --
> Hinko Kocevar
> Technical support software engineer
> Instrumentation Technologies d.d.
> Velika pot 22, SI-5250 Solkan - Slovenia
> T:+386 5 3352600, F:+386 5 3352601
> mailto: [email protected]
>
> http://www.i-tech.si <http://www.i-tech.si/> - When your users demand stability
>
> The information transmitted is intended solely for the addressee and may
> contain confidential and/or privileged information. Any review, retention,
> disclosure or other use by persons other than the intended recipient is
> prohibited. If you received this in error, please notify the sender and
> delete all copies.
>
>
--
Hinko Kocevar
Technical support software engineer
Instrumentation Technologies d.d.
Velika pot 22, SI-5250 Solkan - Slovenia
T:+386 5 3352600, F:+386 5 3352601
mailto: [email protected]
http://www.i-tech.si - When your users demand stability
The information transmitted is intended solely for the addressee and may
contain confidential and/or privileged information. Any review, retention,
disclosure or other use by persons other than the intended recipient is
prohibited. If you received this in error, please notify the sender and
delete all copies.
- References:
- Asyn and I/O intr scanning Hinko Kocevar
- Re: Asyn and I/O intr scanning Eric Norum
- Re: Asyn and I/O intr scanning Hinko Kocevar
- Re: Asyn and I/O intr scanning Eric Norum
- Re: Asyn and I/O intr scanning Hinko Kocevar
- Re: Asyn and I/O intr scanning Eric Norum
- Re: Asyn and I/O intr scanning Hinko Kocevar
- RE: Asyn and I/O intr scanning Mark Rivers
- Navigate by Date:
- Prev:
agenda - registration Dalesio, Leo
- Next:
Re: msi again Andrew Johnson
- 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
- Navigate by Thread:
- Prev:
RE: Asyn and I/O intr scanning Mark Rivers
- Next:
Re: Asyn and I/O intr scanning Eric Norum
- 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
|