与Matlab并行阅读两种签证工具

时间:2015-10-27 12:38:34

标签: matlab visa spmd

我尝试与Matlab(2015a)并行读取两台Keysight示波器的数据。为此,我使用并行计算工具箱和spmd命令。我有一个函数来读取接受签证对象作为参数的数据并返回rawdata。这样在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.

任何想法出了什么问题?

干杯 尼尔斯

1 个答案:

答案 0 :(得分:1)

spmd块体上操作的工作人员是单独的进程。我认为您需要在fopen内拨打spmd,例如:

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