You guys answered one of my questions and now you'll never be rid of me.

robpaige

Member
Join Date
Jun 2011
Location
Wisconsin
Posts
78
So it would appear that that one-button question we all know and love is meant to serve as a speed bump? I finally got past that, and the next few challenges I got from my boss proved easy enough. I now have a bit of a grasp on counters, timers, and latching/unlatching functions. I was glad to hear him say things like "That's actually very good for a person with no programming experience" and "Okay, I'll send you another problem, I just need time, I wasn't expecting you to get that one that fast". I wouldn't claim to be an expert on PLCs, but these folks were cool enough to accept me for their co-op knowing I haven't had the classes that would make me an effective PLC programmer, and trusted that I would work hard to learn what I needed to know, and I have tried my best to learn, if for no other reason than to thank them for taking a chance on me, and to ensure that they will be willing to take on my class mates later on down the line.

I know, I know, "Cool Story, Bro" so permit me to cut to the chase. The difficulty of the PLC programming challenges I have been given has risen:eek:, but I can now look at the problems I am being given, and only certain parts of them are actual problems, the rest is "...And after you've solved for that, apply the tools you already have to write the rest of the ladder logic needed."

So here's my dilemma: I need to convert a temperature (In degrees Fahrenheit, and it's a decimal number) to Celsius. I already know the formula I'm going to use, and I have a rough idea how to implement that in RSLogix 500, I'm just stuck on how the "number gets into the PLC in the first place". I'm thinking that it's one of those fun analogue to digital conversion sort of things that I haven't had yet, but I figured I'd check with you guys, to see if I'm right, and whether I'm right or wrong, ask for some pointers to help get me moving in the right direction.:geek:

Again, let me re-iterate, I'm not looking for you guys to do my "homework" for me, I'm just looking for a nudge in the right direction. Thank you in advance.
 
Maybe you do not have to do anything on the plc ladder programming, I do not know what module you are using but as far as I know temperature modules can give you data in either farenheit or celsius. It´s just a configuring subject. If your using other module for instance 4-20 ma input and need to convert to farenheit or celsius just use the SCP instruction, or use the CPT instruction.
 
I'm just stuck on how the "number gets into the PLC in the first place".

here are some HINTS of things to look for ...

in MOST cases you'll need to know the SPECIFIC catalog number of the input module involved ...

1746-NI4 ... 1746-NT4 ... etc. ...

then you'll need to know what type of TRANSMITTER (if any) is involved - and the transmitter's RANGE ... or what type of THERMOCOUPLE (if any) is involved ...

and you'll need to know how the module has been CONFIGURED ...

somewhere along the line, you'll probably end up with an address such as I:7.0 ... but that's an INTEGER (with NO decimal portion allowed) ...

so now the question becomes, "How is the INTEGER value (the input from the module) being converted into degrees in Fahrenheit – and being stored in a FLOATING POINT value (for example: F8:0)?" ...
 
Last edited:
Ron said
so now the question becomes, "How is the INTEGER value (the input from the module) being converted into degrees in Fahrenheit – and being stored in a FLOATING POINT value (for example: F8:0)?" ...
i
To kinda translate what Ron said and add a bit and not give secret away.
Temp detected goes to a voltage (if RTD or TC) that converts to a magic number in PLC input board. That magic number can be manipulated - the result of that can go to analog output which is often converted in the board to a voltage signal to control something.
One hint y mx + b
See Mr Melore tutorial at the top of the page it is in there and fairly easy to comprehend.

As another hint use Excel and set up formula for y to a power
crank in 2 for y and 1 thru 16 for power. Just so you know you are on right track 2 to the power of 2 is 4 and to power of 3 is 8. You do the rest.

We do not mind showing you the spoon and the food - the rest is up to you. You are doing VERY WELL.

Dan Bentler
 
Thank you both for the advice. You've given me a bit to chew on, and a place to start. I'll post back once I've worked my way through this.
 
My boss has mentioned that the number (temperature) is entered as a word...just thought you guys would like to know. Still working it.
 
My boss has mentioned that the number (temperature) is entered as a word...

well, if I understand what he means by that, then the exercise just got a lot easier ... apparently he's just asking for a "calculator" type operation – rather than scaling a real-world input signal from an actual field device ...

party on ...
 
I'm just stuck on how the "number gets into the PLC in the first place".

In RSLogix, there are several commands instructions that could be used to store a temperature value in memory. The first one that comes to mind is MOV (Move) instruction. COP (Copy) and CPT (Compute) could be used. Compute would be useful to you to calculate and store the value of a temperature converted from F to C. In the example Compute Help, B3:4 is the memory storage location where the result of the computation will be saved.

Below are excerpts from the RSLogix500 Instruction Help pages for MOV and CPT. A printed copy of all the RSLogix Help pages would probably be very useful for you. Another instruction should be mentioned, SCP (Scale with Parameters). Either CPT or SCP could be used to solve your problem in one rung.

MOV [Move]
Description
When rung conditions preceding this instruction are true, the MOV instruction moves a copy of the source to the destination each scan. The original value remains intact and unchanged in its source location.

If you are using a 5/02, 5/03, 5/04, 5/05 or MicroLogix processor, you can use indexed addresses for the source or destination parameters. If you are using a 5/03 OS302, a 5/04 OS401, or a 5/05 processor, you can use indirect addresses for the source or destination parameters.

Source is the address of the data you want to move. The source can be a constant.

