I don't find any usage of %AI39 in the project file you send to me.
However, scaling of analog signals is done in the program block, "ANALOG".
For each analog signal:
Copy the maximum engineering units value to %R20011
Copy the minimum engineering units value to %R20013
Copy the analog signal value to %R20015
Call the subroutine "UE_VAT"
The scaled result is returned in %R20025. Copy that value to the address you will use in subsequent logic.