03-15-2016 03:07 AM
Once invoking Matlab for calculation, Labview 2013 will shut down automatically. Are there any problems with the code?
03-15-2016 08:07 AM
I don't know if there are problems with the code, but why bother with Matlab? This is almost trivial LabVIEW (you should be able to figure out the True case by yourself ...). Note I'm not doing anything "fancy", just a direct implementation of what you wrote.
Bob Schor
03-15-2016 08:23 AM
you mean the problem is in the formula node, but the VI can work properly in the absence of Matlab script (TDEV.vi). thank you for your kind help!
03-15-2016 10:33 AM
There is probably no problem with the formula node except it is not needed here and just complicates things. The matlab script in the subVI could of course also be written in plain LabVIEW, but that would involve a little bit more work. 😉
It is hard to tell what the problem is but we are dealing with two different systems (LabVIEW & matlab) so there are many possibilities of failure. What is your matlab version? Is it 32 or 64bit?
Does the matlab script work correctly with very simple matlab code?
Does the matlab code work correctly within matlab?
Your matlab comments have unusual characters. Are these unicode?
03-15-2016 09:22 PM
mablab version is 2012a with 32bit. Yeah, if the matlab code is simple, the Labview can work correctly. And the matlab code can work correctly in matlab 2012a, but a little time-consuming. however, thank you for your comment.
03-15-2016 10:57 PM - edited 03-15-2016 11:17 PM
Bob,
This is one of those RG things I do not like! (Don't get me wrong! I like you and your code! just... well hear me out OK?)
here we have a comparison driving a boolean case and the number is compared again to select an essentially boolean output (0,1) The true case outputs a constant 0
Would not this be easier and hide less code in the unshown case?
Note: the original code and the equality is added for comparision (Hey, I can make mistakes!) but do you really need a case structure or a select for that?
The "Less Than 10" could be simplified too to "Not Equals 0" and the AND inversion removed but thats splitting hairs