Hello, I am new to PLC programming, and I´ve been assigned this task at USP-070-B10 with UIS-WCB1, using Unilogic 1.23.25:
I have an analog angle measuring sensor, which gives current of 0-20mA( 0mA is for -45°,20mA is for 45°) , which transfers into integer value from 0 to 16383 in INT16, I need:
1) transfer the integer value to value in degrees
2) display the value in degrees on the HMI field
3) compare the value with user written value in another HMI field, and perform actions according to the comparation
I am stuck at the first part, transferring the integer value to degrees. I tried the linearize function, which suggest in help that can be used to convert analog input values. But when trying to compile and send project to the PLC, displayed error suggested, that the input value and output value have to be in the same data type.
Thus I wanted to try the INT to REAL operator, which I probably did not get, how to set up, because when online the value converted into real does not change with the value on the analog input and stays on 0. Furthemore when I want to linearize the converted value of REAL data type into degrees in REAL datatype, the same error displays, that the input value and output value have to be in the same data type, when this is no longer true.
I would appreciate any guidelines to setting up my task.