LabVIEW 8.5 problems using strings with MATLAB Script node

I am having some problems that seem to be a bug that I can not understand how to solve using strings in the MATLAB script node.

I have two subVIs that make some calculations and both include a variable called "errortext" is a string. The two subVIs do their calculations using the MATLAB script node, so all the outputs are defined in the script node.

The first sub - VI outputs that string and a number. The string is sent to an indicator on the front panel. The number is sent to the second Subvi which performs some calculations more and then returns another string of the same name to an indicator on the front panel. This second string is different from the first (error different two messages should appear).

I did have problems with this in the past until this morning. This morning, it seems that two of these channels are now somehow mystically connected to each other. The second string repeat that what the first channel said despite the fact that the first string is not be linked to the Subvi where lives the second string. The only link between the two is a calculated value of double which went from #1 to the Subvi #2 Subvi.

I tried many things: I tried to rename the strings so that they do not have the same name. Initially, he would not let me and gave me an error saying that the renowned string was a undefined variable (which is ridiculous). After removing and replacing things, I finally managed to do so I would change the name, but now it displays nothing at all and even more I think it might still display a completely different another string in my code!

I also tried to remove the channel indicator and replace it. Yet once, it wouldn't let me initially. I would like to highlight, press DELETE and nothing. Finally after replacing all the subVIs with them, I was able to remove the flags, but this did not help the problem.

Any idea for these problems pecular is greatly appreciated!

