LabVIEW Functions and reentrant execution

Are the LabVIEW functions reentrant? I am writing a threaded application where the same code is used for the multiple threads. I have made the top level and lower level VIs reentrant but am wondering if the LabVIEW functions (specifically TCP Read and TCP Write) have only one instance loaded into memory or one instance is loaded for each VI instance that is loaded at runtime?
Cheers,
Wayne

> Are the LabVIEW functions reentrant? I am writing a threaded
> application where the same code is used for the multiple threads. I
> have made the top level and lower level VIs reentrant but am wondering
> if the LabVIEW functions (specifically TCP Read and TCP Write) have
> only one instance loaded into memory or one instance is loaded for
> each VI instance that is loaded at runtime?
The built-in objects in LV do tend to be reentrant. They are always
threadsafe, even when the access must be serialized such as for UI
actions. When the API has a connection ID or other reference to work
off of, they connect directly to lower OS APIs and are as reentrant to
the extent the lower level APIs allow.
Greg McKaskle

Similar Messages

  • Function and procedure execution

    hi all,
    i have question in procedure execution and function execution oracle database.
    i want know that which is faster in execution procedure or function.
    can i see the time taken by procedure and select query
    i want to see only time not cpu cost or anything else.
    i am waiting for your responses...

    There is no difference in cost between whether something is a function or a procedure.
    The decision making should reflect usage only. For example you can not use a procedure in SQL.
    If you wish to break things down further focus on 10046 and 10053 tracing.
    Seeing time only is roughly equivalent to cutting off all of your fingers to see how something feels to your thumb.
    Timing is only one very small part of what you should be watching.

  • Strange problem of calling library function node in labview 2010 and 2011

    one year ago,I develop a program to usb device data and it works well,in labview 8.6 or 2009(win xp).Recently, When I test
    the program in labview 2010 and labview 2011(win xp).,the program always crash immediately.I check the program and find main
    problem is in call library function node. In my program,I use labview 2009 library for the USBExpress driver for
    Silicon Labs USB MCU's from:https://decibel.ni.com/content/docs/DOC-9522,for example, 2 functions SI_OPEN and SI_READ
    can not work well.
    the header definition of SI_OPEN and SI_READ is:
    SI_STATUS WINAPI SI_Open(
    DWORD dwDevice,
    HANDLE* cyHandle
    SI_STATUS WINAPI SI_Read(
    HANDLE cyHandle,
    LPVOID lpBuffer,
    DWORD dwBytesToRead,
    LPDWORD lpdwBytesReturned,
    OVERLAPPED* o = NULL
    the SI_STATUS is equivalent to int type.
    orignally, for HANDLE * in SI_Open, the parameter type in call library function node is numeric, data format is unsigned 32 bit integer ,and pass pointer to value.
    for HANDLE in SI_Read, the parameter type in call library function node is numeric, data format is unsigned 32 bit integer ,and pass value.The program works well in labview 8.6&2009,however,crash in labview 2010 &2011.
    later,I debug the program, for HANDLE *, I choose parameter type in call library function node as adapt to type, data format is point to Handles.for HANDLE, I choose parameter type in call library function node as adapt to type, data format is Handles by Value.Crash not happend in labview 2010&2011,however,it cannot read any data from from USB device correctly as before.I can not find the reason.
    Dear friends,I need your help to answer the problem. Thank you.

    Based on the help page it looks like it should execute asynchronously.
    The thing in the description that leads me to believe they execute asynchronously is that you can configure the library to run as a multi-threaded operation.
    Please take a look here to see the difference between synchronous and asynchronous execution.
    Since the code even has the ability to be multi-threaded, you can consider it as running in parallel to your other code.
    Any data returned is passed to the thread that called that function.
    Cory K

  • How do I start and stop the SolidWorks Simulation by Labview function?

    Hi folks I have two question.
    1. According to "NI SoftMotion for SolidWorks - FAQ http://zone.ni.com/devzone/cda/tut/p/id/10493#h49", an user can manually by right-clicking the SolidWorks assembly in the Project Explorer and select Start Simulation. How to start simulation by Labview function?
    2. How to produce setup program(include Solidworks assembly) by Application Builder? An user can simulate without Labview 2011.

    Thankyou very much for your reply, i am new to Actionscript so your help was really good, I did the following code which seems to work ok.
    I now need to get the time that elapsed from the first to the second key press so I can move an object on the stage a set number of pixels, for example; 1 sec move 10 pixels, 2 sec move 20 pixels etc
    Any further help would be greatly appreciated.
    Thanks again.
    Mick
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    import flash.events.KeyboardEvent;
    var myTimer:Timer = new Timer(100,100);
    myTimer.addEventListener(TimerEvent.TIMER, fl_TimerHandler);
    var fl_SecondsElapsed:Number = 1;
    function fl_TimerHandler(event:TimerEvent):void
    trace("Seconds elapsed: " + fl_SecondsElapsed);
    fl_SecondsElapsed++;
    stage.addEventListener(KeyboardEvent.KEY_DOWN,keyDownHandler);
    var myKeyBoolean = false;
    function keyDownHandler(event:KeyboardEvent)
    if (event.keyCode == 86)
      myTimer.start();
    else if (myKeyBoolean == false)
      myTimer.stop();

  • LabVIEW MilliSecs support manager function and Tick Count block diagram object

    Is the output of the support manager function MilliSecs (used in a CIN) directly comparable with the time returned by the Tick Count (ms) block diagram object? i.e. if they have the same value then it is the 'same' time allowing for OS specific time resolution

    > Is the output of the support manager function MilliSecs (used in a
    > CIN) directly comparable with the time returned by the Tick Count (ms)
    > block diagram object? i.e. if they have the same value then it is the
    > 'same' time allowing for OS specific time resolution
    The LV diagram node is built upon the MilliSecs() function, which is
    built upon various OS specific functions. It is safe to treat them as
    though they are the same function and represent the same clock.
    Greg McKaskle

  • Reentrant execution?

    Hi All,
    Here's my problem. I've built a photon timestamping system. I have a VI that takes a counter channel as input and uses it as a clock. The input to the counter channel is the 80MHz clock onboard the PCI 6602 card. That VI works great. Now I want to instantiate it multiple times, each instantiation will be watching a different input channel. Someone mentioned that I should setting the reentrant execution option for this time stamping subVI in order to have multiple copies running. So I've set that, but so far only my second (I only have two instantiations to start with) instantiation is collecting data. Did I misunderstand the advice I was given? Is reentrant execution for if you want to go into the SAME instantiation of a subVI multiple times? So in this case I shouldn't have reentrant execution selected? Or if I should be doing something totally different please let me know. I've included my code for you to take a look at, there's two photon simulator programs there to to use with the code. Basically what I want to do is use multiple instances of the timestamper I've built and have them all watching different counter channels.
    Thanks to any help,
    Chris
    Attachments:
    LabView App (June 28, 2005).zip ‏158 KB

    Chris,
    I don't have compatible DAQ hardware here to test it, but I think I've got it fixed. Basically, one of those many many tiny little wiring connections wasn't routed properly to the first instance of your 'Single TimeStamping' module. The value of '# to read' went into the 'buffer size' input, and all subsequent wires along the top were likewise shifted one position to the left.
    This would have been hard to debug because the modules, being reentrant, wouldn't have shown the values passed in on the front panel.
    Unsolicited advice: try *really* hard to avoid using those 28-connector panes! It's very difficult to wire them properly, and you can usually bundle several input values into a single cluster input to save on wire count. Personally, I stick with the 12-connector pane for general use and never use more than the 16-connector pane.
    Attached is a (hopefully) fixed version of the top-level vi.
    -Kevin P.
    Attachments:
    CompleteTimeStamping_v5.vi ‏121 KB

  • Reentrant execution problem

    When I select reentrant execution in a sub vi, it seems to want to be turned on manually. When I create an executable the reentrant vi doesen't seem to run. Any ideas?
    Thanks,
    Tom

    Hi Bob,
    Thanks for your response.
    Let me start by stating my task:
    I have a program that I communicate with over active x. My Labview VI quiries with strings - and acts upon the responses. Some of these tasks are time dependent. Therefore I wish to create sub vi's that will thread these tasks at the processor level.
    In the example attached (since you do not have the program, there will be no response string) the active x sub vi is reentrant. The flash vi is just there to crreate a timming issue for the threading to overcome.
    If I run the reentrant test vi as normal, the active x sub vi will update as I click its run arrow. If I first select continuous run on the active x vi and then run the reentrant test vi, the desired
    effect is achieved: continual updates to the quiry string that are not affected by the timming issues of the flash vi.
    Is this the least bit clear? I hope so!
    Thanks for listening,
    Tom
    Attachments:
    reentrant_test.vi ‏15 KB
    active_x_vi.vi ‏11 KB
    flash_vi.vi ‏19 KB

  • [W2k, LV7]: debugging reentrant executions

    Hi there,
    I've entered unexplored territory in LabVIEW7 (at least for me).
    My project involves the start of some daemons watching USB comm lines.
    Those daemons are reentrant vis started using VI server: 'Run VI'. So far so good.
    There seems, however, to be a bug in my code that prevents the self-termination of those daemons under specified circumstances. So now I need some help
    debugging reentrant executions. Maybe someone of you can give me some hints and answer my Qs:
    1. Those reentrant daemons have a non-reentrant subvi as a LV2-style global (USR to store 'global' data). Will this LV2Global run just in one instance as expected, e.g. can I rely on it displaying the results of all daemons?
    2. I've created a little too
    l that shows all running processes and if those are reentrant or not. But i can not figure out how to get the number of instances running of a reentrant VI. Any ideas?
    3. If, as in my case, a reentrant daemon does not stop as expected, is there a save way to shut it down? I had to shut down LV using W2ks task manager to kill that processes. Any better ideas?
    TIA and
    Greetings from Germany!
    Uwe Frenz

    Hi Uwe!
    I am used to seeing you on info-LabVIEW becuase I kunk on that list.
    Yes, Ed's #3 is invalid for the reason you cited.
    I do not think you should rule the VIT approach so quickly.
    I have used VIT's to do this type of thing on a number of occations. Let me share my approach.
    I will use an action engine that I use as a messanger to communicate Start/Stop/Exit messages to the VI instanciated from VIT's. It is a simple VI that uses the VI name to post messages from the daemon to the VI(VIT) and report status back.
    How this works;
    1) After the VI is instanciated using the invoke node "run do not wait" I use the reference to get the name of the VI that was created. I then use this name when I call my "messenger" to tell the VI to start.
    2) The VIT's will first find out what their name is and then check my "messenger" to determine if they should start/stop....
    3) The VI that launches the VIT's will use the "messenger" to check if the VI started OK. If not, I can abort and start the shutdown procedure and log an error after a resonable timeout period.
    4) If the VI(VIT) started OK, the code will then procede to launch the next instance of that VIT.
    5) When it is time shutdown the instanciated VI's, the same "messenger" is used to pass the shutdown message.
    6) VIT's are coded to post their state (stopped, running, exit) to the mesenger.
    7) When shutting down I can monitor if any of the instanciated VI's fail to shutdown and then log errors to give a clue as to which one was getting stuck.
    The cool part of this approach is that all of the instanciated VI's show in the "hiarchy screen" and I can simply double click on the icon and get the FP open for that instance. This lets way I can do execution hightlighting to see what is happening without getting in the way of teh others.
    Re#3;
    I seem to remeber Rolf Kalbermatter lsiting this as with re-entrant VI's that he did not like.
    Trying to repay you for "Info-LabVIEW" contribution,
    Ben
    Ben Rayner
    Certified LabVIEW Developer
    www.DSAutomation.com
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Print text file with labview 2011 and windows 7

    I am having some strange problem, hope someone out there knows the solution.
    We have a labview program running under windows xp, the program runs some test and print label from a local label printer. Last week, I have to upgrade the computer to windows 7 and all the sudden the printer will not print any more.
    The print vi is very simple. I am using the report function and I am attaching the diagram of that vi below. 
    If I use windows notepad to open that small text file, I can print fine. This means the printer driver itself is OK. However, if I print the same text file through Labview printing vi, from the printer's task list, I can see it does not recognize the char. From the attached png file, the top one is the task from notepad, it shows 2 pages and the bottom one is from the labview, it becomes 33 pages. 
    For the printer part, I use Generic / Text Only printer driver which comes from windows itself. And I am aslo attaching a sample of the text file, there are quite a lot of special char, it is for print bar code. When I tried to use labview print text vi to print general text from my computer to a regular printer, the vi works. So it seems Labview print can not handle the special char? Although it worked many years under windows XP in the past.
    Welcome to any suggestions!
    Thanks
    Attachments:
    print vi.gif ‏9 KB
    labview print bug.png ‏26 KB
    SerialLabel.txt ‏1 KB

    DGU wrote:
    where to check RAW or TEXT? the print report vi only asks for file name and printer name.
    When I print from notepad, everything just goes by default. This is a label printer, so I never need to specify printing parameter such as size, orientation, etc in the past
    Famous last words go something like this: "...never had to do that before."  Maybe you have to do that now.  It's worth at least comparing the defaults settings for bothe generic drivers.  It could save you a lot of headache if you notice something different.
    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.

  • Smart Software Engineer with LabVIEW experience (and acoustics a plus) needed in Boston, MA

    We've are looking for a staff software engineer to join our company in Boston, MA (near downtown).  We have a 3000+ vi application that has been in continuous development by multiple software engineers (currently 4 engineers + 1 intern) for 15 years.  Every year we release a new version of the software with significant new features.  An engineer with our company needs to be more than just a LabVIEW hacker.  We need a software engineering that can go into our large application, modify it, sometimes in very fundamental ways, without breaking existing functionality, and have an eye for how their changes impact the maintainability, scalability, reliability, and readability of our code.
    Candidates will likely be LabVIEW Architects or have equivalent experience if they don't have formal certification.  We lean towards candidates who have Masters Degrees in such fields as Electrical Engineering, Mechanical Engineering, and Computer Science. Interviews will be conducted over phone, web, and in person by a LabVIEW Architect and will need to be able to discuss topics such as the following:
    - coupling and cohesion in software design, how this relates to design paterns such as action engines
    - software lifecycle models- state machines, parallel loop architectures, race conditions, data structures, type definitions, Xcontrols,
    - Object Oriented design
    - importance of documentation, importance and use of source code control
    - pseudo code and its usefulness as a design tool, some exercises will require users to read and write pseudo code to solve classic computer science problems
    - tradeoffs of various file formats in terms of flexibility for future software changes
    - FFT, Frequency Response, Amplitude/phase, RMS level, dB, noise, averaging, distortion, loudness, A-weighting
    Formal job ad is below:
    To be considered for this position, please send resumé and cover letter explaining why you are the ideal candidate for this job (in Word or PDF format only) to [email protected]. Please use the subject title Software Programmer.
    Programmer for Audio Test and Measurement software - Boston
    Listen, Inc. is the market leader in PC based electro-acoustic test and measurement systems for testing loudspeakers, microphones, telephones, audio electronics, hearing aids and other transducers. We have been in business for over 15 years and our continued growth has created an opportunity for a software engineer to join our programming team. This is an exciting opportunity to work on an industry leading electro-acoustic test and measurement system used by numerous Fortune 500 companies in the field of loudspeaker, microphone, headphone, telecommunications and audio electronic manufacturing.
     This position reports to the Software Manager. Duties include, but are not limited to:
    Programming in LabVIEW
    Designing and coding new Sound Measurement and Analysis software
    Improving, reviewing and de-bugging existing code
    Preparing internal and user technical documentation
    Testing code
    Interfacing with management, sales teams and customers to define tasks
     Required skills / education
    Bachelor’s degree (Masters preferred) in electrical engineering, mechanical engineering, computer science, physics, or similar subject
    Strong background (4+ years) in programming with 1+ years in LabVIEW.
    A methodical approach to coding, testing and documentation
    The ability to work well in a small team. A willingness to challenge and discuss your own and other people’s ideas.
    Experience in acoustic engineering is a plus.  Relevant topics include FFT, Frequency Response, Amplitude/phase, RMS level, dB, noise, averaging, distortion, loudness, A-weighting
    About Listen
    Listen has been in business for over 15 years and our suite of PC & sound card audio test & measurement products is the accepted standard in many blue-chip companies worldwide. We offer the spirit and flexibility of a small company, combined with stability and an excellent externally managed benefits package which includes competitive salary, healthcare, paid vacation, retirement plan and more.
    Applicants must have authorization to work in the US. We are unable to assist with visa / work permit applications.

    we're interviewing candidates, but, this position is still available

  • How to open labview program with Quit Labview function inside?

    Hi Any idea how to open labview program with  Quit Labview function inside?
    I forgot to add and set the condition of the type for this program.
    If the program is an application, it would close straight away.
    If it is still labview work, it will go straight to editing program without closing.
    So I need to recover, open it and make some changes.
    Clement
    Solved!
    Go to Solution.

    Put the VI in a project and open it from there, then it shouldn't autorun. You can use App.kind property of application to decide whether to close or not.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • LabVIEW classes and mass compile

    Just wondering if anyone out there has found any problems mass compiling LabVIEW classes, as I am having what appears to be totally un-resolvable issues - I get a list of VIs that either say BadsubVI or BadVI all of which I have verified are error free.
    The only thing I can round it down to is the use of the lvclasses, and in particular the fact that I'm making extensive use of the inheritance functionality, and also a few override vi's.
    It wouldn't be such an issue except that I'm calling some of these vi's from TestStand, and am unable to get a deployment to work without a successful mass compile.
    Appreciate any responses,
    David Clark
    CLA | CTA
    CLA Design Ltd
    Hampshire, England

    I'm not sure if it's the same problem but I had a vi that would compile into an unrunable exe. I found the problem by mass compiling the project, which came up with a bad vi and bad subvi's that used that vi. Turns out my problem was that I had two classes with the same name (even though they were in separate lvlibs). And renaming one corrected my problem. LabVIEW 8.5 gives a warning and renames the compiled vi's (so if you could try 8.5, that might help you find the problem quicker assuming it's related). It seems to me that the name spaces provided by lvlibs go away when compiled into an exe or by the mass compiler (It may just affect lvlclasses).
    Matt

  • LabVIEW 2011, and Excel 2010: saving problems

    Hello to all! I am a student of Mechanical Engineeringfthat very little has been using this software. I present the problem: for a matter which is called Biomechanics, I and my colleagues, we have developed the design of a rheometer, which is controlled by LabVIEW2011. Since we are still at the experimental stage, always has been simulated using labview: the whole experience. So, labview, at present, not only controls the stepper motor through the frequency sets, but also simulates the output (in the specific, the response to the torsion of the cartilage, simulated with a low pass filter of the second order). All this was done by my colleague more experienced than me, who today passed me the finished project that in his pc works perfectly while not in mine (we have the same version of labview, but different version of office). In practice, the program is fine (there is no arrow "Run" broken) and the simulation with the creation of the sine graph (response of the cartilage) is done perfectly. My colleague then set labview in order to save the data to an excel sheet at the end of the simulation, asking the user where to put it (the excel file must already exist, labview does not create it). The excel file should contain two columns and a scatter plot (one column represents the frequency, f, of the stepper motor, the second represent the shear modulus G, which increases as the frequency increases and the graph represent the trend of G in function of f). As soon as I decide to save the data, excel opens, for an instant appear the scatter plot and data in columns but immediately after the graph disappears and remain only the columns with data (so I have to make the graph "manually") and labview gives me the following error:
    Error -2147023170 occurred at Property Node (arg 2) in NI_ReportGenerationToolkit.lvlib:Excel_Insert_Char
    t.vi->NI_Excel.lvclass:Excel Insert Graph.vi->NI_ReportGenerationToolkit.lvlib:Excel Easy Graph.vi->SaveExcelFile.vi->Progetto 2.0.vi
    This error code is undefined. Undefined errors might occur for a number of reasons. For example, no one has provided a description for the code, or you might have wired a number that is not an error code to the error code input.
    Additionally, undefined error codes might occur because the error relates to a third-party object, such as the operating system or ActiveX. For these third-party errors, you might be able to obtain a description of the error by searching the Web for the error code (-2147023170) or for its hexadecimal representation (0x800706BE).
    What can I do?
    Thanks. Regards
    Solved!
    Go to Solution.

    The LabVIEW Report Generator in LabVIEW 2010 and more recent versions does, indeed, work very well with Excel in Office 2010.  I helped someone about two weeks ago with a problem saving a series of measurements to a (new) Excel Workbook.  Your problem differs in two ways -- you want to save in an existing Excel file (why? Aren't you worried about overwriting data, or are you trying to add a new WorkSheet, or append to the end of an existing WorkSheet?) and making a Chart.  I've not tried charts, so don't have advice right now.
    Judging by your error message, it is the Chart feature that is giving you trouble.  Can you see how your code runs if you eliminate the Chart functions?  [You can do that by putting a "Diagram Disable" Structure around the Chart code, clicking on the top of the structure and wiring the wires through in the Enable case].
    Give that a try and let us know what happens.

  • Can I call a built in LabVIEW function remotely?

    I would like to call a bunch of LabVIEW's built in GPIB functions on a
    remote computer to talk to a device attached to that computer. I was
    able to do this using VI server and by wrapping the GPIB function in a
    custom vi (this vi was just GPIB Write with controls and indicators)
    Is there a way to avoid making a "wrapper" VI for built in functions
    such as GPIB Write? i.e Open a VI reference to built-in LabVIEW
    functions remotely using VI server?
    Thanks,
    Brian
    Sent via Deja.com http://www.deja.com/
    Before you buy.

    That is one of the built-in functions and not a stand-alone VI and the best way to call it is to create a VI with it on the block diagram.

  • LabVIEW function to detect 32 Bit (X86 Program Files) vs 64 Bit (Program Files) System?

    I am looking for a LabVIEW function that detects whether the system is a 32 bit or 64 bit system.  The reason for this is that I need to change our file paths to draw from either the X86 Program Files folder or the Program Files folder, I'd rather do this programatically so as not having to do it manually each time.
    Thanks.
    Solved!
    Go to Solution.

    Use "Application Directory" for relative paths from your EXE in "Program Files".
    Otherwise, use "Get System Directory.vi" and select "Application Files" as option.
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

Maybe you are looking for