read the independent values in a channel

Hello

I want to read the value of a chanel.

I guess that every chanel's store as an array with an index and a value.

I would like to read a value of a chanel with its index number, then do some calculations, and then write to it.

For example:

Chanel 1:
index value
1           1
2           1
3           1
4           2
5           1
6           1

start index = 0
value > 1?
If no control of the following
If so do something

Do you have a sample script to read a unique value in a chanel?

Kind regards

Frédéric MANUAL

OK, so it should work

Dim oChn, K, value
"Go to the channel you are interested in.
Set oChn = data. GetChannel ("Time")

' loop through all the values
For K = 1 To oChn.Size
Value = oChn (K)
If (value > 1) then
"do something
MsgBox ("value WG 1")
End If
Next

Tags: NI Software

Similar Questions

  • Read the last value of a large file of PDM

    Hello everyone!

    I hope someone can help out me with this one.

    I try to put in place a program that can read the last value of one of the large channels of different TDMS files but I just can´t find a way to do it.

    I would appreciate help for my little problem.

    Thank you very much in advance for your support.

    Kasim.

    Hello

    You can use the following playback TDMS Set Position feature included in the PDM API.  This function receives a parameter called "(0:start)", which can be set to 1 to go to end of the file.  In this way, you can read the last value written to the PDM file.

    I hope this helps!

    Anuar Rojas

  • Read the output values after each step runs in the User Interface of LabVIEW

    Hi all

    Development environment: TestStand 2010 SP1 and LabVIEW 2010 SP1

    Problem: is there a way to run the following steps programmatically and get values out of each of them?

    I have already extended a bit a complete interface IO for TestStand load any sequence, choose among the measures and execute step by step (something as an alternative to the steps run selected). What I'm trying to do is to add some actions between each step and do in the UI (I can't change the sequence!), so I start the NewExecution with some previously configured InteractiveArgsParam and option breakAtFirstStep set to true. Eventually I do just something like step over when debugging the sequence and it works well, but I didn't do well a way yet to read the output values of the place...

    So, if I wait before the end of the run I can read my results by treating the ResultObject, but it works only after the completion of the test sequence. Because I wanted to stop after each step, read the values, do some actions and continue to the next step, I've tried to register a running Trace event reminder View Manager. I see that after each step is executed, this event is fired, but when I try to read that a ResultObject returned in the event data it is not filled with values (ResultList seems to be empty?). Is this a correct behavior or maybe I'm reading the wrong way? (It's the same VI regarding the reading of the ResultObjects after the sequence ends and there it works very well for tables, containers and other types of data).

    As I mentioned I can't change Test sequences, I can not add a UImessages.

    What are my options? If the trace event returns output all the values from each steps or is it just used to check the status? Or maybe there's a completely different approach to this issue?

    Thanks in advance for your suggestions,

    Best regards.

    When you manipulate the UIMessage trace (you need this before the return of the event or you will present the race conditions), download myuimessage. Thread. Then call Thread.GetSequenceContext (0, & Iplease).

    And then on the context of the sequence, either go to PreviousStep.Result if it exists, or watch Locals.ResultList.

    Trace events occur between the steps executed step the more recently is the previous step, but it is also a trace event to the beginning before any measure have run at this time, there will be a previous step.

    Hope this helps,

    -Doug

  • correctly when reading the negative value

    Hi all,

    It's about power meter device. in fact, I've already got the good value here, but I create additional calculations. the situation is:

    When the power reading is positive, I enjoy reading.

    power is negative, I misread (high value). so I need to subtract this value to 2 ^ 32 (or 4294967296).

    is that someone he knows the reason why he needs to happen?

    OK, "registers" are tables of U16. so try to typecast I32. How many elements in the table?

    Somehow, you do everything with tables, but you only display one item. It almost seems to me that everything going primitive "contact numbers" be given ordinary scalars. There are also a lot of duplicate code. You might get away with an instance and a loop FOR, for example.

    Representations of data are a mess with a wild mix of types of data and constraints. The Psum (High value) is I64 without reason (under the constraint of a DBL two values U32 (?) division). I do not understand the function of the Subvi. Can you explain?

    You can place an indicator of one of the 'registers' tables, run the VI so it contains data, then turn the indicator in a constant of schema that contains the typical data (Right-Click... change to constant). Save and attach the VI.

  • reading the filter values (unsharp mask) defined in the dialog box

    for my sharpening script, I should be able to store values defined in the dialog for later use unsharp mask. The script calls the dialog box with DialogModes.ALL, then the values are set manually. Is it possible that I can tell the script to read the values defined and store them in variables.

    Can't find a topic referring to this problem.

    Thanks for any help.

    Hans

    2016, use it at your own risk.

    #target photoshop

    try {}

    var idUnsM = charIDToTypeID ("UnsM");

    var theResult is executeAction (idUnsM, undefined, DialogModes.ALL);.

    var theAmount = theResult.getUnitDoubleValue (stringIDToTypeID ("amount"));

    var theRadius = theResult.getUnitDoubleValue (stringIDToTypeID ("radius"));

    var theThreshold = theResult.getInteger (stringIDToTypeID ("threshold"));

    Alert ("amount" + theAmount + ' \nradius ' + theRadius + ' \nthreshold '+ theThreshold ")

    } catch (e) {};

    based on the code of michael l hale.

    function checkDesc2 {(theDesc)

    var c = theDesc.count;

    var str = ";

    for (var i = 0; i)

    Str = str + ' key "+ i +" = "+ typeIDToStringID (theDesc.getKey (i)) + ': ' theDesc.getType (theDesc.getKey (i)) +"\n"+ getValues (theDesc, I) +"\n ";

    };

    Alert ("desc\n\n" + STR);

    };

    check.

    function getValues (theDesc, number) {}

    switch (theDesc.getType (theDesc.getKey (theNumber))) {}

    case DescValueType.ALIASTYPE:

    Return theDesc.getPath (theDesc.getKey (theNumber));

    break;

    case DescValueType.BOOLEANTYPE:

    Return theDesc.getBoolean (theDesc.getKey (theNumber));

    break;

    case DescValueType.CLASSTYPE:

    Return theDesc.getClass (theDesc.getKey (theNumber));

    break;

    case DescValueType.DOUBLETYPE:

    Return theDesc.getDouble (theDesc.getKey (theNumber));

    break;

    case DescValueType.ENUMERATEDTYPE:

    return (typeIDToStringID (theDesc.getEnumerationValue (theDesc.getKey (theNumber))) + '_' + typeIDToStr ingID (theDesc.getEnumerationType (theDesc.getKey (theNumber)));)

    break;

    case DescValueType.INTEGERTYPE:

    Return theDesc.getInteger (theDesc.getKey (theNumber));

    break;

    case DescValueType.LISTTYPE:

    Return theDesc.getList (theDesc.getKey (theNumber));

    break;

    case DescValueType.OBJECTTYPE:

    return (theDesc.getObjectValue (theDesc.getKey (theNumber)) + '_' + typeIDToStringID (theDesc.getObject Type (theDesc.getKey (theNumber)));

    break;

    case DescValueType.RAWTYPE:

    Return theDesc.getReference (theDesc.getData (theNumber));

    break;

    case DescValueType.REFERENCETYPE:

    Return theDesc.getReference (theDesc.getKey (theNumber));

    break;

    case DescValueType.STRINGTYPE:

    Return theDesc.getString (theDesc.getKey (theNumber));

    break;

    case DescValueType.UNITDOUBLE:

    return (theDesc.getUnitDoubleValue (theDesc.getKey (theNumber)) + '_' + typeIDToStringID (theDesc.getUn itDoubleType (theDesc.getKey (theNumber)));

    break;

    by default:

    break;

    };

    };

  • Read the selected values of af: selectManyListbox

    Hello

    had af:selectManyListbox in the page with the dept_id as the base attribute and dept_name as the display attribute.

    Since his multi select I am able to read the values selected by the table according to the following code

    BindingContext bc1 = BindingContext.getCurrent ();

    DCBindingContainer binding1 = (DCBindingContainer) bc1.getCurrentBindingsEntry ();

    JUCtrlListBinding listBindings1 = (JUCtrlListBinding) binding1.get ("DEPTVIEW1");     

    Object [] str = listBindings1.getSelectedValues ();

    System.out.println ("after object str [] = listBindings1.getSelectedValues ();");

    for (int i = 0; i < str.length; i ++) {}

    System.out.println (STR [i]);

    }

    who's back the dept_id s as it is the base attribute

    say

    2

    3

    6

    on the basis of selection

    I need to recover the DEPT_NAME too?

    How to fetch the DEPT_NAME which is the display attribute?

    Bindings has the DEPTVIEW1 in the variables. so I can't separate the DEPT_NAME also gives access to links.

    Thank you

    Chaya

    Hello

    See page 18 - the solution should work for you

    http://www.Oracle.com/technetwork/developer-tools/ADF/learnmore/january2012-OTN-harvest-1504418.PDF

    Frank

  • How to read the xml value in plsql store proc

    I need to read the value at the bottom of the xml script in plsql procedure. I do not understand how to write. I'm new in xml, please help me solve this problem.


    <? XML version = "1.0" encoding = "UTF-8"? >
    < PrtyActDtlRequest >
    < AcctInfo >
    < > 84188 PartyID < / PartyID >
    < RelAcctID > 125148 < / RelAcctID >
    < RelAcctID > 251486 < / RelAcctID >
    < RelAcctID > 125147 < / RelAcctID >
    < RelAcctID > 125511 < / RelAcctID >
    < / AcctInfo >
    < / PrtyActDtlRequest >

    Here < AcctId > can be repeted n times (unbouinded), but < PartyID > is set once. This is the script that we will get out of the source system.

    Thanks in advance.

    Roy

    You needn't PL/SQL for it. Just use XMLTABLE:

    with t as)

    Select xmltype (')

    84188

    125148

    251486

    125147

    125511

    double x)

    Select PartyID,

    RelAcctID

    t,.

    XMLTable)

    ' / PrtyActDtlRequest/AcctInfo.

    go x

    columns

    PartyID path number "PartyID,

    Path RelAcctIDXml xmltype "RelAcctID."

    ),

    XMLTable)

    'RelAcctID '.

    by the way RelAcctIDXml

    columns

    RelAcctID path number ' / RelAcctID'

    )

    /

    PARTYID RELACCTID
    ---------- ----------
    84188 125148
    84188 251486
    84188 125147
    84188 125511

    Scott@pdborcl12 >

    SY.

  • D2KWUTIL Read_Registry - only reads the string values? How to read the binary?

    Hello, everyone!
    I use forms and reports 6
    D2KWUTIL,
    WIN_API_ENVIRONMENT. Read_registry
    to read the Windows registry values.
    The service works very well with string values (that is, type REG_SZ registry).
    but fails with NO_DATA_FOUND binary values, such as type REG_DWORD.

    D2KWUTIL is really unable to work with other types of chains?
    If so, what can be used instead?

    Appreciate all the guidance,
    Roman

    Published by: user9232995 on November 18, 2010 23:19

    Published by: user9232995 on November 18, 2010 23:20

    It's d2kwut60.dll.

  • All channels to HAVE it have the same value

    I use the example for a multichannel AI aiex2.cpp read with mseries NI6280 devices.

    This example works for a lane, but other chains have the same value

    For example: I put 5 Volt on the first string, and then the other channel are 5 Volt too.

    What should I consider in the configuration?

    Hello Beilei,

    I think that you run in theghost of the question.  The other strings that you use are connected to the earth when you connect the first channel to 5V?  If the other channels are floating, they will read the same value as the first string... 5V.

    Steven T.

  • How to read the value attribute and put inside?

    What happens if we want to read the attribute value? And want to put the data of runtime on the value of the attribute as

    < psoID ID = "user id" / >

    How to get the value of the ID as the user id. And how to put the run value on it?

    I can think about is that

    /psoID/@ID/value GOLD psoID/@ID/*[local-name () = 'value']

    And how to put the value inside ID ="? »

    Thank you

    Because we are dealing with a structure of type anyType you must use the functions of node (local name) in combination with predicates ([]) to read or write values (node) of the element:

    To read the value for example use the copy rule:




    This wil read:

    /processResponse/result/psoID/@ID

    on the message:





    You will see the value 'B '.

    To write, you use:




    Kind regards

    Melvin

  • read the output of a path of analog output current voltage

    In DAQmx if you are unsure of the status of a digital output port, you can take a reading on this subject.  When I try this on an analog output, I get an error.  Is it possible to query the status of the output of an analog output?  I realize that I could follow the State with a variable, but a direct reading would be really handy.

    Hello, GIS.

    There is no way to read the output in the AO modules without wiring physically the signal to a module to HAVE.  You are able to use a variable to read the current value of the output, as you mentioned earlier.

    Channels AO multifunction boards, however, can be read through tasks of entry by rounting in-house channel to read ao vs aoground.

    Lisa

  • Read the EPS file in JScript

    Hi scripters

    I put in EPS file as an object inserted in indesign via JScript,

    doc = app.activeDocument;

    doc.pages.Item(0).place(file("D:\\auto\\Chapter-3\\fig1. EPS")

    here while I place the EPS files in indesign in the subject I want to read the BoundingBox values stored in EPS files. It is possbile to read EPS files in JScript?

    Thanks in advance

    concerning

    a you are the

    It is possbile to read EPS files in JScript?

    JScript is not supported by InDesign. I'll kindly assume you meant 'Javascript', but know JScript is not Javascript.

    It is possible to read any type of file with Javascript. Any file at all. This code snippet

    epsFile = File("D:\\auto\\Chapter-3\\fig1.eps");
    if (epsFile.open("r") == false)
    {
    alert ("Why don't you try an existing file?");
    exit(0);
    }
    do
    {
    someLine = epsFile.readln();
    if (someLine.indexOf ('BoundingBox') > 0)
      break;
    } while(epsFile.eof == false);
    epsFile.close();
    

    reading lines of text until it is short of lines of text or encounters with the exact phrase "BoundingBox".

    However, Javascript is not automatically know what it is reading. EPS can contain binary information, you cannot use the plain text, playback functions. If you need read the binary code - and for that, you need the exact binary an EPS file format.

    In addition, you must analyse the context of the channel "BoundingBox" as well. It may appear in a text ("this image shows a BoundingBox of..") or a comment ("' % this image isn't a BoundingBox" "), or with additional or missing parameters.

    Long story short, 'Yes, it is possible to read EPS files.

  • Replace negative values in multiple channels with "0'.

    Hello

    I'm calculating and then by creating a cumulative channel, multiple channels. Negative values in these channels aren't necessary, and I need a nice way to replace each negative value in these channels with a value of '0'.

    My current code is:

    Do
    Do
    If Data.Root.ChannelGroups (2). Channels (i). Values (II)< 0="" then="" data.root.channelgroups(2).channels(i).values(ii)="0    ">
    II = ii + 1
    Loop until the second > Data.Root.ChannelGroups (2). Channels (i). Properties ("length"). Value
    II = 1
    i = i + 1
    Loop until I > Data.Root.ChannelGroups (2). Channels.Count

    It works, but I don't like. He adds a few seconds when running my script, which was almost instantly. Is there a better way to do it?

    Thank you.

    Hello Kevin,

    The fastest way to go through a channel and check the values less than or equal to 0 is through the canal's calculator. The code below takes all the channel first channel group (with the exception of the first string that is be the weather channel in my example data set) and replaces the values<0 with="" 0="" through="" the="" iif="">

    Set Group = Data.Root.ChannelGroups (1)
    iMax = Group.Channels.Count
    FOR i = 2 to iMax
    Adjust the strings = Group.Channels (i)
    Formula = "= IIF (y '.<0, 0,="">
    Call to calculate (formula, Array("y"), Array (Channel))
    NEXT ' I

    In this example we overwrite the existing values of data channel with 0, but you can also copy the channels to make sure that your raw data is available.

    The calculator of channel is extremely fast for this type of operation because it does not create a loop to go if each line separately and check the values he...

    I hope this is useful,

    Otmar

  • How to read the data processed on frm loop on each iteration of the loop?

    Hello...

    I need to display numbers as 1, 2, 3... constantly using the loop on each iteration (IE out of the loop using threads). I generated the numbers 1 2 3... using the back power node... I can read the final value after the last iteration of the loop for.

    I connected an indicator of the loop for. This indicator displays the value as a 4 If the number of loops that 4. I couldn't view 1 2 3 4 an indicator of items at each iteration.

    I'm in a position to read the value of the variable on each iteration of the loop. Please help me fromthis regard...

    Thanks in advance...

    In fact, I'm programming for multiplication of two table 2D.

    I need to select the particular code to perform this action using the structure of the case. who is right for which I need to give the value select 1,2,3 to a case selector, so I finish the task. you got my point?

    Thanks for the reply

  • How to read the map file?

    Hello

    I have a mapping file to the linker with some data as below

    File name: Load.map

    ABC 2000 b 598

    BBB 20009672

    My requirement is to read the hexadecimal value when an entry is given.

    Inuts are 'ABC' or 'bbb '.

    Example: entering "bbb-" is given then 20009672 should be displayed in the indicator.

    Please let me know the solution because it is very urgent.

    Thanks in advance,

    Krishna

    It's really basic things - both with LabVIEW and file reading/Bay of manipulation in general. Check the tutorials.

Maybe you are looking for