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: Record Parameters in Asyn Port Driver
From: Mark Rivers <[email protected]>
To: "Igor H. Soares Nunes" <[email protected]>, "[email protected]" <[email protected]>
Date: Tue, 6 Aug 2013 14:27:33 +0000
Hi Igor,

With EPICS and asyn you typically create an asyn port driver that is connected to that TCP or serial port.  That is a standard driver that comes with asyn.

You can then send messages to that port in several ways.

One way is to use StreamDevice to create the outgoing messages and parse the responses.  StreamDevice provides device support for many types of EPICS records.  You just need to write a protocol file that describes how to create outgoing messages and parse the responses.

You could also use standard asyn device support and write your own driver that has knowledge of your microcontroller, and then communicates to the device through the standard TCP or serial asyn driver.  That is how many motor controller and areaDetector drivers work, for example.

It depends how complex your device is, and where you want to put the knowledge of the message content.

Mark


________________________________________
From: Igor H. Soares Nunes [[email protected]]
Sent: Tuesday, August 06, 2013 9:12 AM
To: Mark Rivers; [email protected]
Subject: RE: Record Parameters in Asyn Port Driver

Hi Mark,

I am developing an IOC to communicate with a micro-controller using TCP/IP and Serial communication. I need to send messages to this devices according to some parameters specified in the records.
For example:

If I had a record with this inp field:
field(INP, "@$(address).$(variableID=1).$(nbytes=4)")
I could use the following code in device support to get this values (not using asyn):

static long init_record_mbbo(mbboRecord *record){

        int address,variable,numbytes;
        if(sscanf(record->inp.value.instio.string, "%d.%d.%d", &address,&variable,&numbytes)!=3)
                return S_db_errArg;


The meaning of these fields are:
Send a message to a device whose address is "address", read (or write) a variable whose id is 1, and whose size is 4 bytes.

And also, if I wanted to use the "number of bits" field in mbbi/mbbo records I could just simply use the code:

number_of_bits = record->nobt;

This is what I wanted my device and driver to do. Do I make myself clear about it?


Igor H. Soares Nunes
Centro Nacional de Pesquisa em Energia e Materiais (Cnpem)
Laboratório Nacional de Luz Síncrotron (Lnls)
Grupo de Diagnóstico de Feixes (Dig)
________________________________________
From: Mark Rivers [[email protected]]
Sent: Monday, August 05, 2013 2:28 PM
To: Igor H. Soares Nunes; [email protected]
Subject: RE: Record Parameters in Asyn Port Driver

Hi Igor,

The idea of asyn port drivers is that they don't know anything about the EPICS records.  They only know about the standard asyn interfaces (asynInt32, asynUInt32Digital, asynOctet, etc.).  The device-independent device support in asyn/devEpics is the only code that knows about the record fields.

Can you please explain what you want your driver to do, and I can probably tell you how to do it without your asyn port driver needing to know anything about the record fields.

Mark

________________________________________
From: [email protected] [[email protected]] on behalf of Igor H. Soares Nunes [[email protected]]
Sent: Sunday, August 04, 2013 2:27 PM
To: [email protected]
Subject: Record Parameters in Asyn Port Driver

Hello everyone,

I'm developing an IOC using Asyn Port Driver, and I couldn't find out how to get some record parameters in the device support code (cpp file).

I need to get the INP and OUT parameters (port,addres,mask,timeout,...) and also NOBT for mbbi and mbbo records. As well as parameters for ai and ao records (EGUF, EGUL, etc).

Can anyone help me?


Igor H. Soares Nunes
Centro Nacional de Pesquisa em Energia e Materiais (Cnpem)
Laboratório Nacional de Luz Síncrotron (Lnls)
Grupo de Diagnóstico de Feixes (Dig)


References:
Record Parameters in Asyn Port Driver Igor H. Soares Nunes
RE: Record Parameters in Asyn Port Driver Mark Rivers
RE: Record Parameters in Asyn Port Driver Igor H. Soares Nunes

Navigate by Date:
Prev: RE: Record Parameters in Asyn Port Driver Igor H. Soares Nunes
Next: Re: Modbus Zenon Szalata
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: Record Parameters in Asyn Port Driver Igor H. Soares Nunes
Next: Wireshark CA plugin Eric Williams
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 ·