FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
09-27-2021 01:26 PM
Hello,
I am trying to read values from the data layer and print them.
The println function defined in datalayerclient.cpp has a commented line, which would print the actual value in the node.
void DataLayerClient::println(std::string text, comm::datalayer::DlResult result, comm::datalayer::Variant *data)
{
std::cout << text << " " << result.toString();
// std::cout << (std::string)*data.getData();
std::cout << " " << std::endl;
}
But if i uncommment the line, i have a class type error:
"message": "expression must have class type but it has type \"comm::datalayer::Variant *\""
Please let me know how to solve this issue.
Adam
Solved! Go to Solution.
09-27-2021 02:22 PM
Fixed it by using,
std::cout << (std::double)*data.getData();
instead of string.