04-06-2016 12:57 PM
Just a thought.
It seems that your counter is returning a cumulative count of events since it was last reset.
Why don't you set the counter to send a count rate instead? Or maybe you can tell the counter to start again from zero by sending it a command over the serial link?
Rod.
04-06-2016 01:06 PM
@Rod wrote:Why don't you set the counter to send a count rate instead?
That is exactly what I was trying to get to.
04-06-2016 01:16 PM
Hello,
Why don't you set the counter to send a count rate instead?
It is not possible for counter to calculate count rate. Actual it calculates continously. I will take those counts and make a delay of 1 second and calculate the counts per second using a feedback. The purpose of using a labview is to read the continues data and get the count rate out of it.
maybe you can tell the counter to start again from zero by sending it a command over the serial link?
l Have no idea how to send a command over serial link to my circuit.
Thank you
04-06-2016 01:30 PM
What counter are you using? Is it just counting pulses from something else?
There are several issues with what you are trying to do here, most have to due with time.
1. It takes a long time to send a serial message.
2. Windows is horribly inaccurate when it comes to timing.
In short, you need a counter that will measure frequency, not just the number of counts.
04-06-2016 01:43 PM
Hello,
In short, you need a counter that will measure frequency, not just the number of counts
I am not allowed to do any thing with my counter.(Geiger Muller counter-Berthold nuclear spectrometer LB2040). I just need to read the counts in labview and do further calculations.
Is ther any way that i can store a value in shift register whenever i press a start button? Like in your VI we can store the value in shift register when i press start, but i need to store the current value after i start it again.
04-06-2016 02:13 PM
Of course, just use a Select Statement. If you press Start, the True wires through the new value into the shift register. If you don't press the button, it wires through the existing value to the shift register.
I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
04-07-2016 04:31 AM
Hello,
just use a Select Statement. If you press Start, the True wires through the new value into the shift register. If you don't press the button, it wires through the existing value to the shift register.
If i use a Select statement and wire to start button,and connect select output to shift register i am getting an error. How exactly you want me to use a Select Statement?
Thanks for the tutorials, i hope they will help me in improving my labview Basics.
Thank you
04-07-2016 08:15 AM - edited 04-07-2016 08:18 AM
You've already got it wired in there with no errors showing up. The only problem is you aren't using the output of the Select Statement the Start button is wired to. You'd basically do the same thing you are doing now with the <0 conditing and its select statement. (I don't know what your logic tree is for the combination of <0 and Start so I took out the <0 part). And get rid of the case structure. What you are doing in the False case is the wire through. And only in the true case are you doing other logic, and also using the Start button again. I think you want your data processing to occur on every iteration, just only have the start button determine what goes into the shift register.
See below.
04-07-2016 10:15 AM
Hello RavensFan
In your VI you have connected wire from shift register to subtraction terminal, which is wrong we have to connect wire from output of case selector to subtraction terminal. And in your VI if press start button on i am not reading data and if i press start button off i am reading data (from x-y). So i changed the false and true terminals of selector. Now i have a problem that when we press the stop button off i am reading zeros, i need to stop reading (even zeros) when i press start button off, so i have used case structure in my VI(in old one). I want to read data only if i press a start button and stop reading data (even zeros) if i press start button off. How i can do this ?
04-07-2016 12:26 PM
I don't understand all of your requirements so it is impossible for me to give you an example that is going to do exactly what you want without you having to change something.
@liviya wrote:Hello RavensFan
In your VI you have connected wire from shift register to subtraction terminal, which is wrong we have to connect wire from output of case selector to subtraction terminal. And in your VI if press start button on i am not reading data and if i press start button off i am reading data (from x-y). So i changed the false and true terminals of selector. Now i have a problem that when we press the stop button off i am reading zeros, i need to stop reading (even zeros) when i press start button off, so i have used case structure in my VI(in old one). I want to read data only if i press a start button and stop reading data (even zeros) if i press start button off. How i can do this ?
I don't understand how you are getting zeroes if you hit the stop button. If you hit the stop button, the while loop then the VI will end.
I thought your requirements were to store a value that you used in later calcluations wheneve ryou hit the start button. That is basically a Tare function and what I presented to you.
It looks like you have the Start button set to switch action. So it really doesn't "Start" anything. It is actually stays on and behaves more like a "RUN" button. If so, then it seems like you want to grab the first value and store it when the Start button is first pressed, and not when it stays on.
First, rename the buttons so they clearly describe their function. Second, you can use a feedback node or shift register to remember the state of the button from the last iteration. If the previous value is False, AND the new value is True, then wire that boolean value into the Select function.