04-04-2016 11:01 AM
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
04-04-2016 11:32 AM - edited 04-04-2016 11:33 AM
@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.
04-05-2016 06:10 AM
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
04-06-2016 08:58 AM
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
04-06-2016 09:19 AM - edited 04-06-2016 09:20 AM
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.
04-06-2016 09:59 AM
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
04-06-2016 10:55 AM
@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.
04-06-2016 11:49 AM
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
04-06-2016 12:05 PM
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.
04-06-2016 12:26 PM
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.