Thank you Mark for your help.
I solve my problem. And now everything works for me. I did many small mistakes which all together made my diagnosis difficult. I looked at the test examples of asyn driver, especially on asynPortClient, asynPortDriver and asynPortConnect. By reading those examples and digging the source I was able to understand how it works.
Thank you very much
Tomasz
Ps. I did not see the interface asynInt32 error message.
On 2020-02-147 w:7, 00:35, "Mark Rivers" <rivers at cars.uchicago.edu> wrote:
Hi Tomasz,
I believe that when you started your IOC you should have seen an error message printed during iocInit, because devAsynInt32.c would not have found the asynInt32 interface. This is where the error is printed:
/* Get interface asynInt32 */
pasynInterface = pasynManager->findInterface(pasynUser, asynInt32Type, 1);
if (!pasynInterface) {
printf("%s %s::%s findInterface asynInt32Type %s\n",
pr->name, driverName, functionName,pasynUser->errorMessage);
Do you see that error message?
Mark
________________________________
From: Mark Rivers
Sent: Wednesday, February 12, 2020 8:54 AM
To: 'Tomasz Brys'
Cc: tech-talk at aps.anl.gov
Subject: RE: send/receive waveform over network.
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
>
>
>
- 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
- RE: send/receive waveform over network. Mark Rivers via Tech-talk
- Re: send/receive waveform over network. Mark Rivers via Tech-talk
- Navigate by Date:
- Prev:
Re: send/receive waveform over network. Mark Rivers via Tech-talk
- Next:
MRF Delay Compensation Function Shen, Guobao 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
<2020>
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: send/receive waveform over network. Mark Rivers via Tech-talk
- Next:
asynMotorAxis Koennecke Mark (PSI) 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
<2020>
2021
2022
2023
2024
|