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