Dynamicall​y load script

Hi everybody,
Is it possible to load a different m file by browsing it once I have made an executable out of my LV program?
I'll try to explain :
I have 24 data acquisition channels on my bench and I want to make combinations between them (linear or not). I know I will have a maximum number of 5 calculated channels but I don't know neither which channels will be used as inputs nor what operation has to be made.
Example :
Ch_calc_1 = ch5*ch9; Ch_calc_2 = ch1+ch5 +ch8*ch15.
Ch_calc_1 = ch1+ch9+ch14; Ch_calc_2 = ch1*ch5 +ch8*ch15.
Ch_calc_1 = sin(ch9)+cos(ch12+ch19); Ch_calc_2 = ch1+ch5 +ch8*ch15
And so on.
I already know the number of inputs can not be managed dynamically and I think about a swhich (limiting number of input  from 2 to 10). But I don't know how I can load  a  different formula  when ever  I want.
By the way, I do not necessarly need an m file. Using a simple text box on my front panel where I can directly type my formula would be good also.
Thanks for help.
Raoul Chodziesner-Bonne
Ingénieur Instrumentation
CRIL TECHNOLOGY - Groupe ALYOTECH
"Celui qui pose une question peut paraitre idiot sur le moment, celui qui n'en pose pas le reste toute sa vie!"

Hello Raoul,
The short answer to your question is no, it is not possible to load a different .m file in a built executable.  Providing a text box for string input to the MathScript node will not work either.
The difficulty lies in the fact that MathScript is a compiled language.  In order to create executable code from an arbitrary .m file, we would need to first compile it.  This functionality is not provided in the run-time engine.  This question comes up frequently and, honestly, we are a little puzzled as to the usefulness.  Could you elaborate more about your application?  What MathScript functions would you expect to be able to call?  Would you need the performance to be similar to a compiled MathScript?
A simple workaround is to use a development version of LabVIEW at each location you would have used a built executable.  The development version has the necessary functionality to do what you wish.  You could have a string control on the front panel, pass in this string to the MathScript node, and call the "eval" function.
However, if you wish to use a built executable, there are a couple other workarounds possible.  The first is if you can predefine the set of all possible computations you wish to perform.  You can then write LabVIEW code to choose among them as well as provide a mechanism for ensuring the right channel data gets to the MathScript node.  See the screenshot below and attached VI for an example of what I mean.
The other workaround is to use the LabVIEW formula parsing and evaluation VIs.  These VIs are available on the Mathematics >> Script & Formula palette.  These all take a formula string input that you can specify from a front panel control.  However, these VIs do not provide as much functionality as the MathScript node.
Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
Message Edited by GrantM on 01-23-2008 05:02 PM
Attachments:
select.png ‏13 KB
select.vi ‏1 KB

