Szalata, Zenon M. wrote:
Hi Dirk,
These are text messages. Here are a few: INVALID COMMAND ENTRY, NUMBER TOO BIG,
POSITIVE NUMBER REQUIRED, NO PROBE, OVERFLOW, and a handful of other similar messages. The device sends such messages in response to some command. The command may expect a reply or it may not. So, strictly speaking, these are not unsolicited, and yet they are not expected.
In this case, you can use a mbbi record in "I/O Intr" mode with a protocol like
this:
in "%{INVALID COMMAND ENTRY|NUMBER TOO BIG|POSITIVE NUMBER REQUIRED|...}";
Whenever such a string is received, the mbbi processes and is set to the index
of the error messages (starting with 0).
Does the device send "OK" when everything is fine? Then you may put "OK" at index 0.
An alternative would be an exception handler like this:
@mismatch {
in "%(errorRecord.VAL){INVALID COMMAND ENTRY|...}";
}
some_command {
out "do someting %d";
in "OK";
}
If the command does not receive "OK", the @mismatch handler can re-parse the
input and redirect it to an other record. However, if the command does not
expect any reply, this approach does not work. (You can't have a mismatch on
nothing.)
Dirk
Thanks,
Zen
-----Original Message-----
From: Dirk Zimoch [mailto:[email protected]]
Sent: Thursday, October 09, 2008 9:04 AM
To: Szalata, Zenon M.
Subject: Re: Streamdevice/asyn Question
Hi Zen,
Give some examples of your messages.
Dirk
Szalata, Zenon M. wrote:
I am writing a soft ioc for a gpib device using streamdevice with asyn. The device in question can send an unsolicited text message, which I do not know how to handle. I tried defining a record with SCAN "I/O Intr" but cannot make it work, mainly I think, because there are a number of such messages possible and they are all different. Basically, I want to capture the message in a record and display it on an edm screen.
The streamdevice manual hints that a record with SCAN "I/O Intr" approach might work. In the manual there is also a mention of mismatch exception handler. There aren't enough details for me to know how to implement something that works.
Thanks in advance,
Zen
--
Dr. Dirk Zimoch
Paul Scherrer Institut, WBGB/006
5232 Villigen PSI, Switzerland
Phone +41 56 310 5182
--
Dr. Dirk Zimoch
Paul Scherrer Institut, WBGB/006
5232 Villigen PSI, Switzerland
Phone +41 56 310 5182
- References:
- Streamdevice/asyn Question Szalata, Zenon M.
- Navigate by Date:
- Prev:
Scas question Mogamat Amien Crombie
- Next:
Base R3.14.10-RC2 Released 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: Streamdevice/asyn Question Mark Rivers
- Next:
Scas question Mogamat Amien Crombie
- 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
|