Storing a temperary value!

Dear Labview experts,
                                 I am new to Labview and I donot know much tricks. I have the following problem. I am using DAQmx card to acquire voltage from a IR receiver board. The output of this board varies for a small period of time due to the variation at the input. I can trace this change by delaying the signal and comparing with the current value of the voltage and then I use logical comparision to decide I have change(1) or no change(0). I can see the signal change  but I want to store the value to control another while loop. Meaning when I get 1 the while loop must stop execution.
For storing the value I tried by adding this value with the feedback loop. But I do not see any value at the output of the adder I always see 0. Where am I making mistake? please help me to solve this problem.  Any idea would be much helpful.
Advanced Thanks for the users.

Suggesting a solution might be easier if you attached the vi you are working on...
You can right click on the side of your while loop and add a 'shift register'. It places a node on each side of the while loop, the right side to store newly acquired data in, the left side to retrieve the previous iterations data (or the initialized value for the first iteration).
If you want to detect a change in data and use that result to stop another while loop you can use a 'local variable' in the second loop to read the data written to an indicator inside the first loop.
There are probably are number of ways to achieve the functionality you desire without using local variables but without more information on the way your vi functions it is hard to guess at a solution. (Many in this forum recommend avoiding the use of local variables for a number of reasons including performance.)
Troy
CLDEach snowflake in an avalanche pleads not guilty. - Stanislaw J. Lec
I haven't failed, I've found 10,000 ways that don't work - Thomas Edison
Beware of the man who won't be bothered with details. - William Feather
The greatest of faults is to be conscious of none. - Thomas Carlyle

