Hi Andy,
If you want IOC B to always use the most recent version of IOC_A_get_val you can change that record to use the CP link type. Then you don't need to force this record to process with a link at all.
record(calc, “IOC_B_calc”)
{
field(SCAN, “Passive”)
field(INPA, “IOC_A_get_val CP”)
field(CALC, “A * 250”)
}
Your example has 2 records named IOC_B_set_val_to_IOC_A. I think you wanted the second one to be named IOC_B_fanout instead. If you make the change above you can eliminate the LNK1 field.
Mark
________________________________
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: Monday, June 14, 2021 12:57 AM
To: tech-talk at aps.anl.gov
Subject: Best way to properly "synchronize" records between two IOCs
All,
I’m back again with another question.
Suppose I had two IOCs named IOC A and IOC B. IOC A contains three records, two of which utilize StreamDevice and the third record is there to allow slow scanning with fast response. Pseudocode is shown below.
record(ao, “IOC_A_slow_scan”)
{
field(SCAN, “1 second”)
field(FLNK, “IOC_A_get_val”)
}
record(ao, “IOC_A_set_val”)
{
field(SCAN, “Passive”)
field(DTYP, “stream”)
field(OUT, “@inst.proto setVal PORT”)
field(FLNK, “IOC_A_get_val”)
}
record(ai, “IOC_A_get_val”)
{
field(SCAN, “Passive”)
field(DTYP, “stream”)
field(INP, “@inst.proto getVal PORT”)
}
In IOC B, I want to process “IOC_A_set_val” from IOC A, get a value from “IOC_A_get_val” and manipulate that value through a calc record. What is the recommended approach so that the calc record’s INP field gets the most up-to-date from “IOC_A_get_val”. To further elaborate on what I want to achieve, I feel like I can just do the following in IOC B:
record(ao, “IOC_B_set_val_to_IOC_A”)
{
field(SCAN, “Passive”)
field(OUT, “IOC_A_set_val”)
field(FLNK, “IOC_B_fanout”)
}
record(ao, “IOC_B_set_val_to_IOC_A”)
{
field(SCAN, “Passive”)
field(SELM, “All”)
field(LNK0, “IOC_A_set_val.PROC”)
field(LNK1, “IOC_B_calc”)
}
record(calc, “IOC_B_calc”)
{
field(SCAN, “Passive”)
field(INPA, “IOC_A_get_val”)
field(CALC, “A * 250”)
}
Once “IOC_B_set_val_to_IOC_A” is processed, we then proceed to “IOC_B_fanout”, which causes “IOC_A_set_val” to process with the value that was set from “IOC_B_set_val_to_IOC_A”. Then, “IOC_A_get_val” is processed before control is returned to “IOC_B_fanout” and we proceed to process “IOC_B_calc”, at which point “IOC_A_get_val” should have the most recent value. The reason why I want to do it in a round about way is because the StreamDevice documentation specifies that “input links with PP flag pointing to a StreamDevice record will read the old value first and start the protocol afterward”.
Is this thinking correct or not? If not, please let me know where my understanding is incorrect.
Thanks,
Andy
- Replies:
- RE: Best way to properly "synchronize" records between two IOCs Wang, Andrew via Tech-talk
- Re: Best way to properly "synchronize" records between two IOCs Ralph Lange via Tech-talk
- References:
- Best way to properly "synchronize" records between two IOCs Wang, Andrew via Tech-talk
- Navigate by Date:
- Prev:
RE: Instructions on using manage-procs procServ and Conserver Smith, William via Tech-talk
- Next:
RE: Best way to properly "synchronize" records between two IOCs Wang, Andrew 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:
Best way to properly "synchronize" records between two IOCs Wang, Andrew via Tech-talk
- Next:
RE: Best way to properly "synchronize" records between two IOCs Wang, Andrew 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
|