LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Start button for serial data

Hello, 

 

I want to create a start button which i need to start the serial data from 0 irrespective of actual value. And when i stop it the count has to stop and when i start again it has to count again from the same value where it has stopped. I have tried to store the last count of serial data which i received last after pressing the button and tried to subtract that value from the present counts so that i can start it from 0. But it didn't worked out. Is there any way i can do it?

 

Thank you 

 

 

0 Kudos
Message 1 of 24
(3,845 Views)

@liviya wrote:

Hello, 

 

I want to create a start button which i need to start the serial data from 0 irrespective of actual value. And when i stop it the count has to stop and when i start again it has to count again from the same value where it has stopped. I have tried to store the last count of serial data which i received last after pressing the button and tried to subtract that value from the present counts so that i can start it from 0. But it didn't worked out. Is there any way i can do it?

 

Thank you 

 

 


So you want to just count the number of times you read good serial data?

 

How about something like this? I took out the part where you do something with the data and just left in the counter. This way the count will increment only if there is no error. Of course this assumes that not getting a timeout error means you read valid data, you will have to add any error checking as I do not know what your data is or what you need to do with it.

 

ReadCount.png

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 24
(3,823 Views)

Hello,

 


I do not know what your data is or what you need to do with it.

 


My data is, i am reading couts continously from a Geiger muller counter (ex: 1 to 1000). In my Geiger counter if i press a start button that starts counting the data, if i press stop  then it will stop at that count and if i again start then it starts trom the same value again.

Ex:

Start (it start counting from 0)

if i stop it after some time it stops at count EX: 300

if i start again i starts at 301.

 

What i want to do is

now i will start my Geiger counter and read serial data into labview continuously. But now i need to do the above operations using labview. I start my run button in labview which starts reading the serial data.

if i   press a start button after some time of readind serial data in labview it has to start from 0 ( actually i already read some data in labview but i need to subtract that data from the data i read after pressing start button so that i can read from 0 EX; if i read 300 counts already i need to subtract 300 with my present counts so i can read as 1,2,3.......(301-300,302-300,303-300......). And i press the stop button it has to stop reading data(ex: i pressed stop button after reading 350) . After again pressing start button it has to start reading data from the point where i have stopped it .(from 351.....).

 

I tried to store a data using shift regisster after pressing a stop button and subtract it with present date, but the stored value is replaced with the data that i read after pressing the stop button and i am getting value of 0.

 

how i can do implement this method?

 

Thank you

 

 

0 Kudos
Message 3 of 24
(3,776 Views)

Sorry for the confusion.

 

What actually i need is that, i start reading a serial data by pressing the run button. Now after some time when i press a start button i need to store the value which i read at that moment and subtract that value from the next reading data.

 

Ex: i read serial data by pressing run button.

when i press a strat button after few seconds (suppose i read serial data of 150 till that time), now i need to store that data(150) and subtract it with the present data.(present serial data-150) . So that i can start from 0 when i pressed my start button.

 

Thank you

0 Kudos
Message 4 of 24
(3,732 Views)

It sounds like you want something like this.  I initialize the shift register to -1.  Now when you start to store your data, you check to see if that value is negative.  If it is, update the value.  Otherwise keep the old value.  Regardless, subtract and write to the chart.

EDIT: Yes, I realized too late that I did not wire up the chart to the subtraction output.


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 5 of 24
(3,726 Views)

Mr Crossrulz thanks for the quick replay,

 

In my attached Vi, i am reading the serial data by pressing the run button in labview (actual serial data). But now i want my own data (my data)to start from zero when i press a start buttton. So, i need to store the number(serial data value) when i press the start button. Then i need to subtract the sroted number with the actual seril data so that i can read my serial data starting from zero.

 

How can i store a number (serial data value) wheni  press a start button? 

 

Thank you

0 Kudos
Message 6 of 24
(3,711 Views)

@liviya wrote:

How can i store a number (serial data value) wheni  press a start button?


That is what the shift register in my example does.


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 7 of 24
(3,699 Views)

Hello,

 

Your previous VI works as i Expected , except one thing that when i stop the case structure the read stops on display but it keeps running in background and when i start  the case structure again the value is increasing suddenly(it giving all the counts that runs in background). But i need to start again from the same value where i have stopped it. (ex:start 0    stop 300  again start 301  stop 500 again start 501 so on...............).

 

Thank you

0 Kudos
Message 8 of 24
(3,691 Views)

Ok, what exactly is the data coming in?  Because I am completely missing the point of the serial port data because you can just keep a count yourself by incrementing a number.


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 9 of 24
(3,685 Views)

Hello,

 

I have reading the radioactivity of a radioactive material from a Geiger counter. I read the continuous data but it is not necessary for me to store all the data i read. I only want to count the count rate/sec ,so i need to measure only the number of counts i am getting per second. For this reason i want to count the count rates at different times, so i wanted to start the count from zero and stop and start again . If i start again and i get a read not following the previous stop value then i get a huge count rate(false), because it is continously reading in background.

 

My aim is to read the serial data like the way i  count radioactivity on a Geiger counter. It only counts when we press start button and we can pause it by pressing the same button and can restart again and so on.

 

I need only the number of counts that i am getting for a certain time period but it doesn't required for me to read all the data i am recieving from intial to last state.

0 Kudos
Message 10 of 24
(3,682 Views)