LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

Mathscript output array incorrect datatype

Hello everyone,

 

I am trying to overlay a line on an image using the IMAQ Overlay Points VI, which requires an array of clusters, each cluster containing two numbers, so it should be a thick brown cluster wire. This is to be provided by a mathscript block which I created in matlab, and the variable viewer clearly shows that this is the case, but the output on the mathscript block is a thick pink wire.

Even worse, is that when I try and deconstruct the array with for loops and unbundle VIs, it indicates that the output is actually an array of clusters where each cluster contains two arrays of ints instead of two doubles.

Could anybody help me? I have uploaded some screenshots to https://imgur.com/a/5SB9k. Thank you

0 Kudos
Message 1 of 4
(4,884 Views)

Please insert your images directly into the post. Most people here don't want to click on external links with pages full of advertisements.

 

Also free free to post a simplified version of your code.

 

(I will move this thread to the mathscript forum where it belongs).

0 Kudos
Message 2 of 4
(4,858 Views)

Hi,

You can use array manipulation to get the desired values, that is, to extract the first element, like this,

MS_struct.png

And I can get doubles as shown above, would you check if your input is double or int?

0 Kudos
Message 3 of 4
(4,834 Views)

Hello 2benh,

 

the already posted solution looks great.

 

However to point what issue you came across:
Example_VI_BD.png

Right now a is a cluster of two elements in this example. In the moment the bottom line is uncommented, the type of a changes to a Cluster of two 1D arrays.

 

I am taking a wild guess this is intended behavior because Mathscript' structures are defined more loosely than LabVIEW's clusters.


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
0 Kudos
Message 4 of 4
(4,828 Views)