06-03-2020 04:22 PM
Hello experts,
I have created a shared library dll from LabVIEW source code. In essence it does very simple operation:
1. Initializes PXIDMM
2. Configures Measurement
3. Reads Measurement
4. Closes
I ran this vi and it does what it should.
I built Shared Library dll and tried to call it from Test Stand - works perfect.
But when I call it from Custom UI it does all what it should and keeps repeating
the cycle. Here is IO Trace for clarity:
89. niDMM_init ("PXI1Slot11", VI_FALSE, VI_FALSE)
Process ID: 0x000017EC Thread ID: 0x00001094
Start Time: 15:40:15.3508 Call Duration 00:00:00.1849
Status: 0 (VI_SUCCESS)
90. niDMM_ConfigureMeasurementDigits (PXI1Slot11 (0x00000027), 5 (0x5), -1.000000 (-1.000000E+00), 5.500000 (5.500000E+00))
Process ID: 0x000017EC Thread ID: 0x00001094
Start Time: 15:40:15.5358 Call Duration 00:00:00.0000
Status: 0 (VI_SUCCESS)
91. niDMM_Read (PXI1Slot11 (0x00000027), 3000 (0xBB8), 1996.489380 (1.996489E+03))
Process ID: 0x000017EC Thread ID: 0x00001094
Start Time: 15:40:15.5358 Call Duration 00:00:00.1091
Status: 0 (VI_SUCCESS)
92. niDMM_close (PXI1Slot11 (0x00000027))
Process ID: 0x000017EC Thread ID: 0x00001094
Start Time: 15:40:15.6449 Call Duration 00:00:00.0034
Status: 0 (VI_SUCCESS)
93. niDMM_init ("PXI1Slot11", VI_FALSE, VI_FALSE)
Process ID: 0x000017EC Thread ID: 0x00001094
Start Time: 15:40:15.6494 Call Duration 00:00:00.1841
Status: 0 (VI_SUCCESS)
94. niDMM_ConfigureMeasurementDigits (PXI1Slot11 (0x00000029), 5 (0x5), -1.000000 (-1.000000E+00), 5.500000 (5.500000E+00))
Process ID: 0x000017EC Thread ID: 0x00001094
Start Time: 15:40:15.8336 Call Duration 00:00:00.0000
Status: 0 (VI_SUCCESS)
95. niDMM_Read (PXI1Slot11 (0x00000029), 3000 (0xBB8), 1996.448975 (1.996449E+03))
Process ID: 0x000017EC Thread ID: 0x00001094
Start Time: 15:40:15.8336 Call Duration 00:00:00.1082
Status: 0 (VI_SUCCESS)
96. niDMM_close (PXI1Slot11 (0x00000029))
Process ID: 0x000017EC Thread ID: 0x00001094
Start Time: 15:40:15.9418 Call Duration 00:00:00.0229
Status: 0 (VI_SUCCESS)
If someone experienced this behavior please share the solution.
I appreciate all your inputs
Regards,
Leonid.
06-03-2020 05:26 PM - edited 06-03-2020 05:27 PM
I'm guessing there's something wrong with your code. (Vague descriptions with no example code begets vague answers with no real value - GIGO.)
Don't worry - I suffer from the same issues when I ask for help, too. Ugh.
06-03-2020 09:53 PM
Hi GIGO,
Please take a look and tell me if you think something wrong with the code. I am attaching the source code and the Shared library dll I built from the code. Please note again - this dll works as designed if used in Test Stand, but fails to exit after executed in the custom UI.
I appreciate all the inputs. Looking forward to hear from you or anyone else.
P.S. PXIDMM is NI PXI-4071 DMM
06-03-2020 11:53 PM
Sorry, could you please re-upload the files? It seems that I can't download them for some reason or other. 😞
06-04-2020 08:24 AM
Hi Bill,
Files are attached. Thank you
Leonid.
06-04-2020 10:45 AM
It was the custom VI I was really interested in. Sorry I didn't realize that you uploaded the source code for the dll (even though you made that clear).
I guess I'm not doing so well, today - you sure you want me to help you? 😉
Anyway, when something works well in one environment but not another, I would check the environment - in this case, the custom VI - to see what might be happening. When you take a fish out of the water and it dies, you don't suspect something was wrong with the fish. 😉