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,085
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
116
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
5
Views
129
I'm having trouble calming down 2 Tempo Sonics. I'm using Studio 5000 CompactLogix my Raw value is jumping around from 8575.0 to 8755.0 at a...
Replies
30
Views
1,141
I cannot add SLC500 analog input tag (I: 8.3) to EZSeries Touch Panel Editor (V 5.3). I used all the listed tag datatype but it all says "Invalid...
Replies
10
Views
259
Back
Top Bottom