Compiler Error with simple vi using MatLab script nodes

While attempting to build a simple vi to test the capabilities of LabView's interface with MatLab, I received a compiler error message that said I should report the problem to National Instruments Tech Support. The error said, "reference to undefined label from: refPC=0x41C." I've attached the vi that created the error. I am using LabView 7.0 on a PC running Windows 98.
Attachments:
Compliererror.vi ‏11 KB

I don't know if this will help your problem, but there is a fix for some problems with LabVIEW 7.0 and Matlab:
http://digital.ni.com/public.nsf/websearch/4475BC3CEB062C9586256D750058F14B?OpenDocument
Good luck,
-Jim

Similar Messages

  • Compilation error with simple if-else statement

    package chapterFive;
    * Author: Sarab
    * Filename: MainClass.java
    * Purpose: Try and get my mind around the concept of the selection
    * control structures and repetition statements
    class MainClass {
         public static void main(String [] args)
              // some variables and prompt for input
              java.util.Scanner scan = new java.util.Scanner(System.in);
              System.out.print("Please enter your name: ");
              String input = scan.nextLine();
              // some repetition statement, for loop
              if (input.equals("Sarab"));
                   System.out.println("Welcome Sarab!");
              else
                   System.out.println("You are in the else statement");
                   for(int sentinelValue; sentinelValue<5; sentinelValue++)
                        System.out.println("The following is the numbers 0-4"
                                  + " printed on separate lines: " + sentinelValue);
              System.out.println("This line will print regardless of whether you"
                        + " entered the if or the else portion of the selection"
                        + " statement.");
    }I am getting the following error:
    Exception in thread "main" java.lang.Error: Unresolved compilation problem:
         Syntax error on token "else", delete this token
         at chapterFive.MainClass.main(MainClass.java:26)What's the matter? This looked straight forward enough to me.

    if (input.equals("Sarab"));
    // is the same as
    if (input.equals("Sarab")) {}
    // so what you have amounts to this:
    if (input.equals("Sarab")) {}
      System.out.println("Welcome Sarab!");
    else { ... }You've got an if block that does nothing, then a block that always executes, calling println, and then your else. Since you have that block between if and else, the if has ended and it's not legal to use else.
    Get rid of the semicolon after if.

  • Compilation error with simple ELSIF

    Below is a magic program that determines self worth in monetary exchange based on the first letter that comes to you your mind. Whether it realy does that or not is besides the point, what I don't get is what is wrong with my ELSIF statement?
    -- Majic program that will guess how much you are worth
    ACCEPT s_first PROMPT 'Enter your random letter'
    DECLARE
    random_letter  VARCHAR(20);
    personal_worth   VARCHAR(20);
    BEGIN
    IF random_letter >= 'A' AND <= 'D' THEN
    personal_worth = '$100,000';
    ELSIF random_letter >= 'E' AND <= 'K' THEN
    personal_worth = '$10,000';
    ELSIF random_letter >= 'L' AND <= 'N' THEN
    personal_worth = '$1,000';
    ELSIF random_letter >= 'O' AND <= 'P' THEN
    personal_worth = '$100';
    ELSIF random_letter >= 'Q' AND <= 'T' THEN
    personal_worth = '$10';
    ELSE random_letter >= 'U' AND <= 'Z' THEN
    personal_worth = '$1';
    dbms_output.put_line('The letter you entered was ' || random_letter || ' and your personal worth is ' || personal_worth);
    END;

    Hi,
    The code in Husain's last message works for me.
    When I enter F, it prints $10,000:
    'Enter your random letter'
    F
    The letter you entered was F and your personal worth is $10,000
    PL/SQL procedure successfully completed.When I enter T, it prints $10:
    'Enter your random letter'
    T
    The letter you entered was T and your personal worth is $10
    PL/SQL procedure successfully completed.What are you doing differently?
    Post your exact code and output.
    The code I'm running is:
    set define '&';
    PROMPT 'Enter your random letter'
    ACCEPT random_letter
    declare
         --random_letter VARCHAR(20);
         personal_worth VARCHAR(20);
    BEGIN
          IF    '&random_letter' >= 'A' AND '&random_letter' <= 'D' THEN
                   personal_worth := '$100,000';
          ELSIF '&random_letter' >= 'E' AND '&random_letter' <= 'K' THEN
                   personal_worth := '$10,000';
          ELSIF '&random_letter' >= 'L' AND '&random_letter' <= 'N' THEN
                   personal_worth := '$1,000';
          ELSIF '&random_letter' >= 'O' AND '&random_letter' <= 'P' THEN
                   personal_worth := '$100';
          ELSIF '&random_letter' >= 'Q' AND '&random_letter' <= 'T' THEN
                   personal_worth := '$10';
          ELSE --if random_letter >= 'Q'
                  personal_worth := '$1';
          end if;
    --    dbms_output.put_line('The letter you entered was ' || '&random_letter' || ' and your personal worth is ' || personal_worth);
          dbms_output.put_line('The letter you entered was &random_letter and your personal worth is ' || personal_worth);
    END;
    /Note that I changed the put_line statement at the end, but the two produce the exact same results.
    The commented out version is concatenating 3 string literals, analagous to this:
    'x' || 'y' || 'z'The second version is printing the exact same text as one sting literal:
    'xyz'If you you have a reason for using the longer way, then use it.

  • Creating a random noise (Gaussian) using Matlab Script

    Hello,
    Since I only have Labview 6.1 base, I can't use the white-noise generator in Labview. I'm thinking of using the Matlab Script. I have Matlab 2006R installed in the same computer. However, I tried running the program and nothing happened (I used the help example "a=rand(50);surf(a)" in the Matlab Script.
    Why it's not calling the Matlab, or is there a better way to create a Gaussian distribution in Labview 6.1 Base?
    Thanks a lot!

    Hello,
    Why are you unable to use the Gaussian White Noise VI in LabVIEW 6.1?  It is under the Analyze >> Signal Processing >> Signal Generation palette.  I have attached a simple VI that illustrates creating a matrix.
    If you wish to use the MATLAB® script node, let's first make sure it is working correctly.  Try opening one of the LabVIEW shipping examples.  Browse to <LabVIEW>\examples\scriptnode and open "HiQMATLAB_Fractal.llb."  Then open "MATLAB Fractal.vi."  Run the VI.  Do you get any error windows that pop up?  If not and you see a picture of a fractal appear, then the connection to the MATLAB software is working correctly.  In your VI, try creating an error out indicator from the MATLAB script node and see if any errors appear.
    If you do see an error in the shipping example, it means there is a problem with the software connection.  Make sure that you have launched the MATLAB software at least once after you installed it.  This will set up the necessary connection information.  Then launch LabVIEW.  If this isn't the issue, we could try manually restoring the server commands.  Make sure LabVIEW and the MATLAB software are not running.  Go to a command prompt, browse to the MATLAB bin directory (e.g. MATLAB\R2006b\bin), and type
    matlab -regserver
    Quit the instance of the MATLAB software that appears and launch LabVIEW.  If this also fails, please post again with any error information you receive.
    Also, the rand function in your script will not generate a Gaussian distribution. You will need to use the randn function instead.
    MATLAB® is a registered trademark of The MathWorks, Inc.
    Grant M.
    Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
    Edit: For some reason, I am unable to attach the VI.  I have included a picture instead.
    Message Edited by GrantM on 08-08-2008 02:50 PM
    Attachments:
    Gaussian Matrix.png ‏35 KB

  • How to do complex engineering calculation in labview.I tried using MATLAB script

    Hello,
    I am trying to use matlab script node to solve two complex equation.But i get different  errors everytime i run my program.sometimes 1048 sometimes 1050 and sometimes it says LABVIEW could not extract variable from Matlab.I am attaching  my MATLAB script node with this thread.Please Help me out to get rid of this problem.
    I am  using LV-8 and MATLAB R-2006a.
    Attachments:
    matlab.vi ‏10 KB

    Hi Praween,
    beside my little MatLab knowledge I tried to replace your formula with equivalent LV code...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    matlab_lv80.vi ‏18 KB

  • Input data type of Matlab script node

    Hi,
    I have 1D array of complex number in single precision.
    Matlab script node is used to import data into Matlab and do some data processing, and then export.
    Data type of input is currently double precision.
    How to re-define this input data type of the Matlab script node?
    Thanks,

    Right, arrays of singles are not supported. See Comparison of MathScript RT Module and the MATLAB® Software Data Types in LabVIEW
    As for memory usage, Profiling the VI should let you know how much memory Labview uses when running your code. Communication with MATLAB® is done through ActiveX, and I'm actually not 100% sure whether it will reflect memory usage from script execution. I think it'll be simple enough to profile your VI with and without the MATLAB Script node and note the memory usage difference...
    Misha

  • How adaptive algorithm is implemente​d through matlab script node?

    hi
    iam working on adaptive rejection algorithm
    i want to make a adaptive algorithm in labview using Matlab script node, beacuse i have the matlab file of that algorithm
    it is not directly converting in labview, so i wants to make the adaptive algorithm in labview
    but having problem to implement the adaptive algorithm
    could any one has idea?
    thanks
    Solved!
    Go to Solution.

    Hey,
    You just need to copy mfile content in MATLAB script node .. then rest of work is same as with other node in LabVIEW...
    Hope it helps..
    Regards
    HS

  • How to insert data from file into matlab script node

    I have interfaced input data from file to be processed using matlab script node. But the problem is that I could not capture the multiple data into matlab script node and to convert it into matrix. Further to this I need to process the data by plotting graphs from it. Thank you in advance for the advice

    Zarina,
    To clarify your problem, you have a script node contaning your Matlab code. Are you then using the standard LV functions to load in your data from a file and pass it into the script node?
    Regards
    Tristan

  • Error 1050 by trying to use load'filename' in matlab script node

    Hi
    I keep getting error 1050 when Labview tries to load a text file through the matlab script node.
    I've all ready checked for it on google and this forum but found nothing. I've also done this: http://digital.ni.com/public.nsf/allkb/2B3FF46C8512C4F786256CF30071BE53 and tried to use dlmread and more. 
    The thing is that  I need the matlab script node to read a txt file that Labview made from a chart with only 1 array, plot it and export a jpg image. I can't really use the 'export image' or 'get image' function in Labview cause I need the whole plotted chart (these functions only take a snap shot of it when they're run).
    This is my code that I'm using:
     data=load('file') ;
    Vpp=(data(1:2000,1));
    xsize = (1/2000);
    plot(0.0005:0.0005:1,Vpp);
    axis([0 1 -5 5]);
    print('-djpeg', 'graph.jpg');
    The usual load in matlab to load txt files and print to print the jpeg. The code works in matlab but not in labview
    And yeah, I'm using windows 7 and legal versions of matlab r2009b and Labview 2009  
    Solved!
    Go to Solution.
    Attachments:
    matlab.jpg ‏213 KB

    Yes I forgot, this is my error...  It looks like it can't read the file path, but the 'file' path is actually just a path to my c:\user\*\*\*\*.txt 
    Error 1050 occurred at LabVIEW:  Error occurred while executing script. Error message from server: ??? Error using ==> load
    Unable to read file file: No such file or directory.

  • Error (1046) using matlab script

    Hi ,
    im trying to use matlab script Labview , i've got matlab installed.
    when im running the VI , i'm getting an error 1046 , i tried to search the community ,
    and i've been told to check the "choose script server" , i dont know why , but i it's "grayed" ,
    and i cant change anything.

    Cobmetal,
    Looking at the following KnowledgeBase, it looks like MATLAB® may need to be registered as an ActiveX server first.
    http://digital.ni.com/public.nsf/allkb/5BECAA32D63921628625670C005BDA1A?OpenDocument
    Mathworks has good documentation about how to register MATLAB as a COM Automation server in the Windows registry when launched. I would try to do that if the option to choose script server is greyed out (Ctrl+F regserver).
    http://www.mathworks.com/help/matlab/ref/matlabwindows.html
    MATLAB® is a registered trademark of The MathWorks, Inc. Other product and company names listed are trademarks and trade names of their respective companies.
    Matt J
    Professional Googler and Kudo Addict
    National Instruments

  • Compilation problem with templates while using option -m64

    Hi,
    I have compilation problem with template while using option -m64.
    No problem while using option -m32.
    @ uname -a
    SunOS snt5010 5.10 Generic_127111-11 sun4v sparc SUNW,SPARC-Enterprise-T5220
    $ CC -V
    CC: Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25
    Here is some C++ program
    ############# foo5.cpp #############
    template <typename T, T N, unsigned long S = sizeof(T) * 8>
    struct static_number_of_ones
    static const T m_value = static_number_of_ones<T, N, S - 1>::m_value >> 1;
    static const unsigned long m_count = static_number_of_ones<T, N, S - 1>::m_count + (static_number_of_ones<T, N, S - 1>::m_value & 0x1);
    template <typename T, T N>
    struct static_number_of_ones<T, N, 0>
    static const T m_value = N;
    static const unsigned long m_count = 0;
    template <typename T, T N>
    struct static_is_power_of_2
    static const bool m_result = (static_number_of_ones<T,N>::m_count == 1);
    template <unsigned long N>
    struct static_number_is_power_of_2
    static const bool m_result = (static_number_of_ones<unsigned long, N>::m_count == 1);
    int main(int argc)
    int ret = 0;
    if (argc > 1)
    ret += static_is_power_of_2<unsigned short, 16>::m_result;
    ret += static_is_power_of_2<unsigned int, 16>::m_result;
    ret += static_is_power_of_2<unsigned long, 16>::m_result;
    ret += static_number_is_power_of_2<16>::m_result;
    else
    ret += static_is_power_of_2<unsigned short, 17>::m_result;
    ret += static_is_power_of_2<unsigned int, 17>::m_result;
    ret += static_is_power_of_2<unsigned long, 17>::m_result;
    ret += static_number_is_power_of_2<17>::m_result;
    return ret;
    Compiation:
    @ CC -m32 foo5.cpp
    // No problem
    @ CC -m64 foo5.cpp
    "foo5.cpp", line 20: Error: An integer constant expression is required here.
    "foo5.cpp", line 36: Where: While specializing "static_is_power_of_2<unsigned long, 16>".
    "foo5.cpp", line 36: Where: Specialized in non-template code.
    "foo5.cpp", line 26: Error: An integer constant expression is required here.
    "foo5.cpp", line 37: Where: While specializing "static_number_is_power_of_2<16>".
    "foo5.cpp", line 37: Where: Specialized in non-template code.
    "foo5.cpp", line 20: Error: An integer constant expression is required here.
    "foo5.cpp", line 43: Where: While specializing "static_is_power_of_2<unsigned long, 17>".
    "foo5.cpp", line 43: Where: Specialized in non-template code.
    "foo5.cpp", line 26: Error: An integer constant expression is required here.
    "foo5.cpp", line 44: Where: While specializing "static_number_is_power_of_2<17>".
    "foo5.cpp", line 44: Where: Specialized in non-template code.
    4 Error(s) detected.
    Predefined macro:
    @ CC -m32 -xdumpmacros=defs foo5.cpp | & tee log32
    @ CC -m64 -xdumpmacros=defs foo5.cpp | & tee log64
    @ diff log32 log64
    7c7
    < #define __TIME__ "09:24:58"
    #define __TIME__ "09:25:38"20c20
    < #define __sparcv8plus 1
    #define __sparcv9 1[snipped]
    =========================
    What is wrong?
    Thanks,
    Alex Vinokur

    Bug 6749491 has been filed for this problem. It will be visible at [http://bugs.sun.com] in a day or two.
    If you have a service contract with Sun, you can ask to have this bug's priority raised, and get a pre-release version of a compiler patch that fixes the problem.
    Otherwise, you can check for new patches from time to time at
    [http://developers.sun.com/sunstudio/downloads/patches/]
    and see whether this bug is listed as fixed.

  • Using Matlab script in Labview

    Hello,
    I am trying to use matlab script in labview to post process the sampled signals from DAQ(attached is the vi I tried)
    After every 10 seconds I want to the send the sampled voltage data to matlab scritp block which does 1) detection of peaks using peakdetection function and plots the obtained peaks on the sampled signal 2) calculates standard of 10 secs data and plots on chart.
    But I am confused of 1) how to call the peakdetection function inside the matlabscript block
    2) How to send the 10secs data of voltage and time values to the matlab script block
    3) How to plot the signal and detected peaks on the same plot (which can be done in matlab using holdon as shown in the atached vi).
    Can someone suggest for implementing these .
    Thanks.
    Solved!
    Go to Solution.
    Attachments:
    Labview&Matlab.vi ‏55 KB

    Thanks  GabeG,
    Now, Labview&Matlab_TestNoAq.vi  is woking Good and for the second one  Labview&Matlab_TestAq.vi it is showing error as shown in the attached image when these ines of code are present in the matlab scrtip 
    subplot(2,1,1),plot(maxtab(:,1),maxtab(:,2),'*r');
    SDN=std(maxtab(:,1));
    and SDN output of the Matlab script
    but when I removed these it is working fine(but not showing the detected peaks).
    Can you suggest me a solution for the above and also can I know the best method to add one more channel that samples another device signal which has to be processed in this same way(Signals sampled from 2 devices have to be porcessed in this same way).
    Thanks.
    Attachments:
    Script_Error.JPG ‏133 KB

  • Open a file using matlab script block

    Hello!
    I want to open a file from a specified directory using matlab script block.
    The input of this block is a string with file's name......but it doesn't work in this way. I have to change the input data or I have to change it  into matlab matlab script?
    Some idea?
    Thanks!
    Attachments:
    example.PNG ‏4 KB

    Ooooppss!
    My computer is crazy....sorry.
    I'm near to solve my problem...
    The problem is that I have a column of strings like this
    str=['labview'
            'labview2'
           'labview3'
            'labview4']
    I use the double command but the byte array to string block only converts me an element, do you know is exist another block to change all the elements.
    I've tried to do with a for loop block....using an index array and changing with i the index element, but it doen'st work.
    You have some idea?

  • Using matlab script

    Hello!
    I'm using matlab script block in my aplication. The m-file (from matlab) contain an 'if' that depends of an input of labview.
    I want to pass trough this condition only once when input's value changes, but labview "covert" this 'if' in a 'while' and pass trough this sequence n times.
    How can I to impose to pass throug the sequence once the input's value change. It's better to specifie it from matab or from labview.
    Thank you in adavance 

    What is surrounding the matlab script block? LabVIEW should be modifying the matlab code, it should be connecting with matlab and matlab executes its code, returning the results to LabVIEW. Can you do a screen capture of the part of the code that contains the matlab stuff? If yes make sure that it is saved as a .jpg (not .bmp!) for size reasons. If not, if you can send the part of your code that includes the matlab stuff that would help.
    P.M.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • How to load a variable using MATLAB Script?

    I need to load a selected variable from .mat file, using MATLAB script , and analyse it.
    the attched shows my vi, there are two inputs nodes 'file' contains the .mat file path, and 'varn' contains varibale name in that .mat file which can be selected by user. Using " load(file)" the whole .mat file is loaded in the workspace and become avaiable at output node, however I am not able to pass a selected variable name through string "varn" input, MATLAB script does not recognize the variable.
    any idea to reslove it is realy appreciated.
    Attachments:
    load a variable.JPG ‏18 KB

    Download the VI and .MAT file. Run the VI, and it'll plot the data inside of the .MAT file.
    Andy Chang
    National Instruments
    LabVIEW Control Design and Simulation
    Attachments:
    testfile.zip ‏5 KB

Maybe you are looking for

  • Key Figure Monitor in Prod Superviosr business package

    hi, I am trying to set up Key Figure monitor in the Production supervioser business package. I am getting the below error Invalid/No Context ID The application 'Generic Key Figure Monitor' requires a unique context ID. The context ID is a four-charac

  • Regarding headers while downloading to excel

    Hi all, I have two headers in single output  in my report output.It is displaying correctly,but when i am unable to download these two headers into excel while downloading.can anyone please help me in this. Thanks, Anil.

  • Financial Supplier Statement in Discoverer.

    Dear All i have Supplier statement report with all Debits & credits in Oracle Discoverer. Now i need to find the Balance of Supplier. Please guide me how to find the Balance from Debits and Credits. Give me Formula. Regards

  • STATUS OF LEAVE

    Hi guys, Can you please help me out  to find employee leave status in HR abap. is there any function module available  or can we get from any infotype screen thanks in advance. Ranjit

  • Multipart message from Mac with particolat structure

    My application try to parse a mail but throws an exception like: "Missing start boundary" on a message with a internal structure very strange. My message is a multipart/mixed message sended from Microsoft-Outlook-Express-Macintosh-Edition/5.0.3 Conte