Scaling analog input siemens

correction

correction on my comment:

L PIW 500 Vac probe input
ITD Integer to Double Integer
DTR Double Integer to Floating Point // OK
L 1.000000e+001 Multiply by 10 // geves us 0-276480
*R
L 2.764800e+004 Divide by 27648 // 276480/ 27648 = 10
/R
RND Round to a Double Integer
T DB6.DBW4

Your code is good. Sowry...

Everyone has his own way of coding, but in my case I think it's easier to first convert the range to 0-1. So starting with divider by 27648
 
and

and notice that you only have numbers like 0 1 2 3 4 5 6 7 8 9 and 10 now. So it's sometimes better to use the range 10 times greater so that u have a better value to calculate with, and decimal places can be shifted on an HMI
 
You don't need to multiply by 10, just modify your scaling factor...


L PIW 500
ITD
DTR
L 2.764800e+003
/R
RND
T DB6.DBW4
 
reason

Any reason why I should use it ?

A scale is short in code, so I don't mind writing something like that. I usually scale and calculate in the same network, FC105 is just something I don't really need.


manmeetvirdi said:
Hi there
Any Special reason for that??
Or is just matter of like/dislike?
 
Ok my first message here, as posted on the dutch PLC forum
mostly we use this one for coverting and scaling. We are not using decimals in plc. If we want higher accuracy we multiply max and min scale setting bij 10 or 100 1-11 Bar is presented as 10-110.
Reasen for this is speed in calculating and comparingsons later in programs.



Code:
	 L	 #InpValue 
	 ITD	
	 DTR	
	 L	 2.764800e+004	 // Max number of digits SIEMENS   Wago change to 32764							 
	 /R	
	 T	 #tmpInpValue	  //temp variable
	 L	 #Maxunits		 //Max scale value
	 L	 #MinUnits		 //Min scale value
	 -D	
	 DTR	
	 L	 #tmpInpValue 
	 *R	
	 L	 #MinUnits 
	 DTR	
	 +R	
	 T	 #tmpInpValue 
	 RND					   // Real to Integer 
	 T	 #OutUnits		   //output value
 
Last edited:

Similar Topics

Dear all Iam using three load cells connected in parallel to calibrate the weight of a product but in don't have a weighting module in my...
Replies
4
Views
3,501
Hello everyone, I have a plc 5 input card receiving an input from a conductivity Transmitter where 0ma=0 uhms and 20ma= 20,000 uhms The raw min...
Replies
8
Views
3,656
Hello everyone, I have a plc 5 input card receiving an input from a conductivity Transmitter where 0ma=0 uhms and 20ma= 20,000 uhms The raw min...
Replies
2
Views
1,835
Hello! I am new at PLC programming. I am using TM221CE16R PLC with TM3AI8 analog input module and SoMachine Basic v1.6. I am trying to scale...
Replies
8
Views
7,101
Hello, I have a Micrologix 1400 PLC and using RSLogix 500. Using a Multi Ranger Ultra Sonic Level Sensor and the input is moved to N7:11, then...
Replies
15
Views
3,924
Back
Top Bottom