Using the string Variable name to ChnFind

Overview - I find crossing points of zero on a set of data so that I can calculate the phase shift of channel to another in my data.

Small image - I start by finding the zero 1 cross in the data, once I found I want to use the index to find the next and so on

Problem

The posted script comes from looking for the 1st pass by zero before moving on to the next channel. The problem is that I can't find out do my group and channel changes with loops.

Option Explicit  ' force explicit declaration of all variables in a script.
Dim intCount, intChan ' loop variables
Dim z

IntCount = 2 GroupCount-1 ' groups
Call GROUPDEFAULTSET (intCount) ' change the current group
IntChan = 1 to ChnNoMax ' Browse channels
Z = ChnFind ("Ch(""[intCount]/[intchan]"")<0") 'this="" does="" not="" work,="" but="" i'm="" not="" sure="" how="" to="" fix="">
MsgBox (z)
next

I don't know I'm missing something obvious.

MK

Hi Michael,

You need not global variables to simplify this, but I would certainly use object variables to simplify.  When indexing of groups or channels, it is easier to use the variable of index with the Data.Root.ChannelGroups collect or Group.Channels collection directly.  I also prefer to store the group object and the channel object in a variable.  For example, you can then use Channel.DataType to add exactly the same string data to the new group coming from the old group.  You can also easily get the name, unit and all sorts of other properties directly from the object variable.  I prefer to use a separate group object variable to reduce congestion in the colde, although it adds 2 lines to your example of code snippet.

Set FromGroup = Data.Root.ChannelGroups (intCount)
Set FromChannel = FromGroup.Channels (intChan)
Define participatory = Data.Root.ChannelGroups ("Index" & FromGroup.Name)
The rise in the value = ToGroup.Channels.Add (FromChannel.Name & "Rising", DataTypeChnFloat64)
Fall in the value = ToGroup.Channels.Add (FromChannel.Name & "Falling", DataTypeChnFloat64)

Brad Turpin

Tiara Product Support Engineer

National Instruments

Tags: NI Software

