Event structure doesn't handle all events from external DLL source

Hi!
I use a DLL, wich handles an USB CAN transceiver device, and generates LabVIEW user events with extcode.h and PostLVUserEvent() function.
In my vi I use an event case structure to handle theese external events. The problem is, that if the events come too frequently, then it cannot handle all events.
The vi contains a couple of parallel while loops which process the incoming data from the external event.
In another application I use the same architecture, and that works fine. This one is more complex.
Do you think I have reached the limits of the program? Or what else can be the problem?
I have tried to use a queue in the  event structure, it helped a little, but yet, not all the events are handled. My external DLL sends all event, so the problem is not there.
Thanks in advance!

Hi Wasz,
Thanks for the post and I hope your well.
It is not possible for the event structure to miss events - it simply queues them up. To keep the event structure 'in time' with the code you must ensure the code to execute in each event is minimal to allow the event structure to handle the next event. 
Please see this two links:
event structure buffering: leading to,
How to avoid built-up for "cursor move" events? : where somone is trying to avoid handling all events.
What sort of events are not being handled? Could it be an issue your events are not configured correctly? Maybe if you could produce a small example in LabVIEW code, so we can just test the event structure configuration... someone working around the external dll call - which you seem sure is working correctly.  
In terms of queuing to process the events in other loops is certainly an option to speed up the event structure. To do this, use a produce/consumer design pattern.
hope this helps,
Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help!

