The method CreateAccessRule is used to create a new rule for the access control of the server.
The successful creation of a rule leads to the activation of the configured access rules in the function block, even if they had been deactivated using the method ActivateAccessControl() before.
If the function block is not enabled, the plausibility verification of the addresses in the rule configuration cannot be performed. This means that a rule valid at the time of creation can subsequently be recognized as invalid when the function block is enabled.
Inputs / Outputs |
Data type |
Description |
---|---|---|
i_stRuleConfig |
Specifies the configuration parameter for the rule to be created. |
|
q_sResultMsg |
STRING[80] |
Provides additional diagnostic and status information as a text message. |
Data type |
Description |
---|---|
The return value indicates the result of the method. If the value is ET_Result.Ok, the execution of the method was completed successfully. |
If the return value of the method is not Ok, verify the value of the output q_sResultMsg. It provides detailed information about the detected error.
Return value |
Possible cause |
Solution |
---|---|---|
ET_Result.IpAddressInvalid |
The format of the values for sIpAddressFirst or sIpAddressLast is invalid. |
|
ET_Result.IpAddressInvalid |
The combination of the values of sIpAddressFirst and sIpAddressLast is not plausible. |
Verify whether the value of sIpAddressFirst is less than or equal to the value of sIpAddressLast. |
ET_Result.RuleConfigMemoryAddressInvalid |
One of the combinations of the values uiStartAddress, uiOffset, and uiLength is not plausible. |
Verify whether the memory areas addressed by the parameters uiStartAddress, uiOffset, and uiLength are supported by the server. |
ET_Result.RuleAlreadyExists |
A rule with the same values for sIpAddressFirst and sIpAddressLast is already available. |
Execute the method CreateAccessRule() once per rule. Use an initialization procedure for creating the access rules which is executed only once. |
ET_Result.NoMoreRules |
The maximum number of rules is configured. |
|