How to use the external trigger synchronizing both Ni modules

Hello,
I tried to acquide the Analog data using two Ni devices PXIe 6358 and applied the external trigger conntected to PFI1 which belongs to one PXIe 6358.
I wrote the following scripts and ran it:
dq = daq("ni");
for module = ["PXI1Slot2", "PXI1Slot3"]
addinput(dq, module, 0:15, "Voltage");
end
addtrigger(dq, "Digital", "StartTrigger", "External", "PXI1Slot2/PFI1");
addtrigger(dq, "Digital", "StartTrigger", "External", "PXI1Slot3/PXI_Trig0");
dq.Rate = 1.25e+6; % 1.25MS/s
daqDuration = 0.2; % [sec]
dq.DigitalTriggerTimeout = 60;
dq.ScansAvailableFcnCount = dq.Rate * daqDuration;
start(dq, "duration", daqDuration)
After I provieded the triger source to PFI1, I recieved the following errors:
Warning: Error occurred while executing the listener callback for event DataWritten defined for class asyncio.InputStream:
Error using daq.internal.BaseClass/localizedError (line 157)
Internal Error: The trigger timestamp was not received.
Error in daq.ni.AsyncIOInputChannel/getTriggerTimestamp (line 312)
obj.Session.localizedError('daq:Session:TriggerTimestampNotReceived');
Error in daq.ni.ChannelGroupAnalogInput/getTriggerTimestamp (line 306)
triggerTimestamp = obj.AsyncIOChannel.getTriggerTimestamp;
Error in daq.ni.Session>@(idx)channelGroups(idx).getTriggerTimestamp() (line 2451)
getTimestamp = @(idx) channelGroups(idx).getTriggerTimestamp();
Error in daq.ni.Session/setTriggerTime/getTriggerTime (line 2457)
timestamps(index) = getTimestamp(index);
Error in daq.ni.Session/setTriggerTime (line 2427)
aiTriggerTime = getTriggerTime('ai', defaultTriggerTime);
Error in daq.ni.Session/handleMultipleDataSources (line 169)
setTriggerTime(obj);
Error in daq.ni.AsyncIOInputChannel/handleMultipleDataSources (line 246)
obj.Session.handleMultipleDataSources(dataAvailable, channels, double(obj.ChannelGroup.NumScansConfigured));
Error in daq.ni.AsyncIOInputChannel>@(varargin)obj.handleMultipleDataSources(varargin{:}) (line 133)
'DataWritten', @obj.handleMultipleDataSources);
Error in asyncio.Channel/onDataReceived (line 487)
notify(obj.InputStream, 'DataWritten', ...
Error in asyncio.Channel>@(source,data)obj.onDataReceived() (line 425)
@(source, data) obj.onDataReceived());
> In asyncio/Channel/onDataReceived (line 487)
In asyncio.Channel>@(source,data)obj.onDataReceived() (line 425)
I successfully implemented the code when I tried to only one Ni module.
Does anyone help me!
Thank you in advance.

Answers (0)

Categories

Products

Release

R2020a

Asked:

on 6 Aug 2020

Community Treasure Hunt

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

Start Hunting!