c_w_k Posted May 7, 2010 Report Share Posted May 7, 2010 hello, I created a vi that works just fine in LabVIEW 8.6 I then saved it for a previous version and gave it to my co-worker who has LabVIEW 8.2 on his machine. He is able to open the VI but when it gets to a certain function call it crashes. The function call is calling a c++ dll (which he has in the same location as I do on my machine) the parameters of the function are: String (c string pointer), double, long, double, *short Not sure why its unable to call one function and the other is making it crash.... Thanks for any and all help CK here is the function call that is causing LabVIEW 8.2 to crash.......It was created in LabVIEW 8.6 and saved for a previous version. -CK Quote Link to comment
asbo Posted May 7, 2010 Report Share Posted May 7, 2010 Are your machines otherwise identical? The crash may not be LabVIEW's fault. Quote Link to comment
c_w_k Posted May 7, 2010 Author Report Share Posted May 7, 2010 No the machines are not identical? If I created a VI in labVIEW 8.6 and used the "save for previous version 8.2" utility....would i need to have identical machines to run the vi??? Quote Link to comment
c_w_k Posted May 7, 2010 Author Report Share Posted May 7, 2010 I mean our DLL's and folder structures are the same but the computers are not exactly the same themselves......we also tried building the function call from scratch in 8.2 - it wouldn't work then either...... Quote Link to comment
asbo Posted May 7, 2010 Report Share Posted May 7, 2010 I mean our DLL's and folder structures are the same but the computers are not exactly the same themselves......we also tried building the function call from scratch in 8.2 - it wouldn't work then either...... That would lead me to believe it's a problem with your buddy's machine, not LabVIEW. By identical, I meant operating system, hardware, etc. Quote Link to comment
c_w_k Posted May 7, 2010 Author Report Share Posted May 7, 2010 We were able to find out what it was.....the DLL that we were calling uses winapi calling conventions, LabVIEW 8.6 is smart enough to realize this so you don't have to set that when configuring your library function node - so I did not have this configured in 8.6 and it was still working, LabVIEW 8.2 is not smart enough to realize this......so since that was not set in LabVIEW 8.6 once it was saved for 8.2 it thought it was supposed to use the C convention instead of winapi ......after we changed that it worked fine. Thanks CK Quote Link to comment
Rolf Kalbermatter Posted May 8, 2010 Report Share Posted May 8, 2010 We were able to find out what it was.....the DLL that we were calling uses winapi calling conventions, LabVIEW 8.6 is smart enough to realize this so you don't have to set that when configuring your library function node - so I did not have this configured in 8.6 and it was still working, LabVIEW 8.2 is not smart enough to realize this......so since that was not set in LabVIEW 8.6 once it was saved for 8.2 it thought it was supposed to use the C convention instead of winapi ......after we changed that it worked fine. Most likely this is because of the name decoration Visual C uses by default for WINAPI functions. Those functions have in fact by default (but it can be suppressed) an @n appended where n is the number of bytes the function takes on the stack for parameters. LabVIEW has been smart enough to accept undecorated function names(just as it also accepts prepended underscores which is the default name decoration for cdecl functions) and map them to the according decorated name for ages. Apparently they added in 8.6 the smartiness to use WINAPI automatically when the function has this decoration. I guess it can byte your ass as you have found out, but it is not a bad improvement. Of course the backsave feature would be even better if it knew this smartness too, but I have a feeling, that may not have been foreseen in the backsave feature, so it may not even be possible without a lot of extra work. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.