rpop91
Member
Morning Everyone,
Perhaps you all may be able to answer this question for me. I'm having an issue when dealing with DWORD and REAL values. I'm taking a DWORD value from a torque controller, passing it to a REAL number and then stacking it in a DB. If I monitor the output from the torque controller as a floating-point number, the data is correct. However, the value that gets put into my DB is way off. I will attach the STL portion of the code. Should I maybe change this STL to SCL and run a FOR Loop?
Perhaps you all may be able to answer this question for me. I'm having an issue when dealing with DWORD and REAL values. I'm taking a DWORD value from a torque controller, passing it to a REAL number and then stacking it in a DB. If I monitor the output from the torque controller as a floating-point number, the data is correct. However, the value that gets put into my DB is way off. I will attach the STL portion of the code. Should I maybe change this STL to SCL and run a FOR Loop?
Code:
A #sTorque_Number_SetOS
JNB _019
OPN #iDataDB
L #sTorque_Number_Pointer
L L#8 // Length Of Result Data
*I
L L#110 // Pointer for stacking torque data
+I
L L#8
*I
L #tAddr_Start
+I
LAR1
L #sTorque
T DBB [AR1,P#0.0]
L #sAngle
T DBB [AR1,P#4.0]
L #sTorque_Number_Pointer
L L#8
*I
L #tAddr_Start
+I
LAR1