I totally understand what you did, you were talking about variables in your fist post, and it was not clear if you were referring to a variable you have defined in the Matlab code, or you try to call a variable indicator/control, where is often seen on this forum (and who isn't). That said, the crux of The Matlab Script communicates with Matlab via ActiveX, and when you use a command window opens small. This is the workspace of Matlab environment. A variable that you define in a Matlab Script node will be visible in the other, even if it's in another VI (see attached for an example, figure). This is because the script nodes are running in the same environment space. It seems to me that if this is what is happening.

Tags: NI Software

Similar Questions

  • Spend the MATLAB data types 'cell' between MATLAB script nodes in LabView?

    Hi all

    I need to pass a variable of data type of cell of a MATLAB script node in LabView to another, but the cell is not listed as a data type 'exit' in the script node.

    Is it possible to do without converting them into a 2D array?  Each column of my cell has a different number of lines...

    Thank you!

    Mike

    Too bad...

    Rather than use a typical LabView, I just say

    assignin ('basic', ' varname', varvalue ");

    in the first script and varname called from the second node to get my cell.

    Easy... duh leaving here if anyone has the same issue in the future.

  • MATLAB script node error: 1046

    Hello world

    I now use Labview for data acquisition and want to use MATLAB
    function of node script to do the work of image processing.

    I have some problems get MATLAB script to function properly. The
    It is:

    Whenever I tried to run the program, Labview gave me the following
    error:

    "Error 1046: Labview does not initialize the script server, make sure that the server software is.
    installed. »

    However, MATLAB is installed in the PC. I think that the reason of
    This error is that I'm using a PC based campus University. I got into this PC MATLAB is a network
    versioned. (i.e.
    installed on the network server, but not in the local hard disk).

    Is that what I can do to work around this error?

    Kind regards
    Kent

    Hi hykwei,

    Unfortunately, it is not possible to obtain the MATLAB Script nodes to work
    LabVIEW under your current network configuration. So that the
    Node MATLAB Script to work properly, it takes that MATLAB is
    installed on the same machine as LabVIEW. This means that you will need
    either install MATLAB on the local computer on which you apply
    LabVIEW or you need install and use LabVIEW in the same
    Server computer where MATLAB is installed. Function of MATLAB
    feature, you may be able to make some sort of minimum installation on the
    local machine that adds MATLAB to your registry and program files list,
    but who sends you right to the copy of MATLAB on the network.
    However, I am not aware if it is still an option or how you could go
    on the implementation of this scheme, so if you are interested, I would contact with
    MATLAB for more on this topic.

    Kind regards

  • Features of the Matlab script node

    Comparing only the specific features that overlap of Matlab and Labview, is there an advantage for the latter to be able to run blocks in parallel? What exactly is the purpose of the Matlab script node in Labview?

    MathScript can be deployed on real-time hardware (if that is the question). I don't know about the others.

  • error 1050 with matlab script

    Hi, i ' v built a vi what sampling record and playback of audio files, I also added matlab script for data analysis.

    the script tested in matlab and matlab works great, when im trying to use it in labview, I get an error when running sciprt matlab. "Error with the help of griddedInterpolant... »

    I think the error takes place whe trying to run the command: "Sigitp = interp1 (clptv, clpsig, tv,"linear")"; "."

    Furthermore, I can not understand how to read the saved filed when the loop is complete.

    I don't know what the problem is.

    The vi are:

    I have also included the vi

    found how to get this working, the problem was with entry to the matlab script.

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

    Hello

    I get error 1050 when Labview is trying to load a text via the node of matlab script file.

    I have all ready checked for her on this forum and google but found nothing. I also did this: http://digital.ni.com/public.nsf/allkb/2B3FF46C8512C4F786256CF30071BE53 and tried to use dlmread and much more.

    The thing is that I need the node matlab script for reading a txt file that Labview made a chart with 1 single table, draw the it and export a jpg image. I can't really use the 'export picture' or 'get image' function for cause of Labview, I need the whole route chart (these functions only take a snapshot of it when they are run).

    It's my code I use:

    Data = Load ('file');

    VPP = (Data (1:2000,1));

    XSIZE = (1/2000);

    Plot (0.0005:0.0005:1 VPP);

    axis ([1 0 5 - 5]);

    print ('-images ', 'graph.jpg');

    The usual matlab load to load txt files and print to print the jpeg format. The code works in matlab, but not in labview

    And Yes, I use windows 7 and legal versions of matlab r2009b and Labview 2009

    Hehe, I thought about it

    Path must be converted to a string and skip the ' in the file.

    He worked

  • How to capture the data of type string with agent script and then compared to an alarm

    Hello...

    How to capture the string with agent of script data and then create a rule to compare the string data to generate alarm?

    Thank you!...

    Start here:

    http://en.community.Dell.com/TechCenter/performance-monitoring/Foglight-administrators/w/Admins-wiki/6155.custom-script-agent-1-leverage-an-existing-monitoring-script-to-push-data-into-Foglight

  • Problems using BufferApp with Mozilla

    I try to save content I find on the internet using the mozilla browser. I have a BufferApp account, but with content buffering problems. My website http://www.5v5flag.com is a newer site, but this should not create any problems with get content for my blog. Everyone has problems with Mozilla BufferApp.com

    Is the difficulty in using the site (such as a Web site) or the BufferApp extension (http://bufferapp.com/extensions)?

    If this is a common problem, people of BufferApp support might be best placed to answer, but if they are confused, we might be able to spot a conflict of add-on or another factor that they have not heard before.

  • Display problems using Firefox with Windows 7, 64-bit

    Hi support them

    I have a new desktop computer running Windows 7, 64 bit.
    When I use Firefox version 3.6.8 to view my Web site, it displays everything out of alignment.
    If I use IE 8.0 it shows very well.
    If I use my laptop which is running Win XP site displays fine with IE 8.0 and Firefox.
    So I guess it may be a problem with Win 7, 64 bit and Firefox work well together.
    Is there a ready solution to help solve this problem or I have to wait until Firefox came out in a 64-bit version?

    Reset the page zoom on Web sites that have bad air: "view > Zoom > Reset" (Ctrl + 0 (zero))

    See http://kb.mozillazine.org/Zoom_text_of_web_pages

    See also the font size and zoom - increase the size of web pages and font size and zoom - increase the size of web pages and change use the sites of fonts and colors

    If you increased the minimum font size then try a lower setting (default is none) as too high can cause problems that you described.

    Tools > Options > Content : Fonts & Colors: Advanced > Minimum Font Size
    Tools > Options > Content : Fonts & Colors: Advanced > "Allow pages to choose their own fonts, instead of my selections above"
    
  • using strings with percent sign

    I have a long text string that gets parsed as I create custom controls.  The question that I have is to have a percentage in this text string and flags sign is to jump.

    First of all, I doubled the percentage sign who took my first error an unknown specifier.  Now, I'm getting it again, but later in my code.

    String = "ringchoose 1 = Variable check 1-Var, Var 2 = 2, Var 3 = 3; ring: Variable Type compare-char = 1, = 2 int, float/double = 3, chain = 4; the value Format specifier: using %%d used if this value is returned in the string. See Help)-% v; ringoperation-less = 1, equal to = 2, Greater Than = 3, not equal to = 4; "value: value to compare.

    string_args = malloc(strlen(string_arguments)+1);                                  sprintf(string_args,string_arguments); //errored here first time                                        token = strtok(string_args,";");
    while (token != NULL) {                                           item_list=0;                                          arg_token = realloc(arg_token,strlen(token)+1);
                                                sprintf(arg_token,token);   //error here now
                                                            arg_ptr = strtok(arg_token,":");                                            if (strstr(arg_ptr,"ring") != NULL) {                                               arg_ptr = strtok(NULL,"-"); //should now hold title of ring                                             controlIDs[i] = NewCtrl(funcHandle,CTRL_RING,arg_ptr,50*(i+1)+offset,40);                                               SetCtrlAttribute(funcHandle,controlIDs[i],ATTR_WIDTH,200);
                                                    while (arg_ptr != NULL) {
                                                        arg_ptr = strtok(NULL,"=");
                                                        if ((arg_ptr == NULL) || (strchr(arg_ptr,';') != NULL)) break;
                                                        value = atoi(strtok(NULL,",\0")); //holds value
                                                InsertListItem(funcHandle,controlIDs[i],-1,arg_ptr,value);
                                                                    if (arg_ptr[0] == '*') {
                                                            GetNumListItems(funcHandle,controlIDs[i],&item_list);   //holds index-1 to set active
                                                        }
                                                    }
    }
    //Rest of if/elses not supplied  since I know looping works
    
    i++;
                                                sprintf(string_args,string_arguments);  //resets tokening
                                                token = strtok(string_args,";");
                                                for (int j = 0; j < i; j++) {
                                                    token = strtok(NULL,";");
                                                }
    

    It's almost as if the extra percentage signs stripped the first time and the second time I did of this chain, they mistake.

    In the example that you have posted, it seems that you could use strcpy() instead of the sprintf() function. strcpy() would not seek to interpret the content of the string in the same way.

    JR

  • Problem of Windows with Action Scripts run from a Panel

    I created a panel that has shortcuts for Menu items and tools. I have also two buttons on my slab that run scripts that were created with Actions. I tested these two scripts with the ExtendScript Toolkit for both Mac and windows.

    Both scripts do not run on some computers in the window, but they do on others. It seems that the problem more with 7 of the window then in any other operating system, but it is not universal.

    I am at a loss on how to get hurt this problem. Machine window 7, I'm testing on runs the script without any problems, but some users of my panels have the problem above.

    Any ideas?

    Thanks in advance - Sam

    Action handler code looks like it's a step to play a shadow of action which lies in a defined action named SmileixPix.

    If you added that action shadow action value saved SmilePix the action defined and distributed the action defined in the package.

    If users have an action set SmilePix and you loaded the update action defined as a part of you install. Users can end up with two responsible actions named sets SmilePix one containing the action of the shadow and the other without the Sdade action.  I don't know what would happen if your panels has been used and there was a prior action set SmilePix which is not the action of the shadow.  Make sure that defective computers do not list Action Games named SmilePix twon

  • Webcam on Satego X 200 - cannot use it with ICQ

    Hello

    Webcam works fine - with CAM software but not with ICQ.
    When I take a glance in the Panel of configuration/Scanner/cameras it isn´t
    in the list.

    Can someone help me please?

    Please, I beg you!

    Hello

    One of my friends told me that he has disabled the software of the Webcam at MSCONFIG startup and after that he has no problem using cam with other applications. You can try to test it.

    > Hm, most PC problems sit befor 30cm screen. :)

    I agree with you! ;)

  • labview MATLAB script prevents the execution of several times.

    I have a code for communication series in matlab, I want to use in labview for graphical interface easier and better design. for this I used the matlab script node in labview. It seems that labview continue executing the script of matlab, but I want to labview to execute only once.is he sort of to do?

    I don't see how that can occur if you run the VI in "continuous" mode

  • Permission denied error when you use the Matlab script

    I have the following simple running a Matlab script in Labview.

    K = 5;
    Matrix = randn (4,4);
    matlab.io.saveVariablesToScript ('Parameters.m', {'K', 'Matrix'})

    the last command saves the variables 'K' and 'Matrix' in the m-settings file that I can then use to load the settings 'K' and 'Matrix' to a 'Control Design and Simulation Model'.

    When I run the now from Matlab everything works fine. When I run this LabVIEW so I get the following error:

    LabVIEW: An error has occurred during execution of the script. Error message from the server?: Error using matlab.io.saveVariablesToScript
    Parameters.m: Could not open the file: permission denied.

    I use Matlab 2015 and LAbview 2015 in a 64-bit windows computer 7.

    Any help would be really appreciated.

    For those who have the same permission denied errors, I found the solution.

    I had to specify the current working directory in the matlab script (this is the directory to which you saved your LAbview VI).

    For example, if you have saved your labview vi to C:\Example_Folder

    then you must add the following command in your matlab script node before the command that causes the error

    CD (' c:/Example_Folder')

    I hope this will help.

  • Problem using multiple declarations

    I'm having a problem using several WITH instructions. Oracle seems to be waiting for a SELECT statement after the first. I need two to refer to things from each other in another query.

    Here is my code:

    < code >
    WITH calculate_terms AS (SELECT robinst_current_term_code,
    CASE
    WHEN robinst_current_term_code LIKE ' %' 60' THEN robinst_current_term_code - 40.
    WHEN robinst_current_term_code LIKE ' %' 20' THEN robinst_current_term_code - 100.
    END first_term

    CASE
    WHEN robinst_current_term_code LIKE ' %' 60' THEN robinst_current_term_code - 100.
    WHEN robinst_current_term_code LIKE ' %' 20' THEN robinst_current_term_code - 160.
    END second_term

    OF robinst
    WHERE robinst_aidy_code =: sanra)

    / * Use the terms of calculate_terms to generate attendance periods * /.
    WITH gen_attn_terms AS
    (
    SELECT
    CASE
    WHEN first_term AS '60% ' THEN 'fall'. substr (first_term, 0, 4)
    WHEN first_term LIKE '% 20' CAN 'spring'. substr (first_term, 0, 4)
    END first_attn_period

    CASE
    WHEN second_term AS '60% ' THEN 'fall'. substr (second_term, 0, 4)
    WHEN second_term LIKE '% 20' CAN 'spring'. substr (second_term, 0, 4)
    END second_attn_period

    OF calculate_terms
    )

    SELECT *.

    OF gen_attn_terms
    < code >

    I get ORA-00928: SELECT key word error absent. What could be the problem?

    You can just separate them with a comma:

    WITH calculate_terms AS (SELECT robinst_current_term_code,
    CASE
    WHEN robinst_current_term_code LIKE '%60' THEN robinst_current_term_code - '40'
    WHEN robinst_current_term_code LIKE '%20' THEN robinst_current_term_code - '100'
    END first_term,
    
    CASE
    WHEN robinst_current_term_code LIKE '%60' THEN robinst_current_term_code - '100'
    WHEN robinst_current_term_code LIKE '%20' THEN robinst_current_term_code - '160'
    END second_term
    
    FROM robinst
    WHERE robinst_aidy_code = :aidy),
    
    /*Use terms from calculate_terms to generate attendance periods*/
    gen_attn_terms AS
    (
    SELECT
    CASE
    WHEN first_term LIKE '%60' THEN 'Fall '||substr(first_term,0,4)
    WHEN first_term LIKE '%20' THEN 'Spring '||substr(first_term,0,4)
    END first_attn_period,
    
    CASE
    WHEN second_term LIKE '%60' THEN 'Fall '||substr(second_term,0,4)
    WHEN second_term LIKE '%20' THEN 'Spring '||substr(second_term,0,4)
    END second_attn_period
    
    FROM calculate_terms
    )
    

    Not yet tested there is no scripts.

Maybe you are looking for