# Analog Scaling - Temperature Readouts

## Recommended Posts

I need some assistance writing the logic for setting a scale for an Analog Input, and having 10 blocks that display the prior 10 temperatures.

I have a V350-35-R34, that will take place of a RedLion PAXD0000. A pyrometer AMETEK Spot+ reads the temperature of the outgoing billets. The Red Lion takes the peak value, and displays the temperature for about 3 seconds. Unless your writing down the value it hard to keep up with 10 temperatures.

The low for the scaling is 1022, max being 2552. Can anyone assist me in writing the logic to display the peak value Temperature on the first block, and when the next billet comes out the prior temperature moves down. I am very new to the controls world, so any help is very appreciated!!

##### Share on other sites

• MVP 2023

Moved to Visilogic...

I will try to describe your task step by step as I understood it:

1) You want to disconnect the analog output of the pyrometer from the meter and connect it to the PLC. To do this, you need to know which output (current or voltage) comes from the sensor.

2) having determined the type of signal (current 0-20mA or 4-20mA or voltage 0-10V), you need to know exactly the lower and upper limits of the signal, which correspond to the lower and, respectively, upper value of the output signal of the temperature meter. For example, output current 4mA ==1022 degrees 20mA==2552 degrees.

3) knowing the type of signal, you need to connect this signal to the desired selected analog input of the PLC and set the appropriate jumpers in the middle of the PLC JP1-JP2 and JP5 JP4 according to the instructions for the selected PLC analog input.

4) for the selected analog input - you must set a variable (MI) for the Analog input in Hardware configuration in Visilogic, put it on the screen as a Number (digital indicator) of the current raw value and write the project to the PLC.

5) having received a PLC connected to the pyrometer, you can observe the change of the selected raw value variable for the analog input when the temperature changes.

6) Using the linearization block from the Math menu, using the selected variable as an input signal, you build a mathematical converter  that will output the actual temperature of the process in the form of a Number on HMI Screen. You need to look at some documentation and example projects from the Visilogic help menu to understand how to convert the current value into the required temperature readings.

If you follow the path listed above and get the process temperature on the PLC screen as on the real meter screen, then we here on the forum will be able to help build the logic you need to display consecutive values of the maximum temperature for each subsequent workpiece that will arrive.

Considering that this is not an easy task, I think that without its successful solution, there is no point in talking about the algorithm for displaying consecutive maximum values.

If I misunderstood the first part of your task - correct me and describe what you assembled or connected to the PLC in more detail.

##### Share on other sites

On 8/1/2024 at 1:36 PM, kratmel said:

Moved to Visilogic...

I will try to describe your task step by step as I understood it:

1) You want to disconnect the analog output of the pyrometer from the meter and connect it to the PLC. To do this, you need to know which output (current or voltage) comes from the sensor.

2) having determined the type of signal (current 0-20mA or 4-20mA or voltage 0-10V), you need to know exactly the lower and upper limits of the signal, which correspond to the lower and, respectively, upper value of the output signal of the temperature meter. For example, output current 4mA ==1022 degrees 20mA==2552 degrees.

3) knowing the type of signal, you need to connect this signal to the desired selected analog input of the PLC and set the appropriate jumpers in the middle of the PLC JP1-JP2 and JP5 JP4 according to the instructions for the selected PLC analog input.

4) for the selected analog input - you must set a variable (MI) for the Analog input in Hardware configuration in Visilogic, put it on the screen as a Number (digital indicator) of the current raw value and write the project to the PLC.

5) having received a PLC connected to the pyrometer, you can observe the change of the selected raw value variable for the analog input when the temperature changes.

6) Using the linearization block from the Math menu, using the selected variable as an input signal, you build a mathematical converter  that will output the actual temperature of the process in the form of a Number on HMI Screen. You need to look at some documentation and example projects from the Visilogic help menu to understand how to convert the current value into the required temperature readings.

If you follow the path listed above and get the process temperature on the PLC screen as on the real meter screen, then we here on the forum will be able to help build the logic you need to display consecutive values of the maximum temperature for each subsequent workpiece that will arrive.

Considering that this is not an easy task, I think that without its successful solution, there is no point in talking about the algorithm for displaying consecutive maximum values.

If I misunderstood the first part of your task - correct me and describe what you assembled or connected to the PLC in more detail.

I connected to the Ametek and found it can send test mA signals. Here is what i created so far:

as for the linearization in the ladder here is what i got:

