Hello all,
I have following situation:
Goal:
The goal is to persist set-point-values in a file and write them back if necessary.
implementation:
All set-points are marked with "1" in the extended attributes. I have a mimic including an AI Grid, displaying the variable tree. So to persist the values in a file, I read the AI Grid in a for()-loop and check whether extended attribute is "1". If yes, I write the var-name and var-value in file. To avoid that invalid values are stored in the file, I also check the status of the variable for "invalid" status. If not invalid, then write.
problem:
Everything worked fine, until I started to work on some "data-flow-optimizations". Instead of read all values all the time, I used the option to read only if the variable is in a mimic (and in trend, alarm, log, expression, etc..). Now the curios thing is, that if restarting PcVue and try to persists the set-points, the status getting back from SCADA Basic (Variable(Status,2), is invalid for all variables. If scrolling up and down through the AI Grid and perform the saving again, the invalid status disappears. All set-points are trends, so only because of that, the variables should be read all the time. There is also no leak in the trends. The values are definitely valid. I also tried to instead of "read only when in mimic" to check the option "only reading on server side". Same result. Only if checking again "Read variables all the time" it works again. The whole logic is on server-side. So should be not an networking-issue.
I attached the mimic and SCADA Basic Program maybe it helps.
Can anybody give me an explanation for that behavior or even a solution?
Thank you.
Hi Johannes,
First of all there is no mimic and program attached :woohoo:
It looks like you found an issue.
Actually without any mimic opened you could try checking the status of 1 Trend variable. It should not be Invalid.
Are you testing your code on a client or on the server?
Nico
Hello,
I made some additional tests, and the result is the SPR 60840.
In the end I could break down that the issue touches only variables, whose monitoring option is set to "None". If then performing the SCADA Basic function "Variable("Status",varname,2)" after a restart, the returned status for these variables is "0(NS)", which could be the right behavior if they were not trends. If now open a mimic, which contains the variables and performing again, the returned status changes to "1(valid)" and stays even if closing the mimic. Curios is also that it works only on server side. Opening a mimic, which contains the variables on a client brings no changes, the result is still "NS".
After checking the database and trends for leaks, it seems to be that only SCADA Basic or this special function returns this wrong result.
PS: the program is triggered by an event on a bit, which is in a serverlist / clientlist. So logic is only on server side
OK.
Just for information, that's normal the trend variables are NS on the client...
Dispatch from server to client for trends is done only when a TrendViewer is opened...
Nico


