LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Logging multiple analog and counter signals with the same sampling rates

Also I forgot to ask. When measuring angular position it requires the use of an external clock signal designated. In order to get the VI running I used one of the counter channels coming in from the encoder, could this be skewing my data in anyway?

 

Thanks, 

 

Pat

0 Kudos
Message 11 of 19
(646 Views)

Hi Pat,

 

Would you mind reposting your code? I'm wondering how it's set up that's causing it to take two seconds or so to refresh. Does this only happen the first time, or is the data continuously only refreshed every two seconds as the application runs?

 

Can you clarify what you mean by refreshing every 4X you buffer size? When you say that running continuously causes the same issue before are you referring to error -200279?

 

There could be an issue with how you have your clocks set up to work together, getting more information will help me narrow this down.

 

Thanks!

Emily C
Applications Engineer
National Instruments
0 Kudos
Message 12 of 19
(641 Views)

Hi Emily, 

 

 

Sorry for the delay, I've been swamped.

I've posted the code that logs but takes 2 seconds or so to refresh the display. This happens continuously when I'm running the VI. This VI has the name ending with "quad Frequency"

 

As far as the "refreshing every 4X the buffer size" goes, that was for another VI I had made to log angular position. What I meant by that was, depending on what I set for "samples to read" in the DAQ assistant, the log would refresh every 4X that number. So if I would set the "samples to read" to 1k then every 4k samples the count would restart at zero instead of continuing on to infinity.

When I mentioned that running the VI continuously gave me the same error I was indeed referring to error -200279. I've attached this VI as well, the name ends with "quad counter".

 

If you're leaning towards this being a clock issue, I did try using an RTSI cable to sync everything but it didn't really get me anywhere. This could just be an issue with me not knowing how to use it properly.

 

Thanks Again,

 

Pat

 

 

0 Kudos
Message 13 of 19
(634 Views)

Hi Pat,

 

Is it possible you accidentally posted the wrong file? You said in your last post that you managed to get rid of all the Express VI's except for the DAQ Assistants and Write to File, but this code looks the same as what you posted originally.

If this is the right code, it makes sense that you would have a 2 second lag. Having that many Express VIs in a while loop will take a long time, 2 seconds would be understandable.

 

Please verify that these are the file you meant to upload, and I can look into why your log is refreshing every 4k samples.

 

Thanks!

Emily C
Applications Engineer
National Instruments
0 Kudos
Message 14 of 19
(615 Views)

Hi Emily, 

 

I posted that file with the express VI's because there wasn't two much of a difference in how the VI ran when I converted them to lower level functions.  

 

Thanks, 

 

Pat

0 Kudos
Message 15 of 19
(613 Views)

Hi Pat,

 

Could you please post the file without the Express VIs as well? I'd like to compare the performance between the two. Even with fewer Express VIs their setup could be related to the delay you're seeing, and it will be easier to investigate if there were fewer to look into.

 

Thanks!

Emily C
Applications Engineer
National Instruments
0 Kudos
Message 16 of 19
(605 Views)

Hi Emily, 

 

Here's the VI sans express VI's.

 

Thanks,

 

Pat

0 Kudos
Message 17 of 19
(601 Views)

Hi Pat,

With the current setup of your Frequency VI, the two second refresh still sounds reasonable. Every time the Write to Measurement File VI runs it has to open the file, write all the data, then close the file. Along with the other code, this could easily be taking that long. Try adding an indicator to the increment counter of your while loop (the i in the bottom left corner on the while loop). Run your VI for a set amount of time (say, 20 seconds) then see how many times the loop incremented during that time.
If you want this to execute faster, I suggest you move the Write to File outside of your while loop. You'll need to save the data to an array to save until you write it out.
You could also move to lower level writing functions. That way you could open the file once before entering the while loop, then pass the reference in to lower level write to file functions (for example, TDMS Write). Cutting out the overhead of the Write to Measurement File VI would help your loop execute faster.

 

For the other VI, can you try seeing how far you can simplify it down while still seeing this resetting? For example, if you just have your DAQ Assistants without all of the processing, does the data still reset?

 

Thank you,

Emily C
Applications Engineer
National Instruments
0 Kudos
Message 18 of 19
(585 Views)

Hi Emily, 

 

Give your suggestions a try. I've had our flowbench in a different configuration for some other testing, I should have some thing on the bench spinning soon though, so I can keep working on this. 

 

Thanks,

 

Pat

0 Kudos
Message 19 of 19
(562 Views)