Moving Values in STL losing format

rpop91

Member
Join Date
Mar 2012
Location
Detroit, Mi
Posts
44
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?

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
 
sTorque and sAngle are both four bytes as they are reals right?

Then why you transfer only one byte of that data to db ( t DBB should be DBD).

Oh, it must be mistake ;)

Edit : you found it when i was writing my answer :p
 

Similar Topics

Our lift station pumps cycle on/off about 8x/hr sending waste flow offsite. We measure the flow during pump cycles. I will add a totalizer but...
Replies
19
Views
3,459
Good afternoon, I have been programing more in my spare time trying to get back in the swing of things since I've really just been doing a...
Replies
9
Views
2,703
i am working with allen bradley panel view / micrologic parts . when editing the tags in panel view do each individual timer screens have thier...
Replies
1
Views
5,887
I'm a Siemens person, and this is one of my first AB programs. The customer wants everything programmed in Ladder. I have a lot of data (3...
Replies
14
Views
217
Hello, I have a compact Logix plc and I have been task with configuring alarms into our SCADA when an Analog signal stops moving. The analog...
Replies
6
Views
241
Back
Top Bottom