Emmanuel,
Try the attched dummy interface. You have to add it to CONFIG_STREAM:
BUSSES += Dummy
It creates one global bus instance called "dummy".
I found a bug in exec parsing: In order to use %... in exec, you need to
change StreamCode.cc:
In StreamCore::compileCommand() change
if (strcmp(command, commandStr[exec_cmd]) == 0)
{
buffer.append(exec_cmd);
if (!protocol->compileString(buffer, args,
NoFormat, this))
to
if (strcmp(command, commandStr[exec_cmd]) == 0)
{
buffer.append(exec_cmd);
if (!protocol->compileString(buffer, args,
PrintFormat, this))
Dirk
[email protected] wrote:
Hello,
I am tryign to use a feature I have seen in stream protocols.
I would like to call iocsh function from a process variable.
ex:
when a bo record is set to 1, I would like to execute 'dbl' in the iocsh.
Q: is it possible to use stream without instanciating a asynPort ?
Q: is there another SIMPLE way to do this other than with stream ?
Q: apropos is it possible in stream to pass the value of the PV in exec lines?
ex: exec "dbpr mbboPV <valueOfMbboPV>" ;
Thanks,
/***************************************************************
* StreamDevice Support *
* *
* (C) 2011 Dirk Zimoch ([email protected]) *
* *
* This is the interface to a "dummy" bus driver for *
* StreamDevice. It does not provide any I/O functionality. *
* *
* If you do any changes in this file, you are not allowed to *
* redistribute it any more. If there is a bug or a missing *
* feature, send me an email and/or your patch. If I accept *
* your changes, they will go to the next release. *
* *
* DISCLAIMER: If this software breaks something or harms *
* someone, it's your problem. *
* *
***************************************************************/
#include "StreamBusInterface.h"
#include "StreamError.h"
#include "StreamBuffer.h"
// This is a non-blocking bus interface for debugging purpose.
// Normally, a bus interface will use blocking I/O and thus require
// a separate thread.
class DummyInterface : StreamBusInterface
{
DummyInterface(Client* client);
// StreamBusInterface methods
bool lockRequest(unsigned long lockTimeout_ms);
bool unlock();
protected:
~DummyInterface();
public:
// static creator method
static StreamBusInterface* getBusInterface(Client* client,
const char* busname, int addr, const char* param);
};
RegisterStreamBusInterface(DummyInterface);
DummyInterface::
DummyInterface(Client* client) : StreamBusInterface(client)
{
// Nothing to do
}
DummyInterface::
~DummyInterface()
{
// Nothing to do
}
StreamBusInterface* DummyInterface::
getBusInterface(Client* client,
const char* busname, int addr, const char*)
{
if (strcmp(busname, "dummy") == 0)
{
DummyInterface* interface = new DummyInterface(client);
return interface;
}
return NULL;
}
bool DummyInterface::
lockRequest(unsigned long lockTimeout_ms)
{
return false;
}
bool DummyInterface::
unlock()
{
return false;
}
- References:
- stream without asynPort emmanuel_mayssat
- Navigate by Date:
- Prev:
RE: Epics C# Library Bertrand Alain
- Next:
Re: Make target_arch only ... doesn't seem to work on 3.14.11 Janet Anderson
- 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: stream without asynPort Rod Nussbaumer
- Next:
Fwd: Re: GigE cameras stops Bruce Hill
- 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
|