# LabVIEW

cancel
Showing results for
Did you mean:

## Does anyone know how to prevent data from jumping from low to high?

Assume you have data that keeps increasing by 2 for every iteration. So 3, 5, 7 etc...

Now imagine your data starts from 3, 5, then all of a sudden jumps to 100, then back to 9. So 7 is skipped.  . It should've been 3, 5, 7, 9 etc...

How do you prevent this jumping from happening. I thought about using  "In range and coerce" block.  I just don't think it will work or maybe I am not using it correctly (See VI).

Note: 100 is just a random number I picked. I just don't want the number to increase by more than 2.

So instead of getting 3-5-100-9, I would like the 100 or whatever number greater than the increment of 2 to be replaced by the previous number. For instance, I would like to get 3, 5, 5, 9  instead of 3, 5, 100, 9. The goal is to keep this increase exponential or linear.

Side note: The reason I am asking this question is because I have a project where I am reading coil temperature of a mechanical relay placed in an over. I'm expecting the temperature to increase exponentially. But then all of a sudden the temperature would jump from 95 degrees F to 400 degrees F then goes back to 95.1...

I could attach my project code which is extremely big. I am using MCCDAQ (US-TC-AI)  hardware to read data. I know many people probably do not have this hardware. So I just created a simple VI to give you an idea of what I want to do.

Does anyone know a method or block I can use to prevent his?

FYI: I am more of a visual learner. If you just type words, please don't be upset if I keep coming to you for clarifications. If you  explain and I attach a code, I will take my time trying to understand your code and there will be no need for me to keep going back and forth asking questions.

Message 1 of 16
(1,569 Views)

## Re: Does anyone know how to prevent data from jumping from low to high?

To me, this sounds like a hardware issue.  If you simply throw out the bad values, you are masking the real problem, which is that the instrument is giving you false readings.  You might want to investigate so you can find a solution for the problem instead of masking the symptom.

Bill

(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 2 of 16
(1,561 Views)

## Re: Does anyone know how to prevent data from jumping from low to high?

You are asking the wrong question.

Yes, you could use something like a filter to smooth the data.  You would be much better off finding out why your system is lying to you.

A 300degF transient requires an extremely unlikely transfer of energy.  Physics says this is not really happening ( although,  if you really have valid data the application would be priceless.)  Either way you don't want to filter the readings.

So, we need more system information to troubleshoot the problem.  As a first guess I'd check the flyback diode on the coil.  It's missing or fried.  And make sure any magnetic fields aren't affecting your sensor.

"Should be" isn't "Is" -Jay
Message 3 of 16
(1,556 Views)

## Re: Does anyone know how to prevent data from jumping from low to high?

I see. Thanks Bilko!

But can you at least tell me how to force data to be linear or exponential? Just in case in the future.

Message 4 of 16
(1,554 Views)

## Re: Does anyone know how to prevent data from jumping from low to high?

@GRCK5000 wrote:

But then all of a sudden the temperature would jump from 95 degrees F to 400 degrees F then goes back to 95.1...

That sounds like a loose thermocouple connection.  It could be anywhere on the cable from a bad joint at the actual sensor to a intermittent disconnect in the cable.  And any vibration (oven turning on/off, relay switching, somebody walked by the cable) could cause an intermittent connection.  As others stated, your issue is likely in your hardware.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 16
(1,540 Views)

## Re: Does anyone know how to prevent data from jumping from low to high?

Out of curiosity, does this always happen at the same temperature? I have some equipment with "autoranging" capability, but when it is switching from one range to the next it often gives an erroneous measurement.

Message 6 of 16
(1,524 Views)

## Re: Does anyone know how to prevent data from jumping from low to high?

Hey Greg,

No. This happens randomly. What is the name of the equipment with the autoranging capability that you are using? I just wish I could autorange programmatically with LabView for the future.

Message 7 of 16
(1,507 Views)

## Re: Does anyone know how to prevent data from jumping from low to high?

@crossrulz wrote:

@GRCK5000 wrote:

But then all of a sudden the temperature would jump from 95 degrees F to 400 degrees F then goes back to 95.1...

That sounds like a loose thermocouple connection.  It could be anywhere on the cable from a bad joint at the actual sensor to a intermittent disconnect in the cable.  And any vibration (oven turning on/off, relay switching, somebody walked by the cable) could cause an intermittent connection.  As others stated, your issue is likely in your hardware.

The MCC devices force low on open thermocouple.   A positive swing means energy is added.

If the relay coil is actively switching a moving magnetic field exists.....two dissimilar metals will have dissimilar reluctance and have different potentials induced on them.  In fact it's the same principle that causes a voltage at the junction proportional to thermal energy.  The "Randomness" suggests that no time correlation exists between readings and coil energy state transitions.

"Should be" isn't "Is" -Jay
Message 8 of 16
(1,493 Views)

## Re: Does anyone know how to prevent data from jumping from low to high?

@JÞB wrote:

The MCC devices force low on open thermocouple.   A positive swing means energy is added.

That's some good information.  A Keysight device I worked with would go to +99e99 with an open thermocouple.

@JÞB wrote:

The "Randomness" suggests that no time correlation exists between readings and coil energy state transitions.

We often attribute something to randomness when we do not know the pattern.  As of now, we just know it does not appear to be related to a temperature range transition.  It could still be related to the relay or the oven.

We are also assuming thermocouple.  What temperature sensor is actually being used here?

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 9 of 16
(1,486 Views)

## Re: Does anyone know how to prevent data from jumping from low to high?

The device is a thermocouple module with internal cjc. Google helps.

"Should be" isn't "Is" -Jay
Message 10 of 16
(1,477 Views)