LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PtbyPt editing with global variable?

Hey guys,

 

I'm wanting to setup a counter to count a crossing of a sinewave. The thing is, the sinewave is not zeroed. It's a sinewave of a cyclic load cell that I'm testing a material with. With this test, I will put load on the load cell, then cycle from that position, which is my realitive zero.

 

So, say I put 0.043 volts on the load cell. I would then cycle the material at a certain strain both ways horizontally, and this "0.043" would be my zero for the crossing. I've included my Vi so you can see what's happening in the "strain" and "stress" state. These states are independant from eachother and don't work together in anyway. They're just recording data on different channels

 

Is there a way I can edit the Pt2Pt vi to look at this "0.043" value (which is an analog channel)? I was thinking global variable...or...something simpler I could put in my code. I'm still a novice in all this and I would greatly appreciate some advice.

 

Kindly

Gary S.

0 Kudos
Message 1 of 17
(2,500 Views)

If all you're after is a "zero" crossing, couldn't you just subtract the DC offset?

Bill
CLD
(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 17
(2,493 Views)

Hi Gary,

 

usually you store that "offset" value in a shift register and subtract it from your current reading to eliminate offset later on...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 17
(2,490 Views)

Subtracting the DC offset...I'm about 60% sure I understand what you're talking about. But, won't this affect my data? I have a Load cell that's calibrated and I need those exact voltages. Also, aside from the stress and strain tests, I need to be able to do a biased test: where, I increment the load to a certain voltage, far from zero, then start cycling. This method of catching a non-zero crossing is mostly for the biased test but will be useful for the stress and strain portions if the load cell/LVDT isn't always zeroed at the beginning of the test.

 

Can you please help me understand more of what you advised about the DC offset?

 

Thanks

Gary S.

 

 

0 Kudos
Message 4 of 17
(2,485 Views)

Hi Gary,

 

you may only use the offset-free signal just for detecting zero crossing. You know: creating a datacopy in LabVIEW means branching a wire...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 17
(2,476 Views)

Yes, I understand. But, I'm writing my "cycle" count to my data file in the first column. This column is used to identify the cycle as they match up with the sine wave data. If my load cell isn't zero when I start the test, and the Pt2Pt is incrementing the cycle count everytime is crosses true zero, then my cycles aren't true to what's being output to the data file.

 

So, say I start the test at -0.043V as the DC "zero" and the Pt2Pt is set for minus-plus. And I graph 1 cycle of data. The cycle count crossing is going to be at zero, but it's not going to match with my load cell data.The crossing is really at -0.043 volts.I would be over a couple of points the first cycle and the offset will cause the zero to "walk" with increasing cycles.

 

Basically I want to be able to catch this -0.043V (or where ever I set the voltage) and use it as my cycle count.

0 Kudos
Message 6 of 17
(2,468 Views)

@glskinner wrote:

Yes, I understand. But, I'm writing my "cycle" count to my data file in the first column. This column is used to identify the cycle as they match up with the sine wave data. If my load cell isn't zero when I start the test, and the Pt2Pt is incrementing the cycle count everytime is crosses true zero, then my cycles aren't true to what's being output to the data file.

 

So, say I start the test at -0.043V as the DC "zero" and the Pt2Pt is set for minus-plus. And I graph 1 cycle of data. The cycle count crossing is going to be at zero, but it's not going to match with my load cell data.The crossing is really at -0.043 volts.I would be over a couple of points the first cycle and the offset will cause the zero to "walk" with increasing cycles.

 

Basically I want to be able to catch this -0.043V (or where ever I set the voltage) and use it as my cycle count.


I'm not sure I understand.  You don't need to worry about where it crosses when calculating the crossing point - you already know where it is crossing.  It is crossing at the offset.

Bill
CLD
(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 7 of 17
(2,454 Views)

The signal is crossing at the offset, but my "cycle count" is crossing at zero since I'm using Pt2Pt. How to I get my cycle count to cross at the offset? Is there a way I can edit the Pt2Pt to look at my beginning load cell reading zero/offset (I have it a TTL that starts the data aquisition) and then increment everytime is reaches the offset?

 

As for the why I need to worry about where the cycle count crosses: I am recording the cycle count as a scalar numeric value in my data file, along side my load cell. I need this cycle count to match with the crossing of the load cell for data reduction purposes. So if the load cell crosses at -0.043, I need the cycle count to change when the load cell crosses that value. I understand the Pt2Pt crosses at zero, but the stipulation for the crossing of this vi, "0", is what I want to change. I want it to cross at my offset (-.043, or whatever the case may be), since that is my true "zero" in relation to the behavior of my load cell voltage.

0 Kudos
Message 8 of 17
(2,447 Views)

As has already been said, subtract your offset before going into the Zero Crossing VI.


GCentral
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 17
(2,426 Views)

@glskinner wrote:

The signal is crossing at the offset, but my "cycle count" is crossing at zero since I'm using Pt2Pt. How to I get my cycle count to cross at the offset? Is there a way I can edit the Pt2Pt to look at my beginning load cell reading zero/offset (I have it a TTL that starts the data aquisition) and then increment everytime is reaches the offset?

 

As for the why I need to worry about where the cycle count crosses: I am recording the cycle count as a scalar numeric value in my data file, along side my load cell. I need this cycle count to match with the crossing of the load cell for data reduction purposes. So if the load cell crosses at -0.043, I need the cycle count to change when the load cell crosses that value. I understand the Pt2Pt crosses at zero, but the stipulation for the crossing of this vi, "0", is what I want to change. I want it to cross at my offset (-.043, or whatever the case may be), since that is my true "zero" in relation to the behavior of my load cell voltage.


I think you're not following my train of thought.  What you want to do is make a copy of the data (i.e, create a wire branch).  On one branch, you will do the crossing calcs.  On the other branch, you retain the actual data.  On the crossing calcs branch, you will subtract out the offset so you can use the Pt2Pt without modifications.  On the other branch you have your original data.  There should be a direct correlation between the two.  You should now have a record of both how many times it crosses and where it crossed.

Bill
CLD
(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.
0 Kudos
Message 10 of 17
(2,423 Views)