Destination is the address that identifies where the data is to be moved.
Note If you wish to move one word of data without affecting the math flags, use a Copy (COP) instruction with a length of 1 word instead of the MOV instruction.

CPT [Compute]
Description
When rung conditions are true to this output instruction, the copy, arithmetic, logical, or conversion operation residing in the expression field of this instruction is performed and the result is sent to the destination. You may use indexed or indirect addressing to represent addresses in this instruction.

The execution time of a Compute instruction is longer than that of a single arithmetic operation and uses more instruction words.

Entering Parameters

Destination is the address that indicates where the result of the copy, arithmetic, logical, or conversion operation shown in the Expression will be stored. The destination can be a word address or the address of a floating-point data element.

Expressions - The expression is zero or more lines, with up to 28 characters per line, up to 255 characters. Instructions that can be used in the Expression include: +, -, *, l (DIV), SQR, - (NEG), NOT, XOR, OR, AND, TOD, FRD, LN, TAN, ABS, DEG, RAD, SIN, COS, ATN, ASN, ACS, LOG, and ** (XPY). The execution of a CPT instruction is longer than a single arithmetic operation and uses more instruction words.

Note Whether or not an address is valid in the expression operator is determined by the operator it is associated with. For example, since the SQR instruction allows direct, indexed
, and indirect addresses, then any operand associated with the SQR operator in an expression is allowed to be a direct, indexed, or indirect address.
Rockwell Software 2000

Rockwell Software 2000

CPT Instruction Help.jpg
 
Last edited:
This is gonna sound like a stupid question, but when you're talking about the MOV command, for instance, the description says "When rung conditions preceding this instruction are true..." kinda points to what I'm trying to figure out. Up to this point, I've generally used inputs to set up what conditions will be true to cause a desired output to energize. I know that the output(s) I'm energizing for this part of the problem I have been given are going to be things like the functions you listed, as well as some of the math functions, but is it a "legal move" to say, connect the output of the thermometer to an input of a PLC and then tell it "Okay, the data I want to work with is being piped into THAT input" and run from there?

I'd apologize for sounding like a n00b, but I've danced this dance with math, and I recognize that once again, I'm learning a new language, and am destined to sound like a dork while I get the hang of it. I hope I've at least managed to convey what I am trying to figure out, but if not let me know, and I will try to clarify.

Also, I'm keeping half an eye on this, while the other one and a half eyes are working on other things, so please bear with me if I don't reply right away.
 
Rob,....so much to learn, and so little time!

First, you need to know the difference between Bit Inputs and Word Inputs. A temperature would have to be a word (more than one bit long, usually 16 bits). If you have a temperature that has been wired to a PLC Analog Input Module, then all your program instruction has to do is call out that Input Address, in order to use it in your program.

For example, if you had a thermocouple input module with an address of I:4.0, then you could put that address into a CPT (compute) instruction and convert the value in location I:4.0 to a F-degrees value.

EDIT: If a CPT instuction is put on a rung by itself, then the rung preceding is a straight line, which is interpreted by the PLC processor as ALWAYS TRUE. You can put some instruction (such as XIC, Examine if Closed) and then the rung logic is only TRUE if that instruction output is TRUE.

Here is an example from actual program, using Compute instruction to calculate an average temperature and save it to memory location F8:10. This rung will be executed EVERY SCAN because it has no modifying logic (straight line is ALWAYS TRUE).

CPT Instruction AVG Temp Calculation.jpg
 
Last edited:
Could it be? Light? At the end of my tunnel? Thanks Lancie! I'm gonna play with what you've just said, see what I can make happen.
 
Rob,

So probably you need a COMPUTation with somthing like:

5/9 X (I:4.0 - 32), which converted to RSLogix, will look like this (the division symbol is a straight vertical line):

( 5 | 9 ) * ( I:4.0 - 32 )

saved to some Destination. I suggest using memory type F8, which will allow floating-point numbers that you need. So first memory location would be F8:0.
 
Last edited:
I'm gonna go facepalm. My boss came in to ask me what was taking so long with this one, I explained where I was hung up, and he says "Oh, no, just move a number into F8:0 to simulate a temperature, I wanted to see you use the math commands. We'll get into the rest of that stuff later". On second thought, facepalm isn't strong enough. I think this calls for vigorous, repeated applications of face to desk.
 
So you are ahead of him. Now MOVe a number to F8:0, say value "212", Then do a CPT instruction to convert F8:0 to degrees C, and save the result in Destination F8:1. Answer in Degrees C should be 100.

EDIT: What program are you using? HINT: If you are using LogixPro, you will have to do some extra steps....
 
Last edited:

Similar Topics

Now that Kroy has closed it's factory, What are you using for shrink tube labels? Looking for the same durability as the Kroy labels had (ie. no...
Replies
3
Views
1,979
I dunno why, but this really made me p**s myself and I'm not even a shift worker! https://youtu.be/jJ8EoUmJh8c
Replies
2
Views
1,662
I dunno why, but this really made me **** myself and I'm not even a shift worker! https://youtu.be/jJ8EoUmJh8c
Replies
0
Views
1,077
I just put this video together showing my workflow; https://youtu.be/1FdI1ttwVYA I’m interested in what tools and how everybody else is doing...
Replies
6
Views
2,256
Good Morning , We have a new packaging machine that have Slip Rings . We are using the Slip Rings for a rotary jaw assembly that has heaters...
Replies
16
Views
5,055
Back
Top Bottom