10-22-2012 10:45 AM
Hi,
I am currently using Labview to write and read some variables defined through an embedded Twincat application.
I have defined the following variables in Twincat :
Lab_lecture_real AT %MW100 : REAL;
Lab_ecriture_real AT %MW102 : REAL;
Lab_lecture_bool AT %MB1 : BOOL;
Lab_ecriture_bool AT %MB2 : BOOL;
Based on the VI given by Beckhoff for Twincat ADS/OCX (http://infosys.beckhoff.com/english.php?content=../content/1033/tcsample_labview/html/tcsample_labvi...😃 , I succeed to read the variables "Lab_ecriture_real" and "Lab_ecriture_bool" and write through "Lab_lecture_bool".
Nevertheless, i failed to write in "Lab_lecture_real", which is a real.
I have enclosed my VI, everything seems to be correctly connected. Though, I don't understand why it works for a Boolean variable rather than a real one. Maybe the method used for writing a real is different from Boolean.
Could you highlight me on this subject, please?
Regards,
Stephane
Solved! Go to Solution.
10-22-2012 11:05 AM - edited 10-22-2012 11:05 AM
Why are you setting the length for the REAL number as 8 in the VI?
Is it in the documentation for the OCX somewhere else?
10-22-2012 11:48 AM
I have just tried with the length for the real as 4 and it seems to work.
Thanks a lot for your answer !
10-22-2012 12:06 PM
Since a Boolean is a 1, and a Real is a 4, it would indicate that the length is in terms of bytes.