I followed your steps to the best of my ability! If this looks correct or if I need to modify anything, please let me know. The next thing I need to work on is to get the peak value of temperature since the Ametek will be reading the temperature of the bar exiting the heater moving onto a exit conveyor. How can I achieve this? Am I able to save that peak value for last 10 temperatures?

##### Share on other sites

• MVP 2023

I think it will make little difference, but a 10-bit 4-20mA analog input is 204-1023, not 205.

##### Share on other sites

• MVP 2023

Good work.

I hope that the temperature readings obtained by your PLC are similar to the readings of the instrument used for this.

1 hour ago, MFTN said:

How can I achieve this? Am I able to save that peak value for last 10 temperatures?

The next step is to determine the maximum peak value of the rising temperature.

How to do it for your case, I will try to describe again in simple steps:

1) Taking into account the speed of movement of your sample, you need to choose the period during which you will keep the temperature. The fastest the controller can do is the time of one program run. During this time, the ADC of the analog input will convert the temperature into a code, and the linearization unit will convert the code into a temperature. If it is possible to measure more slowly, you can use a self-resetting timer for this.

2) To save 10 maximum temperature values for the sample, let's use cells MI101---MI110.  To save raw temperature you can use MI100.

2) Copying MI1 to cell MI100 will be done according to the principle:

- the temperature of MI1 is higher than a certain minimum limit. You must select this limit on your HMI settings. Then you fix this by changing one of the bits - for example MB10=1 via Compare FB;

- if MB10=1 and the temperature of MI1 is higher than MI100, copying of MI1 to MI100 is performed (via Store Direct FB). Thus, we can record the maximum temperature on the sample. We can do it once per run of the program or, as I wrote above, at a set interval using a self-reset timer.

3) The next step is to detect that the temperature has fallen below a certain set limit (corresponding to MB10=0).

4) using contact -|N|- contact for MB10 as a starting point you can  make sequential copying of MI109>>MI110, MI108>>MI109.....MI100>>MI101, and records the current temperature of MI1>>MI100 (via Store Direct FBs).

It is clear that a repeated increase in temperature above the minimum will set bit MB10=1 and the process of fixing the maximum temperature in variable MI100 will be repeated. And accordingly, each subsequent maximum temperature will shift the ten recorded maximums that were made previously.

Maybe I described the steps a bit complicated, but considering the significant progress in your project, I think this is enough for you to be able to solve the task.

##### Share on other sites

On 8/2/2024 at 4:37 PM, kratmel said:

Good work.

I hope that the temperature readings obtained by your PLC are similar to the readings of the instrument used for this.

The next step is to determine the maximum peak value of the rising temperature.

How to do it for your case, I will try to describe again in simple steps:

1) Taking into account the speed of movement of your sample, you need to choose the period during which you will keep the temperature. The fastest the controller can do is the time of one program run. During this time, the ADC of the analog input will convert the temperature into a code, and the linearization unit will convert the code into a temperature. If it is possible to measure more slowly, you can use a self-resetting timer for this.

2) To save 10 maximum temperature values for the sample, let's use cells MI101---MI110.  To save raw temperature you can use MI100.

2) Copying MI1 to cell MI100 will be done according to the principle:

- the temperature of MI1 is higher than a certain minimum limit. You must select this limit on your HMI settings. Then you fix this by changing one of the bits - for example MB10=1 via Compare FB;

- if MB10=1 and the temperature of MI1 is higher than MI100, copying of MI1 to MI100 is performed (via Store Direct FB). Thus, we can record the maximum temperature on the sample. We can do it once per run of the program or, as I wrote above, at a set interval using a self-reset timer.

3) The next step is to detect that the temperature has fallen below a certain set limit (corresponding to MB10=0).

4) using contact -|N|- contact for MB10 as a starting point you can  make sequential copying of MI109>>MI110, MI108>>MI109.....MI100>>MI101, and records the current temperature of MI1>>MI100 (via Store Direct FBs).

It is clear that a repeated increase in temperature above the minimum will set bit MB10=1 and the process of fixing the maximum temperature in variable MI100 will be repeated. And accordingly, each subsequent maximum temperature will shift the ten recorded maximums that were made previously.

Maybe I described the steps a bit complicated, but considering the significant progress in your project, I think this is enough for you to be able to solve the task.

This is what I came up with, testing it on the workbench it worked:

I then went out to the production floor and wired it in series to still have the reference. This is where I found I did something wrong. It was not capturing the Peak Value, and it kept reading the a cold temperature of 4mA of 1022 for every single temperature read. It saved the 1022 temperature reads for the 10 temperature saves.