Similar Questions

  • Get the string variable name in PL/SQL

    Hello
    Strange question. Is there a way to have access to the object of a decision of the variable IN the name in a procedure?

    for example.
    procedure (var1    IN VARCHAR2(6),
                    var2    IN VARCHAR2(6),
                    var3    IN VARCHAR2(6))
    
    IS....
    You run this procedure and pass in parameters to:

    var1 = > "abcdef"
    var2 = > "defghi",.
    var3 = > 'ghikjl ';

    In the code, I want to access the number in the string of the + variable name: var1+.

    In a naïve sense,.
    num_of_in_var := substr(var1, 4,1) 
    would I hoped to achieve, but

    var1 is set to 'abcdef' if so,
    num_of_in_var := substr(var1, 4,1) 
    would return was '.

    Any thoughts?

    Thank you

    Published by: chris001 on November 20, 2012 13:16

    Hi Chris,

    You can find the details of the $user_arguments data dictionary view settings.

    select argument_name from user_arguments where object_name = 'PROCEDURE_NAME';
    
  • Use the string variable in the functions of film

    I want to know how to use a string as the URL variable in a Movie Clip event.

    example code:
    var numCount:Number = 1;
    var strMov:String = 'rock' + numCount;
    bob.removeMovieClip (strMov);

    Thank you very much!

    Turns out, I have solved my problem. I feel a bit stupid. Thanks for your help!

  • Get the bind variables name string SQL or the cursor

    Hello

    Is there way to get of the bind variables name string SQL or the cursor?

    Example of
    DECLARE
      l_sql VARCHAR2(2000);
      desctab DBMS_SQL.DESC_TAB;
      curid   PLS_INTEGER;
    BEGIN
    
      l_sql := 'SELECT * FROM emp WHERE mgr = :X and deptno = :Y';
    
      curid := dbms_sql.open_cursor;
      dbms_sql.parse(curid, l_sql, dbms_sql.NATIVE);
      ....
    END;
    What I mean with the SQL string:
    I love to get using some functions from above code variable l_sql all the bind variable.
    In this case the function should return array where is for example: X and: Y

    Back to bind the cursor variable names, I mean same but rather string I pass number of cursor.

    Y at - it sucks ready function or some may share a code customized for this purpose?

    Thanks

    Kind regards
    Jari

    http://dbswh.webhop.NET/dbswh/f?p=blog:Home:0Regards,

    Published by: jarola December 19, 2011 02:44

    I found there are wwv_flow_utilities.get_binds of the function not documented in APEX packages that do what I want.
    Usage example
    set serveroutput on
    DECLARE
      binds DBMS_SQL.varchar2_table;
    BEGIN
      binds := wwv_flow_utilities.get_binds('select :P1_TEST from dual');
      FOR i IN 1 .. binds.count
      LOOP
        dbms_output.put_line(binds(i));
      END LOOP;
    END;
    /
    
    anonymous block completed
    :P1_TEST
    But I would not use these functions without papers as those who can change or there is no future versions APEX.
    Is there a documented function or the custom function that do the same thing as wwv_flow_utilities.get_binds?

    Some old basic example code of my friends. Also the media getting the bind variable of PL/SQL code blocks anon.

    SQL> create or replace function GetBindVariables( statement varchar2 ) return TStrings is
      2          --// bind variables names are terminated by one the following special chars
      3          SPECIAL_CHAR    constant TStrings := TStrings(' ',')','+','-','>','<','*',',','=',';',CHR(10),CHR(13));
      4
      5          --// max size of a bind var name
      6          MAX_VARSIZE     constant integer := 100;
      7
      8          pos     integer;
      9          pos1    integer;
     10          occur   integer;
     11          varName varchar2(100);
     12          varList TStrings;
     13  begin
     14          varList := new TStrings();
     15
     16          --// looking for the 1st occurance of a bind variable
     17          occur := 1;
     18
     19          loop
     20                  pos := InStr( statement, ':', 1, occur );
     21                  exit when pos = 0;
     22
     23                  varName := SubStr( statement, pos, 100 );
     24
     25                  --// find the terminating char trailing the
     26                  --// bind variable name
     27                  pos1 := Length( varName );
     28                  for i in 1..SPECIAL_CHAR.Count
     29                  loop
     30                          pos := InStr( varName, SPECIAL_CHAR(i) ) - 1;
     31                          if (pos > 0) and (pos < pos1) then
     32                                  pos1 := pos;
     33                          end if;
     34                  end loop;
     35
     36                  --// extract the actual bind var name (without
     37                  --// colon char prefix)
     38                  varName := SubStr( varName, 2, pos1-1 );
     39
     40                  --// maintain a unique list of var names
     41                  if not varName member of varList then
     42                          varList.Extend(1);
     43                          varList( varList.Count ) := varName;
     44                  end if;
     45
     46                  --// look for the next occurance
     47                  occur := occur + 1;
     48          end loop;
     49
     50          return( varList );
     51  end;
     52  /
    
    Function created.
    
    SQL>
    SQL> select
      2          column_value as BIND_VAR
      3  from TABLE(
      4          GetBindVariables('select * from foo where col=:BIND1 and day = to_date(:B2,''yyyy/mm/dd'')')
      5  );
    
    BIND_VAR
    ------------------------------
    BIND1
    B2
    
    SQL> 
    

    PS. just realize this code is case-sensitive, while variable bind is not. Should throw a upper() or lower() by adding the name of the var to the list - never really a problem for me because I'm pretty tense when it use cases correctly in the code. ;-)

    Published by: Billy Verreynne, December 19, 2011 06:19

  • How to use the String with an external dispatchEvent event.target.name?

    ... I hope that the question of the title makes sense...

    On my stage, I have an external SWF loaded with a button. When you click the button dispatches the main event scene.

    On the main stage a listener can load a SWF it in a magazine called Gallery.

    The charger of the Gallery is also shared by the buttons on the main stage, who use the event.target.name chain to appeal to sovereign wealth funds with corresponding names.

    I use tweens to fade and, in the content of the Gallery when a key is pressed.

    --

    Loading of the FSV worked until I tried to create a universal function for the dispatchEvent buttons...

    The problem I have is that I don't know how to set the string to indicate to the newSWFRequest where the SWF file when triggered by external buttons.

    (I maybe do this wrong... but thought that the best way to load a SWF on the main stage from an external SWF was using dispatchEvent?)

    My code raises the event and the charger of the Gallery Faints, but then it does not find the new SWF:

    Error #2044: Unmanaged by the IOErrorEvent:. Text = Error #2035: URL not found.

    Please can someone help me understand how to make the point in the chain in the right direction? (I think that the errors only are in bold below)

    Code:

    var myTweenIn2:Tween;

    var myTweenOut2:Tween;

    var nextLoadS2:String;

    Listening external inclinometer shipped external event

    addEventListener ("contactStage", btnClickExtrnl);

    function btnClickExtrnl(e:Event):void {}

    nextLoadS2 =?

    myTweenOut2 = new Tween(gallery,"alpha",None.easeOut,gallery.alpha,0,0.2,true);

    myTweenOut2.addEventListener (TweenEvent.MOTION_FINISH, tweenOutCompleteF2);

    }

    Function universal BTNS

    function tweenOutCompleteF2(e:TweenEvent) {}

    myTweenOut2.removeEventListener (TweenEvent.MOTION_FINISH, tweenOutCompleteF2);

    myTweenOut2 = null;

    var newSWFRequest:URLRequest = new URLRequest ("SWFs /" + nextLoadS2 + ".swf");

    myTweenIn2 = new Tween (Gallery, "alpha", None.easeOut, gallery.alpha, 1, 0.2, true);

    Gallery.Load (newSWFRequest);

    Gallery.x = Xpos;

    Gallery.y = Ypos;

    }

    Thank you.

    If this code is on the timeline of a child of the main timeline of your external swf add parent 3rd in two lines with parent.parent.

  • Expection while using the string (compare-ignore-case, uppercase) function

    Hi all

    I am using soa suite 11.1.1.6

    JDeveloper 11.1.1.6

    I tried to use the string functions (only 2 xp20:upper - box (), oraext:compare-ignore-case()) with an xpath expression. But it is throwing an error saying that the xpath expression is invalid. I used the same xpath expression in an assign activity that works very well. The string functions are works well when it is used with constants. But the case failed when they are used together this way

            <assign name="Assign1">
                <copy>
                    <from expression="bpws:getVariableData(xp20:upper-case('inputVariable','payload','/client:LoanEligibiltyRequest/client:LoanType'))"/>
                    <to variable="HL"/>
                </copy>
            </assign>
    

    This is the log

    < 1 July 2013 19:07:10 IST > < error > < oracle.soa.bpel.engine.dispatch > < BEA-0000

    00 > < could not handle message

    javax.xml.xpath.XPathExpressionException: internal error xpath

    at oracle.xml.xpath.JXPathExpression.evaluate(JXPathExpression.java:242)

    at com.collaxa.cube.xml.xpath.BPELXPathUtil.evaluate(BPELXPathUtil.java:)

    247)

    Thanks in advance

    It may be wise to cast to a string also. Sometimes you get the signatures of the rear instead of content element if you specify.

  • Function call for the ActionScript variable name

    I am tempted to call a function dynamically by using a string variable.  I know that to do this normally, I would use code like this:

    var functionName:String = '' + currentItem.id;

    var myData:Array = this [functionName] (parameter1, parameter 2, parameter3);

    However, my function is actually in another directory of flex/package called UploadApps.customUploadFunctions.  I tried this sort of thing:

    var functionName:String = '' + currentItem.id;

    var myData:Array = UploadApps.customUploadFunctions.this [functionName] (parameter1, parameter 2, parameter3);

    but it does not work.  Any ideas on how to call a function with a variable name in another package?

    John

    My suggestion is to stop using the methods at the level of the package. Just do static methods in a utility class as we do in the framework in the mx.utils package. Then you can easily call them UtilityClassName [functionName] (param1, param2, param3). Given that the programming in AS3 is 99.9% on classes, I don't know why AS3 allows even the methods package level.

    Gordon Smith

    Adobe Flex SDK team

  • How to use the global variable in the table target?

    Hello

    I am trying to load several files into a single interface. the data is loaded successfully. 92. the files are there. for this I used variables and package.

    My requrement is 92 files of data loaded into the target table. I want to know what data from file.

    to this I added a column (filename) to the existing target table.

    If I used joints (not same condition), its totally wrong. all file names are coming.

    Please see the following screenshots.

    err27.jpg

    exit; target table.

    err26.jpg

    in fact in the target table. first 10 lines are coming from file.i.e first _ACCOUNT_LIMIT_511.TXT. but all the files names are coming.

    I'm confuse. After the first data file inserted then insert second data file. in that all file names are coming. Please help me.

    I thought that the global variable is preferable to identify the data came from which file.

    to do this, the global variable is used in the target table. I don't always have my exit.

    Please help me.

    Thanks in advance.

    err25.jpg

    Hello

    You can use the same way, how you use the project variable, just you have to do a thin is #GLOBAL.variable_name for example: #GLOBAL. SMART_AL_FILE_NAME_S

    Note: Make sure you that while you use one variable overall in interface, indicator should be staged as you chose above the screen

    hope this helps you

    Kind regards

    Phanikanth

  • Variable adjustment of linking VO using the session variable

    Hello
    I need get/set variable binding VO using the class ApplicationModuleImple or ViewObjectImple. Does anyone know how to do?

    I have a VO based on the query like "select name from users where password =: password". " I had a variable binding him also. now I want to put it to a session scope variable. I can do using ADFContext.getCurrent () .getSession ().get('username');? but somehow, I am not able to obtain the knowledge that is to say where to put the variable binding. Help, please.

    User, please tell us your version of jdve!

    You write a public method in your VO, who has the number of parameters you need (username and password), set the variables in this method binding by using the bind variable setters, expose the method in the interface of the client of the vo. So you see the method in the control of data when you open the VO drag. the method on a page and drop it to count. Then you have the input fields to bind variables and the Send button to execute the method in the VO.

    Timo

  • Keep the text perpendicular to the base line when you use the string.

    Is there a way to keep the text perpendicular to the base line when using the warp function?  I'm trying to reproduce a decal with curved text.  When I use the string to get the text that is curved like the original, the letters are slightly tilted.

    You could try to make each letter on a separate text layer, then use Image > transform > free transform to adapt the letters in place.

    A lot more control over the placement of the letter and size that warp text offers.

  • How to swap two values without using the third variable using the procedure

    How to exchange the two values without using the third variable using the procedure?

    In a procedure using two mode we pass two values A = x and B = y, and let us pass parameters to receive the output has A = y and B = x without using the third variable

    Published by: Millar on August 19, 2012 11:23

    Your question doesn't seem wise. As written, there is no reason to a third variable, just

    CREATE OR REPLACE PROCEDURE(
      x IN number,
      y IN number,
      a OUT number,
      b OUT number
    )
    AS
    BEGIN
      a := y;
      b := x;
    END;
    

    If it's an interview question, I suspect that the intention was that you had two settings IN OUT and you wanted to swap the values without the help of a third variable.

    Justin

  • Use the string as instance name

    var character: Array = new Array();

    for (var i: int = 1; i < = 26; i ++)

    {

    If (I < 10)

    {

    Persona.push ("persona0" + i);

    }

    on the other

    {

    Persona.push ("persona" + i);

    }

    }

    //

    var personaclip = persona [4]; persona04

    var personainstance:MovieClip = new personaclip();

    addChild (personainstance);

    What I'm trying to do here, is first to create a table of all 26 clips that are already in the library and the value of export for actionscript, persona01 to persona26.

    Can I choose the number for the clip to use, which is persona04. I would like to add that, for the scene. So I first create the instance of the element persona04 through personainstance and then add it by addChild.

    But the variable personainstance is where I'm going wrong I get an error #1007 trying to create an instance on an element that is not a constructor. How can I make it clear that for the movieclip personainstance I want to select the clip of persona04 form the library? Guess I have to convert the string "persona04" in the name of the constructor, somehow.

    creating instances of dynamic class using strings
    -------------------------------------------------------------

    var ClassRef: Class = Class (getDefinitionByName ("className"));
    var classInstance: * = new ClassRef();
    addChild (classInstance);

  • using the session variable in init. variable init string of session. block

    Hi, experts,

    is it permissible to use a session variable loaded (A) in the initialization string in the block of the initialization of the session to another variable (B).

    for example,.
    in execution, priority of the initialization of B block, added the initialization of a block

    then in the initialization string in the initialization of B block,

    the likes of sql:

    Select a clause where a.xxx = yyy ' valueof (nq_session. (A)'

    What is the correct syntax?

    Thank you very much!

    This is the correct format. If it does not work for you then you need to give more information than what is happening, how fill you your Init blocks etc.

  • Activate search resource group using the string key

    Hi all

    RIM has provided APIs (Resource Bundle) to support the localization of the applications. We are able to use it

    ResourceBundle.getBundle(BUNDLE_ID, BUNDLE_NAME).getString(key);
    

    He expects int key and generated dynamically by Blackberry. There are 2 cases.

    1. Local labels, we are aware and we can provide keys for those who, for the latter is no problem.
    2. From backend error codes. This is not a definitive list. This is the string value. But we cannot find the resource group by using this key of type string. We have to check what the error code and create the key to this and allows to retrieve the label.
    if(errorCode.equals("SOME_ERROR_CODE"){
       Dialog.alert(LanguageResource.getString(SOME_ERROR_CODE));
    } else if (errorCode.equals("ANOTHER_ERROR_CODE"){
       Dialog.alert(LanguageResource.getString(ANOTHER_ERROR_CODE));}
    

    To avoid this check, we thought that if this was possible.

    String msg =  LanguageResource.getString("SOME_ERROR_CODE"));
    if (msg == null) // Label not found
       Dialog.alert(LanguageResource.getString("GENERAL_ERROR");
    else
      Dialog.alert(msg);
    

    Now, API provides no support for this, is the solution to create the own property file and load them but I think that the Blackberry does support playback of the file as Java Standard properties or may be something else. The same reflection API is not supported in Blackberry up to now, there may be support in the future. This could allow to dynamically use the variable as the key name.

    Someone did it faced simular situation and made a work around? All entries would help.

    Kind regards

    Sandeep

    Edited: updated information on option of the reflection API.

    It will never take in charge of reflection as the baseline for BB Os is J2ME and therefor java 1.3/1.4

    you will have to translate the error to the resource key string yourself.

  • switch the case: should use the string value?

    in the example below, I have two points to a switch box. The first works and is not the second. In the second I tried to use a variable to concatinate the string for the case. For some reason whenever I do, it is not locate the second case. It seems like it should work...

    for (c = 1; c < = numItems; c ++) {}

    model var = app.project.items [c];

    var scale = 100;

    If (comp instanceof CompItem) {}

    for (i = 1; i < = comp.numLayers; i ++) {}

    {Switch (COMP. Layer (i). Name)}

    case 'textLines_NFLAM': we're working //This

    targetWidth = 1400;

    COMP. Layer (i).scale.setValue [(scale, scale);]

    setTextLayer_caseSensitive (comp.layer (i), lineValue);

    If (scaleTextLayer (COMP. Layer (i), comp.layer (i).sourceRectAtTime(1,_true).width, targetWidth)) {}

    modifiedLayers.push (comp.layer (i));

    }

    break;

    showName var = 'TA ';

    case 'textLines_' + showName: / / it does not work unless I change to: case "textLines_TA":

    targetWidth = 1430;

    COMP. Layer (i).scale.setValue [(scale, scale);]

    setTextLayer_caseSensitive (comp.layer (i), lineValue);

    If (scaleTextLayer (COMP. Layer (i), comp.layer (i).sourceRectAtTime(1,_true).width, targetWidth)) {}

    modifiedLayers.push (comp.layer (i));

    }

    break;

    }

    }

    }

    }

    It works for me (at least it works):

    myname = "textLines_TA"; var

    showName var = 'TA ';

    {Switch (myname)}

    case 'textLines_' + showName:

    Alert ("caught");

    break;

    by default:

    Alert ("no to not catch");

    break;

    }

    I suspect, there is something else.

    Dan

