10-09-2023 07:31 AM
Dear all,
I have a setup composed of a MCT sensor and a lock-in amplifier (SRS 830). The signal detected by the sensor is modulated at 1kHz. The SRS 830 provides two analog channels from where you can read directly the amplitude and phase of the detected signal. These two channels are connected to a NI-6210, with the amplitude channel output being connected to the A1/A19 screw terminals and the phase channel output being connected to the AI2/AI10 screw terminals.
I am trying to setup a Python script using the NI-DAQmx driver to store the data pertaining amplitude and phase. I would like to understand how I could use the internal clock to set the number of samples per second to be registered, as well as how to properly setup the Numpy array where the data will be stored, as stated in the read_many_sample() routines.
I have had difficulties understanding the documentation, as I felt it was done in a very "insider" fashion, with little to no introduction for the beginner who opted to use a DAQ system. I also tried to get hold of the API-agnostic NIDAQmx help file, but it seems I cannot find it at all. Anyone has had the same problem? All my software was installed via the NI Package Manager.
Kind regards,
Alcides
Kind regards,
Solved! Go to Solution.
10-09-2023 09:07 AM
You can refer to NI-DAQmx Python Documentation and nidaqmx-python/examples
10-09-2023 09:41 AM
Thanks for your swift reply. Unfortunately, there is no example where I can see explicitly how to use the internal clock of the NI 6210 for AO situations. I would like to control the sampling ratio for each channel, in order to easily calculate a priori the size of the Numpy array to be used in the read_many_sample() function (https://nidaqmx-python.readthedocs.io/en/latest/stream_readers.html). The idea is that, if triggered properly, I would have a fix number of samples that could be binned afterwards for each specific step of my measurement.
10-09-2023 09:51 AM
@Flonares wrote:
Thanks for your swift reply. Unfortunately, there is no example where I can see explicitly how to use the internal clock of the NI 6210 for AO situations. I would like to control the sampling ratio for each channel, in order to easily calculate a priori the size of the Numpy array to be used in the read_many_sample() function (https://nidaqmx-python.readthedocs.io/en/latest/stream_readers.html). The idea is that, if triggered properly, I would have a fix number of samples that could be binned afterwards for each specific step of my measurement.
nidaqmx-python/examples/pwr_hw_timed_stream.py at master is using streaming and hardware timing of the sample clock. You can modify it for AO task.
10-30-2023 04:26 AM
Now comes the second part. I wish to start collecting data using a physical trigger. Unfortunately, I don´t seem to understand how to write in Python how to start measurement with an incoming trigger.
The idea would be - after getting a trigger, record P points during T time and stop acquisition. Can someone provide me with a minimal work example of how to make the NI-6210 start recording data after getting a trigger?
10-30-2023 08:02 AM
See my examples in python-ni-examples/nidaqmx_examples at main · ZhiYang-Ong/python-ni-examples · GitHub