8/26/2015 5:37 AM | |
Joined: 11/21/2007 Last visit: 9/25/2024 Posts: 2325 Rating: (308)
|
Hi Zizo soliman To understand this logic, you need to first understand the Analog Input value representation in S5. I have attached an extract from S5-100U manual for your reference. Here is an Explanation of the statement : L PW 172 // Read Analog Input PW 172 SSW 3 // Shift the Word with Sign 3 Bits to Right ( Discard the Overflow, Error and Irrelevant Bits ) ADD KF -512 // Subtract the offset for 4 mA ( for 4-20mA Value at 4mA = 512 ) to get 0-2048 at 4-20mA L KF +333 XF // Multiply with 333 JP M001 // Jump to M001 if calculated Value is +ve L KF 0 // Else Substitute with Zero ( Ignore -ve Values ) M001 // Label SSD 11 // Shift Accumulator ( As 32 bit ) 11 bits to the Right while retaining sign ( Divide by 2048 ) T DW 11 // Transfer to DW 11 Effectively you will have 4-20mA Scaled as 0-333 Hope this helps Cheers Navnag AttachmentS5_Analog_Inputs_Representation.pdf (470 Downloads) |
Last edited by: Navnag at: 8/26/2015 5:38:14 AMThere is no such thing as the last bug in a program |
|
8/26/2015 9:13 AM | |
Joined: 11/16/2013 Last visit: 9/18/2024 Posts: 41 Rating: (1) |
Thank you very much |
Follow us on