Maybe you are looking for

  • Earlier, I sent a message on my Ipad. The error code was of 1671

    I was updating my 2 Ipsad and accidentally rebooted automation while it was always up to date and that he put away. I now have a screen with the ITunes logo and a usb cable to this topic. I tried to restore the unit via ITunes on my PC. It gives me a

  • Short blink L220x

    Hello you just bought a L220x, very impressive LCD, but I have a problem: At irregular intervals the screen flickers - really short, not more than 0.1 s - but very annoying.I installed the latest drivers for my card (Nvidia Geforce 7900GTX) VGA and L

  • Windows updates ever.

    I was searching through Update window and the imminent security because of the worm problem and realized that windows was rarely updated.  When I try to check for updates and install I get the error code 80248007. Can anyone help?

  • My computer is constantly acquiring network address for wired connections and wireless.

    my computer is constantly acquiring network address my computer is constantly acquiring network address wired and wireless. Note my Dell inspiron B130, Windows xp 32-bit windows 8. also under the management of the network, the details are 0.0.0.0 IP

  • New/old Netbook

    I just acquired an HP Mini Netbook 210-1100 a friend who uses it is no longer.  I'm working on my friend used cleaning programs that I use so I can gain a speed (it's very slow).  After removing the programs, I was unable to get Chrome to search the