03-23-2018 07:14 AM - last edited on 03-23-2018 08:30 AM by Kristi_Martinez
Hi,
My application does 2 main thing:
1) acquire data (the signal of the analog output channel)
2) controlling parameters of an AC motor.
this VI is under the name: Trail of Main 2. I took this VI (that works) and I wanted to upgrade the acquired signal and analysis part, using the producer consumer pattern. this VI is under the name: Trail of Main 2- with producer consumer. I took the analysis part of the signal and moved it to the consumer loop which there I also want to save the data.
the motor loop is irrelevant to my problem.
I don't know why I get an error, I followed the instruction in the NI web for TDMS files and the producer consumer.
I want the user to have the ability to choose the path and name of the new file.
thanks in advanced,
Naama 🙂
Solved! Go to Solution.
03-23-2018 07:46 AM
and the files as explained in the previous message
03-23-2018 09:49 AM
This is a strange error that doesn't seem to have anything to do with TDMS or the basic Producer/Consumer stuff, but may involve other not-so-transparent parts of your code.
When dealing with a complex system, with DAQ, Motor Control, TDMS, Filtering, etc., it sometimes helps to write a simple "Simulation" version of your system. Doing this, you can test pieces of your code in isolation, and can even simulate "what you think you want" and test other assumptions that you have been making.
Below is a Snippet (and I'll try to remember to attach the Actual VI) of your routine with the DAQ stuff stripped out, and a WaveForm consisting of a 2KHz sinusoid, a 30Hz sinusoid, and noise generated at the frequency you are specifying for your sampling (i.e. 500KHz, seems way too high) in the Producer Loop. The Consumer Loop does the BandPass-Rectify-LowPass operation and writes to a TDMS file and a Chart. I'll point out some significant changes.
This code runs without errors. Because of the Rectify/LowPass filter, no high frequency components of the original signal are present in the TDMS data. In particular, the "known" 2KHz sinusoid is mostly removed. Thus you can probably reduce your sampling rate to something like 10KHz (instead of the what-seems-to-be-completely-ridiculous 500KHz rate) and still capture all the "data you want to study" (everything else at frequencies above 30Hz is largely filtered out).
Bob Schor