01-17-2019 10:01 AM
Object: I want to update custom controls on the parallel UUT Dialog from a LabVIEW module.
Overview: I have a simple TestStand sequence using the Parallel Process Model, and modified the UUT Information Dialog in CVI to graph the values of the UUT during the test. I have successfully added custom controls and can even modify the values of the custom control calling my custom function in the modelsupport2.dll with the C/C++ module.
I have validated that the same values are being passed to my LabVIEW VI and my call to the modelsupport2.dll. I am assuming that it has to do something with TestStand loading the modelsupport2.dll into memory and therefore it works calling the dll from TestStand but not LabVIEW.
The custom function currently takes only 2 parameters (int panelId, int testSocketIndex), and I am calling the same dll and function.
Question: How to I call the modelsupport2.dll within LabVIEW to update the the UUT Information Dialog?
Thanks in advance
Matthew
Solved! Go to Solution.
01-18-2019 10:42 AM
Hey Matthew,
It seems like you should be able to follow the instructions found here, Calling a Dynamic Link Library (DLL) from LabVIEW.
If you have tried this method and are running into other issues, are there specific errors associated with those issues?
01-21-2019 10:34 AM
I should have provided a little more information.
I am familiar with calling DLLs from LabVIEW; however, when I try to call the modelsupport2.dll within LV I get a -4 error/response from the dll(The dll does not return a LV error, this is the response from the dll). I am assuming that is error is because I do not Initialize or call the setup of the dll from LV; therefore the dll is not loaded into memory nor configured correctly for LabVIEW to call it?
So what do I have to do to call the dll from LabVIEW?
01-21-2019 10:41 AM
Hey Matthew,
Can you show the block diagram portion of how you're calling modelsupport2 or share that part of your code?
Thanks,
Roxy
01-21-2019 11:25 AM - edited 01-21-2019 11:27 AM
Sure thing,
The DLL currently creates and plots a random number
01-22-2019 12:42 PM
If you call an empty function in modelsupport2 dll from LabVIEW, does that work?
If that does, could you share your function prototype that is causing this error?
Thanks,
Roxy
01-29-2019 03:42 PM - edited 01-29-2019 03:45 PM
Calling an empty function is no issue.
The error -4 is thrown from the GetPanelAttribute()
int DLLEXPORT _stdcall PUUT_PlotStripChartPoint(int panelId, int testSocketIndex) { int error = 0, childPanel, randomNum; PUUT_PanelData *panelData = NULL; errChk( GetPanelAttribute (panelId, ATTR_CALLBACK_DATA, &panelData)); childPanel = PUUT_CalcChildPanel(panelId, testSocketIndex); errChk( GetPanelAttribute (panelId, ATTR_FIRST_CHILD, &childPanel)); if(panelData){ randomNum = rand()*100.0/(double)RAND_MAX; errChk(PlotStripChartPoint (childPanel, panelData->testSocketDataArray[testSocketIndex].ctrls[kTSCtrl_Stripchart], randomNum)); } Error: return error; }
I did double check that the values passed into the function from LV and TestStand are the same.
panelId = 1
testSocketIndex = 0
Thanks,
Matthew
05-13-2019 03:43 PM
Thought I would close the post.
I never resolved the issue and just had LV read data, pass it to TestStand, and TestStand call the dll rather than have my LabVIEW module do the work. While it was messy and not the desired design it worked and I was on a time crunch.