LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save data between cursors using write to measurement file block.

Hi guys! I,ve been working on a VI for my bioengineering class and I am trying to design a VI in which I can save the data between cursors using write to measurement file block.

I will add my Vi file. Thanks for your help boys!

0 Kudos
Message 1 of 13
(1,652 Views)

Hi Stacy,

 


@StacyM=) wrote:

I,ve been working on a VI for my bioengineering class and I am trying to design a VI in which I can save the data between cursors using write to measurement file block.


That's fine! It's also fine you attached your code instead of showing just some images… 🙂

 

Is there any problem or do you just want to share some code?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 13
(1,631 Views)

Yes My VI is not saving the data between cursors and I think the problem might be related to the event structure, it appears that the program gets stuck on an infinite loop when there are no changes in the "acquire" button. But I included that event structure because if I didn't, the values of the wave graph were deleted. Can you help me fix this problem.

 

Regards Stacy

0 Kudos
Message 3 of 13
(1,615 Views)

An Event Structure will return *only* when an event is triggered. In your case, it will only ever return when Acquire is clicked. It's not an infinite loop exactly, more just it gets stuck waiting forever.

 

A proper architecture here would help (like a Producer-Consumer), but if you're just kinda trying to get something quick and dirty you aren't terribly far off.

 

Your problem is the nested loops. You only need one loop for this task. Add another event to the Event case that's a Timeout event, and put the Timeout value in a shift register. Put the DAQ Assistant task in the Timeout case.

 

Add another Event case for clicking the Acquire button. If it's True, change the value in the shift register to 0. If false, to -1 (that will disable the Timeout case, so your DAQ Assistant won't get called).

 

Last, put the code for your Acquire inside the event case. Right now, the acquisition happens EVERY loop, and you only want it to happen once.

 

Try something like the attached. It's super quick and dirty and I don't have DAQ hardware hooked up, so it's untested, but it should be close and will at least get you moving forward.

Message 4 of 13
(1,607 Views)

Hey Stacy,

What do you mean by saving data between cursors?

Message 5 of 13
(1,559 Views)

I want to save the data that is delimited by my cursors in the waveform graph. Only selected data between two cursors will be saved.

 

0 Kudos
Message 6 of 13
(1,548 Views)

Thanks a lot I cant open the file you attached im using labview 2019.

0 Kudos
Message 7 of 13
(1,537 Views)

Sorry about that. Try this one.

Message 8 of 13
(1,528 Views)

Thank you! I added A waveform chart because I need it for my waveform graph to show all data read by the instrument. with an indexing while loop for it. This changed the data types so I also added a waveform array to waveform block to fix compatibility between the cursors functions. Now the problem I am still having is that its saving but the excel file its empty. No data point are shown in the excel file that its generated when pressing save button.

0 Kudos
Message 9 of 13
(1,517 Views)

How often are you trying to save? Every 1000, 2000, 3000, 4000 ms...?

 

 

What is your major? Bioengineering?

 

0 Kudos
Message 10 of 13
(1,494 Views)