LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview 8.20 Crash using vi's created with import dll wizard

Has anyone had issues with the DLL wizard or DLLs that use the USB port?
 
I have used the DLL import wizard to create an instrument driver for a picoscope 3424. When I run the Initaization.vi it exicutes properly, however, if I close the vi I get the Labview must be closed, send an error report to Microsoft blah,blah. If I disconnect the PicoScope (unplug the usb cable) then close the VI no error happens.
 
Once I received the Labview invstigate error and sent the data to NI (REF#7134654).
 
I had a driver written with LV 7.1.1 that worked with out any issue, I converted the 7.1.1 vi's to 8.20 and I no longer have the issue. This leads me to beleive that there may be a bug in the DLL wizard.
Andrew Alford
Production Test Engineering Technologist
Sustainable Energy Technologies
www.sustainableenergy.com
0 Kudos
Message 1 of 13
(5,008 Views)
Based on your description, I'm not entirely clear on what all you did and tried.   Let me try to break down my questions.
 
a)   You mentioned you used the DLL Import Wizard to create an instrument driver for a  picoscope 3424.   Is the source files available somewhere for download.  I'm guessing the inputs to the wizard were a C DLL and header file, correct?
 
b)  You mentioned that when you ran the VI it executed properly but you were not able to close LV correctly.   Just to be clear, the DLL Import Wizard automates what can be created manually using the Call Library Node.   Furthermore, the Wizard makes best guesses on configuring the node, but the user is given option to override the default values if the user is aware of more appropriate settings.  If you were able to create a LV wrapper on top of the C dll in LV 7.1.1, then you can compare the generated VIs with the ones used in LV 7.1.1.   Are there differences in how the CLN is configured?  Maybe in the Wizard UI you can make a different selection that would generate a similar VI to the one in LV 7.1.1.
 
c)   Were you using the wizard to create a LV wrapper to compare with the LV 7.1.1. version?  Or, if you already had a wrapper, why were you re-creating a wrapper using the Wizard?  Just curious.
 
Thanks,
 
Noel Adorno 
0 Kudos
Message 2 of 13
(4,988 Views)

I'll try to answer your questions.

a) Yes that is correct, the source files are avaliable for download at http://www.picotech.com/software.html.

b) I have found some issues with the available settings in the DLL Import wizard, one is there is no availble choice for setting the parameter type to array. This is available when you right click on the CLN and select configure. I checked the configurations of the open unit and close unit nodes and they look the same. I have also noticed that the block diagrams created with the DLL Import wizard are very messy with overlaping wires and poor wire routing.

c) The original wrapper I created was done quickly and I only created the functions I needed at the time, I was attempting to create a proper Insturment Driver project and wanted all of the functions to be created, this is why I was using the import wizard.

I am still at a loss as to why disconnecting the instrument from the USB port prevents this crash from happening.

For now I have reverted to the 7.1.1 wrapper converted to 8.20 as I do not have time to continue investigating this issue.

Thank you for your response.

Andrew Alford
Production Test Engineering Technologist
Sustainable Energy Technologies
www.sustainableenergy.com
0 Kudos
Message 3 of 13
(4,977 Views)
I downloaded picofull_r5_15_5.exe and ran the installer in the self-extracting archive.   It created a Pico Technology directory with lots of dlls.  No header files.   I'm not very familiar with the drivers.  So,not clear on what dll to use and where to get header files.   I'm trying to see what the generated VIs look like.  Obviously, I don't have the actual device to test with, but maybe looking at the VIs would help.
 
Noel
0 Kudos
Message 4 of 13
(4,963 Views)

Re: your comment:  I have found some issues with the available settings in the DLL Import wizard, one is there is no availble choice for setting the parameter type to array.

The DLL Import Wizard does indeed allow you to set the parameter type to array.

On the Configure VIs and Controls page, select a parameter.   Then select Pass Type to be "Pass by Array".   This will allow you to set the array size.  If the Input/Output type is set to just Output, you can tie the size to another array parameter.

0 Kudos
Message 5 of 13
(4,962 Views)

Re: your comment about the messy diagrams.   Thanks for the feedback.  We'll see what we can do about it for future releases.

Noel Adorno

0 Kudos
Message 6 of 13
(4,962 Views)
I have attached the dll and header file. I changed the extention of the DLL to .c
 
The item is required to be passed by pointer, the type should be array. Under the type setting there is no array, this is available under the configure when right clicking on the CLN.
Andrew Alford
Production Test Engineering Technologist
Sustainable Energy Technologies
www.sustainableenergy.com
Download All
0 Kudos
Message 7 of 13
(4,954 Views)

OK, got dll and header file.  Thanks for posting them.  I'm wondering if the installer was smart enough to know that the clean machine I was installing on didn't have a C compiler and hence didn't install the header files.  

Which function are you referring to?   I randomly selected one of the functions that seemed to return an array (ps3000_get_values).   See attached screen capture for parameter settings in the dialog.   I suspect I'm barking up a different tree than you are.   But, maybe if we talk in pictures or specific functions/parameters we'll eventually converge. 

Thanks for your patience.

Noel Adorno

0 Kudos
Message 8 of 13
(4,952 Views)

Now using the wrapper converted to 8.20 I received this crash. DSTM.cpp(160) see attached log.

 

Andrew Alford
Production Test Engineering Technologist
Sustainable Energy Technologies
www.sustainableenergy.com
0 Kudos
Message 9 of 13
(4,936 Views)

Greetings Andrew:

    It is interesting to note that you are able to call the DLL in the earlier version of DLL. Were you able to reproduce the crash on DSTM at the line number. It will be really helpful for us if you were able to give us the smallest snippet of the code using the DLL import wizard. The log file is definitely helpful, and reproducing the crash will be ideal. You mentioned the USB port and how removing it prevents the crash possibly giving us a clue about driver / interrupts caused due to the usb port and the instrument connected.

Thanks for all the feedback and co-operation.

Best regards

Avi Harjani

 

0 Kudos
Message 10 of 13
(4,888 Views)