##### Share on other sites

• MVP 2023

2) Copying MI1 to cell MI100 will be done according to the principle:

- the temperature of MI1 is higher than a certain minimum limit. You must select this limit on your HMI settings. Then you fix this by changing one of the bits - for example MB10=1 via Compare FB;

- if MB10=1 and the temperature of MI1 is higher than MI100, copying of MI1 to MI100 is performed (via Store Direct FB). Thus, we can record the maximum temperature on the sample. We can do it once per run of the program or, as I wrote above, at a set interval using a self-reset timer.

You did not mention in your description about the sensor (connected to I 0) that "sees" the presence or absence of the workpiece.

Therefore, I proposed an algorithm that does not need this sensor.

Rung 4 of your algorithm is unnecessary. I would also like to add that it makes no sense to reset the value of MI 1 to zero.

In rung 5, at the end it is necessary to add the copying of the current value of MI1 to MI100 in order to then see how the new temperature increases.

##### Share on other sites

• MVP 2023
4 hours ago, CENT said:

I then went out to the production floor and wired it in series to still have the reference.

How you can do that????  My first 3 steps from

On 8/1/2024 at 8:36 PM, kratmel said:

1) You want to disconnect the analog output of the pyrometer from the meter and connect it to the PLC. To do this, you need to know which output (current or voltage) comes from the sensor.

2) having determined the type of signal (current 0-20mA or 4-20mA or voltage 0-10V), you need to know exactly the lower and upper limits of the signal, which correspond to the lower and, respectively, upper value of the output signal of the temperature meter. For example, output current 4mA ==1022 degrees 20mA==2552 degrees.

3) knowing the type of signal, you need to connect this signal to the desired selected analog input of the PLC and set the appropriate jumpers in the middle of the PLC JP1-JP2 and JP5 JP4 according to the instructions for the selected PLC analog input.

Need to disconnect sensor from readout meter and connect to PLC

Please post diagram. It is not possible to wire current signal in series if PLC  is used the same power sorce as main system.

##### Share on other sites

On 8/5/2024 at 1:42 PM, kratmel said:

2) Copying MI1 to cell MI100 will be done according to the principle:

- the temperature of MI1 is higher than a certain minimum limit. You must select this limit on your HMI settings. Then you fix this by changing one of the bits - for example MB10=1 via Compare FB;

- if MB10=1 and the temperature of MI1 is higher than MI100, copying of MI1 to MI100 is performed (via Store Direct FB). Thus, we can record the maximum temperature on the sample. We can do it once per run of the program or, as I wrote above, at a set interval using a self-reset timer.

This is how i translated your comment. What can I do to fix this correctly?

On 8/5/2024 at 1:42 PM, kratmel said:

You did not mention in your description about the sensor (connected to I 0) that "sees" the presence or absence of the workpiece.

Therefore, I proposed an algorithm that does not need this sensor.

This IO sensor is used for cycle time. What adjustments can I make to add this sensor to the program? I do apologize for not mentioning it.

##### Share on other sites

On 8/5/2024 at 1:42 PM, kratmel said:

Rung 4 of your algorithm is unnecessary. I would also like to add that it makes no sense to reset the value of MI 1 to zero.

In rung 5, at the end it is necessary to add the copying of the current value of MI1 to MI100 in order to then see how the new temperature increases.

I will add the necessary changes to Rung 5. I cannot recall why I added this reset to the program.

On 8/5/2024 at 1:54 PM, kratmel said:

How you can do that????  My first 3 steps from

Need to disconnect sensor from readout meter and connect to PLC

Please post diagram. It is not possible to wire current signal in series if PLC  is used the same power sorce as main system.

You are right I cannot do that, and I am not sure why I got readings to begin with. When I went back to to re-test it nothing was working or reading. I disconnected the pyrometer from the PAXD and connected them to the PLC like you said to begin with. I left it initially to have temperature reference, but it did not work the second go around. On the workbench I did use two different power sources. I can do that again if need be. @kratmel I apologize for not quickly responding and any miscommunication.

##### Share on other sites

• MVP 2023
2 hours ago, CENT said:

What can I do to fix this correctly?

I use your rung numbering and "replace" your code for code that is the same as my #2 text algorithm.

2 hours ago, CENT said:

it did not work the second go around.

You must open PLC back cover and check board near analog inputs. It is possible that something wong happend.

## Create an account

Register a new account

×