Skip to content
Snippets Groups Projects
Commit 04c7ab55 authored by Martin Christoph Hierholzer's avatar Martin Christoph Hierholzer
Browse files

properly specify the AccessModeFlag for control system variables

parent 35a9768c
No related branches found
No related tags found
No related merge requests found
......@@ -328,10 +328,20 @@ boost::shared_ptr<mtca4u::NDRegisterAccessor<UserType>> Application::createProce
else {
dir = SynchronizationDirection::deviceToControlSystem;
}
AccessModeFlags flags = {};
if(node.getDirection() == VariableDirection::consuming) { // Application-to-controlsystem must be push-type
flags = {AccessMode::wait_for_new_data};
}
else {
for(auto &consumer : node.getOwner().getConsumingNodes()) {
if(consumer.getMode() == UpdateMode::push) flags = {AccessMode::wait_for_new_data};
}
}
// create the ProcessArray for the proper UserType
auto pvar = _processVariableManager->createProcessArray<UserType>(dir, node.getPublicName(), node.getNumberOfElements(),
node.getOwner().getUnit(), node.getOwner().getDescription());
auto pvar = _processVariableManager->createProcessArray<UserType>(dir, node.getPublicName(),
node.getNumberOfElements(), node.getOwner().getUnit(), node.getOwner().getDescription(),
{}, false, 3, flags);
assert(pvar->getName() != "");
// create variable ID
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment