ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET assembly with MathScript Node

Dear Community, I'm trying to build a .NET assembly with Labview 2015 32 bit containing a MathScript Node with a call on a Matlab function and I get a really strange behaviour.

 

What happens is that if I build the assembly and I try to call his function in a Labview VI I get the error 1172 (as shown in the figure) but if I build the same VI that gets the error as an executable it works perfectly. Moreover, if I remove from the MathScript Node the Matlab function called "sub" (row 😎 the assembly works also when is called by the VI.

 

The problem seems to be related to the Matlab function but why it happens only when I execute the VI and not if I run the executable?

 

Thank you all in advance if someone has an idea.

Download All
0 Kudos
Message 1 of 5
(2,924 Views)

Hi Paolo,

I just noticed that the MATLAB function called sub is not supported by MathScript, so I can't see the purpose of keeping it in the code.

 

Searching for your error message I found these documents:

Even if they don't exactly relate to your problem, maybe they could help to find an explanation of this strange behavior, if you care about it.

Regards,

Alessia

0 Kudos
Message 2 of 5
(2,855 Views)

Hi Alessia,

 

thank you for your feedback. The function called sub is not a Matlab function but a function that I create in Matlab, sorry if didn't explain properly; it's a simple .m file that returns the first value of a vector ( a=a(1) ). The strande thing is that the VI that calls this function works, when I create an assembly from that VI if call this from an other VI it returns the error but if I compile the latter VI as an excutable it back to work.

It's annoying because I can't run the software I'm working on in Labview Environment but I have to build this as exe :(.

 

Thank you for the documentation, I'll take a look on it.

 

Paolo

0 Kudos
Message 3 of 5
(2,845 Views)

Hi Paolo,

thank you for the clarification, I'm sorry for the misunderstanding. Could you please share the code of the sub function? I guess we might find there the key to explain and solve the issue.

Regards,

Alessia

0 Kudos
Message 4 of 5
(2,832 Views)

Hi Alessia,

 

the code is:

 

function b=sub(a)

b=double(a(1,1));

 

Often happens that when the Mathscript calls external DLLs doesn't recognize the variable type and, for example, a double can be assigned as a matrix of double. I use this function to simply redefine the variable type as a double.

 

Paolo

 

0 Kudos
Message 5 of 5
(2,827 Views)