f



Labview 8.5.1's MathScript window failed running imread with an error "A problem occurred in a subVI call."

Hi, I am trying to port a Matlab program into a MathScript script.  Following is the first few lines of the script:clear;image1=imread('C:\LV_VertAlign\DSC_0104.jpg','jpg');image_double1=im2double(image1);image_gray11=rgb2gray(image_double1);In the first line, imread is supposed to read in a photo taken from a DSLR camera, so I think it's a 32-bit image.  And this is the error I got when trying to run this script in the Labview 8.5.1's Mathscript windows:"Error in function imread at line 2.  A problem occurred in a subVI call."What is the problem here?  and why does it complain about a subVI call?Thanks for any help to point me in the right direction.-Anh
0
x9561 (148440)
6/13/2008 2:10:04 AM
comp.lang.labview 35213 articles. 1 followers. vasusachin24 (1) is leader. Post Follow

3 Replies
1368 Views

Similar Articles

[PageSpeed] 10

Hi Anh,
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; We have documentation on many of the MathScript functions available in LabVIEW.&nbsp; You can look at a document <a href="http://zone.ni.com/reference/en-XX/help/371361D-01/lvtextmath/msfunc_imread/" target="_blank">here</a> that describes how to use the imread function.&nbsp; This is searchable from ni.com by entering the function name.&nbsp; If you read this document you will see the second parameter of the function only accepts the following arguments : 'BMP', 'JPEG', 'PNG'.&nbsp; If you change your line 2 to : image1=imread('C:\LV_VertAlign\DSC_0104.jpg', 'JPEG');&nbsp; you should have no problem.&nbsp; Have a great day.
0
x9561 (148440)
6/13/2008 4:40:06 PM
Hello Anh,As you may know, LabVIEW MathScript is implemented on top of LabVIEW.&nbsp; The error message you received indicates that a problem occurred in one of the LabVIEW subVIs that MathScript calls.&nbsp; As Jim indicated, the problem is in the file type specifier you passed to the function.&nbsp; MathScript requires the use of 'JPEG' and not 'jpg' or even 'jpeg.'&nbsp; In this case, we could return a better error message.&nbsp; I have filed a bug report (115804) for this issue.You will find that once you fix this, the im2double and rgb2gray functions are not supported.&nbsp; In LabVIEW MathScript, you generally can execute scripts written in the MATLAB� language syntax.&nbsp; However, the MathScript engine executes the scripts, and the MathScript engine does not support some functions that the MATLAB software supports.We will look into adding these functions in a future release of LabVIEW MathScript.&nbsp; If you need this functionality now, these functions are very simple to write yourself.&nbsp; If you are performing additional image analysis in your script, you may wish to purchase the IMAQ toolkit.&nbsp; It doesn't add any functions to MathScript at this time, but you could continue your analysis outside of MathScript with LabVIEW VIs.MATLAB� is a registered trademark of The MathWorks, Inc.Grant M.Staff Software Engineer | LabVIEW Math &amp; Signal Processing | National Instruments
0
x9561 (148440)
6/13/2008 4:40:08 PM
Thanks Jim and Grant for the info.&nbsp; It works fine after changing the file type to JPEG. Too bad I wont be able to use imread to read in my photo which is about 3 megapixels, since imread caps out at 1 megapixel.-Anh
0
x9561 (148440)
6/13/2008 7:10:04 PM
Reply:

Similar Artilces:

How can I modify the &quot;Type definitions&quot; of &quot;Function Prototype&quot; if I want build a DLL in Labview 8.5.1.?
Hello,We have a library with several VIs (API - Interfaces to our Real Time Target). This VIs we provide to our customer to generate own VIs to control the Real Time Target.Now we want to provide the functionality of this VI-library as DLL to our customer. The problem is, that labview use self definite name of type definitions. Also if I use "strict Type definition".Example:void GetOutputValues(VARIANT *Scale_In, int32_t ModelNr, uint16_t SignalID[], TD1:smileymad: *errorIn, VARIANT *Scale_Out, TD2 *Data, TD1 *errorOut, int32_t len)It is possible to modify "TD1" and "T...

