Forgot to cc tech-talk again
Sent from my iPhone
Begin forwarded message:
From: Mark Rivers <
[email protected]<mailto:
[email protected]>>
Date: July 2, 2019 at 10:29:44 AM CDT
To: "Wlodek, Jakub" <
[email protected]<mailto:
[email protected]>>
Subject: Re: Question regarding a waveform record and writeOctet
Does your driver's writeOctet correctly set nActual?
Sent from my iPhone
On Jul 2, 2019, at 10:15 AM, Wlodek, Jakub via Tech-talk <
[email protected]<mailto:
[email protected]>> wrote:
Hi all,
I have run into an issue with a waveform record I added to one of my IOCs. It simply stores a filename, and there is a writeOctet function that catches writing to it and makes sure that the filepath is valid. This all seems to work OK - the filepath is checked
correctly, and the code is able to access it as expected later on. It all works, aside from the following error message displayed in the IOC shell:
2019/07/02 10:47:37.910 13SIM1:{SimDetector-Cam:1}CV1:FilePath devAsynOctet::writeIt requested 22 but sent 94456003460432 bytes
The entered filepath does in fact have a length of 22 bytes, but I have no idea where the 94456003460432 came from, especially since the remainder of the code seems to be reading the entered string correctly. After further testing, I wrote to the filepath PV
again, and got:
2019/07/02 10:47:46.220 13SIM1:{SimDetector-Cam:1}CV1:FilePath devAsynOctet::writeIt requested 23 but sent 0 bytes
Once again, the filepath was processed correctly and worked fine in my code, and it was 23 characters long. After some searching I identified the printout to be in the asyn library here:
https://github.com/epics-modules/asyn/blob/187b0a03e5d2cdd696c4203147aebe83ef049cb9/asyn/devEpics/devAsynOctet.c#L636.
My record definition looks as follows:
-----------------------------------------------------
record(waveform, "$(P)$(R)FilePath"){
field(PINI, "YES")
field(DTYP, "asynOctetWrite")
field(INP, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))NDCV_FILEPATH")
field(FTVL, "CHAR")
field(NELM, "256")
field(autosaveFields, "VAL")
}
record(waveform, "$(P)$(R)FilePath_RBV"){
field(DTYP, "asynOctetRead")
field(INP, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))NDCV_FILEPATH")
field(FTVL, "CHAR")
field(NELM, "256")
field(SCAN, "I/O Intr")
}
If anyone could help me identify what might be causing this issue it would be much appreciated.
Regards
-Jakub Wlodek