07-14-2016 01:35 PM
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.
07-14-2016 01:50 PM
07-14-2016 01:52 PM - edited 07-14-2016 01:53 PM
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).
07-14-2016 03:03 PM
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.
07-14-2016 08:30 PM
07-14-2016 08:40 PM
@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.
07-15-2016 06:57 AM
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.
07-15-2016 07:05 AM
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.
07-15-2016 07:22 AM
@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.
07-15-2016 07:27 AM
In the existing code after finding the Peak Detection use the attached logic for dynamically creating Group Name