필터 지우기
필터 지우기

Arduino external mode USB - Virtual Desktops

조회 수: 2 (최근 30일)
Cristiano Cumer
Cristiano Cumer 2017년 4월 7일
답변: Gillian Rosen 2017년 4월 11일
Hello,
we are trying to make simulink and arduinos work in external mode with our VDI infrastructure. We are using Horizon View and we are redirecting the client USB per IP to VMs in our datacenter. Compiling and deploying works, we have issues when we sample data over 200Hz, I presume the added latency is the culprit here. Is there a way to compensate for the higher latency caused by the USB redirection?
Cristiano

답변 (1개)

Gillian Rosen
Gillian Rosen 2017년 4월 11일
Hi Cristiano, 
I understand that you are running a simulation in External mode on Arduino through a Virtual Desktop interface, but you are encountering issues when you try to sample at over 200 Hz. 
First, please note that MATLAB is not qualified against virtual desktops, and therefore, virtual desktop operations are not guaranteed to perform as expected. 
If you are experiencing lagging data or missing data points, you may be able to correct this by changing the Duration parameter in your model's External mode settings. 
The Duration value specifies the number of contiguous points of data to be collected in each buffer of data-  this value should be large enough that the time it takes to send the data is less than the times it takes to log the next packet of data. If you enter a value less than the number of available sample points since the previous sent packet, you may lose sample points during the time spent transferring values from the data buffer to the MATLAB workspace.
To set this value, please use the following steps:
1. Under the 'Code' tab in the Simulink window, select 'External Mode Control Panel'.
2. Open the 'Signal and Triggering...' window.
3. Set the Duration parameter.
4. Click 'OK' to apply your changes and close the window. 
By default, the Trigger duration for Arduino models is set to 2. To prevent loss of data, increase the duration to  a value greater than 2 (For instance, for a sample time of 1 ms, set the Duration to 10).
For more details, please see the following documentation link:

카테고리

Help CenterFile Exchange에서 MATLAB Support Package for Arduino Hardware에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by