SLC 500 - Dealing with Analog I/O

justin lutz

Member
Join Date
Aug 2008
Location
Columbus, Ohio
Posts
93
Good afternoon, all.

I am working with a SLC 5/03 Processor. In addition, I am using a 1746-NI8 analog input module and a 1746-NO41 analog output module. I have never worked with analog before, so I am unsure as to how to set things up. I've read the AB manual for the 1746-NI8 and have followed the instructions, configuring my first channel (channel 0) with the necessary operating parameters. I then created integer file, i.e.) N:10, with element N10.0, and entered the channel 0 configuration parameters into it. I created a rung of logic which on first pass, copies the contents of N10.0 into the ouput word O:1.0 (thus configuring the channel on startup).

I think I am alright, up until now. There are 2 sludge pumps which maintain a constant discharge flow rate of 300 - 600 GPM, by varying the speed of the pumps' motor with a VFD. I have a magnetic flowmeter which provides a 4-20mA input signal to the PLC, used to maintain a constant preset discharge flow rate from the selected pump(s). An analog output will be provided from the PLC to the VFD to maintain the flow rate within the stated range. This is where I am looking for some direction. How do you effectively utilize the analog input values that are pulling from the field? Is this simple enough that a PID is not needed? Which data type is best to use in order to get back to a meaningful value, i.e.) the discharge flow rate? Any help would be greatly appreciated!


Thanks,
Justin
 
Greetings Justin ...



and welcome to the forum ... before we go any further, it would be a very good idea for you to post your .RSS file ... that will save a LOT of back and forth typing (for you and for us) as we try to nail down what you’re working with ...



I have never worked with analog before



that’s not a problem - we can help ... you’ve got some typos in your post ... there’s enough there to show us what you’re up to, but try to be more careful in the future ... the exact addresses do make a difference in a lot of cases ... you can save time and trouble by giving rock-solid information ...



I think I am alright, up until now.



you should make sure before you go any further ... set up an SCP instruction for your input signal and scale the incoming data to some “meaningful” units of measure (example: 0 to 600 GPM) ... if you’re not sure how, just give it a try - and post again if you can’t get it done ...



This is where I am looking for some direction. How do you effectively utilize the analog input values that are pulling from the field?



in the simplest scheme, you’d basically scale the input data into usable units (like GPM) and then have the PLC compare the value to a desired “target” value ... you could use something as simple as the idea “if the input signal is less than 300 GPM, then speed up the pump motor” ... and “if the input signal is greater than 300 GPM, then slow down the pump motor” ...



Is this simple enough that a PID is not needed?



probably not ... think about the “bare bones” scheme that I just described ... you can almost hear the pump constantly oscillating between speeding up and slowing down already can’t you? ...



a better idea than just using a set of comparisons is to have a PID equation look at the input signal - and then calculate an output value for the pumps - based on HOW FAR the signal is off the target - and HOW LONG it’s been off the target - and HOW FAST the signal is changing ... that (in a nutshell) is what PID is designed to do for you ... think of it as something like the cruise control on a car ... that’s much better than just laying a calibrated brick on the gas pedal and hoping for a steady speed ...



plan of attack: manually control the speed of the pumps - and make sure that the analog input signal is coming into your PLC as a properly scaled data reading ... then connect the analog output of your PLC to the input of your VFD ... make sure that you can manually change the value of the output - and use it to (temporarily) control the amount of flow ...



secret handshake: if the input signal isn't RIGHT - and the output signal isn’t RIGHT, then there’s NO WAY that the PID (or anything else for that matter) can give you good control over the system ...



when you’ve got your IN’s and OUT’s hooked up, scaled, and confirmed working correctly, then (and only then) start thinking about adding in the PID rung ...



hope this helps ... out of typing time for today ...
 
Last edited:
Ron, thank you for your reply. I am at home today, and do not have access to my .RSS files, I am working off of paper. I will try to post tomorrow.

