01-18-2017 07:10 AM
Hello to everyone,
I want to ask you a question about data collection. I have a system of eight sensors. My aim is to record data from these sensors. I have a logic signal to determine when I get data from these sensors. But the time between the signals is not constant. I get about 2000 trigger signals in a second. I have usb 6210 and pci 6010 cards. My problem is;
I want to get 1 data from sensors with every trigger signal.
(trigger signal > sensor1>sensor2>...>sensor8> wait until next trigger signal>trigger signal>sensor1>....).
But the n samples option can be at least 2. How can i do it?
Also, with cards that I have, is it possible to carry out this event?
I was able to get data with the 6210 card using PFI inputs (2 or more data for each sensor).
I would be glad if you help.
01-19-2017
02:31 PM
- last edited on
02-16-2025
10:00 PM
by
Content Cleaner
Hello,
I dont know if I fully understand the situation here, especially since it sounds like you want either 1 sample per sensor per logic analyzer tick, or n samples per sensor per logic analyzer tick. If you only want 1 sample per sensor per logic tick, what I would recommend is as follows.
Set up a continuous analog task that can hold all of your analog channels. When you configure your sample clock timing, set the source to be any PFI line on the device. That is the PFI line that you should connect your logic signal. What this is going to do setup the sample clock of your task to be the logic analyzer signal so that ever tick will create a pulse, even if the signal is uneven.
If you want to do n samples per sensor per logic analyzer tick, then there are going to be some difficulty that goes with that, and I do not believe that your devices will be able to handle that since they do not support retriggerable tasks. I would then recommend an X series card like the NI USB-6341.
https://www.ni.com/en-us/shop/model/usb-6341.html
Best,
Shamik C
Applications Engineer
National Instruments
01-19-2017 03:38 PM - edited 01-19-2017 03:39 PM
Dear ShamWOW!!,
thanks for your answer. my native language is not English, so sorry for my possible incorrect sentences. i attached a file about what i want to do. i have an encoder. it gives me 1024 pulses for every turn. but the distances between pulses are not constant. approximately it gives 2kHz frequency (average) for motion of my motor.So my aim is,
when i get 1st trigger->read sensor1-sensor2-sensor3-...-sensor8 data->wait until next trigger,when i get 2nd trigger->read sensor1-sensor2-sensor3-...-sensor8 data->...
thanks for your answer.
01-19-2017 04:12 PM
Okay,
Then I recommend the first step where you make the encoder into your sample clock. This should work, even if irregular. You can do this pretty quickly by modifying an example DAQmx VI, and I recommend Voltage - Continuous Input.vi from Help >> Find Examples.
From there, change the sample clock source input to your PFI line with the encoder, and then change the Physical Channels input to list out the channels you are using.
01-26-2017 02:31 AM
Dear ShamWOW!!,
thanks for your reply. i modify the example program for my system (attached). i want to ask you a question - i hope the last 🙂 - ;
How can I be sure that the program stores the data at the time I want? Because the time column is not found in the data I recorded. Thank you for your interest.
Mustafa.
01-26-2017 05:53 PM
This community example demonstrates how to add timestamps to a TDMS file.
http://forums.ni.com/t5/NI-DAQmx-Examples/Write-Data-Events-to-a-TDMS-File/gpm-p/3503233
02-17-2025 07:56 AM
Maggie, that link didn't work for me.
This forum post also shows how to add a timestamp channel to a TDMS log file.
https://forums.ni.com/t5/LabVIEW/Data-Logging-using-Write-to-TDMS/m-p/3238910#M942726