Hi,
In order to acquire analog data, I use the Analog Discovery 2 from Digilent. I used the "Data Acquisition Toolbox" and the "Digilent Analog Discovery Support from MATLAB" package.
I achieve to get data in a tab and want to automatically launch the acquisition when the power is high enough. Maybe using a trigger ?
I also can't use the App, my device doesn't appear and the "Refresh" button doesn't change anything.
If someone already used this device can help me !
Thanks

 採用された回答

Brian Hu
Brian Hu 2018 年 11 月 26 日

0 投票

Hi Christophe,
There are a few workflows that you may be interested in looking into. First, make sure that you can detect the Analog Discovery 2 on a separate Digilent software to make sure that your issue is not due to hardware connection. Please also make sure that you have the correct support package for Digilent Analog Discovery Hardware downloaded. I have included the support package in the link below.
After verifying this, you will want to successfully connect to the Analog Discovery 2 device through MATLAB then transmit and receive data. The examples below might be useful for you to get started.
Lastly, if you are interested in launching acquisition when a certain variable reaches a threshold or triggers, you may want to consider using MATLAB callbacks to accomplish this. An alternative would be to have a control for loop within the code that triggers when the power read from the device exceeds your intended threshold. If you are interested in using callback functions, here are a few links that may be helpful.

4 件のコメント

Christophe Combaud
Christophe Combaud 2018 年 11 月 27 日
Hi Brian,
Thank you for your answer.
The Support Package is included and it works. But the device still not appears in the "Analog Input Recorder" App.
I achieve to receive data and to save it. For my project I have an signal emitted every 15s which last 1s, see picture below. Currently, to record it I have to set a 20s acquisition and to select manually the data containing the message.
I saw the two links of your message and the "Software-Analog Triggered Data Capture" is interesting. But I have a few problems :
ch1.TerminalConfig = 'SingleEnded';
>>> For this type of channel, the 'TerminalConfig' property is not settable. It has a value
of 'Differential'.
As I can't configure it, it is necessarily 'Differential'.
s.IsContinuous = true;
>>> You cannot use the "IsContinuous" property with Digilent hardware.
It mains that I can't let the device run automatically ?
startBackground(s);
>>> Method 'startBackground' is not supported on objects of class 'daq.di.Session'
I think I can't acquire and do operations in the mean time.
message.png
Brian Hu
Brian Hu 2018 年 11 月 27 日
I believe the reason why you cannot see the device on the Analog Input Recorder app is due to the fact that the Support Package provides extra functionalities and accessibility for MATLAB to use the device, but it may not provide an interface through the Analog Input Recorder app.
If you are interested in acquiring data from the device every 15 seconds, but you do not require an incredibly precise measurement of time, one approach you can try is to use the inputSingleScan(s) function within a for loop that pauses for 15 seconds between iterations. Ultimately, it will depend on your workflow and what you are trying to accomplish, but by doing this you can perform other tasks such as processing data within the same loop if necessary.
Christophe Combaud
Christophe Combaud 2018 年 11 月 28 日
I think that the function 'inputSingleScan(s)' may be a solution but how can we launch it when we have the first emission ? Because if we launch it when there is no emission, we will miss others.
Brian Hu
Brian Hu 2018 年 11 月 28 日
Please refer to the following documentations for the current hardware limitations with Analog Discovery devices.
If you want to use a digital trigger, this example might be helpful for you to get started.
Otherwise, you can also try rapidly triggering inputSingleScan until the first signal is read, then follow with startForeground in order to capture data. Like you mentioned previously, there is currently no functionality for startBackground with the device you are using.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeData Acquisition Toolbox についてさらに検索

製品

リリース

R2018b

質問済み:

2018 年 11 月 19 日

コメント済み:

2018 年 11 月 28 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by