LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Start button for serial data

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.

0 Kudos
Message 11 of 24
(1,565 Views)

@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.


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
0 Kudos
Message 12 of 24
(1,557 Views)

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

0 Kudos
Message 13 of 24
(1,550 Views)

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.

 


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
0 Kudos
Message 14 of 24
(1,542 Views)

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.

 

 

 

0 Kudos
Message 15 of 24
(1,536 Views)

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

0 Kudos
Message 16 of 24
(1,527 Views)

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

 

0 Kudos
Message 17 of 24
(1,498 Views)

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.

 

 

Message 18 of 24
(1,486 Views)

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 ?

0 Kudos
Message 19 of 24
(1,469 Views)

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.

0 Kudos
Message 20 of 24
(1,458 Views)