Similar Messages

  • Which table is stored for O3defaults value?

    which table is stored for O3defaults value?

    Dear King Qi ,
    the default values that you create via transaction O3DEFAULTS are stored in two linked database tables:
    The header data is stored in table OIB_DEF_INDEX_GM
    The default set parameters itself are then stored table OIB_DEFAULTS.
    I hope this helps,
    Kind regards,
    Markus

  • Save prompted sql stored proc parm values in rpt file from designer

    How can I save the last prompted sql stored proc parameter values from within the CR designer.  In other words I want to hard code some of the parameter values (the rest are passed) so that CR does not prompt at run time.  I am running CR Developer XI R2 SP1 from within VS.Net 2005 (Winforms)

    Please re-post if this is still an issue to the .NET Development - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly

  • Assigning stored procedure output value to java variable

    I have one stored procedure which is having ref cursor as the output parameter.
    How to assign refcursor value to my java variable?

    cstmt.registerOutParameter(1, OracleTypes.CURSOR);
    cstmt.execute()
    ResultSet rs = (ResultSet)cstmt.getObject(1);
    ==
    Ashok

  • Java stored proc. malformed values in numeric Datafield ...

    The java stored procedure functiones well, if it access tables that are on the same server.
    Retrieving Data from numeric field of a resultset will result in malformed numeric values , if the table I access it on another server.
    like sms.tabname@server.
    No matter , which methods I use
    rset.getBigDecimal , rset.getFloat /these will retrieve sometimes values with 20 to 40 digits!.
    Maybe some NLS related problem ?

    Hi,
    Which RDBMS release/version are you using (and whish one is the target)?
    Kuassi, http://db360.blogspot.com

  • Storing 6 millions values in SQL server columns

    Hi,
    How many values (size) I can store in single SQL server column.
    My Scenario,
    Column1    Column2      Column3
         1      ABC     1,2,3,........(6 millions values)  
         2      CDE     1,2,3,.......(6 millions values)  
    and problem is that I can't store them in rows. I need to store them in single column with comma separated.
    What would be the best way to store them and retrieve them faster. I am thinking about converting it to byte[] or something but not sure how much time it will take to convert to byte and  then again to text.

    and problem is that I can't store them in rows. I need to store them in single column with comma separated.
    No you don't! Unless, that is, you really like to hurt yourself. It's a basic idea that in a relational database that each cell holds an atomic value, and this what relational datbases are optimised for.
    That said, if all you want to do is to store a bunch of values that you will never look at in the database, but the database will act as an unintelligent data store you will only look at the values outside the database, then it
    could make sense. However, a warning: just because you think that there is no requirement today, don't be surprised that you are sooner or later are asked questions like: "which the highest value for ABC?", "Which value is the most
    frequent across ABCs and CDEs?". Questions that are very simple to answer is you have data in a properly designed data model. But extremely to painful to answer if your all values in a single column.
    But if you take this, path, yes, storing values in a varbinary(MAX) with four bytes (or whatever that is needed) per value would be the best thing. It takes up less space than a string, and with fixed length it's easier to find value 198713 if this would
    be nedded. You seem to be worried about conversion from byte to text. Why is not clear to me, since number are usally born binary. But obviously, I have no idea where you get these values from or how you would use them.
    My initial recommendation still stands: store each value in a single row.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Not able to get Oracle stored procedure return value passed to Powerbuilder

    I have an Oracle Stored Procedure that receives a string value and returns a string value..  When I call it from Powerbuilder, it executes but does not send the return value of a string back.  I am trying to encrypt a string in Powerbuilder, pass it to a .net web page and then decrypt so I can check the security tables for permissions to view the web page.  I have tried creating a simple stored procedure that takes a string and returns a string to Powerbuilder; but even that is not working.  Any suggesstions?
    Oracle Procedure:
    CREATE OR REPLACE
    PROCEDURE               TESTINOUT_VARCHAR
    ( P_STRING IN VARCHAR2, P_OUT OUT VARCHAR2)
    IS
       BEGIN  
          P_OUT := P_STRING || 'TESTING';
    END TESTINOUT_VARCHAR;
    Powerbuilder Call:
    string p_string ='                                 '
    Declare TestingString procedure for TESTINOUT_VARCHAR(:ls_group, :p_out) using SQLCA
    Execute TestingString;
    IF SQLCA.CODE = 0 THEN
    FETCH TestingString into:p_out;
    End If
    p_string = p_out;

    Hello John,
    I'm not sure if you already found a solution using an ODBC connection.
    Below the solution with an RPC call:
    Create a user object (uo_trans) of type transaction with the following local external function:
    subroutine TESTINOUT_VARCHAR(string P_STRING,ref string P_OUT) RPCFUNC
    Execute this script
    uo_trans l_transaction
    string ls_outparam
    l_transaction = CREATE uo_trans
    // Profile ODBC_ORA
    l_transaction.DBMS = "ODBC"
    l_transaction.AutoCommit = False
    l_transaction.DBParm = "ConnectString='DSN=ODBC_ORA;UID=system;PWD=<xxxxxx>'"
    connect using l_transaction;
    ls_outparam = space (30)
    l_transaction.testinout_varchar( sle_1.text, ls_outparam)
    messagebox("OUT parameter", ls_outparam)
    disconnect using l_transaction;
    DESTROY l_transaction

  • How to stop SQL Server Agent Job if Stored Procedure returns value 0

    I have SQL Server 2012 SSIS.
    I have 2 SSIS packages.
    I have created SQL Server Agent Job for running packages.
    I have created steps. If first step have run succesfully next step is run.
    I have need to add new logic.
    I have validation stored procedure, which validate DB table values and returns 1 or 0.
    I would like to create logic where first of all this SP is runned. Return value of SP determines if steps are run or not.
    I was thinking to use Execute SQL Task for running SP.
    If value 1 is returned, then run rest of Tasks is run.
    If value 0 is returned, what should I do so that Job is stopped? I need assistance! 
    I want current step to stop never moved to next step.
    Is there any SSIS tasks, which can stop the Job?
    Or should I make Step for running validation SP?
    How to do so that if value 0 is returned stop Job.
    Kenny_I

    Please refer the below link:
    http://technet.microsoft.com/en-us/library/aa260308(v=sql.80).aspx
    Please read Remarks carefully!!!
    Remarks
    If a job is currently executing a step of type CmdExec, the process being run (for example, MyProgram.exe) is forced to end prematurely. Premature ending can result in unpredictable behavior such as files in use by the process being held open. Consequently,
    sp_stop_job should be used only in extreme circumstances if the job contains steps of type CmdExec.
    Permissions
    Execute permissions default to the public role in the
    msdb database. A user who can execute this procedure and is a member of the
    sysadmin fixed role can stop any job. A user who is not a member of the
    sysadmin role can use sp_stop_job to stop only the jobs he/she owns.
    When sp_stop_job is invoked by a user who is a member of the
    sysadmin fixed server role, sp_stop_job will be executed under the security context in which the SQL Server service is running. When the user is not a member of the
    sysadmin group, sp_stop_job will impersonate the SQL Server Agent proxy account, which is specified using
    xp_sqlagent_proxy_account. If the proxy account is not available,
    sp_stop_job will fail. This is only true for Microsoft® Windows® NT 4.0 and Windows 2000. On Windows 9.x, there is no impersonation and
    sp_stop_job is always executed under the security context of the Windows 9.x user who started SQL Server.

  • Varbinary(max) parameters in Nested Stored Procedures by value or reference _Expand / Collapse

    Consider a situation where a stored procedure taking a varbinary(max) (BLOB) input parameter
    then calls a nested stored procedure and passes along that varbinary(max) as an input parameter to the nested stored procedure.
    Is a copy of the BLOB provided to the nested stored procedure (passed by value) OR is the BLOB passed by reference.
    My interest is in understanding the potential memory hit when handling large BLOBs in this environment.
    For example, if the BLOB is 200MB, will SQL server need to allocate memory for a new copy each time it's passed to another stored procedure at the next nestlevel?
    Looks like table type parameters are passed by reference, but I haven't been able to find any info on BLOBS in this context.

    The semantics for parameters in SQL Server is copy-in/copy-out. However, this does not mean that there cannot be optimizations. That is, there is no need to copy the BLOB, as long as the procedure does not change it. Whether they actually have such an optimization,
    I don't know.
    I composed the repro below, and it is sort of interesting. If I restart my instance (SQL 2014), the memory usage grows with about 40 M for each nesting call, which certainly indicates that the BLOB is copied over and over again. But if I then run it again,
    the growth is not the same. This may be because, it uses buffers already available. (A BLOB has to be a handle like a table when it is over some size.) Then again, it means that it is squeezing something else out of the cache.
    CREATE PROCEDURE K  @h varchar(MAX) AS
       SELECT SUM(pages_kb)*8192 AS K, datalength(@h) as Dlen FROM sys.dm_os_memory_clerks
       SELECT @h = ''
    go
    CREATE PROCEDURE L  @h varchar(MAX) AS
       SELECT SUM(pages_kb)*8192 AS L1, datalength(@h) as Dlen FROM sys.dm_os_memory_clerks
       EXEC K @h
       SELECT SUM(pages_kb)*8192 AS L2, datalength(@h) as Dlen FROM sys.dm_os_memory_clerks
       --SELECT @h = ''
    go
    CREATE PROCEDURE M  @h varchar(MAX) AS
       SELECT SUM(pages_kb)*8192 AS M1, datalength(@h) as Dlen FROM sys.dm_os_memory_clerks
       EXEC L @h
       SELECT SUM(pages_kb)*8192 AS M2, datalength(@h) as Dlen FROM sys.dm_os_memory_clerks
       --SELECT @h = ''
    go
    CREATE PROCEDURE N  @h varchar(MAX) AS
       SELECT SUM(pages_kb)*8192 AS N1, datalength(@h) as Dlen FROM sys.dm_os_memory_clerks
       EXEC M @h
       SELECT SUM(pages_kb)*8192 AS N2, datalength(@h) as Dlen FROM sys.dm_os_memory_clerks
       --SELECT @h = ''
    go
    DECLARE @h varchar(MAX) = replicate(cast('ABCD' AS varchar(MAX)), 1E7)
    EXEC N @h
    go
    DROP PROCEDURE K, L, M, N
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Storing set of values in an array

    I am curious how this would be done best. I have 15 sets of x and y values, that should be stored together. I was thinking I could have an array, holding 15 other arrays, each holding the x and y value? Is that a valid way to do this? Also, is there a way to create those arrays holding the x and y, dynamically, so they just get numbered?
    MainArray[
         subArray[x1, y1];
         subArray[x2, y2];
         subArray[x3, y3];
         subArray[x4, y4];
         subArray[x5, y5];
         subArray[x6, y6];
         subArray[x7, y7];
         etc...
    Obviously, above is not correct AS. Is this even a way to do this? Are there other much better ways???
    Thanks a lot!

    In addition to Ned's suggestion you can use points:
    var array:Array = [new Point(100, 50), new Point(40, 30), etc.]
    You would read/write it the same way as in Ned's example:
    array[1].x
    array[1].y
    Although Ned's suggestion is more compact, if you need to use Point class' properties and methods that may save some calculations (especially if the array intended to use in some physics engine) - holding x/y in point instance is probably more desirable.

  • How to get a stored function return value (which is not a cursor)?

    I want to do so with ADO inside Visual Basic. I know how to call a stored procedure, but nothing I tried could help me in calling a stored function and getting its return code. Note that the function has no cursors within its argument or return code.
    Your quick response would be appreciated
    Eyal

    Eyal,
    A stored function returns a value. You need to have the first parameter (of correct data type) for the returned value. The parameter binding is pretty much the same as you would do with stored procedures.
    e.g. "begin :1= proc(....); end;"
    Sinclair

  • Problem in storing date & Time value

    How to store the Date & time value in 1 textfield only.In my case i am selectecting The Time from two LOV's (HH & MM),then Date value is selecting from simple i/ptext,
    I want to store the (Date+HH+MM) in the date field.......
    code is....
    public String CalculationM() {
    BindingContainer bindings = getBindings();
    DCIteratorBinding dcIterBinding = (DCIteratorBinding)bindings.get("Timeview1Iterator");
    RowSetIterator row= dcIterBinding.getLovRowSetIterator();
    String i=selectOneChoice5.getValue().toString();
    int index=Integer.parseInt(i);
    int index2=index+1;
    Row r= row.getRowAtRangeIndex(index2);
    String val=r.getAttribute("Hour").toString();
    String i1=selectOneChoice6.getValue().toString();
    // System.out.println("HH index="+index2+" MM index is="+i1);
    int index1=Integer.parseInt(i1);
    int index3=index1+1;
    Row r1=row.getRowAtRangeIndex(index3);
    String val1=r1.getAttribute("Minutes").toString();
    int valint=Integer.parseInt(val);
    String valnew;
    if(valint<=12)
    {  if(valint==12)
    valnew=val+":"+val1+":"+"PM";
    else
    valnew=val+":"+val1+":"+"AM";
    else
    val=String.valueOf((valint-12));
    valnew=val+":"+val1+":"+"PM";
    valnew=val+val1;
    String Dateis= inputText4.getValue().toString();
    String Date1=Dateis+" "+valnew;
    System.out.println("TOTAl Date Is="+Date1);
    try
    { SimpleDateFormat sdf = new SimpleDateFormat("dd:MM:yyyy hh:mm");
    java.util.Date date = sdf.parse(Date1);
    java.sql.Date sqlDate = new java.sql.Date(date.getTime());
    oracle.jbo.domain.Date ojdd = new oracle.jbo.domain.Date(sqlDate);
    FacesContext context = FacesContext.getCurrentInstance();
    Application app = context.getApplication();
    DCBindingContainer binding = (DCBindingContainer) app.getVariableResolver().resolveVariable(context, "bindings");
    binding.findIteratorBinding("AppointDetView1Iterator").getCurrentRow().setAttribute(7,ojdd);
    catch(ParseException e)
    System.out.println("Error is:"+e.toString());
    OperationBinding operationBinding =bindings.getOperationBinding("Commit");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    return null;
    But i am getting error ....the Time is not storing in Date field bt the Time which we r giving with the Date field is storing.......
    My Date Attribute has Date format as dd-MM-yyyy hh:mm:aa
    If i changed it to dd-MM-yyyy then .... The value "12-3-2008" is not a valid date. Valid example: "29-11-2005 ".this error is getting
    Error
    - Not a date.
    Plz help me in this case ...wil be very thankful for ur help.........

    actually i am inputting the value 12-03-2008 but i am getting tha error which i hav told before....
    plz reply me....
    Message was edited by:
    user553181

  • Which table or combinations of table that stored net book value for asset?

    I need help in finding the above. I need to customize an asset report and need the net book value amount.

    hi Mohamed,
    basically you have to calculate like this:
    + ANLC-KANSW
    + ANLC-KAUFW
    + ANLC-KINVZ
    - ANLC-KNAFA
    - ANLC-KSAFA
    - ANLC-KAAFA
    hope this helps
    ec

  • Field Storing 'AND'  & 'OR' values

    hi Guys,
      This is an urgent requirement . I need a field and DB table which stores either 'AND'  &  'OR' values .
    Thanks & Regards,
    Santosh

    hi Santosh,
    You can use the dataelement/domain XANDOR as mentioned by Ferry Lianto.
    This is used in tables USCRAUTH, USCRCOMID, USKRIA and USKRIAT.
    But if you are looking for, where the values AND and OR are maintained, they are not maintained in master tables; instead they are maintained at domain level as 'Fixed Values'.
    Hope this helps,
    Sajan Joseph.

  • Storing a position value from the previous frame

    Hey guys,
    So, I'm trying to assign the X value a null object had at the previous frame so I can continue to subtract a number from it cumulatively. I'm trying to assign it to a variable (prevframe). I'm not sure where I'm going wrong, but the line I'm trying to do it on is written as follows:
    prevframe = transform.xPosition.valueAtTime(time-(1/24))
    So in my mind, this should be taking a look at the value of X on the null, then looking back in time to figure out what it's value was on the previous frame (my frame rate is 24, so I'm dividing 1 second in to 24 pieces and telling it to subtract that much from the current time), and assigning whatever that returns to the variable. But it's just returning a static value, even though I'm subtracting from it. I feel like it's not the correct syntax, but I really have no idea.
    I want to continue to subtract a value which is based on the velocity of another object from this, which I have worked out, I just can't figure out how to reference what this nulls X position was in the previous frame so it always returns the same value until all motion has stopped. The formula the variable is being run through looks like:
    finalposition = prevframe - camvelocity
    Which is then assigned to the final X position of the null object.
    So, I'm not sure where I'm going wrong. I hope I've provided enough information to help someone wrap their head around this and hopefully help me solve it.
    Thanks in advance,
    -Seth

    Sorry it was confusing. Let me try to clarify. My null object has a starting point, which is an X value of 2020. For each frame the camera is moving, I want to subtract the cameras velocity from 2020, but I want it to be cumulative. So say the camera is moving linearly at 20 px per frame. On the first frame this starts, the value it will return is 2000. Then on the next frame I'd like it to subtract 20 from the new X value of 2000, but it continues to look at 2020 as the value to be subtracted from. So there isn't any accumulation of this X position getting lower and lower, it just gets to 2000 and stops.
    When I plugged in your code I was getting the same result. I'm not sure if it's just not meant to work the way I was thinking I'd like it to, but…
    What I'm trying to accomplish is kinda weird though. I'm trying to get this null, which is a parent to some glares nested in a composition, to take both camera movement and actual composition movement in to account as it drives the position of the glare objects. I wanted to see if the composition was moving faster in the main timeline, or the camera, and then add or subtract the faster velocity to the position of the null object, and have it do that continuously rather than to the null objects starting value and nothing else. so 2020 - 20 - 20 - 20 - 20 ect., with a 20 (or whatever the velocity works out to be) for each frame things remain in motion.
    I want it to remain based on expressions just because I'm going to have a lot of these panels with glares, and hand keyframing each of them isn't something I'll have time to do, so I just want it to be based off of those two movements.
    I think I'm going to take a different approach though. I think I'm trying to do too much with this expression that can be done in different ways. Instead of having one null I'm going to have two, and I'll have an expression within my glare objects to decide which ones coordinates to use as a parent still based on velocity.

Maybe you are looking for

  • Error msg RSAR502,while creating source system?

    Hello Gurus, when i am creating source system i got error msg called RSAR502,can any one solve this issue.. Thanks in Advance

  • Delivery date in the purchase order

    Hi all, Iam creating the standard P.O. today 2nd Jan.System is taking the delivery date as 5 th Jan ie..after three days. How system is calculating this? I know this is MM related But is is quite confusing when I practise Schedluing & avai check Rega

  • Resolution Lowered When Waking Up in 10.8.3?

    Hi! I'm wondering if anyone has seen an issue with their Mac when it wakes up from idle/sleep in 10.8.3. For the past couple days, when I wake my Mac mini up from idle or sleep, it drops the resolution down and the only thing that resolves the issue

  • Add to Favorites

    Hi experts, Im having a Webdynpro application developed in ABAP. It has five views(navigating from view 1 to 5 based upon user interaction). I created an I-view in portal( webdynpro - ABAP ) and everything is working fine. I want to add the particula

  • Correlated subquery

    Pleas help me to write this query.. i want to use review_id from mantas.kdd_review table to union caluse. SELECT kr.review_id,kb.break_id FROM ((select break_id from mantas.kdd_break kb where kb.prnt_break_id=*kr.review_id* UNION select break_id from