LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need an explaination on resetting and then plotting the data

Solved!
Go to solution

Hi,

 

I am new to Labview and I am trying to learn it for school, but I am stuck with a question I can't find the right answer for at the moment or how to find that answer.

 

I have made a block diagram that sents data to 2 waveform charts and data to Microsoft Excel.
For my experiment I want the data to be stored every 5 milliseconds into excel and everytime it has beent sent it needs to reset.
In the current state of my block diagram it keeps adding up the data instead of refreshing.
Does anyone know how to write the code or solve this problem.

 

Greetings,

 

JorisRoz

Download All
0 Kudos
Message 1 of 8
(2,922 Views)

(I cannot see your DAQ assistance configuration).

  • From the 10 ms wait, your loop runs every 10ms, which is 100Hz (not 10Hz as you labeled it).
  • You cannot store every 5ms if the loop runs with a 10ms period.
  • You probably should not wire the start time at all, check the help.
  • What is "it" that should reset? (the file? The time?). Do you really want to overwrite the current file every time, keeping only the newest data?
  • ...
Message 2 of 8
(2,800 Views)

First of all thank you for your reply, as you can see I am fairly new to the software.

(I cannot see your DAQ assistance configuration).

I am using a CountEdges input with the NI-USB6009, I've connected a tachometer to it.

  • From the 10 ms wait, your loop runs every 10ms, which is 100Hz (not 10Hz as you labeled it).
    I have changed it to 5ms and changed the label to 200 Hz.
  • You cannot store every 5ms if the loop runs with a 10ms period.
    Done.
  • You probably should not wire the start time at all, check the help.
    Checked it and deleted it.
  • What is "it" that should reset? (the file? The time?). Do you really want to overwrite the current file every time, keeping only the newest data?
    Sorry for not being clear the first time, I am gonna try my best to explain it as well as I can;

    At the moment I am sending the gathered data to excel, for example every 2 seconds I get the amount of pulses there have been in total, but what I actually want is the generated amount of pulses every 2 seconds. So every 2 seconds (or in my case every 5 milliseconds) I want to get the pulses that had happened in the period of those 2 seconds. 
    Is it possible to store this in a way it keeps all the data in one Excel-Document and doesnt delete the past data?
    EDIT: I have added a png file what the state of excel is atm.

    Greetings,

Joris

0 Kudos
Message 3 of 8
(2,781 Views)

I think I've might just accidentely deleted my own comment whoops...

Thanks for your reply, as you can see I am fairly new to the software.

(I cannot see your DAQ assistance configuration).

The DAQ assistant I am using is a CountEdges input, I use the USB-6009 and I've connected it to a tachometer.

  • From the 10 ms wait, your loop runs every 10ms, which is 100Hz (not 10Hz as you labeled it).
    Fixed it. Changed it to 5ms and changed my label to 200Hz.
  • You cannot store every 5ms if the loop runs with a 10ms period.
    Understood.
  • You probably should not wire the start time at all, check the help.
    Deleted the the start time.
  • What is "it" that should reset? (the file? The time?). Do you really want to overwrite the current file every time, keeping only the newest data?
    Sorry I couldn't explain it right the first time, so let me try again;

    I want the data stored in my excel document every 5 milliseconds, what the problem is, is that the data keeps stacking. So if I received a total of 20 pulses the first 5 milliseconds and then the next 5 milliseconds I received 19 pulsess, it will display 39. But I want it to display 20 and then 19, is there a good way to solve this? (See attachment for the current state of my excel document).

Greetings,

 

Joris

0 Kudos
Message 4 of 8
(2,778 Views)

Hi,

 

Wanted to let you know that I had an euraka moment and I've solved the problem, thanks for your time 🙂

 

Greetings,

 

Joris

0 Kudos
Message 5 of 8
(2,763 Views)

@Jorisroz wrote:

Hi,

 

Wanted to let you know that I had an euraka moment and I've solved the problem, thanks for your time 🙂

 

Greetings,

 

Joris


Your "Eureka!" moment might be someone else's, too!  You may be helping the next person by posting what you did and then marking it as the solution.  Never underestimate the importance of your solution just because you are new to something.  🙂

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 6 of 8
(2,750 Views)

Jorisroz wrote:

Wanted to let you know ...


Sorry, it was 3:30 in the morning in my part of the world and I went to sleep after my message above.

Message 7 of 8
(2,742 Views)
Solution
Accepted by topic author Jorisroz

Hi!

 

I solved it with making a shift register and substracting the new result with the previous result. After this it sent the correct amount of pulses each time instead of adding them all up :-).

 

Greetings,

 

Joris

0 Kudos
Message 8 of 8
(2,728 Views)