automatic creation of local variables

Hello

I have the impression that the idea I have is probably not possible, but I thought it wouldn't hurt to ask.  I connect CAN data using a cRIO and NI 9853 using the framework on the channel of convertion vi.  I have a selector of cases in which the message id dictates the case.  In each case, the raster data are converted and sent to tables for data and the name of the channel.  Then, in a separate loop, I make every tenth iteration in the name of channel and data with local variables and save it to a file of PDM.  I currently use local variables for each table in the selector of the case.  While this works well, I'm trying to simplify it and make it like if someone wanted to add several CAN signals for forest exploitation and so more cases in the selector of the case, they could do with as little work as possible.  In essence, I need to make fake evidence.  The idea that I'm trying to find a way to create a local variable and a specific reference indicator as soon as a case is created automatically.  Is it possible, or I ask much of labview?  Thank you.


Tags: NI Software

Similar Questions

  • I want to fill and empty a tank automatically that can be achieved without the use of local variables?

    Labview gurus,

    I have a project to complete and I'm new to labview, I have the 2009 version of the student. and want to build an initial vi of a municipal plant to FILL AND EMPTY TANKS. I use the DSC module to help and I can get my tanks to complete a sequence, but it uses local variables. They cannot be shared on the network when I create my libraries.  Need urgent help...

    Casey74

    Here's a quick attempt at a state machine. See if it makes sense.

    (It can be simplified a bit more!)

  • Copy a structure of event containing local variables

    Hello

    I am a state machine design in Labview and next state transition logic to wait be clicked a few buttons on the Panel.

    If I press a Boolean button from 1 to 9, next State should be X, otherwise condition (10 to 16 tags) should be there.

    I thought that the right approach, because it would be a structure of the event, where I added two cases: case 1 (button 1: mouse to the bottom button 2 down,..., 9 of the mouse down) and box 2 (10 mouse buttons down,...). For each of these cases, I'm reading & writing the local variable of some double digital.

    When I copy the structure of the event in another case of structure of outer case, I note the following: all cases in the event loop is missing, and the local variable renamed automatically and a new created indicator digital.

    • How to make an exact copy of the structure of the event, without the problems described above?
    • Could you suggest a different approach more effective than mine?

    Thanks for any response.

    Start by reading the guard and recommendations for using events in LabVIEW - LabVIEW 2011 help

    The fact that you try to copy and structure of the event to another, and that a structure of the event will be buried in a case initially tells me you are already heading on the wrong track and yourself in creating a world of problems.  Your architecture will never seem to work for you.

    The event structures are always active and capture events.  Even when the structure of the event is not in the path of execution, it's queue of events to which he attributed to him.  If you have events that are set to lock the façade until full, then you're really screwed because the event structure will capture the event, locking of the front panel and the execution path of your code with the state machine may never come to the specific case that has captured the event to support then release the façade.

    In general, you should have the structure of a single event in a VI, and should not be buried in a case structure where he can never carry.  You also shouldn't have several event facilities manage the same events.   These are not hard and fast rules, but until you are quite familiar with how the event structures work and completely understand the architecture of your code, you should not violate or you will just ask trouble.

    Similarly with the help of local variables.  The fact that you say that you have local variables and you try to copy tells me that you already have too many.  There is certainly a better way to build your VI, which does not require local variables with the exception of a few cases and certainly won't need several structures event buried in the structures of the case.

    You should probably have a producer/consumer architecture that handles the events.  Have a simple loop with a structure of the event which captures all user interactions.  Pass events to a loop of consumer who is also your computer through a queue of State.  (Also known as a computer state in queue or the BAU).  Let the state machine to determine how to manage the events, he received based on what is the current state of the VI.

  • copy a local variable without front double element

    whenever I have copy and paste a local variable in the block diagram, LV automatically duplicate the front panel which is really awkward... is there anyway to stop the duplication of the façade?  I have look all over the place, but maybe I missed something... .Gee where that parameter could be?

    There are two ways to copy objects in LabVIEW. Of course, we're the regular copy and paste. You can also hold down the Ctrl key and click on and drag any element in LabVIEW to create a copy. It is not only faster, but this copy mechanism can be used for local Variables and related nodes of property without too much a copy of the associated control. Check it out!

  • Cannot insert field or paste into the existing local Variable (Boolean container)

    Cannot insert field or paste into the existing local Variable (Boolean container)...  TestStand 4.1.

    It is very strange, especially since I've done it before.

    'Paste' and "insert field" selections are grayed out and disabled in the context menu.  I tried everything I could imagine and tried various combinations of positions.  I'm sure it's something simple, bu redicoulously, I can't find the redicule to solve this annoying problem issue.

    The local variable is a container of Boolean.  It has 90 elements and I need to add one more.  I can not change / rename or do something with this Local.  Must be karma (for those who know me in the LabVIEW forum).  Usually, you do a right click, insert field and that's where...  Not this one...

    Anyone seen this before?  Closing and re-opening TestStand doesn't change anything.  There is a collection in LabVIEW that feeds the local section in TestStand.

    It is a container of data custm type.  To change flags are ok (edit is allowed).  Can't think of any other valuable information...

    He finds...

    It should be edited in the Data Types...  It was not automatic after reloading the prototype of LabVIEW.

    I knew it was something stupid that I didn't...  I became close... but had not sought far enough.

    I was looking at the range of Types, but not in the file of the sequence...

  • Local variables are comparable to the value property of a control or indicator?

    I use the buttons / switches mechanical locking action, event structures and local variables to track the status of my switches.  I used local variables with indicators, too.  Now I see that this could be done via the node property of a switch or an indicator.  Should I use the nodes property instead of local variables?  Should I use "switch" mechanical action and control the State of the control buttons / switches?  I used a mechanical locking action because it automatically reset when it is read, but who pushed me in the use of local variables.

    I know the property values to adapt the data flow model, while local variables might be placed in a sequence structure to ensure the order of execution.

    I just don't want my program all except if it is a correct approach.

    Thank you

    DH

    Dark Hollow says:

    Well, I'm changing the properties of user interface in my state machine.  For example, when you push a button to START the TEST, I want to disable and gray this button and activate the button to STOP the TEST.

    No engineer too much. In this case, you can use a single button and label the FALSE case a 'start Test' and the REAL case as TEST 'STOP '. No additional code needed at all. At the same time, you only use the half-Panel space! (and 10% space diagram!)

    Dark Hollow says:

    Another example... I have a couple of dozens of LEDs on the front panel to show the TEST SUCCEEDED.  If I have the wiring all of them, my state machine diagram gets messy.

    Define disorder! In my mind, code is not held together by wire is much messier because it is impossible to determine the order of execution and so program logic. A thread is a small 1 d object. A property node is a significant 2D object. 20 wires are much less messy than 20 knots of property, especially given that each property nodes still hanging by a thread in one way or another!

    In order to reduce the number of threads, use the most appropriate data structures. Instead of a few dozen sighted use a single Bay of LED. A single wire! Keep the table in a shift register and update alone LED as necessary by using "replace subset of the table".

  • LabVIEW 2010 local variable behavior

    HI -.

    I upgraded to LabVIEW 2010 of 2009SP1 and the attached sub that VI no longer works correctly.  It is a case of State machine structure that is called inside a loop.  I will put a Boolean variable true local, then on the next appeal when the case changes the variable has been reset to false. He has not done this in LV2009.

    Someone tell me immediately I have a race condition, but these local variables are not be written anywhere else, just in these separate cases.

    See the attached code, specifically, the local variable 'Activate' is to reset during the passage of the 'turn on' case for case "power."

    Anyone else seen elsewhere deliver, or can shed some light?

    I've corrected the VI by writing the value in each case, but this different behavior I wonder what are the other issues lurking in LV2010?

    Thank you

    This code looks more like a kind of a motor of Action that a state machine, but not quite.  It is called several times since a state machine, and he decides who will be the next State according to the entries.  Instead of using all local variables, I would use shift registers not initialized (Nothing cable on the left side).  They hold their value of one call to the other.  A case more will need to be added in this case.  An event of default without a name, which would set the initial values of all the shift registers.  Make the default case and does the same name.  It will be called first automatically because the shift register is not initialized, then the default value will be called.  Inside the default case, set all the shift fits to the desired values.  Next time the Subvi is called, these values will always be there.  As long as nothing is wired on the left side, everything is wired for the shift state register will be the next case called.

    See attached vi.  It's broken because I have this thread not to indicators.

  • LabVIEW: Concerns with local Variables and the readability of the program

    Hello everyone. I was hired for the summer to work at my University to a new laboratory. All right, but I have some problems with my main VI. I am a new user of labview coming from a C++ background. I went through several iterations of adding features, fixing bugs and doing my readable program. Before the last "cleaning" my program was so big that I couldn't see it all at once on my screen. My goal was to solve this problem. My solution contained three parts: use a state machine show parts of my code at the same time, to remove the son as much as possible, and use structures element to position my code manually.

    I met since problems write other programs that brought me here, and I saw a series of messages condemning the new programmers for their use of local variables instead of cables. I do not know my use of structures element as fancy boxes I can exclude the automatic cleaning is also a terrible practice.

    After doing some more reasearch on the subject I see local variables to add the duplicate in memory entries and their suppression can significantly speed up execution time. I have a delay programmed in a part of my code, but the rest can run as fast as he can as far as I'm concerned.

    I have attached my main program. Looking at it I think I did a good job to make it readable. But I'm not a user expert labVIEW.

    How to balance (do not use local variables, these structures element, etc.) efficiency and readability. Before you make these changes, there was so many things and so many threads all over the place that I couldn't even tell what was going on, and even less my teacher. I really wish I could see my entire program without scrolling on this computer of the laboratory (resolution 1280 x 1024).

    Advice on how I can achieve the efficiency, simplicity and common readability would be greatly appreciated. I feel I've done the latter while sacrificing the first two. Ultimately the three should probably be equally important.

    Thank you.

    Nukem

    LabVIEW 2010

    As said altenbach, attach your event structures.  It should really be only need structure of an event, especially for a simple VI like that (I counted 3).  This is the second time I have recommended this today, but fetch JKI State Machine.  I use as the basis for most of my interfaces.

    Here's a way to manage the break with JKI.

  • How to determine the number of rows in the database and save the result to a local variable?

    Hello

    I'm a newbie in the use of TestStand, databases and SQL, and now I've met difficulties. I use TestStand 2014 (32 bit).

    I have a need to know the number of rows in a database and save that number in a local variable. I tried to practice using the database of the Types of step provided with TS. I tried to use the following in a SQL statement:

    Locals.NumberOfRows = ("SELECT COUNT (*) FROM TEST_TABLE")

    It returns an error: specified value is not the expected type. My goal is possible in this way, or I'm doing this completely wrong?

    -RautSa

    Thank you for your response, Norbert. I have a database of who wins new values at random, and sometimes I need the exact number of rows in this table.

    I managed to achieve my goal by using the SQL statement: "SELECT COUNT (*) as Rowcount OF TEST_TABLE", followed by a data GET operation, which records that number of lines in a local variable.

    -RautSa

  • In collaboration with a no engine in the types of different scheme (local variables).

    The program below is used to control a motor with the NI 9401. However, it has been designed to work in two ways, when you push the buttom "adelante" or "ago" he turns in one direction or another, but if you press 'Start' it begin to move in a particular way (which I mentioned) and if you press again the same ('Start'), we need to stop (this way you can push the door "adelante" or "ago" If you want to). The problem I have is with the "local variables", because when the 'Start' button is the I three while loop and I Don t know how said it stops when the 'Start' button has been pushed and the same when the 'Start' button is pushed, and I press the 'Start' button to stop it. I have a mess with the function of local variables.

    I know it's a little complicated to understand by Word, I tried to explain more clearly.  I hope you can help me.

    Hello matt198717,

    Yes, I think that the problem was trying to use local variables in parallel loops. I use this property at the time of the node and it works!.

  • How to copy Step.Result.Error.Code in the local Variable

    How can I copy Step.Result.Error.Code to a stage in particulat to a local variable.

    I want to print the value of Step.Result.Error.Code in my test report.

    Help, please. Thanks in advance.

    Kind regards

    Sagar Joshi

    Yes of course!

    This is better handled by the recall of SequenceFilePostStepRuntimeError:

    (1) StepResultCode (number) is added FileGlobals

    (2) add SequenceFilePostStepRuntimeError callback to your movie file

    (3) the next stage of the declaration adds the recall of SequenceFilePostStepRuntimeError :

    FileGlobals.StepErrorCode = Parameters.Step.Result.Error.Code

    Here is an overview of the sequence:

    I hope this helps.

  • Change local variables with dll c#

    Sub AppMgr_UserMessage (UIMessage uiMsg)

    {

    Try

    {

    switch ((int) uiMsg.Event)

    {

    10200-case: //update the UI to reflect the current status

    progressBar.Value = (int) uiMsg.NumericData;

    label. Text = uiMsg.StringData;

    break;

    10201-case: //Close form, cleaning of the AppMgr reference

    AppMgr = null;         This. Close();

    break;

    //=========================================================

    10202-case: / / send the text to the caller App test bench

    label. Text = "10202."

    uiMsg.AsPropertyObject (). SetValString ("Locals.opText", 0, "Something");

    break;

    //===========================================================

    It is a code in your example of Panel floating .net

    In the last case above trying to change one of the local variables of the test bench. I think that it is probably not wise to cast as a how PropertyObject uiMsg which I have here.

    I think it is more likely that I'll have to pass the variable I want to change benchmark to the DLL.

    Don't know how to do this, any ideas?

    Hi Krugman2,

    To do this, you need the coresponding SequenceContext!

    Try uiMsg.Thread.GetSequenceContext(0,frameId). AsPropertyObject()

    Maybe this thread could be interresting:

    http://forums.NI.com/NI/board/message?board.ID=330&thread.ID=17870&view=by_date_ascending&page=1

    Greetings

    Jürgen

  • Why flatten data chain not getting past all about TestStand via a local variable of the string?

    I tried to go around a series of data in TestStand as a string using "flattened chain" of LabVIEW. When I create a local variable in TestStand of type 'string' and try to write the cluster flattened at this that he simply not transmitted. If I convert the string flat binary table and then pass it around, I can recover all the data very well.

    Is there something I'm missing here?

    I've attached an example Teststand sequence that illustrates this problem. If you run this sequence that the 1st test will fail, which is the attempt to simply pass the flattened string data structure and the 2nd test will pass as it is the binary table that I generated from the flattened string.

    Thank you

    Pete

    crossrulz is correct.  The Null character affects how TestStand handles the string.  You will need to specify the string to a binary string in the list of settings both the VI.  TestStand then encodes the stringso it can prevent the loss of data.

    If you need work on the binary string in TestStand, you will need to convert it to an array of raw data with PropertyObject.GetValBinary.

  • How to find the steps associated with a local variable?

    In a sequence, we have to write or read from a local variable. Is it possible (for example right-click the variable) to find out related measures?

    Thank you!

    Are you talking about discover what steps use the local variable.  Because the measures are not really "related" variables.  Either they are or they aren't.

    You can use the search/replace tool.  Edit > find/replace

    In the look for:, enter inhabitants.

    You can check her search for: box, and then select the order in which you want to search.  This should show you a list of all instances of the local variable.

    Hope this helps,

  • How to create a nested local variable control custom?

    I inherited code which has a cluster of CTL control nested inside another group of control CTL.  If I drag the control nested outside the border of the other, I can right-click to create a local variable, I need to connect to the bundle name.  However, as soon as I drag the inside the limits of external control, it breaks the local variable.

    How can I create a local variable in a cluster THAT CTL nested in a second group CTL?

    Is there some kind of reference OuterCluster.InnerCluster, that I can use if I do a local variable of the external group?

    It turns that I need a local variable for the cluster internal.

    JPG attached shows that I created a local variable for the external cluster (ParametersCluster), used a Unbundle based on the name to access cluster internal (EmptyParmeters) and can access one of the elements through an another Unbundle by name.

Maybe you are looking for

  • mcscm.dll + Lib

    Use mcscm.dll. It has 22 functions. The functions are defined in a library file named mcscm.lib. I just called mcscm.dll using node library call to call a particular function. But what the thing is since all this dll functions are defined in the mcsc

  • Office Jet 6100: Remove the printer tray

    How did the paper tray removed for transport?

  • Added to my rocket 4 GB - 16 GB card how to appear correctly?

    After you add a 16 GB card supplied to my 4 GB Fuze, I then connected on the pc. In my computer, when I click on the properties of the rocket , it still shows 4 GB, but when I click on removable disk , it will show the 14 GB... When I turn on the "ro

  • 2 wireless routers, I can get out, but not in

    I was hoping you might be able to help me with my setup, I've almost got it, there's just something that I'm missing.  I had a wireless router G (WRT54G) running well in my network for a while now, and since my wife and I both just 802.11n capable la

  • Money 2007 will not open - library of record not found

    Money 2007 worked fine yesterday.  This morning, when I tried to update my accounts, it failed with a msg about the library for registration.  How to remedy?