Analog to DINT

sheperd9

Member
Join Date
Jun 2013
Location
Ohio
Posts
13
I'm working on a project where I have to take a reading of a +/- 5V Analog DC signal and convert it to a DINT for some calculations. I'm using a compactlogix controller and have most of the code written out but I can't figure out how this will work. Is there any reading I can do on something similar, or a similar project I could look at?

Thanks in advanced
 
I assume you have the data in a REAL.
You can use a Move instruction (MOV) to move the data into a DINT.
If you want to multiply the value first, you can use a MUL instruction, and just have the destination type a DINT.
eg. MUL REAL1 1000.0 DINT1
 
Thanks I will probably do the latter, because I have to do some converting after that. The inputs are LVDTs so I think there might be not be an exact number it will read at any given point. Do you know if there is any way around this?
 
From you earlier posts I'm guessing you are using a compact logix with 1769IO. The compact logix does not support scaling on the analog cards. You will need to scale your raw analog input with a CPT instruction, a ST statement if you have the ST extension, or with a scale function block if you have the FB extension. You could also download an SCP AOI or write your own to perform the scaling. Since you will be doing the scaling in the software then just make the destination your DINT tag.
 
You are correct, right now my scaling is just a simple
Code:
d := 39.3701*(.001*LVDT+.005); //A specific LVDT's compression in inches
Does that look plausible for my situation?
 

Similar Topics

ControlLogix 5550 PLC (Or any other) Just wondering in general, what is the better method for handling Scaled inputs? Move the scaled value to...
Replies
12
Views
9,115
Hi looking to install a smaller less sophisticated PLC for fountain timing and also one analog pressure sensor which would be used to detect...
Replies
23
Views
608
Hi all. I have 1793-IE4 (4)analog inputs modules in a 1794-ADN IOFlex DeviceNet Rack. I cannot find if I can I have access to individual channel...
Replies
1
Views
72
Good afternoon, I am currently working with an HMI/PLC LP-a070 and I require at least one analog output, but the PLC does not have one. I was...
Replies
5
Views
150
Hi all. Customer wants analog faceplates really bad, even if we explained that it doesn't make much sense in his process. What he wants to see...
Replies
7
Views
232
Back
Top Bottom