Hi Andrew,
I would have expected your database to work. Do the aao records use asynchronous device support? How is an aao record getting a string?
In any case, if you have the calc module, you could replace the fanout with a sseq record, which can wait for completion between output links. I would do it like this:
record(sseq, "sseq_rec") {
field(LNK1, "aao_rec_1.PROC CA")
field(WAIT1, "After2")
field(LNK2, "aao_rec_2.PROC CA")
field(WAIT2, "Wait")
field(LNK3, "asub_rec.PROC PP")
}
This will process aao_rec_1 and aao_rec_2, wait for them both to finish, and then process asub_rec.
I would not use aao records to hold strings. I would use waveform records with FTVL=="CHAR".
Tim Mooney (mooney at anl.gov) (630)252-5417
Beamline Controls Group (www.aps.anl.gov)
Advanced Photon Source, Argonne National Lab
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Wang, Andrew via Tech-talk <tech-talk at aps.anl.gov>
Sent: Friday, April 16, 2021 9:29 PM
To: EPICS tech-talk <tech-talk at aps.anl.gov>
Subject: Fanout and asub interaction issues
All,
I am encountering an interesting problem and would again appreciate your insights.
Essentially, I have a fanout record and asub record that resemble the following pseudocode:
record(fanout, “fanout_rec”)
{
field(SCAN, “Passive”)
field(LNK0, “aao_rec_1”)
field(LNK1, “aao_rec_2”)
field(LNK2, “asub_rec”)
}
record(asub, “asub_rec”)
{
field(SCAN, “Passive”)
field(SNAM, “c_code”)
field(INPA, “aao_rec_1”)
field(FTVA, “CHAR”)
field(NOA, 2048)
field(INPB, “aao_rec_2”)
field(FTVB, “DOUBLE”)
field(NOB, 2048)
}
My goal was to first process the first two aao records so they contain the most up-to-date values before processing “asub_rec”. When I attempt to retrieve the values from both aao records within “c_code”, it is getting previous values
that they contained prior to their latest processing.
For instance, if “aao_rec_1” contained “hello”, then when I print out “(CHAR*)prec->a” in “c_code”, it prints out nothing. But when I process it again, but with a different value, I print out “hello”, rather than the latest value it has.
I’m beginning to think it might be better to use the PP flag for INPA and INPB like this:
record(asub, “asub_rec”)
{
field(SCAN, “Passive”)
field(SNAM, “c_code”)
field(INPA, “aao_rec_1 PP”)
field(FTVA, “CHAR”)
field(NOA, 2048)
field(INPB, “aao_rec_2 PP”)
field(FTVB, “DOUBLE”)
field(NOB, 2048)
}
Any thoughts or suggestions?
Andy
|