When using SetVariableDefaultValue I'm able to save any data type into another one without having any warning or error, for example: saving a string in a bool variable or a string inside an integer variable.
Just wanted to know why is this allowed?
SetVariableDefaultValue allows to set arbitrary values
Moderator: uasdknet
-
- Hero Member
- Posts: 21
- Joined: 14 Jun 2021, 23:39
- Support Team
- Hero Member
- Posts: 3070
- Joined: 18 Mar 2011, 15:09
Re: SetVariableDefaultValue allows to set arbitrary values
Hello,
The method SetVariableDefaultValue does not do any DataType checks for performance reasons. The method can only be called by the server application and we do not want to cause the overhead on checking the DataType, ValueRank because we expect the server application to call the methods in a correct way.
When a client is writing a value, then the checks are done by the sdk, because we cannot expect that all clients are implemented correctly.
The method SetVariableDefaultValue does not do any DataType checks for performance reasons. The method can only be called by the server application and we do not want to cause the overhead on checking the DataType, ValueRank because we expect the server application to call the methods in a correct way.
When a client is writing a value, then the checks are done by the sdk, because we cannot expect that all clients are implemented correctly.
Best regards
Unified Automation Support Team
Unified Automation Support Team