I apologize for any typos, please alert me to any incorrect information I may have listed.

So, for the SCP instruction, I have (according to the info. I've already provided):

Input I:9.0

Input Min. 3500

Input Max. 20,500

Scaled Min. 300 (GPM)

Scaled Max. 600 (GPM)

Output N50:0 (Example Location)

One question, should the Input Min/Max be what I have, or 4000 and 20,000, respectively? What I have shown is how the Manual showed the scaling, I was not certain if that was always the case.

The bare bones scheme you described: When you say, "Scale the data into usable units like GPM...," is that just done by setting up an SCP instruction like the one above, or is there more math and manipulation to it than that?

One complication that I have is that the facility that I work for does not have the actual processor, rack, or any other equipment available for me to go online and debug with. I am writing the code all offline and then doing installation/test/debug at the field location. Not the preferred way of working, I know, but it's what I have to work with.

One other question: I am new to the site, can you tell me how to include quotes in your replies?

Sorry for the long winded reply, but thank you very much for getting back to me, Ron.


Justin
 
One complication that I have is that the facility that I work for does not have the actual processor, rack, or any other equipment available for me to go online and debug with. I am writing the code all offline and then doing installation/test/debug at the field location.



ugh! ... that’s not good ... what type of deadline do you have? ... how far away is the job site? ... how much “slack time” will you have available on start up day? ... what happens (financially, etc.) if the system doesn’t work right out of the box? ...



my off-the-cuff advice is “Run, Justin, Run ... Run like the wind” ... this job (particularly if there’s PID involved) sounds like forty miles of bad road - with no room to turn around at the end ... but only because you don't have the stuff you need to work with ...



but ... if you’ve got the time, I have the same type of hardware that you mentioned available in my lab ... IF (big IF) I get some spare time this week, I might be able to plug in the program you’re writing and see how it works ... no guarantees about whether I can make that happen ... I’m kind of swamped right now - but I’ll do it if I can ...



I’ll have to say that your chances of being able to pull this off are not very good ... no offense intended, but you're something of a beginner at this - right? ... well, this isn't exactly the type of job that I'd assign to "break in" a beginner - but then that's just me ... do you have any "supervision" or "coaches" available to help out? - or are you pretty much on your own here? ...



I’ll be looking for that .RSS file ... let’s hold off on answering your scaling question until we get our eyeballs on that piece of the puzzle ...



gotta go ...





quotes.JPG

 
Last edited:
ugh! ... that’s not good ... what type of deadline do you have? ... how far away is the job site? ... how much “slack time” will you have available on start up day? ... what happens (financially, etc.) if the system doesn’t work right out of the box? ...

I know, I hear ya. I've got another week or so to work on this, however it seems that the timeline keeps getting pushed back on this one. So, I cannot give you a solid answer, but I do have some time. The job site is about an 8 hour drive from Columbus.

but ... if you’ve got the time, I have the same type of hardware that you mentioned available in my lab ... IF (big IF) I get some spare time this week, I might be able to plug in the program you’re writing and see how it works ... no guarantees about whether I can make that happen ... I’m kind of swamped right now - but I’ll do it if I can ...

Ron, I know you're swamped, so I really don't expect you to delve that deep into this for me, although I really appreciate the offer. If, however, you might be able to provide me a few rungs of logic to get me started - pulling the 4-20mA input from the card, scaling it, using it in the program - that would be especially helpful, just so I can see how I should be setting this up. I have a number of other analog I/O to tackle, so if you could guide me on how to deal with one of these, my hopes are that it will get me going in the right direction on the rest.

or are you pretty much on your own here? ...

For the most part, I am. I have some assistance on the overall project, but not so much in the programming realm. I have been trying to utilize other resources (former coworkers, friends, etc.) to gain an understanding of what needs to be done.

I’ll be looking for that .RSS file ... let’s hold off on answering your scaling question until we get our eyeballs on that piece of the puzzle ...

The current .RSS file I have created is comprised mainly of permissives for the sludge pumps to run. I have not included anything for the analog inputs yet. It is commented, so if it helps you to see it, I will post it.


Thanks, again!

Justin
 
The current .RSS file I have created is comprised mainly of permissives for the sludge pumps to run. I have not included anything for the analog inputs yet. It is commented, so if it helps you to see it, I will post it.

what I was mainly wanting to see was the I/O Configuration feature ... that would at least tell us what hardware you've got - and how it's arranged ... but ... based on what you're telling us now, I'll bet the only thing there is what you've put in the file yourself ... right? ... if so, is there any chance that you can get your hands on the "existing" program - the one that’s (presumably) already out there being used in the field? ... that might be VERY helpful ...

key point: if there is an existing program that you’re going to modify, then you can't just go blindly picking out address ranges, etc. to use for your “new stuff” ... you do NOT want to inadvertently overlap anything ... that would be “bad” ...

anyway ... keep a cool head ... like I said, if you’ve got “time” then you CAN get it done ...

I’ve got to go for now - but there are many qualified members on the forum who can help ... the best course of action is to post EVERYTHING that you can ... the more we know, the more we can help ... there’ll probably be a lot more action on your thread tomorrow ... the holiday has things pretty slowed down on the forum ...

good luck with your project ...
 
Justin the advice Ron has given is rock solid.

I got a request to tune a Temperature PID. I responded that I can even spell PID so there was no way that I could comfortable take on this task. The plant manager at this site said “I will give you all the time you need” I politely refused the job. The man said he did not care if it took a week just please start on it. I said OK and got a copy of the program opened it up. Poorly documentation 22 temperature PID loops, only 2 PID instructions, and a boat load of JSRs caring parameters to a file. 4 hours later I tracked down the loop settings. Nice use of indirect addressing. So the short version is if you have to drive to the location and copy every piece of paper that you can find on this machine. You may be trying to drop code into a very complex, or basic system. I little bit in a box and you stop the slude pumps
you do NOT want to inadvertently overlap anything ... that would be “bad” ...
 
Ron,

I'll bet the only thing there is what you've put in the file yourself ... right? ... if so, is there any chance that you can get your hands on the "existing" program - the one that’s (presumably) already out there being used in the field?


The file that I am working with is brand new, as I have created it from scratch. I do have access to the existing program for the facility if you think it will help. As far as inadvertently overlapping data, I intend on choosing address ranges that are far enough out that they are unused by anything else.

I have attached my .RSS file, entitled, "Sludge Pumps." As I said, there is not alot to it. Also, the address ranges I am currently using may appear jumbled because I was told part way into the game to use different addressing. It needs to be cleaned up.

Please let me know if there is anything else that I can clarify. As I said before, if you might be able to provide me with a few rungs of logic to get me started - pulling the 4-20mA input from the card, scaling it, using it in the program - that would be especially helpful, just so I can see how I should be setting this up.

Thank you,
Justin
 

Similar Topics

I have a program that I've used 100 times. SQO settings: File N7:0, Mask 0FFFFh, Dest B3:1, Control R6:0, Length 8, Pos 2. Length & Position...
Replies
48
Views
957
Everyone, i am in the process of purchasing the Slc 500 version of software to support what we have and i have a question. Several of our...
Replies
9
Views
766
In a slc 500 plc I am trying to move data with out using a lot of moves. I want to move data from n7:1 to n7:2 and data that was in n7:2 to n7:3...
Replies
16
Views
1,355
Customer has a circa 2004 SLC-500 PLC. Fieldbus is a 1747-SDN DeviceNet scanner. Customer has SLC-500 file (.rss) with no comments. Has no *.dnt...
Replies
7
Views
553
After I tried wiring, I used computer program communication to read the PLC N value, but received a NAK signal. And the DL3500 CHA light keeps...
Replies
0
Views
424
Back
Top Bottom