Jump to content

hooovahh

Moderators
  • Posts

    3,363
  • Joined

  • Last visited

  • Days Won

    268

Posts posted by hooovahh

  1. If I had to guess I would say this is a behavior of the operating system. I say that because I cannot seem to find a instance, where a single application, that has more than one window, will behave differently than the one we experience with LabVIEW where all other windows are brought up. (I did a quick test with Microsoft Word and IE)

    Well there are windows DLL calls that allow you to manipulate window Z-order. So one could certainly modify the order of all your applications' windows manually. I don't think I've ever had a case, where my application would have multiple windows, in the same application instance, and want to the operator to see one, without bringing the others in front of all other applications. I guess I just don't know your use situation well enough.

  2. The benefit of placing it here is that when the normal operator run it and it prompts for a Automatic Software update, the Update Software have permission to overwrite contents in this folder.

    The ini files and other local config files, we store in a different folder that we call:

    C:\<MyCompany>\<MyAwesomeApplication>_Data

    So that means that an operator can simply navigate to the built application and delete the EXE. Now I realize if an operator does this that it would probably be considered malicious behavior. In my opinion giving a user, who likely doesn't fully understand the system, the ability to break a test system so easily is a very big deal. But then again I don't know the type of environment that the system is in, and this may be a fine setup.

  3. Your solution has one possible drawback. Only changing the rights of the config file alone is likely not enough as the directory needs to have its rights also changed.

    This is not the case at all. I can't seem to find the stupid batch file I created, but it would run an installer (with some silent switches) then run the command line program Icacls (built into Windows 7) to allow the INI file that got installed to be written by anyone in the Users local group. This batch file of course would need to be ran by someone with elevated privileges the first time. But then again only someone with those privileges should be installing updates anyway.

    Then the application (stored in the Program Files) could modify the INI file that was in the same folder as the EXE, even when the logged in user only had limited rights. This also only modifies the security of the INI file, the directory it self still cannot be modified by someone in the Users group.

  4. Just a thought (and probably not a good one) but what if you install to program files like always, and have the ini file in program files along side the EXE, but then during the install run function that will set the privileges of the INI to be written by any level user?

    The EXE doesn't need to have elevated privlages, the file can just have lower ones. I know there is a Windows command line function to set file permissions but I can't seem to find it at the moment. One downside is the file isn't as hidden as other places, but it also feels like a patch when it sounds like the proper way would be to store the data in ProgramData.

  5. You can get VIs to run in well under a millisecond. You probably won't get down to a microsecond though, there is some amount of overhead involved in a VI call (as is the case with function calls in any language). That doesn't mean you can't execute a chunk of code more often than a microsecond, careful placement of loops, use of inline VIs, and subroutines can make for some pretty impressive speeds.

    I was curious so I wrote a quick VI to see how fast I could get a loop to run that performs some calculation. Now this is a very simple VI that doesn't call a subVI (so no overhead there). But I wanted to see how fast I could get a loop to run.

    post-6627-0-56740800-1334672189_thumb.pn

    Please pardon my crude code, but on my machine running 100,000,000 loops, each loop takes about 42 nano seconds to execute. Much faster than I would have expected, but again there isn't really much going on. As soon as you add any communication VIs, loop rate will increase.

    EDIT: I removed everything in the loop and the loop now runs at less than 2 nano seconds...but again what good is a loop that doesn't do anything? Other than a dwell I guess, which won't be very consistent.

  6. I believe this is an issue with the ActiveX control it self. You have similar issues when you put ActiveX controls like this into tabs. It works just fine, but changing between tabs you'll see a flicker of the ActiveX control on top of the tab, and then moved back into the tab.

    I don't know of a work around. For the tab it's annoying but doesn't change functionality. For your application it sounds like more of a show stopper.

  7. gb119 you have more patience than me. Copied from the LabVIEW help.

    Searches for an element in a 1D array starting at start index. Because the search is linear, you need not sort the array before calling this function. LabVIEW stops searching as soon as the element is found.

    You cannot use this function to retrieve the index of a value that is not an element of the array. For example, if you have an array of two elements (0.0 and 1.0), this function does not find the index of the value 0.5, as that value is not an element of the array. Use the Threshold 1D Array to find a fractional index.

    This function only finds a string if the element you specify matches an array element exactly. For example, if you have an array of two elements (upper limit and lower limit), this function does not find the index of the value limit, because limit does not match an array element exactly. To search a string for any occurrence of a regular expression, such as in the previous example, use the Match Regular Expression function.

  8. Is it possible to achieve the speed faster than 1ms for a vi running under windows target. All the data communication functions such as queues doesn't seem to be timed out in less than 1ms and I tried to monitor the loop rate using tick count function but these also monitor in ms scale and do not return value in DB format.

    I will be amazed if it is not possible to run a windows vi as fast as 1us when the processor could run in GHZ.

    Will appreciate comments on this. I am working on a high speed control application and it is not suitable to use the RT target for this application.

    Kind Regards

    Austin

    Couple things. Your processor maybe running at the GHz but that is if you are only running one instruction. There is tons of overhead when running in windows when compared to a microcontroller. I would say I could do many operations on a 4MHz micro faster than on a 4GHz windows machine, and more reliably. Which is why when I need determinism, and high speed I move to FPGAs or RT environments.

    Windows is not deterministic, and should not be used for an application that needs to maintain timing less than 1 ms. What if the antivirus application decides to run a scan and slow down the PC? Or if Windows update decides to install a bunch of crap during a very sensitive time? There are many cases where Windows will not be able to maintain timing and will fail.

    You can run a VI that has a loop rate less than 1ms. But the overhead associated with measuring that applications rate, will effect your timing and then may run slower. Quantum Mechanics is not my thing but measuring something can effect it so that the measurement is not accurate. Also your loop may run faster than 1ms some times, but again with Windows it may take more than 1ms the next time. There was some code posted on NI's forums that I can't seem to find right now that would calculate the number of clock cycles a VI takes to operator, and then using the CPU frequency would calculate the time it took. But keep in mind that doing these operations takes clock cycles and makes your numbers less accurate.

    Also if you are trying to do something quick try to remove all of the extra steps that maybe in your way, like queues. There have been times where I had a nice wrapper written with queues or user events, but when I needed to do something fast, it was better to just do it in one VI than it was to pass data around to other VIs.

  9. I asked my IT guy about it and he said by default during windows installation it happens like that.

    and i do not know what i can proceed further. i'm thinking to buy a USB to serial Port converter so that i can try to communicate the device from the laptop.

    Your IT guy was wrong. If Windows Device Manager sees a serial port, its because there is a serial port. This may not be a normal serial port that is exposed to the outside world via a DB-9 but an internal one for diagnostic support. I've seen several PCs have internal serial ports that allows for for intimate access to the PC, or it is possibly a serial port that is only accessible through a dock that the laptop is connected to.

    In any case it is not going to be a serial port that is going to be available for communicating with other hardware and investing in a USB-to-RS-232 is going to be a good idea. I've heard some cheap ones don't work with all hardware, but I haven't found any hardware my no name cheapo couldn't talk to yet.

    • Like 2
  10. So alot of people have their opinions (several in this office) but I use UltraMon to manage multiple monitors. It adds a second task bar to the other monitor, and it can be configured to only show windows on the taskbar that are on that monitor.

    Additionally I use the Hotkey (setup in UltraMon) to allow the CTRL + Space to move the window to the next monitor. Keep in mind this replaces the quick drop feature in LabVIEW which I don't use. If I need to find something I use search. My left hand is almost always on the home keys, and so hitting this set of keys is a quick way to organize Block Diagrams on one window, and Front panels on the other. I can also use this technique to open two projects and have one on each monitor.

    UltraMon also adds other not as useful features, like multiple desktop images, monitor cloning (built into Windows 7 now), multiple screen saves, and a few other things I don't use.

    There are other free alternatives that I hear work just as well.

    EDIT: Sorry I didn't fully read your post. If you want code to span both monitors, UltraMon can add a Maximize to Desktop button. This button appears next to the minimize button of all windows, and when pressed will maximize over all desktops. I don't recommend coding this way. It is useful in Excel, where you open two workbooks and what to view one on each monitor, so you maximize the master window then position the two workbooks independently.

  11. (We might be able to help more if a few less VIs were password protected ;))

    I think if there was an unofficial patch put out, it would need alot of customization, on allowing the user to select things that it modifies. Because some people may want their VI.lib replaced, and some may not even want the Riffle function replaced.

    EDIT: Nevermind read his post wrong.

  12. Yes, NI logs everything we do on their site.

    Wait...EVERYTHING...something tells me they should call them something other than "private message".

    I know we've had some sales guys that will use some features of the website to see what hardware they would want. Using it to recommend hardware and a chassis and make a shopping cart just for a quote. NI has then called our sales guy and tried closing the deal, not knowing it was for a quote. All they see is a shopping cart filing up with tons of stuff, and then nothing.

  13. Okay let me see if I have this straight. The 'Application Directory' will give me my .lvproj file directory path in the IDE and the .exe file directory path in the Run Time Environment (RTE). Did I state that correctly?

    I just did a test and that is exactly how it works. I did not know that feature either. Normally I would use the OpenG VI "Current VI's Parent Directory" which will keep going up a folder until it finds a real folder (not a directory in the built EXE).

  14. You disgust me.

    Both work properly, but I'd rather use the first solution,

    Well my methods may be disgusting but at least spaghetti_developer agrees with my methods...on second thought I'm not sure how I feel about that.

    In all honesty my method probably has more maintenance, and is probably less obvious to another developer, but choose which you prefer.

  15. There are those who feel committing build products to a source code system is an abuse. To me subversion is just a distributed file system that provides a traceable history of what was put in when. It works very well for this.

    -Rob

    I agree but it can be slippery slope. Why stop at a built EXE? Should you commit the installer for your application?

    What about if the installer contains all the NI products that your application uses? Then every build and commit will potentially add GB's of data to the repository, and pulling that from a remote location will be very time consuming.

    Lets say you agree to commit the installer with all the tools, what about making a hard drive image with the system on it, maybe sysprep'ed for deploying to duplicate machines. Now we're talking about 10's of GB's of data every build and commit. And again someone may just do an update to get the latest and then unexpectedly be waiting for several hours while source, EXE, Installer, Tools, and hard drive images are downloaded.

    I generally stop after the installer (without the NI tools), but there have been instances where it made sense to commit the installer with all the NI tools.

  16. So with most LabVIEW UI issues there is a work around. This work around only works for strings controls unfortunately. Hide the real string control off screen that has focus, then have it use the event for change value updating the string control on screen. Attached is an example in 2009 that does this. The key is to enable "Update Value When Typing" on the string with focus so that an event is fired after every key press.

    Keyfocus Without Border.vi

  17. I've seen other similar posts about this issue and was wondering if anyone had a decent work around. This post reminded me of the issues I was having.

    Basically you have a list of channels that you can view on a graph. As you choose more signals, the plot fills up, and the Plot Legend fills with the signal names. I have it set to show no scroll bar on the legend until you have more than 11 signals. There is no limit to the number of signals on the graph, (this test VI only has 20) and so to see all the signals you'll need to scroll. This all works fine. The issue is when you select many signals, then scroll down, then select only a few signals. The scroll bar will disappear (by design) but the value of the scroll bar stays the same, showing a blank plots. Without the scroll bar you cannot change the value and are stuck until you select more than 11 signals and scroll up.

    So my question is this, is there a decent work around people have found? I can't find a property of the control that allows me to set the value of the scroll bar (or the optional index) back to zero. I also don't want to show the scroll bar when there are so few signals that it doesn't need to be seen. I would prefer a XControl that replaces the vertical scrollbar with one with more control, as well as not allow you to scroll down past the number of signals on the graph.

    Attached is an example that demonstrates this issue saved in 2009.

    EDIT: NI Crosspost

    Graph Channel List Problem.vi

  18. Well, one could argue that any CRC sucks, as there aren't completely mutually-exclusive signatures for all possible permutations of a string input.

    This is an important thing to remember. Any CRC/checksum method will have multiple messages generate the same result. There are an infinite number of strings that will return the same MD5Sum for example. The likelihood of having two random strings generate the same MD5Sum is 1 in 340,000,000,000,000,000,000,000,000,000,000,000,000 (rounded down). Similar things can be said for GUIDs.

    There have been several attempts to break MD5 in a systematic way and I believe someone was able to but I can't seem to find the example at the moment. The example was a EXE that when ran would say "Hello Wold". Then there was a second EXE with the same MD5 and when it was ran it would say something else.

×
×
  • Create New...

Important Information

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