First, sorry if any of these questions seems too simple. I started working recently with EPICS and I am still learning how it works.
Basically, I am trying to create an IOC that works as a UDP server. It should be listening at a certain port and, when a new packet arrives, it should update a set
of records with the incoming data.
It doesn't need to respond to any of the packets.
The data is a binary array, which will be read into a waveform record, and then unpacked into other records in order to be read by the clients (I don't know if this
is the best approach, for now I am just experimenting). The structure of the binary array is fixed and known beforehand.
For now, I just want to update the waveform record with the binary data when the UDP packet arrives. I am using asynDriver since it seems to provide all the tools
I need:
On the 'st.cmd' file I have:
drvAsynIPServerPortConfigure ("fgc_udp", "localhost:2906 udp", 10, 0, 0, 0)
dbLoadRecords("db/fgc_udp.db","GW=${FGC_GW_NAME}:")
And on the 'db/fgc_udp.db' I have:
record(waveform, "$(GW)UDP") {
field(SCAN, "I/O Intr")
field(DTYP, "asynOctetRead")
field(FTVL, "UCHAR")
field(DESC, "UDP publication")
field(NELM, "4096")
field(INP, "@asyn(fgc_udp, 0, 0) drvUser")
}
Since I am using 'I/O Intr', I would expect the record to be updated when a new UDP packet arrives, but it is not working.
It only updates if I use the IOC shell command "dbtr xxx:UDP", or if I change SCAN to a "N seconds" option.
Do you know how I can fix it? I guess it is something simple, but I am stuck.
I would also like to know if using a waveform record is a good starting point for unpacking binary data, or if there is a better alternative.