Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing to unmonitored structures sends invalid data #131

Open
ralphlange opened this issue Jan 26, 2022 · 0 comments
Open

Writing to unmonitored structures sends invalid data #131

ralphlange opened this issue Jan 26, 2022 · 0 comments

Comments

@ralphlange
Copy link
Member

Reported by Mikel Rojo:

I have this db:

record (opcuaItem,"CBS:IN-OPCUA-STRUCT"){
    field(INP, "@PLC0 ns=3;s=\"SimInputs\".\"Inputs\".\"P101\" monitor=n")
    field(DEFACTN, "write")
    field(WOC, "immediate")
}
record (ao,"CBS:VAR1"){
    field(DTYP, "OPCUA")
    field(OUT, "@CBS:IN-OPCUA-STRUCT element=PG1.variable1 monitor=n")
}
record (ao,"CBS:VAR2"){
    field(DTYP, "OPCUA")
    field(OUT, "@CBS:IN-OPCUA-STRUCT element=PG1.variable2 monitor=n")
}

With the following initial setup, this is what occurs:
CBS:VAR1=0 #in IOC
CBS:VAR2=0 #in IOC
PG1.variable1=0 #in PLC
PG1.variable2=0 #in PLC
$caput CBS:VAR1 1 #old value=0; new value=1
CBS:VAR1=1 #in IOC
CBS:VAR2=0 #in IOC
PG1.variable1=1 #in PLC
PG1.variable2=0 #in PLC
$caput CBS:VAR2 2 #old value=0; new value=2
CBS:VAR1=1 #in IOC
CBS:VAR2=2 #in IOC
PG1.variable1=0 #in PLC, value reverted back!!
PG1.variable2=2 #in PLC
$caput CBS:VAR1 1 #old value=1; new value=1
CBS:VAR1=1 #in IOC
CBS:VAR2=2 #in IOC
PG1.variable1=1 #in PLC
PG1.variable2=0 #in PLC, value reverted back!!

Whenever I write a new value to a variable, the other variables get reset to their previous value on the PLC. This happens with more than 2 variables too, if I write to a third variable, the other two will also get reset back to 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant