PtbyPt editing with global variable?

Hey guys,
I'm wanting to setup a counter to count a crossing of a sinewave. The thing is, the sinewave is not zeroed. It's a sinewave of a cyclic load cell that I'm testing a material with. With this test, I will put load on the load cell, then cycle from that position, which is my realitive zero.
So, say I put 0.043 volts on the load cell. I would then cycle the material at a certain strain both ways horizontally, and this "0.043" would be my zero for the crossing. I've included my Vi so you can see what's happening in the "strain" and "stress" state. These states are independant from eachother and don't work together in anyway. They're just recording data on different channels
Is there a way I can edit the Pt2Pt vi to look at this "0.043" value (which is an analog channel)? I was thinking global variable...or...something simpler I could put in my code. I'm still a novice in all this and I would greatly appreciate some advice.
Kindly
Gary S.
Attachments:
New CSS state44.vi ‏405 KB

glskinner wrote:
The signal is crossing at the offset, but my "cycle count" is crossing at zero since I'm using Pt2Pt. How to I get my cycle count to cross at the offset? Is there a way I can edit the Pt2Pt to look at my beginning load cell reading zero/offset (I have it a TTL that starts the data aquisition) and then increment everytime is reaches the offset?
As for the why I need to worry about where the cycle count crosses: I am recording the cycle count as a scalar numeric value in my data file, along side my load cell. I need this cycle count to match with the crossing of the load cell for data reduction purposes. So if the load cell crosses at -0.043, I need the cycle count to change when the load cell crosses that value. I understand the Pt2Pt crosses at zero, but the stipulation for the crossing of this vi, "0", is what I want to change. I want it to cross at my offset (-.043, or whatever the case may be), since that is my true "zero" in relation to the behavior of my load cell voltage.
I think you're not following my train of thought.  What you want to do is make a copy of the data (i.e, create a wire branch).  On one branch, you will do the crossing calcs.  On the other branch, you retain the actual data.  On the crossing calcs branch, you will subtract out the offset so you can use the Pt2Pt without modifications.  On the other branch you have your original data.  There should be a direct correlation between the two.  You should now have a record of both how many times it crosses and where it crossed.
Bill
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

Similar Messages

  • Formula node with global variable

    Hi,
    I am tring to use formula node with global variables as an input and output,
    but this is where I see the SW hangs forever.
    By the way I am a novice to the labview.
    Can some give me hint why this is happening?
    Thank you in advance,
    Do
    Solved!
    Go to Solution.
    Attachments:
    formula_node_wGlobalInputOutput.JPG ‏281 KB

    Well, the first case of the two loops has a direct LabVIEW translation like this:
    However, just because that's the direct translation doesn't mean that's what you should be doing. In the formula node it seems as if you were copying elements from one array to another. Element-wise operation on arrays via loops can be quite inefficient in LabVIEW. Often one can operate in place with arrays, and an operation that would require two loops in a language like C would actually require no loops in LabVIEW. In fact, with the above example, even if you were to use loops, arrays can auto-index for-loops so you don't even need to wire the constants to the N terminals to tell the loop(s) how many times to run.
    Can you describe what you're trying to accomplish? There's likely to be a more natural way to do it in LabVIEW that would require no loops. Have you gone through the tutorials? You can also look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.

  • Using built-in with global variables

    I am trying to setup built-in source code control for LabVIEW. It seems to be OK except in one case:
    Is it possible to use built-in with global variables ?
    VIs that use a global variable are supposed to be updated automatically when global variable is modified but what happen when VIs are checked-in ? LabVIEW cannot updated them. Is it necessary to check out all VIs before modifying global variable ? This is not convenient if global variable is used in more than 100 VIs !
    Is there another solution ? Can Perforce resolve this problem ?
    Thanks for your help !
    David

    You can still use and update global variables while they are checked in to SSC. The default values will still be saved in SSC but they can still be modified and read by other vi's.
    goldie

  • Creating single executible with global variables

    I am trying to create an executible with global variables. I dynamically load the source file but when I run the indicator does not update unless I run both VI's together. Is the executible require different inputs during creation?

    Hello,
    It's not the fact that you are creating an executable that is causing the issue. What you are experiencing is expected behavior. Please see this KnowledgeBase" for some solutions.
    Nicholas C
    National Instruments
    Applications Engineering

  • Issue with Global variable in FM

    Hi experts,
    I have created  two functional modules under same function group and declared the internal table (ITAB)as global variable ,
    i have populated the data to to  ITAB n first function module , and  These FM are used in a program , when i debug the program , the data is populated to 1st FM and but in  2nd function module the ITAB is null only internal table structure is available.
    please let me know the reason.
    Thanks NK

    thanks all, the program ( it also an FM)  ,which is calling the 2nd FM is in background mode, i think thats the reason ITAB values are not populated.
    i ts working fine with IMPORT/EXPORT but my lead says it is not advisable and they are obsolete in ECC 6.0,
    ---> declated iTAB as global variable.
    ---> call FM1 --populate itab
    call function " MAIN_FM" in update task.
       ---> fm2 cllaed in side MAIN_FM,   ( here values not populated)
    please suggest global variable not filled incase of background mode.
    thanks
    NK

  • Build stand-alon​e applicatio​n with Global variable

    Question:
       how to build a VI access a global variable into a standalone EXE file?
    there are multiple VIs access to one Global variable, one of the VIs need to run in background to update the Global variable, whick i built into EXE file.
    the rest VI will be called in from Teststand to retrieve the Global variable.
    the global variable is updated if i run the background VI in labview, but after i build it into EXE file, it seems the global is not updated even the EXE running OK.

    Hi,
    Do you actually need to have an executable.
    If you can call your global variable updater VI as a VI form, then your other VI's will still beable to see the Global variable.
    You can launch you global variable updater VI in a new thread or execution so that it runs in the background and returns back to TestStand sequence so you can continue on with the rest of your tests.
    Remember to close your global updater VI before you complete your test sequence run.
    Regards
    Ray Farmer

  • Problems with global variable!!

    Hi!
    I am using some cluster (global variable), and certain fields in the cluster don't be updated.I can't understand where is the problem, because some fields are updated correctly and others no!!
    Any idea?
    Thanks in advanced!!
    Graci

    A functional global acts as a global variable in that it allows LV applications to access the data from different parts of the vi or from different vis for as long a LV is running. The vi is set to not be reentrant so that race conditions are avoided. Since functional globals are subvis that you write you also have the ability to store many global variables which are dependent upon only one input by performing the calculations within the functional global vi. You can certainly achieve this by using semaphores, but with functional globals this synchronization is built in.
    In the functional global vi you have a while loop which is set to stop after 1 iteration. This while loop has a shift register which holds the global data. There is a cas
    e structure to determine whether to read or write the functional global variable. In the write case the data from the input is written to the shift register on the right side. In the read case the data from the left shift register is written to the output and also passed on through to the right shift register. A good example can be found at the following link.
    http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3DB4956A4E034080020E74861&p_node=174821&p_submitted=N&p_rank=&p_answer=&p_source=External

  • Adding tab to typedef tabcontrol causes class conflict with global variable

    Hi,
    I am quite new to labview. I have to update an existing program and I have a problem whith a tabcontrol. In attachement, I give you a very simple solution showing my problem.
    I have defined a simple tabControl in a typedef ctl. I had it to a VI and in block diagram of this VI, I want to fill a global variable with this control and this global variable is set as "Include Data Type".
    When creating my ctl file with a simple tabcontrol, there is no problem but my tabcontrol only contains 2 tabs. When I use "Add page after" in my ctl file to create a third one, after saving, I get a class conflict error on wire to global variable in my block diagram.
    If I remove added page, all is OK again. I don't understand why adding a new page causes a class conflict. In my attachement, it is very simple but in program that I have to modify, I already have 15 tabs and I just want to add a 16th one so, I am sure there is a mean, but impossible to fond it after many hours...
    If someone can tell me how to make my example works with "Include Data Type" (if I remove it, it always works but that is not what I want) and adding an additional tab, it would hemp me a lot!
    Thanks in advance.
    Yohann
    Attachments:
    test2.zip ‏11 KB

    The problem is that the tab is an enum, and you can't wire two strictly typed references of two different enums together, because they are considered different data types. What you can do is right click the reference control in the global variable and select Show Control, which will show the data type of the reference. You can then replace the control inside the reference with the typedef, which will cause it to update correctly.
    Although that will solve the problem, if you have the reference to a tab control in a global variable, you probably have some issues with your code, but that's not something which can be commented on without more details.
    Try to take over the world!

  • Is it possible to intialize a text item with Global Variable

    Hi,
    I have forms10g, I want to initialize text item with current hour for this purpose I have defined one global variable and initialize text item(for hour) with this global variable.
    Defination of global variable
    :GLOBAL.my_var := TO_CHAR(sysdate,'hh24');
    Initial Value of form text item as
    :Global.my_var
    but when I run the form it raise error " ORA-01403 no data found " error
    I already check this global variable intialize properly with the current hour.
    Thanks and Regards.
    Khawar

    Hi Francois,
    Thanks for reply, but when I removed initial value property of text item from Global variable to other or Null form starts running, I have one Poplist and it populate with a procedure at form startup I remove it but no success.
    Thanks and regards.
    Khawar

  • Status with global variable

    Hello to you all,
    I would like to add a status bar using a global variable, unfortunately it does not work that way I thought.
    Pls see attachement: Status_test_global.vi contains the global variable that I used.
    What couses the problem and how can I solve it ?
    Every answer is appreciated.
    Br
    B.
    PS: Status_global.picture is a *.jpeg
    Solved!
    Go to Solution.
    Attachments:
    Statusbar_Test_global.vi ‏4 KB
    Status_bar.vi ‏10 KB
    status_global.jpg ‏223 KB

    There are some mistakes in your VI.
    1) You have not followed dataflow structure between updating global variable and delay time.
    2) You are not updating indicator (You have kept it outside loop hence it will update only one time)
    Do following correction
    1) Make functional global VI. (Take reference from forum if you don't know about functional global)
    2) make two while loop structure running parallel.
    3) From one loop update message in Functional global vi.( Keep sequence like -messageupdate-delay-messageupdate-delay..so on)
    4) Read functional global vi in another loop also keep some delay in this loop.
    Try this correction.
    Prashant
    CLAD
    Labview 6.1-2010
    KUDOS ARE WELCOMED
    PBP (CLAD)
    Labview 6.1 - 2014
    KUDOS ARE WELCOMED.
    If your problem get solved then mark as solution.

  • Hazards with global variables

    Hi all,
    I have a theoretical question. Is it possible to have hazardous situation when using global variables in stacked frame sequence?
    Situation above is just an example. The data in global could be much more complex. Is it possible that in some case writing to global variable can last long enough to end later than reading it in the next sequence? I'm 99% percent convinced that it would never happen. Is execution of next frame waits until writing to global is finished or is it only starts the task "write to global" and then goes to next frame?
    Best Regards,
    Pitol
    Certified LabVIEW Developer, Certified TestStand Developer

    If a wire will do the trick, use it... 
    Anything that breaks dataflow (Local, Global, even a FGV/AE, StackedSequence Structure) can introduce uncertainties into the code... Uncertainties are when you run the code and get different results, usually because of race conditions.  Other uncertainties would be inccorect behavior because the data did not reach its intended destination (example:  error cluster going into a structure, but not refreshing the next iteration / page, etc..).It's not limited to the error cluster, but any variable.
    The most common situation is the race condition.
    The proper architecture will ensure that the code is robust, repeatable, maintainable and scalable.

  • Running Business Rules with global Variables in Composite Forms

    Hi,
    I am having trouble running Business Rules, that include Global Variables, in composite forms.
    I have two forms in the composite form, both have entity in Page dimension set to 'local'. one includes entities at level 3 and the other has entities at level 0. I need to pass this level 0 entity to the business rule, from the form.
    When i try to run the rule, it gives me the following error:
    "This rule cannot be launched because it has hidden rtp variables without default values "
    I get this error even when i set the default value for the global variable.
    This rule runs perfectly when run from the individual form (which is part of the composite form).
    Please help.
    Thanks.

    Known Issue: 9900514
    The Use Members on Data Form and Hide Prompt options for business rules attached to composite data forms apply only for runtime prompt values from the globally shared pages and POVs of a composite data form. In other words, this will only use members that are shared across all component data forms. If users want a business rule to take context from a single component data form, they should attach the business rule to that component data form and include the business rules for that component data form at the composite data form level (<Business rules for componentX>).
    Please let me know if this is not what we are talking about.
    Thank you,
    Todd Rebner

  • TS/OI - problem with globals variable

    Hello all,
    I am in the middle of developing OI which uses some of our previously developed sequences/teststeps etc.
    When I do have sequence running directlly on TS - it performs without any problems;
    When I run it on OI I dont get some data i think stored mainly in global vi. I havent developed library, so I am not quite sure how it works, but I belive it is something like this :
    there is some .ocx file which handles all that - the handle/reference for that is kept in global vi. using this ocx we are also getting some data from text file (mainly addresses for communication) . Those addresses are then stored in stationglobals for TS to use them. 
    The problem is, that when I run that sequence on OI the addresses remain 0x0000, when i want to debug the vi it finds addresses normally. 
    Have anyone faced something like this? Or can have sugguestion what check (ie execution options, preload system etc ?)
    Thanks for help
    Regards,
    PacHOOk

    Can you expand on the following...
    [The problem is, that when I run that sequence on OI the addresses remain 0x0000, when i want to debug the vi it finds addresses normally]
    When you say, "when I want to debug the vi....."
    How are you doing this are you running in SeqEditor and LabVIEW development system?
    or
    Running in your OI with labVIEW development system?
    When it fails, with your OI are you using the LabVIEW RTE for your labVIEW Adaptor comfiguration or are you still using the LabVIEW development System.
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Dynamic event with global variable (vi)

    I have registered a dynamic event to fire when a control in a global vi value changes. All works fine when I open the global vi and change the value of the control manually. When I have another vi modify the value of the global, the dynamic event does not fire.
    I have tried leaving the front panel of the global vi open and observed the value being changed...
    Any help appreciated...

    Hi,
    Please refer to the following document that explains why programmatic changes to the global doesn't get detected.
    Event Structure Does Not Capture the Value Changed Event...
    I hope this helps.
    Sincerely,
    Feroz
    National Instruments

  • Problem with .DLL and global variables

    Hi,
    I need some helps to figure out my problem.
    I wrote a .dll file to open and run a GUI. When I run it at the first time, it is ok. When I call it again, there is an error "Pointer to free memory passed to library. It will be ok if I completely exit the program that calls the .dll before re-call it. I think there is some problems with global variables when I call another thread. How can I free global variables between threads. Is there any solution for this problem?
    Thanks

    Vinh Pham:
    Are you doing anything intentionally that frees your globals?
    CVI ships with an example program that demonstrates calling a DLL to create a user interface: guidll.cws.
    I made two simple modifications to guidll.cws.
    1. In guidll.c, I made hpanel global by moving its declaration from RunDLLUI() to right below the #include statements.
    2. In useguidll.c, I duplicated the lines calling RunDLLUI () and MessagePopup() to call the DLL gui twice.
    I built the project and ran it.  I had no problems with free'ed globals.
    Take a look at the guidll example.
    Can you either post your code or a modification to guidll that demonstrates the problem you're having?

Maybe you are looking for