Error Code &quot;1097.....this might corrupted LABVIEW's memory..........&quot; appears after exit the labview and re-start labview
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I have a probelm when I use the "tool/import shared library(.dll)" wizard&nbsp;to generate the&nbsp;API from C. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The API &nbsp;works correctly when I complete the wizard, but after I exit labview and re-start labview to run&nbsp;the API&nbsp;again. The error 1097 code "......this might corrupted LABVIEW's memory.............."appears. &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs...

plug-in &quot;not installed&quot; in my LabVIEW project's &quot;Build Specifications&quot;
I moved my LabVIEW project from one computer to another, now when I click on any item under the project's "Build Specifications", I get an error reading "The plug-in for the selected item is not installed on your system." Does anybody know how to fix this? I have no idea what this "plug-in" is.Attached is a screenshot. plug-in error.PNG: http://forums.ni.com/attachments/ni/170/222664/1/plug-in error.PNG ...

error 7 in &quot;application builder&quot; for LabVIEW 8.5.1
Hello, &nbsp; I am getting an error while building a project for making EXE file. &nbsp; below is the displayed message. &nbsp; Error 7 occurred at Copy in New VILibrary.vi-&gt;AB_Dest_LLB.lvclass:Create_Destination.vi-&gt;AB_Build.lvclassLCreate_Destinations.vi -&gt;AB_Build.lvclasss:Build.vi-&gt;AB_EXE.lvclass:Build.vi-&gt;AB_Engine_BUild.vi-&gt;AB_Build_Invoke.vi-&gt;A B_Build_Invoke.vi.ProxyCaller &nbsp; ============================NI-488: Non-existent GPIB interface. C:\ProgramFile\NationalInstruments \LabVIEW8.5\vi.lib\Utility\libraryn.bin &am...

LabVIEW RT 8.5.1 &quot;reboot due to system error&quot;
I'm running my app on a quad core RT desktop target.&nbsp; The executable runs anywhere from a few minutes to a few hours before the machine reboots.&nbsp; About half the time I get the "reboot due to system error" and the "software state: safe mode" messages.&nbsp; rtlog.txt has no record of the reboot. &nbsp; Is there any way to get LabVIEW to log any useful data when this happens? &nbsp; What actions can I take to track this down (other than disabling portions of my code to see what part might be causing it)? Connect up a display to&nbsp; the...

Error 1047 in LabVIEW 8.2: LabVIEW failed to send variable to the script server. Server:&quot;&quot;
I am working with the evaluation version of labVIEW as well and I have run into another error.&nbsp; I am using a MATLAB script node within a for loop and attempting to pass the for loop counter variable into the script.&nbsp; When I run the code it brings up a 1047 error and says "LabVIEW failed to send variable to the script server. Server:"" ".&nbsp; I looked up the error online which seems to have roots in a failed auto initialization of MATLAB.&nbsp; Is there something that I can do in labVIEW to fix the problem or is it strictly a MATLAB error? &nb...

Build error after upgrading from 8.2.1 to 8.5 &quot;Error 1055 occurred at Invoke Node...&quot;
After upgrading to 8.5, I'm getting the following error when trying to build an EXE: &nbsp; Visit the Request Support page at ni.com/ask to learn more about resolving this problem. Use the following information as a reference: Error 1055 occurred at Invoke Node in AB_Source_Library.lvclass:Close_Reference.vi-&gt;AB_Build.lvclass:Copy_Files.vi-&gt;AB_Application.lvclass:Copy_Files.vi-&gt;AB_Build.lvclass:Build.vi-&gt;AB_EXE.lvclass:Build.vi-&gt;AB_Engine_Build.vi-&gt;AB_Build_Invoke.vi-&gt;AB_Build_Invoke.vi.ProxyCaller Possible reason(s): LabVIEW:&nbsp;...

LabVIEW 8.5.1 &quot;The build was unsuccessful&quot;
When attempting to build my executable in LabVIEW 8.5.1 I get the following dialog: &nbsp; <img src="http://forums.ni.com/attachments/ni/170/338657/1/Build%20Errors.PNG"> &nbsp; I've tried recreating my build specification, reinstalling LabVIEW, commenting out sections of my code and nothing seems to help.&nbsp; Has anyone encountered this before?&nbsp; Any ideas NI?Message Edited by FlamingYawn on 07-08-2008 11:24 AM Build Errors.PNG: http://forums.ni.com/attachments/ni/170/338657/1/Build Errors.PNG Hi, &nbsp; Are you building a .exe application? I...