Similar Messages

  • LabView user-event from external dll source

    Hi!
    I'm dealing with the following issue:
    I use a CAN sniffer device, wich sends data over USB to a PC. The main goal is to create a vi that can process the incoming data. I already have a vi wich works with polling mechanism. It calls external DLL functions with the "Call library function node". The main problem is the polling mechanism.
    I would like to recreate this vi so that it would work event-driven. I have an other application, written in C++, that does the same thing, and it gets interrupts from a DLL, when a new data is available in the input buffer.
    The callback mechanism is implemented in the DLL.
    In LabView I would like to do tha same thing. There is the "event case structure", but there is no option for defining such user-events, that i would prefer.
    I have found a similar topic, there the solution is "occurrences". The occurrence is called from a DLL, too. But this solution uses the "waiting for occurrence to set", that is an endless-loop-like thing.
    The other thing I've found is the ActiveX and .NET events. I don't know, probably that is the solution.
    Anyway: is there a possibility to create such events, that can be generated from a simple external DLL and can be handled by "event case structure"? How should I do this?
    Or how NI does this? I mean that NIs DAQ cards must use some similar methods for data processing. Is there some tutorial or support about it?
    Thank you for your answer!

    2716jag wrote:
    Hi Wiebe,         From your answer i have a doubt that What it exactly means "If the dll is used from within LabVIEW". Also i want to know Is there any way to access the functuions defined in the .SYS file in Labview Environment. Regards,Jagan Can you be a litte more specific with your first sentence. I have no good idea what you mean. A .sys driver is usually a kernel device driver. This driver has to be started and run in the kernel subsystem which LabVIEW can not access directly. Such a driver is initialized using the CreateFile() Windows API. The returned handle is then used with other API functions such as ReadFile(), WriteWile(), DeviceIoControl(), and finally CloseHandle().Theoretically you could call all this APIs directly from within LabVIEW using the Call Library Node. In practice you do not want to do this even for fairly simple kernel drivers since the parameters for those APIs do get fairly complex in most cases, and you usually do also want to have some sort of asynchronous operation using events or such to make the driver access user friendly. All these things are most easily handled in a user space DLL written in C that exports a more LabVIEW friendly API that you can then import into LabVIEW using the Call Library Node. Usually most kernel device drivers do come with a accompagning user space DLL already, as this is the only sensible way of accessing such a driver. So you can usually look for the documentation of that user space DLL API and go from there trying to import that into LabVIEW using the Call Library Node. Even then it may not be easy at all if that API uses complicated function parameters and even completely impossible if it uses callbacks or such, requiring you to write a so called wrapper DLL that translates between the native API and a more LabVIEW friendly API.  You don't have to believe me but I can guarantee you that if writing such a user space DLL or wrapper DLL is beyond your capabilities, trying to go directly about accessing the Windows APIs in LabVIEW to access a kernel device driver is going to make you squirm in real pain. And those knowing how to write such a DLL would never even consider spending the time to try to access a kernel device driver directly from LabVIEW. Rolf Kalbermatter

  • Find Control in Event Structure doesn't show the object when it is not in the frontmost Tab page [Bug Report, LabVIEW 2012]

    When you are looking for the control/indicator handled by a case in the Event structure, you can use the contextual menu item "Find Control" (doesn't distinguish between control and indicator, BTW).
    The result is that the control/indicator is highlighted on the FP. The problem is, if that control is in a Tab and specifically in a page of that Tab that happens to not be the frontmost, the only thing you'll see is marching ants, but no control:
    <=========== the wrong TAB page was shown. LV did not bother to switch to the relevant one....
    In other words, "Find Control" in the Event Structure doesn't switch the tab to the owning page. This is contrary to what happens if you right-click, say, the terminal of this control: the FP will switch to the owning Tab page.
    I'd call this a bug and this is definitely an annoyance (which most likely has been around since the creation of the Event Structure).

    I did not. Is there any better chance for it to be caught there by a NI eye than it is in the LV forum? I though these threads were deemed to gather bugs/features that had been already acknowledged by NI with a CAR number.
    I (and others!) wished there was something like this: http://bugs.sun.com/ or http://bugs.python.org/ for LabVIEW...
    I am just coming back from a short conference of scientists who quite uninamously ended up with the conclusion that LabVIEW was to be disregarded as a lab development environment because of maintenance problems (which could have been argued for any language in my opinion, although I think they meant spaghetti diagrams are the natural tendency of students who could not care less as they are not going graduate because of their LV skills or lack thereof), but I guess I could have added my grain of salt and added the complete opacity on bug and feature handling by NI.

  • Capacity of the computer to handle all programmes from Adobe - and at least: photoshop, illustrator and Indesign and a website.

    Can you tell me what kind of capacity the computer needs in order to handle all programmes from Adobe - and at least: Photoshop, Illustrator and Indesign and a Website (Adobe or Wordpress)?
    My computer an Acer from 2005 with a 32 bit Ram and Window Vista - could not even download Photoshop - and I need to buy a new one - as I have to build my own Website - a newssite.
    What technical data should I look after in a new computer to fulfill my needs?
    Is Windows 7 the best to use for handling Adobe?
    Greetings Yuola

    The important things are DISKS  2x 1To ,32 RAM okay ,very important the choice of processor and video cart  that up to people who know your needs on your PC, harlan heuker

  • Old laptop died, got latest itunes on new laptop and recovered all music from external hard drive but ipad not recognised as device when plugged in? Do i reset my ipad2!!!

    Old laptop died, got latest itunes on new laptop and recovered all music from external hard drive but ipad2 not being recognised as a device when plugged in so can't sync? Do i reset my ipad2?!!!! Its only taken 7 months to get to this point.
    My ipad is set to sync via wifi but it is still trying to look for my old laptop which has been trashed..but i have deauthorised it and removed it from my account and still not recognised.
    Please help (an extreme novice to Apple products)

    Sync Your iOS Device with a New Computer Without Losing Data
    http://www.howtogeek.com/104298/sync-your-ios-device-with-a-new-computer-without -losing-data/
    iPad not appearing in iTunes
    http://www.apple.com/support/ipad/assistant/itunes/
    iOS: Device not recognized in iTunes for Mac OS X
    http://support.apple.com/kb/TS1591
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    IOS: Syncing with iTunes
    http://support.apple.com/kb/HT1386
    Apple - Support - iPad - Syncing
    http://www.apple.com/support/ipad/syncing/
     Cheers, Tom

  • Event structure doesn't register local vars

    I have a gif of a basic FPGA topology that I want to show some loopbacks in.  As the user clicks on the booleans, vertical lines should appear, then disappear as they click them again, showing the current loopback topology.
    To conserve resources, I opted to use an event structure.  So far I have set it up for the RX_FAC and RX_TERMXCO4AU loopbacks that you see in the upper left of the picture.
    Only one RX loopback and one TX loopback can be on at a time, so one of the first things that happens when the user clicks the boolean is that it sets the values of all the other booleans in that row to false, via the use of local variables.
    The problem is - the event structure only executes when the user actually clicks the boolean true or false, but not if the boolean is set false via the use of a local var.  In other words, let's say I have RX_TERMXCO4AU true, and RX_FAC false.  If I click RX_FAC to set it true, then you'll notice RX_TERMXCO4AU goes dark/false, and RX_FAC lights up.  So the value of RX_TERMXCO4AU changed, but the event structure associated with RX_TERMXCO4AU did not execute (which is why the vertical line between RX_TERMXCO4AU and TX_FACXCO4AU stays there).
    This will make a lot more sense if you run the attached simple VI.  Right now, events only exist for RX_FAC and RX_TERMXCO4AU, but it's sufficient to explain the problem I think.
    Any help is appreciated.
    Solved!
    Go to Solution.
    Attachments:
    loopbacks.vi ‏55 KB

    bmishoe wrote:
    I learned something new today...
    One more thing you can learn, When you are passing an array input to a For loop with 'Auto indexing' enabled, you need not wire anything to For loop's 'N' terminal.
    In other words:
    If you enable auto-indexing on an array wired to a For Loop, LabVIEW sets the count terminal so you do not need to wire the count terminal. 
    In your code, you can remove the 'Array Size' nodes.
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • Can JFC handle all event of html element

    I was just going through with JSF spec.
    I have some doubts .
    Can JSF hanlde all the events related to html element like key down , onclick etc, on form load.
    Instead of writing heavy javascripts for this on client , can i handle all this on server side with JSF.
    In my application , for each html field, we make server trip. To handle these html events , we are dependent on javascript. we don't use any fancy Elememnt.
    My concern is this ,
    by using JSF can i avoid this javascript coding on html event. and use JSF element with server side event handling .
    thanks

    If I understand your question, you're asking whether JSF component event handling can be done on the server side, rather than through the use of client side javascript.
    The answer, I suppose is yes; you'd write server side code that is run during an appropriate phase in the life-cycle after data is submitted to the server.
    However, I don't see much point in doing this. You're bound to create less scalable applications. If you're disgruntled about javascript, consider designing a set of JSF components based on XForms (provided you have an appropriate browser plug-in).
    Rob

  • My Library Doesn´t Show All Events

    Hi!
    After a data crash my library shows only half of existing events. The "missing" pictures / events seam to be okay - I can open them in Finder.
    How can I rebuild my library without importing the pictures again?
    TIA HJ

    Try these in order - from best option on down...
    1. Do you have an up-to-date back up? If so, try copy the library6.iphoto file from the back up to the iPhoto Library (Right Click -> Show Package Contents) allowing it to overwrite the damaged file.
    2. Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.
    3. If neither of these work then you'll need to create and populate a new library.
    To create and populate a new library:
    Note this will give you a working library with the same Events and pictures as before, however, you will lose your albums, keywords, modified versions, books, calendars etc.
    In the iPhoto Preferences -> Events Uncheck the box at 'Imported Items from the Finder'
    Move the iPhoto Library to the desktop
    Launch iPhoto. It will ask if you wish to create a new Library. Say Yes.
    Go into the iPhoto Library (Right Click -> Show Package Contents) on your desktop and find the Originals folder. From the Originals folder drag the individual Event Folders to the iPhoto Window and it will recreate them in the new library.
    When you're sure all is well you can delete the iPhoto Library on your desktop.
    In the future, in addition to your usual back up routine, you might like to make a copy of the library6.iPhoto file whenever you have made changes to the library as protection against database corruption.
    Regards
    TD

  • Event structure and automatic queueing of events.

    I have found out the long way that the event structure queues all the events taken place while it has been executing yur most current event.
    In other words... I understand why the locking of the front panel is an automatic option that is selected. As it will prevent you from queueing more events,  and causing yur program to execute endless event structure runs, when you wanted it to stop 15 button presses ago.
    case in point.... is in this simple VI i attached.
    My question is ... is there a way to turn off this automatic queueing of events??
    Attachments:
    EventStructureHUH.vi ‏53 KB

    Well ... the problem for me... was, for example, in the VI I posted....
    The OK button in the VI I posted, has an event triggered to it in the event structure.... So when I enter that loop after hitting the enter loop button... it registers those OK clicks...
    Say the OK button and NOT the continue button takes me out of the little loop and back into the big loop. Now, after leaving the little loop and entering into the big loop, I will immediatly enter back into the event structure to handle the OK button click.
    Basically I wanted one button to control the termination condition of the little loop, but also have an event in the event structure associated with it, so basically one button to exit the little loop AND the big loop.
    I hope Im making sense. I found a solution, by just making two buttons, when entering into the little loop, the one button dissapears... and vice versa when entering into the big loop. So to the USER it appears like ONE button... but in the code its actually two.
    I just wasnt sure if there was another way around it... it was tough to figure out what was really happenening in my code... took my about an hour or two to track down.
    EDIT: Yea.. thanks for the reply....  as for the comments in my code... yea, I get a little crazy towards the end of the day... after 6-8 hours of straight labview programming. 
    Message Edited by MJBrehm on 06-30-2006 02:21 PM

  • Simple example - Break FOR loop inside an event structure based on Front panel event change.

    I am running a for loop inside a state machine architecture that contains a FOR loop. How can I break this For loop based on Event change in front panel ??
    Abhilash S Nair
    Research Assistant @ Photonic Devices and Systems lab
    [ LabView professional Development System - Version 11.0 - 32-bit ]
    LabView Gear:
    1. NI PXI-7951R & NI 5761
    2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021
    OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
    CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
    MEMORY - [ 16.0 GB RAM ]
    GPU - [ NVIDIA GeForce GT 530 ]
    Attachments:
    Case inside Event 3.vi ‏19 KB
    Case inside Event.ctl ‏6 KB
    Case inside Event 2.ctl ‏6 KB

    Okay. Accpeting that the design is not favorable and not advantageous when my program expands. I have begin to follow producer/consumer programming architecture.
    Please find the attached program which is a simple producer consumer with event structure. I wonder how could I stop looping around the producer and consumer loops over and over again. I am pretty sure that this ENQUEUE ELEMENT loops back to the consumer loop and starts from begining.
    I hope my first program in PC architecture with State machine and Event structure is correct. 
    Abhilash S Nair
    Research Assistant @ Photonic Devices and Systems lab
    [ LabView professional Development System - Version 11.0 - 32-bit ]
    LabView Gear:
    1. NI PXI-7951R & NI 5761
    2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021
    OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
    CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
    MEMORY - [ 16.0 GB RAM ]
    GPU - [ NVIDIA GeForce GT 530 ]
    Attachments:
    Case inside Event 3.3-ProducerConsumer Event.vi ‏25 KB
    Case inside Event.ctl ‏6 KB

  • Can I use Ctlref in a event structure with a mouse up event?

    I have a large number of controls on a front pannel. I'm using a event structure that triggers the motion of a given motor when the corresponding control is pressed. However, I would like to avoid creating N mostly identical events, so I was planning on using a mouse down event on the front pannel, then retrieve the control reference using the Ctlref node (with gives "Reference to the control on which the event occurred" according to labview manual) and scan a array of references to find out which motor is supposed to move. However, it seems that this node does not appear (contrary to what the manual says).
    I have found other ways to do what I need (I was thinking of using an array containing the coordinates of my controls and the coords node of the event structure), but I wanted to know why I can not find that node (which appears for "value change" event for instance). I'm using Labview 2013.
    Solved!
    Go to Solution.

    Bad luck for you. Mouse down on panel does not have the control refnum as it is not operating on a control. Mouse down on a control does have it and since you can configure mouse down events on several controls in the same event case, it provides also a control refnum so that you can still operate on the control in question.
    This is probably also the issue Jeff might have seen. When configuring multiple events for the same frame LabVIEW will only show the event terminal that are present in all of those events. Terminals that don't exist in at least one specific event of the multiple events for that frame are not selectable anymore.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Calendar said if I wanted to save entries for more than a month to click 'all events' in settings.   Now all events except birthdays have disappeared!  Have tried to reverse request with no luck.  HELP!

    Calendar message said if I wanted to save entries for more than a month I should go to settings and change to sync for 'all events'.  I did this and all but repeating birthday entries disappeared.   I have tried to reverse but nothing has reappeared.  HELP!

    Welcome to the discussions,
    WHY does it claim to be 8G but my capacity now says its just 6.83
    The size of you HD is calculated binary when it comes to use it, instead of decimal when companies want to advertise there products. 1 KB=1024Byte instead of 1000KB as advertised by the manufacturer. In your case this reduces the actual available space by the factor of 0.93 or approx. 7,4GB.
    If you have an "other" section in your color bar showing the different types of data on your ipod, which is bigger than 500MB, this could be a sign of corrupt data caused by a sync that did not complete or copied damaged data. A restore will reduce the size to normal again.
    Restoring: http://support.apple.com/kb/HT1414
    If you restore your ipod, iTunes will install the newest firmware first and then add back your data and settings from your last backup if you choose to "restore from backup". Every backup is replaced by the following one, so make sure to include this folder in your backup routine in case you'll have to go back.
    You can check the location and size of the backup folder for your ipod here:
    Windows Vista and Windows 7: \Users\(username)\AppData\Roaming\Apple Computer\MobileSync\Backup\
    copied from: About backups http://support.apple.com/kb/HT1766
    Sorry, I can't answer your payment question, I have never used your kind of setup, maybe you can find something useful here: http://www.apple.com/support/itunes/

  • Safari doesn't "Reopen All Windows From Last Session" and links from Mail

    After a crash I found myself trying to "Reopen All Windows From Last Session", then I found that if I click a link from Mail it does not open it ... as well from any other application. It's like only workin' within itself and can't interact with any other application. Plus I used a lot "Reopen All Windows From Last Session" and now it doesn't work

    Same thing just happened to me. Reinstalling Saferi did not help.

  • Not able to crawl all items from External content type

    Hello All,
    "All the records in my external content source are not getting crawled, only 1/3 rd of the data are getting crawled."
    Steps:
    I created "External content type" using sharepoint designer which connects to a SQL Server database.
    Have written a SQL View joining 2 tables, which return 9,00,000 rows when executed using the SQL Server management studio.
    I used the default "Business Data Connectivity Service" and "Search Service Application" and made sure the necessary permissions are set.
    Created a External Content source for the search service application and selected the "Business Data Connectivity Service" -> "Crawl selected External datasource" -> <my external datasource i created in sharepoint designer>
    Issue
    When i ran the full crawl for the first time it crawled "3,49,923" records in 01 hour and 07 seconds. And returned 1 error "Error crawling LOB Contents.(Error caused by exception: System.InvalidOperationException. There is an error in XML
    document...)
    Later i removed the below item from the index and started a full recrawl, this time it crawled "3,49,924" records 1 record extra from my previous crawl
    and no errors were returned.
    Please let me know what could be the issue. It doesn't look like the permission related issues as i am able to crawl the 1/3rd of my total data. Also i am able to search the crawled data. I also set the throtteling limit for the "Business data catalog"
    to -maximum 10000000 -default 1000000 which is less than the data it has to crawl.
    SRIRAM

    Hi ,
    I started the change suggested in the link shared by you, but got stuck at a point,
    The field which i set as identifier in BCS earlier is not having unique values. Total rows returned by the sql view is 899000, but the unique values present in the column that is set as identifier is
    3,49,923, which is equal to the number of rows crawled. - Is this the reason why it didnt crawl all records?
    The table that is used in the sql view has composite key, - Is it possible to have multiple identifier in BCS as well?
    Is it possible to make BCS to ignore the identifier? i mean creating BCS without an identifier column?
    Please let me know your suggestions on this.
    Thanks,
    SRIRAM
    Yes, BCS needs a UID. This is so it can figure out changes over time to a single record. Otherwise all changes to a row could be a potential new row without BCS knowing any better.
    Yes, or just have it run off the composite key instead of the field you're using now.
    Nope, BCS needs a UID field like in answer 1 :)
    Good luck!
    My CodePlex -
    My Blog - My Twitter
    Join me at the San Francisco SharePoint User Group!
    If this post helped you or answered your question please remember to mark it! :)

  • Listener doesn't pick up messages from a particular source.

    I have a queue populated from two different sources. My listener configured on that queue receives messages send from one source and not the other.
    I can see the messages from both sources in the queue when I check through the server administration page.
    To make things interesting, messages from both the source looks identical (in terms of all the properties except id and timestamp).
    Any clues anyone?
    Thanks

    Are the two queues are having two different names.
    which server are you using
    Can you tell me how to see the messages from in queue from administration console

