07-30-2021 10:34 AM
Hello all,
I am using the STG 4008 from Multichannel Systems on LabVIEW via a .net dll. I have been having connecting issues with the device and Labview, but that has been resolved since Labview is registering that there is an STG device in the USB port but still not triggering it to stimulate. There is a .net node that displays error texts and it reads "Device is locked"; Labview also crashes with an Access Violation after I stop the program. I can attach the vi if necessary, but I do not think it would be of much use without the STG device.
I have been in contact with Multichannel Systems Support but they also do not know why the device is locked, since the device works fine with the MC_Stimulus software that is specifically made for STG devices. If anyone has any experience or knowledge about this problem or using Multichannel System hardware with Labview, any insight would be appreciated. Thank you!
07-30-2021 12:27 PM
.NET can be tricky to figure out when it doesn't work in LabVIEW but does work natively.
Best advice I can give you is to ask for a working source code example in C++/C#, then see if there is anything they are doing that you're skipping in LabVIEW. It could be there's some background initialization or closing of resources that you need to do that isn't obvious.
There are some things that you can't do in LabVIEW with .NET that you can do in C-based languages, such as the option to wire in a "null" string instead of just a zero-length string, that it's also possible that the program depends on. That's just one example I have found, and I'm sure there's more.
If you can narrow it down to just one VI or DLL call that causes the problem you could post pictures and code here (snippet + VI + DLL) to see if anyone here can see any obvious issues.
07-30-2021 01:06 PM
Thank you for your response! I did follow an example C# code and it seems that the problem is actually the computer I was using, since the code works fine when I connect the device to my laptop but the computers have limitations set by the lab. Unfortunately I still need to use the computers in the lab for the entire program to work so I'm trying to find a workaround for it now.