4-20mA input instruction

tjoneill

Member
Join Date
Jul 2007
Location
Michigan
Posts
66
Hello again everyone, i have a quick question for the forum.
I am installing a 4-20mA input card in a SLC 5/04 processor which will read a sensor reading alkalinity in a water tank. All i need it to do is open a valve if the level is to low and close when reaches SP. My question is, what instuction do i have to use to achieve this.
Thanks guys

ps. do i have to use a GEQ and a LEQ instruction or is their an easier way?
 
Well, if that's all there is to the problem, you've got it.

You'll probably want to set up a limit, like 60/40, where if the reading is above 60, the valve turns on, and, when its below 40, it shuts off. Otherwise, the valve will chatter when the single number is near the actual reading of the sensor.
 
Thoneill,

Check to see that your 4-20 mA Alkalinity input is scaled properly. Then decide at what pH you want the valve to open, and at what value you want it to close.

You may use any Comparison instruction, including EQU, GEQ, LEQ, LES, and so on. I like the LIM instruction, because you can set a range of values. The output is on when the input is anywhere between the High Limit and Low Limit. That avoids rapid open & closing of the valve around the setpoint value.
 
Last edited:
tjoneill,

I've attached a example file on one way to achieve this, I didn't check it out totally but I believe it will do what you're looking to do.

I noticed that I didn't put values in N11:1 & N11:2 before uploading (these are your low and high level setpoints)
 
Last edited:
Looks like you’re on the right track ensure that the 4-20mA signal is scaled well and clear. You can use the two compare instructions to create a simple ON/OFF control for the valve with a dead band. You may want to use integer values or Float depending on your application when doing the compare. This way you can make easy changes to the valve open and close set points.

You can also say open if PV < (SP - Dead Band) and Close if PV >= SP it's all up to you my friend. If it is really critical and the dead band is unwanted maybe you could explorer a PID and a Proportional Valve.
 
Ok...I am using a 1746-NI16I Analog card and applied the file that pc geek supplied for me using a SCP instruction with..
Input-I:19.0
and left the other setpoint the same.
I am reading a 4-20mA signal from a Rosemount Analytical liguid analyzer and have verifies the mA at I:19.0 but am not reading anything at the SCP input actual in the program and the LED on the channel status is not on.
What I am trying to do is open a valve at 12mA and close at 17mA which I have in the LEQ and GEQ instructions in the file above.
Any thoughts on what I might be doing wrong??
Thanks again guys
 
Tjoneill,

On Rung 0 of PCGeek's program, you did change his Input I:1.0 to your I:10.0? He used an example, and then you have to insert the proper input for your situation.

Check the value of I:19.0 in the RSLogix Data File, Inputs. If the number is changing proportional tothe current signal, then the problem is in your program. If not, it is a hardware problem. Either the signal wires are not connected correctly (+ and - switched?), the card does not have any power to it, or it is defective.
 
Last edited:
Lancie1 said:
Tjoneill,

On Rung 0 of PCGeek's program, you did change his Input I:1.0 to your I:10.0? He used an example, and then you have to insert the proper input for your situation.

Check the value of I:19.0 in the RSLogix Data File, Inputs. If the number is changing proportional tothe current signal, then the problem is in your program. If not, it is a hardware problem. Either the signal wires are not connected correctly (+ and - switched?), the card does not have any power to it, or it is defective.

Lancie1

I checked the Data File and nothing..I have the + wired into terminal 0 and the - into the common.
I did notice that the power LED light is on but the Input 0-3 LED is not.
I will look into this more on Monday.
Thanks again
Tim


PS
Is their a DIP switch or jumper I might have overlooked?
 
Last edited:
tjoneill said:
Ok...I am using a 1746-NI16I Analog card and applied the file that pc geek supplied for me using a SCP instruction with..
Input-I:19.0

Here is an old post http://www.plctalk.net/qanda/showthread.php?t=10839

My reading of your problem is that you need the COP instruction shown in post 5. This tells the card how to talk You need to research what the Interger N values need to be the -16144 may be correct for 4/20 mA.
 
I did notice that the power LED light is on but the Input 0-3 LED is not.

PS
Is their a DIP switch or jumper I might have overlooked?
According to the 1746-NI16I manual, your LEDs are saying that you have not "enabled" the channel. You probably did not know that you have to enable ALL channels being used, before this analog card will work. Basically you MOV, COP, or otherwise set word O:19.0 (if your module is located at I:19.0) to a 16-bit number that tells the module how you want it to operate.
 
Ok, I think I found it.
On page 5-3 on the manual Mickey sent, their is a channel config. for I:19.0 and I have to set the bits for what I want the card to do....right?

I:19/15=1 enable
I:19/4=1 4-20mA

Not sure about anything else I need to set but looks like this is the problem. I will try it out and let you all know.
A big thanks

Can I manualy set the bits in the Data File or do I have to program them to be high?
 
Last edited:
tjoneill,
Configure your card for "class 3" it will make your life alot easier. (see file below)
Then use the config screen to configure your card

ConfigScreen.jpg
 
Last edited:
tjoneill said:
Ok, I think I found it.

I:19/15=1 enable
I:19/4=1 4-20mA

Can I manualy set the bits in the Data File or do I have to program them to be high?
If you set the INPUT bits you are going to be disappointed--your analog Input card still will not work. It is the EQUIVALENT OUTPUT bit address that you need to set.

You can do it manually, but it is smart to put 1 rung in that uses the S:1/15 First Pass bit to then copy or move a number into O:19.0. No, again, that is NOT a mistake---O:19.0 is where you want to set your enable bits, even though you do not have an Output module at O:19.0. Back in the old days these cards were set with DIP switches on the cards. Then somebody at AB relaized that the normally unused, but reserved, Output word could be used to "enable" (configure for desired operation) them. The analog module configuration menu also will do this for you, but I like the idea of having a rung that sets up the card. That way, it will always be correct for this program, no matter if someone swaps it out for a new unenabled card, or messes with the configuration at some point in the future.
 
Last edited:
Mickey said:
tjoneill,
Configure your card for "class 3" it will make your life alot easier. (see file below)
Then use the config screen to configure your card

ConfigScreen.jpg


One quick question, can I configure a "class 1" card for a "class 3"?
And,(post by Lancie1) do I have to figure out the "decimal#?" that would have to be moved to I:19.0 that is equivilat to the 16bit word in I:19.0?
Seems to me that the easer way to do this is to configure the card to a class 3, but I still want a good understanding of how to set the bits.
Hope I am not confusing anyone??
I will have the downtime thursday night to try this.
 

Similar Topics

I have a customer with a machine that is physically maced out on I/O. I have 5 Thermocouple inputs that are not used. I need a signal conditioner...
Replies
8
Views
2,775
Simple Question - Standard 4-20 ma Input Card (Siemens) SO if at 4 ma we get 4000counts and at 20ma We get 26800 counts when it goes overscale...
Replies
3
Views
1,366
Got a new piece of equipment that has a flow switch on it. But the flow switch is 4-20ma output and we don't have any analog inputs left and the...
Replies
19
Views
5,231
Just asking for clarification here, but from my research all I need is a 500 ohm resistor across the AI and the common? Heres my schematic. I...
Replies
5
Views
2,606
Hi all Hoping somebody can help me here. I have a system equipped with 500A / 50mV shunts and need to measure system current in the realms of...
Replies
4
Views
1,660
Back
Top Bottom