04-04-2019 11:46 AM
Hello im trying to calculate an average for the selected section of the waveform, N amount of times to get an overall averaged waveform. however at the moment when i select a section of the waveform only the average of that waveform gets displayed. the goal is to add up all the selected waveforms and display and averaged waveform.
Thanks in advance
04-04-2019 11:55 AM - edited 04-04-2019 12:00 PM
There is no waveform data, just a 2D array. Currently you are selecting one column and limiting the averaging of that column between the two cursors. Do you simply want to do the same on the average of all columns or something else?
A lot of your code does not make a lot of sense though and could be simplified. Some things are plain wrong, for example you could combine the two property nodes. These operate top to bottom, so you need to set the active cursor before taking the position and not the other way around. It is also safe to say that using "read delimited spreadsheet" is NOT the correct tool for the attached tdms file.
04-04-2019 12:12 PM
i apologise i put in the old VI, i have attached the new VI which can read TDMS files and turn them into a 2D array. in regards to the active cursors im not too sure what you mean.
FYI i am very new to LABVIEW and not to good with the software, hope you can help
thanks in advance
04-04-2019 12:36 PM - edited 04-04-2019 12:37 PM
@da325 wrote:
in regards to the active cursors im not too sure what you mean.
Property nodes operate top to bottom, so if you read the cursor position before setting the active cursor, you are reading the position of whatever the currently active cursor was, which might be unpredictable.
It is also better to read the cursor index, which gives you directly the right index value of the array elements (but the cursors need to be locked to a plot).
You also probably want to insert a "Max&Min" to make sure the indices are sorted.
I'll have a look at the code later.
04-04-2019 01:06 PM
Hi altenbach, i just wanna say thank you for taking the time to help. I tried what you told me to do but i think my explanation wasn't too good. basically i want to load the acquired waveform data into the "Raw Data Input" graph, from here i want to select certain segments of the waveform and display the selected segment into the "Data Section" graph. if i decide to log this data then it should be displayed on the "current Data" graph and each time i select a different segment of the graph and log it it should add up and present and average waveform. the reason i'm doing this is because i'm currently working on a project which involves controlling a wheelchair with EOG signals. so to do the calibration i need the user to look either each direction, x amount of times so i can get an average of the signal and from there calculate a threshold value. i far from finished and like i said before i'm very inexperienced with LABVIEW. I really appreciate your time and patience, your advice has really helped me greatly. i have attached my full project up to date just so that you can get an idea of what i'm working on.
p.s its far from finished
04-04-2019 04:54 PM
Well, the Good News is you now have responses from at least two LabVIEW Users who know about Eye Movements (and know where to put the electrodes for an EOG). You seem to have done a reasonable job of copy-and-pasting from LabVIEW Examples, and have tried to build your code "from the bottom up". While the DAQmx part (from the Example) looks reasonable at first glance, you then throw in an Express VI for your Filter, add that awful construct, the Dynamic Data Wire, then strip off the Time information inherent in the Waveform coming out of the DAQmx Read.
Fortunately, you are "near the beginning", so saying "Start over" isn't as bad as if you had a 4-screen VI with hundreds of wires running all over the place. Here's what I recommend:
Bob Schor
04-04-2019 04:59 PM - edited 04-04-2019 05:19 PM
Sorry, I was away from the computer.
First things first: In your first small FOR loop, you need to either initialize the shift, or even simpler, just autoindex at the output tunnel. No shift register needed (See picture).
Also, the entire code seems inside/out. You should have an outer while loop and no inner while loops and a state variable that selects the current state based on the tab, for example.
I still don't understand what you want, for example if you would move the cursors between log clicks, you would get a misalignment in the data. Or do you want to sum the entire row/column instead?
04-05-2019 04:58 AM
It looks like da325 is struggling to read out all 1d-array data from the .tdms file, which works like this: