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.
We need to reduce the possible error situations. The error can occur at
Please check the different points.
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...)