Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bonsai Crashes with PCIE-6321during execution of digital output from DAQmx library #20

Open
aseiffe opened this issue Jan 3, 2025 · 2 comments

Comments

@aseiffe
Copy link

aseiffe commented Jan 3, 2025

Hi everyone,

I'm trying to set up a simple go/no-go task using Bonsai with my National Instruments PCIE-6321 device. However, I keep encountering an issue where Bonsai crashes when I attempt to run even a very basic workflow.

Here is the error message displayed in the prompt:

Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at nNIMSAI100.tChannelListCache.getChannelListForInitialization(tChannelListCache* ) at NationalInstruments.DAQmx.Channel..ctor(Task task, tCaseInsensitiveBasicString<unsigned short,_STL::char_traits,_STL::allocator,nNIDMXS100::tLocaleConsideringWideStringComparitor,nNIDMXS100::tLocaleConsideringWideStringCaseForcer>* virtualChannelName, tCaseInsensitiveBasicString<unsigned short,_STL::char_traits,_STL::allocator,nNIDMXS100::tLocaleConsideringWideStringComparitor,nNIDMXS100::tLocaleConsideringWideStringCaseForcer>* physicalChannelName, Int32 usageType, tChannelType channelType, tLineGrouping lineGrouping, tCaseInsensitiveBasicString<unsigned short,_STL::char_traits,_STL::allocator,nNIDMXS100::tLocaleConsideringWideStringComparitor,nNIDMXS100::tLocaleConsideringWideStringCaseForcer>* customScaleName) at NationalInstruments.DAQmx.DOChannel..ctor(Task task, tCaseInsensitiveBasicString<unsigned short,_STL::char_traits,STL::allocator,nNIDMXS100::tLocaleConsideringWideStringComparitor,nNIDMXS100::tLocaleConsideringWideStringCaseForcer>* virtualChannelName, tCaseInsensitiveBasicString<unsigned short,STL::char_traits,STL::allocator,nNIDMXS100::tLocaleConsideringWideStringComparitor,nNIDMXS100::tLocaleConsideringWideStringCaseForcer>* physicalChannelName, tLineGrouping lineGrouping) at NationalInstruments.DAQmx.DOChannelCollection.CreateChannel(String lines, String nameToAssign, ChannelLineGrouping grouping) at Bonsai.DAQmx.DigitalOutput.CreateTask() at Bonsai.DAQmx.DigitalOutput.<>c__DisplayClass33_01.b__0() at System.Reactive.Linq.ObservableImpl.Defer1.Eval() at System.Reactive.Linq.ObservableImpl.Defer1..Run() at System.Reactive.Linq.ObservableImpl.Defer1.Run(IObserver1 observer, IDisposable cancel, Action1 setSink) at System.Reactive.Producer1.SubscribeRaw(IObserver1 observer, Boolean enableSafeguard) at System.ObservableExtensions.SubscribeSafe[T](IObservable1 source, IObserver1 observer) at System.Reactive.Linq.ObservableImpl.Do1.Run(IObserver1 observer, IDisposable cancel, Action1 setSink) at System.Reactive.Producer1.SubscribeRaw(IObserver1 observer, Boolean enableSafeguard) at System.ObservableExtensions.SubscribeSafe[T](IObservable1 source, IObserver1 observer) at Bonsai.Expressions.InspectBuilder.<>c__DisplayClass47_01.b__0(IObserver1 observer) at System.Reactive.AnonymousObservable1.SubscribeCore(IObserver1 observer) at System.Reactive.ObservableBase1.Subscribe(IObserver1 observer) at System.ObservableExtensions.SubscribeSafe[T](IObservable1 source, IObserver1 observer) at System.Reactive.Linq.ObservableImpl.IgnoreElements1.Run(IObserver1 observer, IDisposable cancel, Action1 setSink) at System.Reactive.Producer1.SubscribeRaw(IObserver1 observer, Boolean enableSafeguard) at System.ObservableExtensions.SubscribeSafe[T](IObservable1 source, IObserver1 observer) at System.Reactive.Linq.ObservableImpl.Select2.Run(IObserver1 observer, IDisposable cancel, Action1 setSink) at System.Reactive.Producer1.SubscribeRaw(IObserver1 observer, Boolean enableSafeguard) at System.ObservableExtensions.SubscribeSafe[T](IObservable1 source, IObserver1 observer) at System.Reactive.Linq.ObservableImpl.Select2.Run(IObserver1 observer, IDisposable cancel, Action1 setSink) at System.Reactive.Producer1.SubscribeRaw(IObserver1 observer, Boolean enableSafeguard) at System.ObservableExtensions.SubscribeSafe[T](IObservable1 source, IObserver1 observer) at System.Reactive.Linq.ObservableImpl.TakeUntil2..Run() at System.Reactive.Linq.ObservableImpl.TakeUntil2.Run(IObserver1 observer, IDisposable cancel, Action1 setSink) at System.Reactive.Producer1.SubscribeRaw(IObserver1 observer, Boolean enableSafeguard) at System.ObservableExtensions.SubscribeSafe[T](IObservable1 source, IObserver1 observer) at System.Reactive.Linq.ObservableImpl.Using2..Run() at System.Reactive.Linq.ObservableImpl.Using2.Run(IObserver1 observer, IDisposable cancel, Action1 setSink) at System.Reactive.Producer1.Run(IScheduler _, State x) at System.Reactive.Concurrency.ScheduledItem2.InvokeCore() at System.Reactive.Concurrency.CurrentThreadScheduler.Trampoline.Run(SchedulerQueue1 queue) at System.Reactive.Concurrency.CurrentThreadScheduler.Schedule[TState](TState state, TimeSpan dueTime, Func3 action) at System.Reactive.Concurrency.LocalScheduler.Schedule[TState](TState state, Func3 action) at System.Reactive.Producer1.SubscribeRaw(IObserver1 observer, Boolean enableSafeguard) at System.ObservableExtensions.SubscribeSafe[T](IObservable1 source, IObserver1 observer) at System.Reactive.Concurrency.Synchronization.<>c__DisplayClass21.<>c__DisplayClass4.b__1() at System.Reactive.Concurrency.Scheduler.Invoke(IScheduler scheduler, Action action) at System.Reactive.Concurrency.CatchScheduler1.<>c__DisplayClass51.b__4(IScheduler self, TState state) at System.Reactive.Concurrency.ScheduledItem2.InvokeCore() at System.Reactive.Concurrency.EventLoopScheduler.Run() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()

I'm not sure what is causing this crash.

Here’s what I’m using:

Bonsai: 64-bit version.
NI Driver: DAQmx runtime, version 2022 Q3. I understand this version supports both 32-bit and 64-bit environments.

Here’s what I’ve tried so far:
Verified that the National Instruments device is recognized by the system.
Confirmed that the device is working correctly in NI MAX.
Simplified the workflow to ensure it’s not overly complex.

Has anyone encountered a similar issue? Any advice on how to debug or resolve this problem would be greatly appreciated.

Thank you in advance!

digitaloutput

@vegardkb
Copy link

vegardkb commented Jan 8, 2025

I had the same issue, fixed by downgrading NI-DAQmx to version 19.0. downgrading to 21.6 worked for someone else, see #16.

@aseiffe
Copy link
Author

aseiffe commented Jan 9, 2025

Thank you very much! I worked with 21.6 version :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants