LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 90129, unable to coerce data

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.

 

0 Kudos
Message 1 of 13
(4,563 Views)

Hey Zack,

 

Im not getting an error. Can you post an example of the problem?

 

This runs without error:  Im using LabVIEW 2011 SP1

math.png

Lewis Gear CLA
LabVIEW UAV

0 Kudos
Message 2 of 13
(4,544 Views)

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!

 

Blue hills2.JPG

0 Kudos
Message 3 of 13
(4,540 Views)

Hi Zack,

 

I built this MathScript node in LabVIEW 2011 with no problem. Seems to run fine.CoerceDataMSNode.png

 

Have you tried rebuilding it? Not sure why it would be working after the upgrade but it wouldn't hurt to try.

0 Kudos
Message 4 of 13
(4,533 Views)

Hi Alisha.  I will try rebuilding it and let you know.  Thanks!

0 Kudos
Message 5 of 13
(4,530 Views)

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!

0 Kudos
Message 6 of 13
(4,524 Views)

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. 

0 Kudos
Message 7 of 13
(4,518 Views)

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!

0 Kudos
Message 8 of 13
(4,515 Views)

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.

0 Kudos
Message 9 of 13
(4,502 Views)

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.

0 Kudos
Message 10 of 13
(4,496 Views)