Labview 8.5 error on save: &quot;Cannot load help information of [filename].&quot;
Hi all, &nbsp; &nbsp;I was working on a VI in Labview 8.5 when the program (Labview) crashed. When I relaunched Labview it asked me if I wanted to recover the VI&nbsp;I was working on,&nbsp;I said yes and the recovered VI runs fine, but I cannot save it. When&nbsp;I try to Save or Save As I receive the following error message: "Cannot load help information of [Filename]" and my only option is "Cancel Save". If I click "Cancel Save" Labview returns a "File not Found error". Until the recovery, I could and did save the file with no prob...

why it keeps on asking &quot;NI LabVIEW 8.5.1&quot; distribution when building installer?
Hi, I am building an installer for one image processing application. For addtional installers, NI Labview runtime engine 8.5.1NI vision runtime engine 8.5NI IMAQdx 3.1.2NI VISA runtime 4.3When building, it keeps on asking "NI LabVIEW 8.5.1" distribution even though I put the CD into CD room, saying it needs to copy a component installed or updated by the distribution to continue building the installer.If&nbsp; NI-IMAQ dx 3.1.2 not checked, it is OK. BUT, I need it.Thanks a lot for any help.Anne Zuo What is a "CD room"? or CD driver. sorry for my language.&nbsp; T...

Re: &quot;Total Data Size&quot; property of running VI in LabVIEW 7.1 doesn't work any more?
Just bumped into this problem and did find the answer in this thread dating back to 2005. So, is there a way to do this with 7.1 or 7.1.1 or not? From the 2005 discussion, the resolution was that in LabVIEW 7.1 and later, you cannot read the memory used by a running VI. &nbsp; I just ran both example programs posted in 2005, and no - you still cannot read the Total Data Size of a VI when it is running.&nbsp; I ran both programs in LabVIEW 8.5.1.&nbsp; &nbsp; Kevin S. Applications Engineer National InstrumentsMessage Edited by Kevin_S on 07-11-2008 04:53 PM So, how does one...

An exception occured within the external code called by a Call Library Node.... was stopped at node &quot;&quot; at a call to &quot;IMAQ RejectBorder&quot;
Hi, I get occasionnaly this message when running an executable which has been installed from the same machine: &nbsp; LabVIEW: An exception occurred within the external code called by a Call Library Node. This might have corrupted LabVIEW's memory. Save any work to a new location and restart LabVIEW. VI "1629-00_200-Main.vi" was stopped at node&nbsp;"" of subVI "IMAQ RejectBorder" &nbsp; It is really anoying because the executable can run without any poblems for many hours and then the message comes and can crash the application &nbsp; Any adv...

'&&&&a'="&&&&a."
I need a data step that is equivalent to data _NULL_; file print; put '&&&&&&a=' "&&&&&&a"; run; Yet the number of & is a variable, I need to write a Macro, so far I got only half of the code('&&&&&&a.='), I don't know how to put the other half ("&&&&&&a.") into Macro Thanks. %Macro R(k); data _NULL_; file print; put %do i= 1 %to &k.; '&' %end; 'a=' ; run; %mend; %R(10); ==================================================...

Labview &quot;Fatal Internal Error &quot;memory.cpp&quot; line 1038
Hi, &nbsp; This is an example file provided by NI and can be found in Labview 8.2\examples\instr\niHSDIO: Dynamic Generation.lib. Inside this library, there is a file called "Dynamic Generation.vi". If I copied "Dynamic Generation.vi" to other place, the labview will crash. Error message: &nbsp; "Fatal Internal Error. "memory.cpp". Line 1038. Labview version 7.1.1. You will lose any unused work, please contact NI, etc, etc" &nbsp; In the mean time, the Windows freeze. Mouse right click no response. No status bar at the bottom of the screen. T...

Web resources about - Labview 8.5.1's MathScript window failed running imread with an error &quot;A problem occurred in a subVI call.&quot; - comp.lang.labview

Resources last updated: 2/12/2016 8:49:53 AM