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,037
Hi We're having issues with an FX1N-1DA-BD Analog output module. We're using an metallic contamination sensor MCS 1000 to detect particles. This...
Replies
1
Views
60
I am converting a SLC 500 to a Compact Logix. I plan on using a Compact Logix 5380 with conversion Kit. The problem is that the analog input cards...
Replies
1
Views
114
Hi there, I'm doing some extensive testing and commissioning with a slew of new Emerson PACSystems RX3i PLCs. It would be convenient to...
Replies
5
Views
80
In this sample programming, what does U4 mean? Any assistance would be greatly appreciated.
Replies
8
Views
170
Back
Top Bottom