Similar Messages

  • Creating SQL-Loader script for more than one table at a time

    Hi,
    I am using OMWB 2.0.2.0.0 with Oracle 8.1.7 and Sybase 11.9.
    It looks like I can create SQL-Loader scripts for all the tables
    or for one table at a time. If I want to create SQL-Loader
    scripts for 5-6 tables, I have to either create script for all
    the tables and then delete the unwanted tables or create the
    scripts for one table at a time and then merge them.
    Is there a simple way to create migration scripts for more than
    one but not all tables at a time?
    Thanks,
    Prashant Rane

    No there is no multi-select for creating SQL-Loader scripts.
    You can either create them separately or create them all and
    then discard the one you do not need.

  • How to Eliminate Special Character in SQL LOADER Script

    How to eliminate special character from SQL LOADER script file which suppose not to insert in TABLE
    example.CSV lile like this
    <ABC/ , 7747>
    <DEF/ , 7763>
    <NEW/ , 7779>
    <OLD/, 7795>
    I have to remove < > and / character at the time of loading into table. How It could be done. It is not possible to remove < , > , / character manually from CSV file

    On Unix/Linux that's very easy, on Windows... I don't know...
    $ cat myfile.csv
    <ABC/ , 7747>
    <DEF/ , 7763>
    <NEW/ , 7779>
    <OLD/, 7795>
    $ tr -d "\057\074\076" <myfile.csv >outfile.csv
    $ cat outfile.csv
    ABC , 7747
    DEF , 7763
    NEW , 7779
    OLD, 7795
    $

  • ORA-00936 error from SQL expression in SQL*Loader script

    I am getting the above error on the following line in my SQL*Loader script:
    DIA_CLM_RES_OID DECIMAL EXTERNAL
    "SELECT N_ORG_ENTY_ID FROM TESTG4.ORG_ENTITY
    WHERE N_USER_ID =
    (SELECT UNIQUE WSR_NT_ID FROM CONV_CLM_RESOURCE
    WHERE CLM_RES_OID = :DIA_CLM_RES_OID)",
    What I am basically trying to do is a 2-table lookup of a value:
    1. Find a row in table CONV_CLM_RESOURCE where the value in column CLM_RES_OID matches the value in the input file in field DIA_CLM_RES_OID.
    2. Take the value of field WSR_NT_ID from that row and use it to find a row in table TESTG4.ORG_ENTITY.
    3. Take the value of field WSR_NT_ID from that row and set it in the target table in field DIA_CLM_RES_OID.
    In other words, I am essentially trying to translate the input value by using two other tables to lookup the value to translate to. However, no matter how I arrange it, I keep getting the "ORA-00936: missing expression" error on this statement.
    Can anyone see what I am doing wrong, or perhaps suggest a better way of accomplishing a two-table translation of a value?
    Thanks!

    Still not sure why this doesn't work, but I was able to create and use a function to do this instead, which is probably a better approach anyway.

  • Cannot load script for execution.

    hi 
     iam creating  the  sisi package  with in script task . script task   was  build successful .  but when i was executive the ssis packages vs 2012.
     it get  error :Cannot load script for execution..
     the code is 
       Microsoft SQL Server Integration Services Script Task
       Write scripts using Microsoft Visual C# 2008.
       The ScriptMain is the entry point class of the script.
    using System;
    using System.Data;
    using Microsoft.SqlServer.Dts.Runtime;
    using System.Windows.Forms;
    using System.IO;
    namespace ST_8cdbf584a74b48abb384d8f03cf42f4d.csproj
        public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
            #region VSTA generated code
            enum ScriptResults
                Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
                Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
            #endregion
    The execution engine calls this method when the task executes.
    To access the object model, use the Dts property. Connections, variables, events,
    and logging features are available as members of the Dts property as shown in the following examples.
    To reference a variable, call Dts.Variables["MyCaseSensitiveVariableName"].Value;
    To post a log entry, call Dts.Log("This is my log text", 999, null);
    To fire an event, call Dts.Events.FireInformation(99, "test", "hit the help message", "", 0, true);
    To use the connections collection use something like the following:
    ConnectionManager cm = Dts.Connections.Add("OLEDB");
    cm.ConnectionString = "Data Source=localhost;Initial Catalog=AdventureWorks;Provider=SQLNCLI10;Integrated Security=SSPI;Auto Translate=False;";
    Before returning from this method, set the value of Dts.TaskResult to indicate success or failure.
    To open Help, press F1.
            public void Main()
                byte[] dataByte = null; String errInfo = "";
                try
                    String sDirectory = Dts.Variables["User::Directory"].Value.ToString();
                    String CreatePartitionFileXMLA = sDirectory + "\\partitionssales20010701to20010731.XMLA";
                    String ProcessPartitionFileXMLA = sDirectory + "\\partitionssales20010701to20010731.XMLA";
                    // Create XMLA Script
                    Dts.Variables["User::CreatePartitions"].Value = ReadFile(CreatePartitionFileXMLA, errInfo);
                    if (errInfo.Length > 0)
                        Dts.Log("Error while reading XMLA file: " + errInfo, 0, dataByte);
                        Dts.TaskResult = (int)ScriptResults.Failure;
                    //Process XMLA Script
                    Dts.Variables["User::ProcessPartitions"].Value = ReadFile(ProcessPartitionFileXMLA, errInfo);
                    if (errInfo.Length > 0)
                        Dts.Log("Error while reading XMLA file: " + errInfo, 0, dataByte);
                        Dts.TaskResult = (int)ScriptResults.Failure;
                    Dts.TaskResult = (int)ScriptResults.Success;
                catch (Exception ex)
                    Dts.Log("Error Message: " + ex.Message, 0, dataByte);
                    Dts.TaskResult = (int)ScriptResults.Failure;
            public String ReadFile(String FilePath, String ErrInfo)
                String strContents;
                StreamReader sReader;
                try
                    sReader = File.OpenText(FilePath);
                    strContents = sReader.ReadToEnd();
                    sReader.Close();
                    return strContents;
                catch (Exception e)
                    MessageBox.Show(ErrInfo);
                    ErrInfo = e.Message;
                    return "";
     how to solve this issue
     pleasse help me..

    Hi sheshu0022,
    Based on my research, the issue can be occurred due to something get corrupted in the script task. To fix this issue, please copy the code in the task, then rebuild the script task with the same code to test again.
    The following similar thread is for your reference:
    http://stackoverflow.com/questions/15165760/ssis-script-task-fails-on-server-with-error-cannot-load-script-for-execution
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Using SQL Loader script in a Stored Procedure

    Can I use SQL Loader script in a stored procedure and then execute it from a front-end appl.? The reason for this seemingly convoluted solution is that the users don't want a batch load though the records volume is quite high (around 1 mil). Other loads using ODBC connection or OLE DB seem to be inferior to SQL Loader.

    I would suggest a couple of solutions:
    1. Have a cgi script that can upload the file to the server from a web ui, then have the cgi script call the sql*loader file, and it will insert into the database.
    2. You can try to use External tables. This is avaliable in 9i and onwards. You will be able to make any sql DML on the external table.
    I would normally use sql*loader, move the data to a staging table with nologging, and paralle loading. After it has been loaded into the staging table I would process it into my main tables. Have used this approach with up to 60 million records in one load.
    You can do calls to C procedures, Pro*C procedures through PLSQL, as well as java calls, or use Java stored procedures.
    My experience is that SQL*Loader is the fastest way to load data into the database.

  • Need help in Load script

    Hi All,
    I have recorded a Load script with 5 classes(5 check boxes) and i press select all button,so if script is having 5 classes it will pass and if it is having less than 5 classes it is failing.
    http.solveXPath("web.input.selected",".//INPUT[@name='selected[]']/@value", "3523", 0,EncodeOptions.None);-one checkbox
    Need suggestions what should be done.
    Thanks
    Mahesh

    hi, use this one, it's working, if any thing u want mail to this id [email protected] .
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <script type="text/javascript">
    var newwindow;
    function poptastic(url) {
    newwindow=window.open(url,'name','height=300,width=400,left=100, top=100,resizable=yes,scrollbars=yes,toolbar=yes,status=yes');
    if (window.focus) {
    newwindow.focus()
    } else {
    newwindow.close()
    } // if (window.focus) {newwindow.focus()} }
    </script>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    </HEAD>
    <BODY>
    World Environment
    </BODY>
    </HTML>

  • Cannot load script for the required change in butt...

    I got the email saying Skype will be changed after 15 March.  It says we need the new buttons.  So I go the site, and then there is a big box which says: "cut and paste this" which is:
    <script type="text/javascript" src="http://www.skypeassets.com/i/scom/js/skype-uri.js"></script>
    <div id="SkypeButton_Call_[Removed for privacy]_1">
    <script type="text/javascript">
    Skype.ui({
    "name": "call",
    "element": "SkypeButton_Call_[Removed for privacy]_1",
    "participants": ["[Removed for privacy]"],
    "imageSize": 32
    </script>
    </div>
    So where do I paste this script. Plus I get we need to do on our Ipads as well.

    Hi sheshu0022,
    Based on my research, the issue can be occurred due to something get corrupted in the script task. To fix this issue, please copy the code in the task, then rebuild the script task with the same code to test again.
    The following similar thread is for your reference:
    http://stackoverflow.com/questions/15165760/ssis-script-task-fails-on-server-with-error-cannot-load-script-for-execution
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Sql loader script

    hi all i require a sql loader script
    i have some files that i will have to load to oracle database 11g... i dont know the number of files that will fall on the directory daily
    how do i do this. ?
    my requirement is in_file parameter in the control file should be dynamically populated with the file names and all the files should be processed ... the structure and columns in all the files are same.
    plz let me know if you have code for this.
    regards
    raj

    Raj,
    Here is you can use to generate sqlldr control and you can include this in simple sql script or call it from unix script or batch script. Run this sql from IDE or sqlplus and pass "table name " generate sqlldr control file
    spool &table_name..ctl
    SELECT      'LOAD DATA'
             || CHR (10)
             || 'INFILE '''
             || LOWER (table_name)
             || '.dat'''
             || CHR (10)
             || 'INTO TABLE '
             || table_name
             || CHR (10)
             || 'FIELDS TERMINATED BY '','''
             || CHR (10)
             || 'TRAILING NULLCOLS'
             || CHR (10)
             || '('
      FROM   user_tables
    WHERE   table_name = UPPER ('&table_name');
      SELECT   DECODE (ROWNUM, 1, '   ', ' , ') || RPAD (column_name, 33, ' ')
               || DECODE (
                     data_type,
                     'VARCHAR2',
                     'CHAR NULLIF (' || column_name || '=BLANKS)',
                     'FLOAT',
                     'DECIMAL EXTERNAL NULLIF(' || column_name || '=BLANKS)',
                     'NUMBER',
                     DECODE (
                        data_precision,
                        0,
                        'INTEGER EXTERNAL NULLIF (' || column_name || '=BLANKS)',
                        DECODE (
                           data_scale,
                           0,
                           'INTEGER EXTERNAL NULLIF (' || column_name || '=BLANKS)',
                           'DECIMAL EXTERNAL NULLIF (' || column_name || '=BLANKS)'
                     'DATE',
                     'DATE "&dformat" NULLIF (' || column_name || '=BLANKS)',
                     NULL
        FROM   user_tab_columns
       WHERE   table_name = UPPER ('&table_name')
    ORDER BY   column_id;
    SELECT   ')' FROM DUAL;
    spool offhttp://www.oracleutilities.com/OSUtil/sqlldr.html
    Regards

  • Error: Failed to load script file; java.lang.ArrayIndexOutOfBound.Exception: 3184

    Script editor was working find when I last used it last week.  Tried to open a script today to make some changes and now I'm getting this error message.  I have uninstalled and re-installed editor, checked the compatibility mode and it wont open the script.  any ideas out there what the problem could be? need some trouble shooting help.
    Error:
    failed to load script file: java.lang.ArrayIndexOutOfBound.Expception: 3184
    Thanks
    Lora

    Hmmm....   I haven't seen that, but I can tell you what I would do if I were you.  This is kind of drastic, but the alternative may be a workstation reimage.
    Open the windows control panel, and open the add/remove programs snap in.
    Uninstall the CRS editor.
    Uninstall all the JRE instances you have.  They may be listed as something like Java (TM) update....   or they may appear as J2SE Runtime....   Check in the J's (it's alphabetical) and uninstall all of them.
    Reboot the machine.
    Download and reinstall Java 1.6.0.17   (This is what's running on my workstation right now, and it works with the editor).
    Reinstall the CRS editor
    Reboot the machine
    Try it and see if it behaves.  If it doesn't, you may need to rebuild the whole thing.

  • Failed to load script class for script ...

    We are trying to run a script in Thin Client mode, recorded in Oracle Functional Testing,
    But get: "Failed to load script class for script ...".
    Anyone has any tips for what we should check to solve this problem?

    Hi,
    There was no option for "java client", and it was set to "thin client" by default.
    Anyway, changing the setting back and forth between "thick client" and "thin client" solved the problem.
    Thanks.

  • Applescript: Problem Using Load Script File. Please Help :-!

    My setup: file 1 is a script object and file 2 is the script that uses the script object in file 1. This seems straightforward, but I'm getting runtime errors when tryig to use the script object, whether looking at its properties or calling its handlers. The whole thing just doesn't work. What am I doing wrong?
    Question 1: Is the 'load script' statement correct in file 2? It took forever and looking at many examples to not get an error in that statement. I don't understand why the path string is 'as alias'.
    Question 2:  When loading a script and specifying its path, is there a way to start with the current path (of the executing script file). All the scripts are stored together, but so far, I've only seen commands for absolute paths or user or desktop, etc. how can I get the path of the currently running script?
    Question 3: Is the cURL syntax ok? I can't even get the script to run to that line, so I don't know if it will even execute.
    Thanks a million, in advance.
    Cheers,
    Mark
    File 1: this is the script library file
    script AR_Redeye
      -- IR Command URLs
              property outside_lights_ON : "http://..."
              property outside_lights_OFF : "http://..."
              on do_command(command_url)
              -- execute the url using cURL
                        set command_status to (do shell script "/usr/bin/curl -s -S  " & command_url) as string
              -- the url (when opened in a web browser) displays 'success' or 'fail'
                        return command_status
              end do_command
    end script
    File 2: The script that calls the handlers in the library file
    set arRedeye to load script (("Macintosh HD:Users:...:AR Redeye Class.scptd") as alias)
    tell arRedeye to do_command("http://...")

    If I may indulge you again, I've cleaned up the scripts according to your advice and made progress, but I am still receiving the following errors:
    Applescript Error:
    «script» doesn’t understand the do_command message.  (see below for where it occurs)
    I also get an error for referencing a property of the script object.
    Might you provide some insight as to why this is occurring?
    Still a little confused.
    Thanks,
    Mark
    =================================
    -- File AR_Redeye.scptd
    -- IR Command URLs
    property outside_lights_ON : "http://redeye..."
    property outside_lights_OFF : "http://redeye..."
    property all_AV_OFF : "http://redeye..."
    property airplay_all_rooms : "http://redeye..."
    on do_command(command_url)
      -- execute the url using cURL
              set command_status to (do shell script "/usr/bin/curl -s -S  " & (command_url as string)) as string
              return command_status
    end do_command
    -- End file
    ==================================
    -- Main Script File
    tell application "Finder" to set appPath to container of (path to me)
    set scriptPath to POSIX path of (appPath as text) & "AR Redeye Class.scptd"
    set arRedeye to (load script scriptPath)
    tell arRedeye to do_command(outside_lights_ON of arRedeye)
    -- the above line returns an error: «script» doesn’t understand the do_command message.
    -- also returns an error related to using the property outside_lights_ON of the arRedeye script object.
    -- Main Script File End

  • Changing Host/Server for an EBS form Load script

    I am trying to create load scripts which can be reused. I"m having issues with the New Journals and New Invoices functionality. For some reason I cannot convert or change a load script for either of these processes for a new server (HTTP address). I am able to do this convert for Inquiry of Journals and invoices fine. so it has to be something to do with adding new data. Does anyone have any knowledge or know of any tips for doing this? I really would prefer not having to record multiple scripts, one for each environment.

    Just thought I would report back on this as I have managed to test the provisioning script with the 'network profile' option at last:
    After using 'network profile' in the networking / interface setup of the boot interface, and running the provisioning script - the following occurs:
    1) /etc/dhcpd.conf is updated on the staging server to reflect all MAC addresses entered in
    2) The network profile auto allocates hostnames / IP addresses for each MAC address - again these are entered for each host in dhcpd.conf
    3) Each host is set to take filename "/pxelinux.0"; even if the path to the boot directory is set to "linux-install/pxelinux.0" in (Infrastructure/Boot configuration) - manual change is required.
    So from a dhcpd.conf - it all looked very promising apart from the pxelinux.0 change....
    However, after the provisioning install had completed, the hostname did not end up as that which was set in dhcpd.conf - but again - a combination of 'ovs-MAC'.
    In addition /etc/hosts on the newly provisioned OVM server was not updated to reflect the host name either. This is a problem as it's very important to have a correctly formatted /etc/hosts for OVM to actually work.
    The only good news is that the IP address that was set in the network profile (and set in dhcpd.conf) did end up being the IP of the new OVM servers configuration - so the network profile is actually working.
    And the dhcpd.conf file is actually being updated to reflect the auto pattern / iterative hostname naming.
    So I don't understand why the IP setting worked, but the hostname did not......
    It's not really workable to have your Oracle VM servers hostname set as 'ovs-MAC' - you just can't remember which server is what.... especially as it's not possible to change it afterwards.
    Cheers,
    Jeff

  • Load Script Function

    I see a number of great things on the jQuery site that it offers, but have never understood the process of what to do. I'm sure the new Load Script function simplifies that process, but I'm just plain stuck. Was wondering if Adobe, or anyone, is planning to write out specific instructions, such as getting an accordion menu into a project and making it functional. Once I see and/or hear a process explained thoroughly, it sinks in. Thanks.

    see my blog on this here: http://www.edgehero.com/tutorials/plugins. You can download the samples to see how they are used.  It was using scripts with yepnope but the principle is the same. You can see the code inside the init function and you would use that pretty much the same.
    1- load the script
    There is a tab on the right sie - library - called 'scripts with a plus button.
      Click on the plus ans choose an option - load from a folder or from a URL
    2- Use the plugin as indicated in its API
    For the accordion, using jquery-UI it is pretty simple.
    Here is an example:
    https://app.box.com/s/quwocwbh6i9xx8sf2qkr
    I will update the blog with version 3 and script load in the near future.
    Let me know if you need more help.

  • Need data loader script for Buyer Creation for R12

    Hi ,
    Anybody has data loader script for Buyer creation in R12. Please copy paste one line in the reply on this message.
    Thanks

    Hi ,
    Anybody has data loader script for Buyer creation in R12. Please copy paste one line in the reply on this message.
    Thanks

Maybe you are looking for