Maybe you are looking for

  • Site search will not work in Firefox but works with Chrome

    I run three websites. One is personal (www.rossolson.org) and two are for non-profit organizations (www.outpostministries.org and www.tccsa.tc). All have site search through Google, my own site is paid to be ad-free, the non profits are free and with

  • Enhanced CDs not showing up in Finder

    I've come across situations where I'll insert an Enhanced CD to import tracks into iTunes, but the music files don't show up in Finder. The 'enhanced' content does, but not the music files. Does anyone know how to work around the enhanced content to

  • Oracle Form as redirect to Oracle Reports

    Okay, I can't figure out how to hide the parameters in a URL from a non-Oracle Form to an Oracle Report. I found a work around on how to call an Oracle Report with a built in parameter form from an Oracle Form, but I have never used forms. Could anyo

  • Serial-to-serial cable. Does it exist?

    I would like t interconnect two cisco routers for testing purposes, using their serial ports, but still can not find serial-to-serial cable (60-pins each side). Should i make such cable by myself? And where can i get pinout for the cable like this? T

  • Using Internet explorer .Have new computer with windows 8.  Has older version but newer fails why?

    Why am I unable to install newer version of flash player on Windows 8?  Older version will not work with games on Pogo game site.  Anyone know what I should try?  I have followed all Adobe instructions for correcting with no success.