08-30-2012 01:03 PM
I am trying to run a labview program developed in verson 8.5 in the 2011 version. I am getting an error code related to the Mathscript RT module, error -90129, failure to coerce data. I get this errer in several VIs and several mathscript nodes, but here is a very simple example:
two inputs:
record
toggle_record
one output:
record
here is the code:
if toggle_record==1
if record==1
record =0
else
record=1
end
end
I get a red coersion dot on the record output in the 2011 version, but not in 8.5. All inputs and outputs are booleans.
08-31-2012 05:44 AM
Hey Zack,
Im not getting an error. Can you post an example of the problem?
This runs without error: Im using LabVIEW 2011 SP1
08-31-2012 08:16 AM
Lewis,
Thanks for the reply. I was not getting an error in that node, just getting errors in similar nodes with problems coercing data types. I typed in the smallest mathscript node just for an example, and also in the meantime have found i can get rid of the coersion dots by usint true/false instead of 1/0. not sure why this is, it works fine in version 8.5. Anyways here is the mathscript node that is producing an error. I apologize if the pic quality is bad, and sorry it took me a while to reply. I am at work and cannot do labview and the internet on the same computer, so i have to burn a picture of it onto a cd and transfer... The inputs are all real but I wired indicators to the outputs for the sake of troubleshooting. In the program they go to other places. Thank you so much for the help, I really need to get this running!
08-31-2012 09:29 AM
Hi Zack,
I built this MathScript node in LabVIEW 2011 with no problem. Seems to run fine.
Have you tried rebuilding it? Not sure why it would be working after the upgrade but it wouldn't hurt to try.
08-31-2012 09:51 AM
Hi Alisha. I will try rebuilding it and let you know. Thanks!
08-31-2012 10:51 AM
OK, well I rewrote the mathscript node and it does run without errors. However when I put it in with the rest of my program it will not run. Here is the problem. The input Speeds in my program is a 1-D array. That makes the output speed_channel become a 1-D array. When I change that output to a dbl precision integer that is when I get the coersion dot, and the error.
With the program in version 8.5 the Speeds input is still a 1-D array, but it will output the speed_channel as a dbl precision integer without causing the error.
I have to output speed_channel as a dbl precision integer, not an array to fit with the rest of the program.
Any ideas would be greatly appreciated, and thanks for the help so far, I feel like I am making progress!
08-31-2012 11:09 AM
Hi Zack,
The math you are doing is producing an array. If you only want one value of the array, you could use Index Array function to select one index of the array. If it's an array of doubles, this index will be a double you can use in the rest of your program.
The other option would be to change the math within the node to produce the dbl that you're looking for.
08-31-2012 11:30 AM
Alright, makes sense. I will try to change the math within the program. But what is different between the 8.5 version and the 2011 version that lets this run just fine in the 8.5 version?
Thanks!
08-31-2012 11:42 AM
Hi Zach,
I'm really not sure what's occuring the 8.5 version to allow this. I would expect LabVIEW to always complain if you try and use an array as if it were only one integer value. LabVIEW requires your data types to match. I would think using the Index Array function would be the easiest solution to this problem.
08-31-2012 11:54 AM
I added the index array function and it seems to be working!! Thank you. Next week I will hook it up to all of my equipment and hopefully everything will work. Thanks again.