FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
11-05-2020 04:29 PM - last edited on 11-18-2020 09:57 PM by PedroReboredo
Hello,
One customer has a really fancy behavivour:
He has a variable inside his PLC Project calling "Position" which reads the actual position of an Axis via the PLC. Inside the PLC Project while the customer is logged on, the variable value is 74.6:
The customer is also reading this variable via an C++ App:
and writes out the result into the logbook:
but as you can see, the values doesn´t match. How could this be? What is done wrong here?
Solved! Go to Solution.
11-09-2020 06:53 AM
Hello Maurus
We need to reduce the possible error situations. The error can occur at
Please check the different points.
Regards
Jochen
11-09-2020 11:40 PM
The variant class includes some helpful conversion operators. In the SDK (1.5.0), see include/comm.datalayer/comm/datalayer/variant.h.
I was able to read PLC variable Position (defined as REAL), using the following:
result = client->readSync(temp, &value);
float f = float(value);
(In your case, with Position defined as LREAL, you'll need to use double, but the principle should be the same...)