12-04-2016 12:39 PM
Hello everyone.
I am using LabView + Matlab to control a system, the issue is that everytime I try to do an else if statement, I get an error from the software.
"LabVIEW: LabVIEW failed to send variable to the script server."
If I use just If + else, it runs ok, but when I try to do if + if else + else, the error comes back. Someone have the solution? May I am comitting some type of error?
Thank you!
12-04-2016 01:00 PM
I cannot comment on this particular error you get, but I give two advices:
Here is some more reading: http://www.ni.com/newsletter/51735/en/
12-04-2016 01:24 PM
I appreciate your advices.
But the doubt is just about the if statements, I don't see why other parts of the code matters here.
When I am using if + else, it works, when using if + if else + else, it fails.
12-04-2016 01:33 PM
Other parts of the code does not affect this matlab script, right. But in overall, your programming style is dangerous, almost impossible to debug such code. I see many strange things and lots of Rube Goldberg constructs. Besides, why do you need that MATLAB script, that simple logic can be easily programmed using LabVIEW functions...?
12-04-2016 01:38 PM
The code is this way because my Teacher of Nonlinear Control give us this task to be made in 1 week and I don't have time to do it the right way 😄
The Matlab script is just because he demands that the control algorithm must be made in Matlab.
Yeah, this is nonsense, but I have to do it.
12-04-2016 01:43 PM
Right now i do not have access to LabVIEW to test this script. Could you put together a very simple vi, where you can reproduce this error? Just a simple vi only with this matlab script. Also double check whether you are using the correct syntax in the script. If you can recreate this error, attach this simple vi, so people can test it and figure out what is wrong.
12-04-2016 01:58 PM
12-04-2016 02:06 PM
12-04-2016 03:42 PM
The highlighted MATLAB code looks OK.
You could try the actions suggested in the below post.
12-04-2016 07:00 PM
Thanks to everybody.
I am working in this code for hours and I had perceived that everytime I use a float in the code, the error returns.
For example, I have an expression:
(4/pi)*(27/100)
if I change 27 per 27.5, I got the same error. I have no idea why, but I adapted the code to bypass this problems in another way.