From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview crashed when attempting to send array to matlab program

Solved!
Go to solution

I am trying to create a simple VI that takes an image with my allied vision usb3.0 camera, converts the image to an array of pixel values, then sends this array to a matlab function. This is basically a test VI to make sure I understand how all these different functionalities work since I am new to IMAQdx and using matlab functions in a VI. Everything works well until I try to call the matlab function and pass the array to it. Then labview crashes and I get an access violation error. Ive seen the recommendations here: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P9TXSA0 and followed the ones short of uninstalling, which I'd like to avoid (and don't think would help since this seems tied to a particular issue).

 

The VI is attached, the matlab function is not, but it is very simple: function plotIm(im); disp(im(1));end. Note that i have been able to call matlab functions successfully in a different program. Any Idea what is causing this issue?

0 Kudos
Message 1 of 4
(648 Views)
Solution
Accepted by topic author Evan333

Usually this happens with MatLab and LabVIEW when there is a mismatch of the array dimensions, or data type between what LabVIEW sends and what MatLab expects. So I would double check they match. If you attach your matlab file, it would be easier for someone to look and try it as well.

0 Kudos
Message 2 of 4
(633 Views)

thanks for you reply. The matlab code is listed in the question, only one line. 

I will try and check the data types. The image VIs do produce data types I am unfamiliar with so maybe I need to convert it to something matlab likes

 

0 Kudos
Message 3 of 4
(626 Views)
Solution
Accepted by topic author Evan333

After I converted the data type to a double precision floating point type array, it worked! My camera was black and white so it was using u8 data type. A more descriptive error message would sure be helpful here!!!!

0 Kudos
Message 4 of 4
(613 Views)