mindshaper said:
Hello, I'm new to siemens and i have problem about analog signals...
I'm using a 8x13 Bit AI, a 4x12 bit Ao and a combo 8 bit 4ai/2ao card.
How can i read input values and scale, also write output values?
Thks.....
PS: I really need help...
hi mindsheper
Remember,Analogue input 4-20mA = 0-27648,
You can use Siemens readymade locked blocks FC105 for SCALE AI.(and FC106 for UNSCALE).This fuction work very well.or also u can write your code for equation Y=M*X+C, this is required above two value for input and output min & Max value
calculate Y=mx+C:
1. first derive m=(y2-y1)/(x2-x1)
suppose you are measuring pressure -6 bar to 10 bar by using 4-20 mA AI
then y2=10 , y1=-6,x2=27648,x1=0
2.then calculate temp=m*(Analaog Integer Value, like PIW256)
3.then calculate C=constant=y2-m*X2 or by c=y1=m*x1
4.finally you will get the scaled Pressure in unit BAR at y=temp+c
It will work very as I generally use this equation in every leanear scaling.
good luck