Commit 1ed840a1 authored by Julian Grothoff's avatar Julian Grothoff

Adapted ES and OM enumerations to current profile definitions in BaSyx.

parent a5a9a943
Pipeline #256904 failed with stages
in 12 minutes and 1 second
......@@ -106,6 +106,8 @@ test:compliance:selfcheck:disabled:
stage: test
dependencies:
- build:linux64
except:
- master
allow_failure: true
script:
- cd build/bin
......@@ -120,6 +122,8 @@ test:compliance:external:acplt:
stage: test
dependencies:
- build:linux64
except:
- master
allow_failure: true
script:
- cd build
......
......@@ -21,8 +21,8 @@ To start an OPC UA server with some examples on localhost and default port 4840
## Profiles
BaSys control components may implement the following profiles. They are officialy documented in the [basyx wiki](https://wiki.eclipse.org/BaSyx_/_Documentation_/_API_/_ControlComponent#Control_component_profiles).
The [service interface profile](https://wiki.eclipse.org/BaSyx_/_Documentation_/_API_/_ControlComponent#service_interface_profile) is special, because it is orthogonal to the other profiles. Hence, every other profile looks a bit different, when a different SI profile is realised.
BaSys control components may implement the following profiles. They are officialy documented in the [basyx wiki](https://wiki.eclipse.org/BaSyx_/_Documentation_/_API_/_ControlComponentProfiles).
The [service interface profile](https://wiki.eclipse.org/BaSyx_/_Documentation_/_API_/_ControlComponentProfiles#SI_Facets) is special, because it is orthogonal to the other profiles. Hence, every other profile looks a bit different, when a different SI profile is realised.
A rough implementation status of the examples and tests are marked in the table with -, 0 and +.
Profile | Name | Values | CMD | OPERATIONS | SERVICES
......@@ -30,8 +30,8 @@ Profile | Name | Values | CMD | OPERAT
SI | Service Interface | CMD, OPERATIONS, SERVICES, VARIABLES | + | + |-
OC | Occupation | OCCUPIED, PRIO, LOCAL | + | + |-
EM | Execution Modes | AUTO, SEMIAUTO, MANUAL, SIMULATE | + | + |-
ES | Execution States | COMPLETE, SUSPEND, HOLD, STOP, ABORT | + | 0 |-
OM | Operation Modes | CONTI, MULTI, PARALLEL | + | 0 |-
ES | Execution States | BASYS, PACKML, ISA88, MTP, OPCUA, NE160| 0 | 0 |-
OM | Operation Modes | MULTI, PARALLEL, CONTI | + | 0 |-
For each profile a correspondig enumeration, respectively a bitmask, is implemented in `inc/profiles.h` header file.
Some features may be optional, but if used they should be realized in the same way. Therefore the label `Optional` is used in tests.
......@@ -41,18 +41,18 @@ Another keyword is `Behaviour` to define tests, that activate operations and che
### Common Profile Values
All profiles can be determined with an positiv integer or zero, respectively enums may be implemented.
As it is usefull to combine different profile values of one profile, the values are represented as bitmasks.
So e
All profiles can be determined with an positiv integer or zero, respectively enums are implemented.
If it is usefull to combine different profile values of one profile, these values are represented as bitmasks.
Otherwise normal enums are used.
Bit | Value | Shortname | Example ES| Description
Bit | Value | Shortname | Example SI| Description
--- |--- |--- |--- | ---
1 | 0 | Unknown | UNKNOWN | No statement or not compliant profile variant
1 | 1 | None | NONE | Profile is not used or implemented
2 - n | > 1 | Any | ANY | One ore more profiles. All 2-n bits are linked by or operator (Value > 1)
2 | 2 | Default | COMPLETE | The default profile variant is used (specific to profile)
3 | 4 | First | SUSPEND | Alternative profile variants (specific to profile)
4 .. n | 8 ..n | Second | HOLD | Alternative profile variants (specific to profile)
2 | 2 | Default | CMD | The default profile variant is used (specific to profile)
3 | 4 | First | OPERATIONS| Alternative profile variants (specific to profile)
4 .. n | 8 ..n | Second | SERVICES | Alternative profile variants (specific to profile)
### Service Interface Profiles
......@@ -68,11 +68,6 @@ The following profiles are available at the moment:
* **VARIABLES**: A list of variables to start the different operations of the offered services.
* **MTP**: Modulte Type Package conform service interface. Possibly a specific version of the VARIABLES profile.
### Other Profiles
In the future other profiles for standardized state machines of basys control components may be added.
As example some execution state (ES) profiles for PackML respectively ISA88 can already be tested here.
---
## Profile Compliance Testing
......@@ -145,7 +140,7 @@ Test name | Profile Value\*| ANY or profile specific values.
Examples of a full test names are:
* `ns=1;i=10001/ES.STOP`
* `ns=1;i=10001/ES.BASYS`
* `ns=2;s=MyControlComponent/SI.ANY`
* `ns=3;i=42/OC.OCCUPIED_Optional`
......@@ -157,7 +152,7 @@ gtest_filter= | Description of selected tests
--- | ---
`*/SI.ANY*` | Service interface profile with all common tests.
`*/SI.CMD*` | Service interface profile with value CMD only
`*/ES.STOP*:*/ES.ABORT*`| Execution states and commands of PackML state automat within ES profile STOP and ABORT
`*/EM.AUTO*:*/EM.MANUAL*`| Execution modes AUTO and MANUAL within EM profile
`-*_Optional` | Exclude checks for optional values.
Filters may be concenatet with a **colon (:)**.
......
......@@ -5,6 +5,8 @@
Version : 0.1
Copyright : PLT
Description : Common definitions for the service interface profiles
Description can be found in:
https://wiki.eclipse.org/BaSyx_/_Documentation_/_API_/_ControlComponentProfiles
============================================================================
*/
#ifndef PROFILES_H
......@@ -58,25 +60,20 @@ static const char *EM_PROFILE_STRINGS[] = {"UNKNOWN", "NONE", "MANUAL", "SEMIAUT
/*
* ES: Execution state profile names and numbers
* defined in BaSys 4.2 Deliverable D-4.6
* Only BASYS profile is supported right now
*/
typedef enum ES_PROFILE {
ES_UNKNOWN = 0, // Undefined execution state profile
ES_NONE = 1, // No execution states to select (=Always in EXECUTE)
ES_COMPLETE =
2, // Orders = START, RESET.
// EXST = EXECUTE, (COMPLETING), COMPLETE, (RESETTING), IDLE, (STARTING)
ES_SUSPEND = 4, // Orders = SUSPEND, UNSUSPEND.
// EXST = EXECUTE, (SUSPENDING), SUSPENDED, (UNSUSPENDING)
ES_HOLD = 8, // Orders = HOLD, UNHOLD.
// EXST = EXECUTE, (HOLDING), HELD, (UNHOLDING)
ES_STOP = 16, // Orders = START, STOP, RESET.
// EXST = EXECUTE, (STOPPING), STOPPED, (RESETTING), IDLE, (STARTING)
ES_ABORT = 32 // Orders = ABORT, CLEAR, RESET, START.
// EXST = EXECUTE, (ABORTING), ABORTED, (CLEARING), STOPPED,
// (RESETTING), IDLE, (STARTING)
ES_BASYS = 2, // Subset of PackML (Start, Stop, Reset, Abort)
ES_PACKML = 3, // Full PackML state machine
ES_ISA88 = 4, // ISA 88 procedural elements state machine
ES_MTP = 5, // MTP state machine
ES_OPCUA = 6, // OPC UA program state machine (Part 10)
ES_NE160 = 7 // NE160 procedural state machine
} ES_PROFILE;
static const char *ES_PROFILE_STRINGS[] = {"UNKNOWN", "NONE", "COMPLETE", "SUSPEND",
"HOLD", "STOP", "ABORT"};
static const char *ES_PROFILE_STRINGS[] = {"UNKNOWN", "NONE", "BASYS", "PACKML",
"ISA88", "MTP", "OPCUA", "NE160"};
/*
* OP: Operation mode profile names and numbers
* defined in BaSys 4.2 Deliverable D-4.6
......@@ -85,9 +82,9 @@ typedef enum OM_PROFILE {
OM_UNKNOWN = 0, // Undefined operation mode profile
OM_NONE = 1, // No operation modes to select (= Always in BSTATE)
OM_MULTI = 2, // Multiple operation modes
OM_PARALLEL = 4, // Parallel executable operation modes, each has its own execution
OM_PARALLEL = 3, // Parallel executable operation modes, each has its own execution
// state, but the overall execution state has to be aggregated
OM_CONTI = 8 // Conti process operation mode. BSTATE, STARTUP, SHUTDOWN
OM_CONTI = 4 // Conti process operation mode. BSTATE, STARTUP, SHUTDOWN
} OM_PROFILE;
static const char *OM_PROFILE_STRINGS[] = {"UNKNOWN", "NONE", "MULTI", "PARALLEL",
......
......@@ -19,85 +19,109 @@ TEST_COMPLIANCE(ES, ANY) {
UA_NodeId_clear(&statusId);
}
TEST_COMPLIANCE(ES, STOP) {
DOC_TEST("Checks for ES profile STOP")
TEST_COMPLIANCE(ES, BASYS) {
DOC_TEST("Checks for ES profile BASYS")
SI_SPECIFIC(OPERATIONS) {
DOC_RULE("OPERATIONS has hierarchical reference to START, STOP and RESET method")
DOC_RULE("OPERATIONS has hierarchical reference to START, STOP, RESET, ABORT and "
"CLEAR method")
UA_NodeId methodId;
const char *startPath[2] = {"OPERATIONS", "START"};
translatePath(client, nsIdxProfiles, nodeId, startPath, 2, &methodId);
UA_NodeId objectId;
translatePath(client, nsIdxProfiles, nodeId, "OPERATIONS", &objectId);
translatePath(client, nsIdxProfiles, objectId, "START", &methodId);
checkMethodExecutable(client, methodId);
UA_NodeId_clear(&methodId);
translatePath(client, nsIdxProfiles, objectId, "STOP", &methodId);
checkMethodExecutable(client, methodId);
UA_NodeId_clear(&methodId);
translatePath(client, nsIdxProfiles, objectId, "RESET", &methodId);
checkMethodExecutable(client, methodId);
UA_NodeId_clear(&methodId);
const char *stopPath[2] = {"OPERATIONS", "STOP"};
translatePath(client, nsIdxProfiles, nodeId, stopPath, 2, &methodId);
translatePath(client, nsIdxProfiles, objectId, "ABORT", &methodId);
checkMethodExecutable(client, methodId);
UA_NodeId_clear(&methodId);
const char *resetPath[2] = {"OPERATIONS", "RESET"};
translatePath(client, nsIdxProfiles, nodeId, resetPath, 2, &methodId);
translatePath(client, nsIdxProfiles, objectId, "CLEAR", &methodId);
checkMethodExecutable(client, methodId);
UA_NodeId_clear(&methodId);
UA_NodeId_clear(&objectId);
}
}
TEST_COMPLIANCE(ES, COMPLETE_Optional) {
DOC_TEST("Checks for optional features of ES profile COMPLETE")
TEST_COMPLIANCE(ES, BASYS_Optional) {
DOC_TEST("Checks for optional features of ES profile BASYS")
SI_SPECIFIC(CMD) {
UA_NodeId cmdolistId;
translatePath(client, nsIdxProfiles, nodeId, "CMDOLIST", &cmdolistId);
DOC_RULE("CMDOLIST string array contains orders: START, RESET")
DOC_RULE(
"CMDOLIST string array contains orders: START, STOP, RESET, ABORT and CLEAR")
checkValueInStringArray(client, cmdolistId, "START");
checkValueInStringArray(client, cmdolistId, "STOP");
checkValueInStringArray(client, cmdolistId, "RESET");
checkValueInStringArray(client, cmdolistId, "ABORT");
checkValueInStringArray(client, cmdolistId, "CLEAR");
UA_NodeId_clear(&cmdolistId);
}
}
TEST_COMPLIANCE(ES, SUSPEND_Optional) {
DOC_TEST("Checks for optional features of ES profile SUSPEND")
SI_SPECIFIC(CMD) {
UA_NodeId cmdolistId;
translatePath(client, nsIdxProfiles, nodeId, "CMDOLIST", &cmdolistId);
DOC_RULE("CMDOLIST string array contains orders: SUSPEND, UNSUSPEND")
checkValueInStringArray(client, cmdolistId, "SUSPEND");
checkValueInStringArray(client, cmdolistId, "UNSUSPEND");
UA_NodeId_clear(&cmdolistId);
}
}
TEST_COMPLIANCE(ES, PACKML) {
DOC_TEST("Checks for ES profile PACKML")
SI_SPECIFIC(OPERATIONS) {
DOC_RULE("OPERATIONS has hierarchical reference to START, STOP, RESET, HOLD, "
"UNHOLD, SUSPEND, UNSUSPEND, ABORT and "
"CLEAR method")
UA_NodeId methodId;
UA_NodeId objectId;
translatePath(client, nsIdxProfiles, nodeId, "OPERATIONS", &objectId);
TEST_COMPLIANCE(ES, HOLD_Optional) {
DOC_TEST("Checks for optional features of ES profile HOLD")
SI_SPECIFIC(CMD) {
UA_NodeId cmdolistId;
translatePath(client, nsIdxProfiles, nodeId, "CMDOLIST", &cmdolistId);
DOC_RULE("CMDOLIST string array contains orders: HOLD, UNHOLD")
checkValueInStringArray(client, cmdolistId, "HOLD");
checkValueInStringArray(client, cmdolistId, "UNHOLD");
UA_NodeId_clear(&cmdolistId);
translatePath(client, nsIdxProfiles, objectId, "START", &methodId);
checkMethodExecutable(client, methodId);
UA_NodeId_clear(&methodId);
translatePath(client, nsIdxProfiles, objectId, "STOP", &methodId);
checkMethodExecutable(client, methodId);
UA_NodeId_clear(&methodId);
translatePath(client, nsIdxProfiles, objectId, "RESET", &methodId);
checkMethodExecutable(client, methodId);
UA_NodeId_clear(&methodId);
translatePath(client, nsIdxProfiles, objectId, "HOLD", &methodId);
checkMethodExecutable(client, methodId);
UA_NodeId_clear(&methodId);
translatePath(client, nsIdxProfiles, objectId, "UNHOLD", &methodId);
checkMethodExecutable(client, methodId);
UA_NodeId_clear(&methodId);
translatePath(client, nsIdxProfiles, objectId, "SUSPEND", &methodId);
checkMethodExecutable(client, methodId);
UA_NodeId_clear(&methodId);
translatePath(client, nsIdxProfiles, objectId, "UNSUSPEND", &methodId);
checkMethodExecutable(client, methodId);
UA_NodeId_clear(&methodId);
translatePath(client, nsIdxProfiles, objectId, "ABORT", &methodId);
checkMethodExecutable(client, methodId);
UA_NodeId_clear(&methodId);
translatePath(client, nsIdxProfiles, objectId, "CLEAR", &methodId);
checkMethodExecutable(client, methodId);
UA_NodeId_clear(&methodId);
UA_NodeId_clear(&objectId);
}
}
TEST_COMPLIANCE(ES, STOP_Optional) {
DOC_TEST("Checks for optional features of ES profile STOP")
TEST_COMPLIANCE(ES, PACKML_Optional) {
DOC_TEST("Checks for optional features of ES profile SUSPEND")
SI_SPECIFIC(CMD) {
UA_NodeId cmdolistId;
translatePath(client, nsIdxProfiles, nodeId, "CMDOLIST", &cmdolistId);
DOC_RULE("CMDOLIST string array contains orders: START, STOP, RESET")
DOC_RULE("CMDOLIST string array contains orders: START, STOP, RESET, HOLD, "
"UNHOLD, SUSPEND, UNSUSPEND, ABORT and CLEAR")
checkValueInStringArray(client, cmdolistId, "START");
checkValueInStringArray(client, cmdolistId, "STOP");
checkValueInStringArray(client, cmdolistId, "RESET");
UA_NodeId_clear(&cmdolistId);
}
}
TEST_COMPLIANCE(ES, ABORT_Optional) {
DOC_TEST("Checks for optional features of ES profile ABORT")
SI_SPECIFIC(CMD) {
UA_NodeId cmdolistId;
translatePath(client, nsIdxProfiles, nodeId, "CMDOLIST", &cmdolistId);
DOC_RULE("CMDOLIST string array contains orders: ABORT, CLEAR, RESET, START")
checkValueInStringArray(client, cmdolistId, "HOLD");
checkValueInStringArray(client, cmdolistId, "UNHOLD");
checkValueInStringArray(client, cmdolistId, "SUSPEND");
checkValueInStringArray(client, cmdolistId, "UNSUSPEND");
checkValueInStringArray(client, cmdolistId, "ABORT");
checkValueInStringArray(client, cmdolistId, "CLEAR");
checkValueInStringArray(client, cmdolistId, "RESET");
checkValueInStringArray(client, cmdolistId, "START");
UA_NodeId_clear(&cmdolistId);
}
}
......@@ -105,10 +129,8 @@ TEST_COMPLIANCE(ES, ABORT_Optional) {
void
ES::registerTests(SI_PROFILE si, UA_NodeId nodeId) {
REGISTER_TEST_COMPLIANCE(ES, ANY);
REGISTER_TEST_COMPLIANCE(ES, STOP);
REGISTER_TEST_COMPLIANCE(ES, COMPLETE_Optional);
REGISTER_TEST_COMPLIANCE(ES, SUSPEND_Optional);
REGISTER_TEST_COMPLIANCE(ES, HOLD_Optional);
REGISTER_TEST_COMPLIANCE(ES, STOP_Optional);
REGISTER_TEST_COMPLIANCE(ES, ABORT_Optional);
REGISTER_TEST_COMPLIANCE(ES, BASYS);
REGISTER_TEST_COMPLIANCE(ES, BASYS_Optional);
REGISTER_TEST_COMPLIANCE(ES, PACKML);
REGISTER_TEST_COMPLIANCE(ES, PACKML_Optional);
};
\ No newline at end of file
......@@ -22,8 +22,8 @@ TEST_COMPLIANCE(OM, DISABLED_CONTI_Optional) {
SI_SPECIFIC(CMD) {
UA_NodeId cmdolistId;
translatePath(client, nsIdxProfiles, nodeId, "CMDOLIST", &cmdolistId);
DOC_RULE("CMDOLIST string array contains orders: BSTATE, STARTUP, SHUTDOWN")
checkValueInStringArray(client, cmdolistId, "BSTATE");
DOC_RULE("CMDOLIST string array contains orders: CONTI, STARTUP, SHUTDOWN")
checkValueInStringArray(client, cmdolistId, "CONTI");
checkValueInStringArray(client, cmdolistId, "STARTUP");
checkValueInStringArray(client, cmdolistId, "SHUTDOWN");
UA_NodeId_clear(&cmdolistId);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment