I'm trying to do something simple which is to clear the value of a parameter when the value of another parameter changes.
I want the parameter to be "Not initialized" rather than empty therefore i don't think this is possible from a Qaction.
I'm currently calling a trigger with two actions a "clear" and "clear on display"
After this executes the value of the parameter is set to "Not initialized" both in the client and server since if i do a GetParameter at this point null is returned.
The issue now occurs if i restart the element since this parameter has the save="true" the values before the clear come back and it shows both in the client and server.
Is there something else i need to do to clear the values in the database??
Hi Geovanny, From what you've tested, it seems that the clear action doesn't remove the value from the database (SLDMADB.ElementData). That's why on restart of the element (or DataMiner restart) the values will be retrieved from the database and pop back up.
Instead, I would suggest you to define an Exception on your parameter interprete definition. That way when you want to bring the value in a empty or special state, you can use this exception value to highlight the state. This will be more meaningful and you will be even able to alarm on this specific state.
Don't forget when defining a default alarm threshold for exception values, that you need to prefix the value with '$' (See: Exception Values)
The advantage of setting this parameter to use the exception value/state, is that since your parameter is saved, this specific value will also be saved. So after element (or DataMiner) restart you will remain with the same value/state.
This is the correct way. Not Initialized should never be set from within the driver.
Not Initialized may only exist after a restart, it indicates no polling or no logic has been performed to handle filling in that parameter.
If a parameter is ‘not initialized’ for a long time after restart it’s usually an indication of a bug.
When you think: I want this to be set to Not Initialized. You should immediately think: I need to use an exception value here instead.
I made a small test and when you perform a save action on the parameter after you’ve cleared the value, it will update the value in the database to an empty string.
So after restarting your element the value will now go from “Not Initialized” to an empty string.
You could still implement an after startup logic that would do another “clear on display” action based on a condition if the value is an “emptystring”.