03-20-2014 01:41 PM
Hello there,
I am attempting to communicate with an STG 2008 Multichannel Stimulator using LabVIEW 2010. We have the code essentially finished but we have been unable to discover connectivity between the device and the computer running the software. I have attached a photo of the setup that we have been attempting to use to connect to the device. I reached out to the stimulator manufacturer for some guidance as to why we have been unable to establish a connection and the response he provided me with was this:
"you need the CMcsUsbListNet class to get such an entry,
in C# it would be:
CMcsUsbListNet usblist = new CMcsUsbListNet();
usblist.Initialize(DeviceEnumNet.MCS_STG_DEVICE);
after this, a call to
usblist.GetUsbListEntry(0)
will provide an entry of the first STG device found"
From looking at our code I feel like we have done what he said we would need to do in order to communicate with the device but so far we have been unsuccessful despite a company representative's guidance.
If anyone has any input that we could use to solve this problem I will appreciate it.
Thank you!
03-21-2014 09:52 AM - edited 03-21-2014 09:52 AM
Hi SCapouch,
I am not familiar with that device, but to translate that C# code you have to LabVIEW, it looks like this:
Basically it just looks like you're missing that "Initialize" method for the CMcsUsbListNet object.
-Jim B.
Applications Engineer, National Instruments
03-21-2014 02:02 PM - edited 03-21-2014 02:03 PM
Sir,
After fixing this error using your method, I am now receiving an error 1172 out of the Connect from CStg200xDownLoadNet Construct. Do you have any ideas as to how I can remedy this? I have attached an image of the error below. I apologize, my LabVIEW skills are not as good as I wish they were.
03-21-2014 03:30 PM
03-22-2014 01:31 PM
When you say to close the connection after finishing the operation, do you mean to move the closing operation to the other side of the sequence structure? I tried that and I am still being presented with the ERROR 1172. I'm not sure how to deal with this
03-22-2014 01:34 PM
James,
Is the variable connected to McsUsbDevice in the picture you send me just a numeric ring constant that I name MCS_STG_DEVICE, or is that an input variable that I need to obtain from the manufacurer's DLL that I downloaded from their website?
Thank you
03-22-2014 01:44 PM
03-22-2014 02:05 PM
The reference is inputted to the subVI that I have been asking about from a NET library in the main VI of our code. I have attached a photo with an arrow pointing to the subVI where I have been experiencing problems
03-23-2014 11:37 AM
I used debugview to isolate what the error is specifically and this is what I found:
DNError: Error calling method Mcs.Usb.CStg200xDownloadNet.Connect (1172) System.ArgumentNullException: Key cannot be null
I have searched the web trying to gain some perspective but have had no success so far; any ideas? Thank you
03-24-2014 12:39 PM - edited 03-24-2014 12:39 PM
I got that ring constant by right clicking on the input terminal for McsUsbDevice and clicking "Create->Constant"
It sounds like that particular invoke node does not like the object being passed in to it. I noticed that there are two different constructors for that object, so maybe try using the other one.