Jump to content

Mellroth

Members
  • Posts

    602
  • Joined

  • Last visited

  • Days Won

    16

Posts posted by Mellroth

  1. Move Register Events outside the loop - it should only be done once.

     

    I'd just be guessing to explain why this works, but perhaps the re-registration will not contain a previously generated Event (in the case of no Delay).

     

    I would say it is because this is not re-registering at all, but creates a new registration at every iteration (because register refnum is not wired into the registration node). This code is leaking references at each iteration of the upper loop (check Desktop Execution Trace Toolkit)

     

    Just follow the suggestion from Greg and move the registration out of the loop and you should be fine.

     

    /J

  2. I'd like to be able to build packed libraries with a flat structure regardless of the actual file structure, i.e. no history of folders in the paths.

    A safe way to do it seems to be

    1. create a Source distribution that adds prefix to files

    2. use an auto-populating folder to suck all the source distro files into the project

    3. build the packed library from the library in the source distro.

     

    Since this works I really don't see any point why the "Preserve hierarchy" option is always enabled and dimmed in the packed library build specification.

    I have even tried editing the .lvproj xml-file to disable the "Preserve hierarchy" option, and it sure works.

     

    Have anyone else tried this?

    Why is the Preserve Hierarchy option dimmed in the first place?

     

    From my point the packed libraries should never include the file structure, instead I'd like them to reflect the virtual hierarchy of my public files in the lvlib that is the source of the packed library, or am I missing something that makes the paths essential? 

     

    /J

  3. You would lose the linkage to the typedef. Also I'm not sure how LabVIEW would handle changing the control from a typedef to a control, it may very well mutate your constant values just as modifying the typedef would.

     

    Of course case structures completely throw a wrench in the plans I've mentioned above. Fun fun fun.

    I thought that MikeL wanted to remove the connection to the typedef while preserving the constant values.

    It is all about having fun ;-)

  4. What I've done in the past is open the typedef, right click on the icon to do a "find all instances", then document each constant's value with a comment (or really any means, comments are nice because you can do a #enum or something similar). Do what you need to to, then go back and double check your constants. Yes, it sucks, but I still don't trust LabVIEW as far as enums go.

    Isn't it enough to open the typedef, and turn it into a ordinary control, apply changes, and then remove the typedef from the library?

     

    /J

  5. I also had a similar issue where a simple VI using Variant attribute lookup took a long time to execute if the owning library/class was opened.

    The time difference was never measured, but running through ~1000 elements was noticeable slower.

     

    I tracked this down to be an issue with re-entrancy, once I made the VIs reentrant the execution speed was the same regardless of where it was started.

     

    /Jonas

  6. If I do it the other way round and rename the file within the LabVIEW project and commit the changes, then Mercurial things I've jsut removed the old file and added the new and the history is lost.

    Can anyone help with this please?

     

    If you rename in LabVIEW, I believe you can "Detect" renames in the Mercurial commit dialog.

    It is still a bit of manual work, but I think the history is preserved.

     

    /J

  7. I'd prefer to make this more portable and more easily maintainable in this shared satting under VCS, ideally just popping up a panel that offers controllers to connect to so the operator just clicks on a system to connect to. Desired features would be:

    1. Dynamically identifies connected cRIO controllers

    2. Offers choice of controller to connect with

    3. Remembers last choice with ini file and automatically connects if there is only 1 possible target

     

    You can use the RT Target information to get a list of all connected RT systems, and from this list filter the system to connect to , e.g. by name, type etc.

    post-5958-0-99770500-1379573582.png

     

    As long as both cRIOs use the same name, no dialog should be necessary, regardless of network environment.

     

    /J

  8. Hey Guys,

    hope you have some input for me.

     

    I have a compactDAQ and I want to dynamically check the modules which are injected?

    ...

     

    Personally I would use the DAQmx API.

    In the DAQmx/Advanced/System palette you find the System property node, that will give you information about the currently used devices, as well as all configured tasks and global channels.

     

    To get more info for a specific device you use the Device property node in the same palette.

     

    Note that with CompactDAQ the Device property node returns references to both the chassis as well as individual modules.

     

    post-5958-0-84573000-1379526938.png

     

    /J

  9. Here's where i found my issue... it is "cmd /c" NOT "cmd c" ! so i used "cmd /c c:temp.tsv" and voila it opens with the default program for .tsv (which is obscure enough that i can make Excel a default on all of the computers in the building) for some reason cmd /c excel.exe does not work to open excel. i found this odd as excel.exe entered directly in the command line will open excel regardless of which version you have installed, but i believe i can live with this. 

     

    Instead of using the command line, you can use the "Open URL in Default Browser" VI in LabVIEW.

    You'll find this in the "Dialog and User interface"->"Help" palette (or in Quick drop).

     

    This VI is polymorphic, and accepts a path or string as input. When given a path it opens the path using the default program for that file type. 

    It even works with path to folders, allowing you to open a specific folder from your application.

     

    /J

  10. Hi Darin,

     

    Can you please post an example of using the VI Activation event? I can't seem to find it. Is it one of those hidden features that one may be just lucky enough to stumble upon?

     

    Enable VI scripting features, and then look in the Application features of the"Edit Events" dialog.

    The event will be fired whenever a new BD or FP is activated.

     

    /J

  11. I agree that this can be a place where the Flush can be used, but my work around was when the slider had a value change all it did was set a boolean true in a shift register.  This boolean would set the event structure timeout to 0ms.  Then in the timeout case I would perform the analog output, then set the boolean in the shift register back to false.  The timeout case only gets executed when there are no other events in the event queue.  So I would only set the analog out after the 100s of value changes had stopped for 0ms.  This would reduce the number of analog output commands from 100s to on the order of 10 or so and it would always set the last value.

     

    I don't think flushing events would solve this, e.g. how can you be sure that the last element isn't already in the event queue, meaning that flushing will remove the most important element you actually want to handle.

     

    Letting the timeout case handle the last event can be very neat, and I use this very often in small UIs. Another option is to use a size limited queue used with the lossy enqueue primitive. This can be handled in the timeout case, or in a separate consumer loop depending on the requirements.

     

    /J

  12. WireFlow releases the first Security suite software that is natively supported on any LabVIEW platform with an available USB port, including VxWorks and Pharlap based Real-Time targets.

     

    The security suite addresses IP protection issues for the LabVIEW platforms; not only does it add copy protection, but also enables user identification and feature control.

     

    SecSuite_1.jpg?height=119&width=320

     

    To learn more, please visit http://www.wireflow.se/news/SecuritySuite_news

     

    /The WireFlow Team

  13. ...I was poking through some old code on Friday that had a case structure of 100+ cases and it became really annoying to be working in a case, flip to another one to check what it was doing, then going back to the original case.  I would love to have a return to previous case function (How about ctrl+shift mousewheel to flip between the two most recent cases?)...

     

    Not a solution to flip back and forth, but to compare two cases you can open the same VI in two different projects, and get a side-by-side view of the differences.

     

    /J

  14. ...Using the Title and Description feels like a solution that is right, well, and good. If you know of any reasons to declare it wrong, bad, or evil, please share.

     

    The only reason I can think of is that if you have a plug-in that can be used multiple times in your application, the Title and Description would be shared between menu entries. With a text based plugin, menu items with different names can use the same plug-in code.

     

    /J

  15. I am having some problems with a LabVIEW application of mine. It is set to auto-run on startup, and the OS is Windows XP Embedded. I am trying to add a NIC to the system to allow for Ethernet communication. That makes two network interfaces, since there is one built-in network interface that is being used for control of some internal RF ComBlocks.

    The problem I am seeing is when I attempt to open the connection to the ComBlocks I get an error because the correct connection is not made. Disabling the second NIC solves the problem, but even trying to hard-route a connection using ROUTE ADD doesn't. The only thing that has worked has been to have a launcher executable run at startup instead, and then after some delay launch the real program. However, if I put the same delay within and at the beginning of the 'real program', it fails.

    This all seems to indicate that the OS has not properly initialized the Ethernet connections at the time my application runs. I am almost resigned to just having a launcher executable, but I wanted to check and see if there was some way of querying the active interfaces available. Or if there was some way to force TCP Open to choose the correct interface that would be nice too.

    Ideas?

    A few ideas;

    1. Use StringToIP configured to output multiple IPs (right click and select Multiple Output) to see if your application sees your NICs

    2. Make sure the NICs are on different subnets, If not, I believe Windows will select the first NIC matching your requested IP address.

     

    /J

  16. Most likely it is because the Kinect DLL is built in .Net 4.0 and you have to manually enable CLR 4.0 support in LabVIEW for it to work.  There should be instructions in the user manual that ships with the toolkit that describe how to do it, or you can also check out the LabVIEW help.

     

    Just be aware that this setting can cause builds to fail with very strange errors, e.g. on my system I could not build applications that linked to the LabVIEW error database. At first I removed the "Copy error code files" option to be able to build my application, but in the end I realized that the .NET 4.0 was the actual cause.

     

    /J

  17. Then I just have to squint a lot at my laptop screen when I'm scrunched up in a dark corner on some submarine trying to do code changes.

    I know it's off-topic, but that sounds so cool!

    Off Topic again; the reason for sub-routines got a much better explanation now.... :rolleyes:

    Merry Christmas everyone

    /J

×
×
  • Create New...

Important Information

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