07-06-2016 11:48 PM
Hi everyone,
I'd like to send a signal in a water pipe system and the signals will be converted to wave signals by transducers. At the end of water pipe I have another transreceiver that it will read signals and I'll be sampling them at range of 200Khz. There were some inconvenience:
1-)Memory allocation
2-)Syncronization problem with transmitting and receiving part
The problem with memory allocation might be solved with using producer-consumer structure as you could see in the attached file. However, this program is only saving 1 second of data into one file. I want to improve that to up to 1 minute. I added a control to wait function but this time it's creating file according to my control but writing the datas only in 1 sec. Could you guys help me on that?
As for the second part, I would like to send my own function as a signal so I plan to use mathscript structure. However, the issue with this part is that I need to syncronize it with receiver part and they should have a same clock. I also need to see the time difference between the signal that's transmitted and it's received.
Any suggestions?
Mecit
07-07-2016 08:52 AM
Few concerns on the code?
what is the pupose of "Folder Name Sequencer Loop" really looping concept is required for creating a path?
Create Queue with Proper Name
Better to use Wait until next milli second instead of wait
You can use Loop iteration value for file name instead Shift register
you can use single stop button for stopping both loops
07-15-2016 05:47 AM
I have modified to the following version. I have got a problem with this one, I can't use the dt_TR points as the sampling points. I wanna have a plot of syncronized time for both receiver and sending side so that I can see the time difference between the first signal send and first signal received.
Do we have similar examples that I can follow?
07-18-2016 10:03 AM
Hello agungor,
Briefly looking at your code and application. I think the documents below may possibly help.
Synchronization Explained - http://www.ni.com/white-paper/11369/en/
Getting Started with DAQmx: Synchronization in NI-DAQmx - http://www.ni.com/tutorial/5471/en/
One thing that I did notice is that in your code you use the DAQ assistant. While it might be simple to set up things using that VI, I would suggest that if you need more explicit functionality like timing and sync you might fare better with DAQmx VIs.
Also be sure to check out the shipping examples in the NI example finder which talks about timing and sync functions and methods.