LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving acquired data in a new channel or sheet (TDMS) automatically after trigger cycle

Hello LabVIEW enthusiasts,

 

I have a VI which I want to use to acquire data from a process. I already managed it to save the acquired data and to trigger the acquisition like I want it to. My problem is to change the column or the sheet (both would be ok) in which the data is saved inside the TDMS file with every new acquisition trigger. My solution would be to change the group name of the TDMS every time the data acquisition is triggered off or on, so the future data would be saved in a new sheet. Unfortunately I'm not able to implement my idea into LabVIEW.

 

Does anybody has an idea how to automatically save the incoming data in a new column or sheet after every trigger cycle?

 

Attached is a picture and my current VI. I'm using LabVIEW 2014.

 

channel.PNG

0 Kudos
Message 1 of 16
(4,227 Views)
It's quite simple to implement your requirement , changing group name depends on trigger but what are the group names , whether do you have fixed number of group names?

Make sure you have different group names and feed to write tdms file based on your trigger point.
----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 16
(4,222 Views)

The simplest way would be to have a number at the end of the group name.  You can store the number in a shift register and increment it each time the TRUE case is called.

 

Also, there is no need for that Express VI which converts the data to a Dynamic Data Type (which many of us concider evil).

 


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 3 of 16
(4,220 Views)

Hey guys,

 

Thank you very much for your fast reply and the tip with the evil data 😛

 

Trying your solution, I end up with the problem that the VI is producing a new sheet for every value that is written to the tdms file. I think it is because the case structure is executing every time a true or false value comes in and that happens, depending on the sample rate, every 10ms.

 

Maybe it makes sense to create a second case structure that executes only once when the trigger signal comes in? But I have no Idea how to trigger this second case structure.

0 Kudos
Message 4 of 16
(4,204 Views)
Just let us know. Based on what you need to create new group. How your group should look like?
If you are clear with this then you will get the answer.
----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 5 of 16
(4,182 Views)

@ZMK16 wrote:

Trying your solution, I end up with the problem that the VI is producing a new sheet for every value that is written to the tdms file. I think it is because the case structure is executing every time a true or false value comes in and that happens, depending on the sample rate, every 10ms.


Perhaps the trigger level is not high enough?  Or did you put the same code in the FALSE case as well?  Can you share what your typical data looks like?  You could also add some logic to only increment if the previous loop had a false.


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 6 of 16
(4,179 Views)

The Channel names should be like example1, example2, example3.

I did not put the same code in the false structure 😛

 

The data I'm working with is like a sine wave that variates between 0 and 8 and I want to save the part of the signal that is higher than 5 and would like to have a different sheet for every sine wave peak.

0 Kudos
Message 7 of 16
(4,157 Views)

First Differentiate or separate sine wave peak, then use shift register logic to increment suffic with example1,exmaple 2 etc for every interval of sine wave peak.

 

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 8 of 16
(4,155 Views)

@ZMK16 wrote:

The data I'm working with is like a sine wave that variates between 0 and 8 and I want to save the part of the signal that is higher than 5 and would like to have a different sheet for every sine wave peak.


Ok, those are different requirements.  In that case, we need to first find the section of read data that is greater than your threshold and then just log that.


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 16
(4,148 Views)

In the existing code after finding the Peak Detection use the attached logic for dynamically creating Group NameGenerate Group name for TDMS.png

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 10 of 16
(4,145 Views)