使用 Matlab 并行读取两份签证文书

Read two visa instruments in parallel with Matlab

我尝试使用 Matlab (2015a) 从两台是德科技示波器并行读取数据。为此,我将并行计算工具箱与 spmd 命令结合使用。我有一个函数来读取接受签证对象作为参数和 returns 原始数据的数据。这在像这样的 spmd 命令之外工作正常(scope1 和 scope2 是开放签证对象):

scope = {scope1, scope2}
scopedata1 = scopeGetCh1Raw(scope{1});
scopedata2 = scopeGetCh1Raw(scope{2});

我从两个示波器获取数据。

如果我这样做:

spmd
    scopedata = scopeGetCh1Raw(scope{labindex});
end

我收到以下错误:

Error detected on workers 1 2.

Caused by:
    Error using icinterface/fprintf (line 147)
    OBJ must be connected to the hardware with FOPEN.
    Error using icinterface/fprintf (line 147)
    OBJ must be connected to the hardware with FOPEN.

知道出了什么问题吗?

干杯 尼尔斯

在您的 spmd 块主体上运行的工人是独立的 进程 。我假设您需要在 spmd 中调用 fopen,例如:

spmd
    myScope = fopen(...); % do whatever to open the scope
    scopedata = scopeGetCh1Raw(myScope);
end