Page 1 of 1

Analog scaling in Step 7

Posted: Wed Jul 05, 2017 6:08 am
by internal
I have CPU 312-2DP and digital and analog i/o modules , I want to make a program which work like this

there is a input signal to the Analog module with range of 0-10 vdc , i want to save this values in a data block , please let me know what memory type i should use word or int or real , i use word or double word

once the value is saved in the data block i want to use this data block address and not scale this value to 0-5 v range and move output to the Analog output module

Re: Analog scaling in Step 7

Posted: Tue Jul 11, 2017 2:14 pm
by jokfem2016
internal wrote:I have CPU 312-2DP and digital and analog i/o modules , I want to make a program which work like this

there is a input signal to the Analog module with range of 0-10 vdc , i want to save this values in a data block , please let me know what memory type i should use word or int or real , i use word or double word

once the value is saved in the data block i want to use this data block address and not scale this value to 0-5 v range and move output to the Analog output module
Select FC 105 from standard library... Define your high and low setpoint. For this block your high and low limit will be real (data type) meaning you are going to use double word.. Your analog output is going to be real as well.. After this select FC 106 to unscale your output value to an integer data type for your analog output card.. Hope this is helpful..

Re: Analog scaling in Step 7

Posted: Wed Jul 12, 2017 12:26 pm
by Dfcz
L PIW 256 // ANALOGICA TRASDUTTORE
L 0
<=I
JC PR
L PIW 256 // ANALOGICA TRASDUTTORE
L 69
/I
PR: T #PRESSURE // PRESSIONE
T MW250 // PRESSIONE
T MD260 // PRESSIONE
T DB1.DBW 0 // PRESSIONE

Re: Analog scaling in Step 7

Posted: Wed Jul 12, 2017 12:28 pm
by Dfcz
This is input validation.

L PIW 256 // LETTURA TRASDUTTORE
L W#16#7FFF // ERRORE
==I
O(
L PIW 256 // LETTURA TRASDUTTORE
L W#16#8000 // ERRORE
==I
)
= M 126.1 // ALLARME