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  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024  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  <20202021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: send/receive waveform over network.
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: 'Tomasz Brys' <Tomasz.Brys at ess.eu>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Wed, 12 Feb 2020 14:54:31 +0000
Hi Tomasz,

The problem is that you are trying to send data on the asynInt32 interface to the drvAsynIPPort driver.  That driver does not support the asynInt32 interface, it only supports the asynOctet and asynOption interfaces.

You can write and read your FPGA data by using a waveform record of type "char" and the asynOctetWrite and asynOctetRead device support.

Mark


-----Original Message-----
From: Tomasz Brys <Tomasz.Brys at ess.eu> 
Sent: Tuesday, February 11, 2020 11:29 AM
To: Mark Rivers <rivers at cars.uchicago.edu>
Cc: tech-talk at aps.anl.gov
Subject: Re: send/receive waveform over network.

Hi Mark,
I am sorry for confusing you. Yes, I need both, I need to write few MB and I need to read few MB. My device is a FPGA board with a custom protocol with handshake based on UDP. This is the reason why I do not want to use a stream device. The UDP packets in the custom protocol are numbered. The FPGA is connected directly to a dedicated PC.

I have two problems:
1. How to send/receive a single record via TCP/UDP not using a stream device. I have record like this:
record(longout, "p") {
           field(VAL, "1")
           field(DTYP, "asynInt32")
           field(OUT,  "@asyn(det-stream)")
        }
With configuration: drvAsynIPPortConfigure("det-stream", "localhost:7777") I have a server written in python listening on port 7777. 
If I do "dbpf p 30" it does not send anything. What I am doing wrong? Do I have to write dedicated asynDriver?
 
2. Write an asynDriver and parse message from the FPGA device to support handshaking. I can write asynDriver if I solve the first problem.

I hope is much clearer now.
Regards
Tomasz

On 2020-02-066 w:6, 18:58, "Mark Rivers" <rivers at cars.uchicago.edu> wrote:

    Hi Tomasz,
    
    I am a little confused. You original post saint you wanted to send a big waveform from the IOC to the external device. But your second message said you want to receive a large waveform from the external device. Do you need to do both?
    
    I think Stream Device can do both of these. But if you need to parse a message from the device in order to know how much data it will send that is beginning to sound complex enough that you might want to write a driver using asynPortDriver.  You will use an underlying drvAsynIPPort driver to do the actual I/O.
    
    There are examples of doing this in a number of drivers, for example the drvTetrAMM driver in the quadEM module, or the marCCD driver in areaDetector. 
    
    What type of device are you talking to?
    
    Mark
    
    
    Sent from my iPhone
    
    > On Feb 6, 2020, at 11:40 AM, Tomasz Brys <Tomasz.Brys at ess.eu> wrote:
    > 
    > Hi Mark,
    > Thanks for you answer.
    > Maybe I simplified too much my problem. The device is sending 16-bytes packets. I do not know in advance how many packets I will receive. I will know it after I analyze the first packet and proper response for it. Then I can get even MB of data. Is a stream device with interpose function still appropriate tool for that?
    > 
    > Anyhow, How should I write my record from the previous email?
    > 
    > Regards
    > Tomasz 
    > 
    > On 2020-02-066 w:6, 18:15, "Tech-talk on behalf of Mark Rivers via Tech-talk" <tech-talk-bounces at aps.anl.gov on behalf of tech-talk at aps.anl.gov> wrote:
    > 
    >    Forgot to CC tech-talk.
    > 
    > 
    >    Sent from my iPhone
    > 
    >    Begin forwarded message:
    > 
    >    From: Mark Rivers <rivers at cars.uchicago.edu<mailto:rivers at cars.uchicago.edu>>
    >    Date: February 6, 2020 at 11:11:17 AM CST
    >    To: Tomasz Brys <Tomasz.Brys at ess.eu<mailto:Tomasz.Brys at ess.eu>>
    >    Subject: Re: send/receive waveform over network.
    > 
    >    Hi Tomasz,
    > 
    >    There is no limitation that prevents Stream Device from sending a large waveform. In fact I have done so with the Tabor waveform generator in the synApps "ip" module.
    > 
    >    https://github.com/epics-modules/ip/blob/master/ipApp/Db/Tabor8024.proto
    > 
    >    Mark
    > 
    > 
    >    Sent from my iPhone
    > 
    >    On Feb 6, 2020, at 11:02 AM, Tomasz Brys via Tech-talk <tech-talk at aps.anl.gov<mailto:tech-talk at aps.anl.gov>> wrote:
    > 
    >    Hi
    >    I have a beginner question. I want to send via ethernet (TCP/UDP) a waveform from IOC to external device. The waveform consists of binary data and can be big so the Stream Device is not a solution. To simplify the problem, I tested it with longout and a local server listening on port 7777.
    >    In my startup command I have:
    > 
    >    drvAsynIPPortConfigure("det-stream", "localhost:7777")
    > 
    >    Then I load my db, which is very simple:
    > 
    >    record(longout, "p") {
    >       field(VAL, "1")
    >       field(DTYP, "asynInt32")
    >       field(OUT,  "@asyn(det-stream)")
    >    }
    > 
    >    I started IOC, no errors. But how I can send the VAL over TCP?
    >    "dbpf p 2" does not work, neither "dbpf p.PROC"
    >    Do I have to write my own implementation of asynDriver?
    >    Is it any differences between sending longout and waveform?
    > 
    >    Regards
    >    Tomasz
    > 
    > 
    > 
    


Replies:
Re: send/receive waveform over network. Mark Rivers via Tech-talk
References:
send/receive waveform over network. Tomasz Brys via Tech-talk
Fwd: send/receive waveform over network. Mark Rivers via Tech-talk
Re: send/receive waveform over network. Mark Rivers via Tech-talk
Re: send/receive waveform over network. Tomasz Brys via Tech-talk

Navigate by Date:
Prev: RE: asynMotorAxis Mark Rivers via Tech-talk
Next: Re: Standard RTEMS NFSv3 client Matt Rippa via Tech-talk
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  <20202021  2022  2023  2024 
Navigate by Thread:
Prev: Re: send/receive waveform over network. Tomasz Brys via Tech-talk
Next: Re: send/receive waveform over network. Mark Rivers via Tech-talk
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  <20202021  2022  2023  2024 
ANJ, 13 Feb 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·