Jump to content
Sign in to follow this  

Array Events - Bug or Expected Behavior?

Recommended Posts

(If this is not the right forum, please move as appropriate)


Yesterday, I was trying to capture the "key down?" event on a string array control. I noticed that the event would never get fired while typing into one of the strings in the array. The event does fire if you type in the index control of the array. My question: Is this expected behavior or a bug? After trying a few things, I can get the behavior I want by getting a reference to the "ArrElem" and registering it for the "key down?" event and passing the into the dynamic event terminal. This is fine for my purposes and will implement my code in this fashion. However, I certainly was not expecting this event to behave in this way. I guess I could see why this may be the case (you are typing into a string control, not an array) but curious what other people think...


This was all done in LV2013.



Share this post

Link to post
Share on other sites

I can understand why you would think that way, and users would probably generally want the function to work that way.  But by the rules of LabVIEW, when you register for an event on the array, you are registering on the array control, not on the control within the array control, that is a different reference and it seems you've found how to get at that reference.

Share this post

Link to post
Share on other sites

Yes, I did find that reference. I could make an argument either way. It was just different than what I expected and was curious what others thought.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Similar Content

    • By Andersen Chen
      hello everybody,
      i want to index column 0~39,how to achieve and simplify
      thank you for help
    • By _Mike_
      Hello all!
      I have a problem with registering to GigEVision events with LabVIEW & NI-IMAQdx
      I work with Teledyne Dalsa Genie Nano G3-GC10-C1280IF camera with GigEVision interface.
      It's documentation describes several events I can enable at the camera that will be "... sent on control channel when ..." particular situation occurs at the camera - e.g. @exposure end.
      However, when I wire session wire to Register Events node, I still have options only for "Attribute Updated", "Frame done" and "Plug and Play". 
      I would like to ask you for help in finding how does GigEVision events can be read/discovered/registered to through NI-IMAQdx.

    • By bingbot
      1: How to get last index, not last element, but last index number of an 2d array?
      2: say 2d array has contents
      elephant  crow    dog      goat
      giraffe      eagle   cat       fly
      ant          pig        horse   bee
      How to get that the bee is the 12th or 11th index in the array? (11 if you count elephant as zero index, 12 if you count elephant as first index), meaning I want the index number 11 or 12, not "bee"
    • By pkeny
      I am having trouble on learning what to do after you input a file into labVIEW. I cannot seem to find help on this topics. I have seen many videos and tutorials on how to read and write excel/text (.csv) files. But, I am not able to do anything after importing an text/excel file into labVIEW.
      So, I was wondering if someone had a simple VI that they could share. In the end, I want to do some automation so it will read a number and a status from excel. And then that number and status will either turn on or off a switch which controls something else. 
      Anyways, I would greatly appreciate if someone could share a VI as an example of how to manipulate the data to control something after you import a text/excel file into labVIEW.
    • By Sean Donner
      We have a 3rd party application that can talk to an arbitrary LabVIEW VI (or exe) via ActiveX and can both change and read the controls on the VI (or exe).  The problem we are facing is that the ActiveX interface does not support events.  This means that if a control registered for a value-change event has its value changed over ActiveX the VI does *not* fire off the value-change event; although the control's value will indeed change.
      Currently, our developers are working around this issue by forgoing the event structure altogher and using a polling loop instead.  My goal is to see if I can abstract away the polling loop so the developers can use the event structure and I'm *almost* there but I've hit a problem.  I've abstracted the polling loop into a "brat" VI that gets a ref to the parent and uses VI server to do the polling and if a value is found to be changed it issues a value-signaling event via the control's property node.  
      This solution works exactly how I want it to as long as the *only* thing doing the value changing is the 3rd party application.  The problem lies in the fact that the VI's front panel is still required to be visible and operational such that a user can change the control via the front panel as you normally do.  If a user changes a control via the front panel, not only does my "brat" code detect this change and fire off a value signaling event but because it's done through the front panel the event structure fires off as well and now I get two events firing when I only want one. 
      I don't expect there to be an elegant way to solve this, but what would be the least ugly way to do it?  Is there anyway for my "brat" code to programatically detect the last time a control ref had an event fired, *and how* (front panel vs value signaling)?
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.