Jump to content

hooovahh

Moderators
  • Posts

    3,388
  • Joined

  • Last visited

  • Days Won

    283

Everything posted by hooovahh

  1. Well thank you for your code...but your demo didn't really work for me. In the Example the only button that did anything was the surprises. I ran the Sample 1 Popup.vi and no error was returned but first call to TaskDialogIndirect returned a return type of -2147024809. This was on a Windows 7 x64 machine, with LabVIEW 2013 SP1 32-bit. Is this intended for 64 bit LabVIEW?
  2. Oh wow that is cool. Please do post here when you get something working. In the past I had a similar need. Where I wanted a dialog box which looked similar to the system ones, but I could provide an image to be displayed below the text, above the buttons. I had tons of code handling the window resize, resizing the image, and the text, and had code trying to increase the font size, and splitter positions. It was a pain and wasn't very modular. It also was system looking, it looked like my current system. Having more low level control of system dialogs like that could be very useful.
  3. Have you tried using this code on Linux? I didn't try it because I don't have access at the moment, but I see no reason why this wouldn't work on Linux it is just using the UDP primitive calls.
  4. You reminded me of an interesting post where Altenbach noticed according to NI legal you can't use the word LabVIEW in a sentence, among other strange legal-eze. http://forums.ni.com/t5/BreakPoint/proficiency/m-p/3124823#M26799 I'm unsure if it is NI legal that is crazy or the whole system. In either case I'm always glad to hear changes in legal that simplifies things, or allows more control as a user of their tools.
  5. I don't know what the TaskDialogIndirect looks like or what functionality it has. But for system Windows like dialog boxes, with options for 1, 2, or 3 buttons, and various warning/information glyphs I've been using this Windows DLL call. https://decibel.ni.com/content/docs/DOC-35643
  6. Right but, if I asked you to round 3517564740 (what I think is June 19 at 13:19 for you) to the nearest 86400 (24 hours) you would say the value is 3517603200, which ends up being the next day. But I could see how this could cause confusion.
  7. What about it? You state the day is wrong, which is true but rounding up to the nearest second could mean the second is wrong, it doesn't invalidate the fact that you only rounded up a fraction of a second. Yes time is absolute and relative I guess. So if we think of it as seconds passed from some date GMT, rounding up a fraction of a second doesn't mean anything more than just rounding up that fraction of decimal. Also your date example of rounding to another day doesn't matter to the other 23 time zones that would still be in the same day. None of this explains why NI chose to do what they did, but in opinion this isn't much of a reason to treat timestamps different.
  8. Rounding time up? Like traveling into the future? That's just crazy! Rounding down is fine, it's like going into the past, you know the past exists you already were there. But how can you round up, the world might end in those milliseconds you rounded up to, now won't you have egg on your face when you look at your data after the world has ended, and your timestamp shows data was taken after the world ended. But seriously though, other than philosophical reasons, I don't know why we couldn't round up when appropriate.
  9. I don't have IMAQ installed but I think those settings are exposed using various property nodes. I also remember those settings in MAX and saving them in MAX retained the values. So in the past I've just set it up in MAX and saved it, and never needed to change it for the application.
  10. Launch the example finder by going to Help >> Find Examples and search for Simple Serial. There are also several examples on the NI forums and even here. https://lavag.org/files/file/172-hyper-terminal/
  11. It is a handy feature to have. Especially for UI's that you have lots of panes and scaling happening. There are times that going too small just breaks things, so you make it as small as you can, then set the size to that to make sure the user doesn't make the UI unusable. Like I said there is a property for each pane as well but this is harder to get at because you need to drop down property nodes to read, they aren't viewable in the VI Properties. And then weird things can happen if you try going smaller where a pane can't get small but the window can so I almost never use this feature.
  12. That's an interesting approach, with several pros and cons over the typical poll the timeout case and check method. A few comments, you aren't closing lots of various references, and I figure you probably just threw this together. You have a VI reference, notifier, and user event for each trigger that aren't being closed, and you aren't unregistering for the user events. Some of these take care of themselves when the VI stops but I don't think they all do. Also I'm not sure you are aware of this or not, but you can create an array of user events, and register for all of them at once as long as the data type of the user events are the same. This might help make things scale easier because you could be making timing sources in a for loop, and to add another source you just need to run the for loop another iteration. Overall I like the concept. I keep going back and forth, but I do not think I have a need for adding things to the end, and front. If I go off and do some things, and I want to go to Idle periodically to see if there is new events to handle (like a trigger) my first thought is I would want to add Idle states to the front, then add the states added in the event structure at the end, unless it is a critical thing like shutdown. But this isn't true because when I add Idle cases is is probably going to be in a Macro all at once, so it doesn't matter if it is at the end or front. And as for going to Idle periodically, I wouldn't want to go there until I was done doing what I'm doing anyway, and then the event structure will act like a queue and my events will be waiting for me when I'm done doing what I'm doing. In the past I've seen where the states were always added to the end, except for an exit which was added to the front. But again with this design you're not usually going to go check to see if you should exit, until you're done going to your states, so it didn't really matter. Oh and I've used the DAQmx events. Just like all state machines where you have work, and UI stuff in one loop you need to be mindful that things should happen quickly, so the UI appears responsive, and you don't delay the work going on. Like you probably wouldn't want logging in that same loop because an event is generated for taking DAQ, then you take the DAQ log it, do limit check, database, or whatever, and this whole time your UI is unresponsive.
  13. Certainly posting the VI might help. Short of that I've seen this issue when using this function a couple times, all of which were expected if I had stopped to think about it. The first is maybe your front panel has a minimum size set, and the decoration is less than that minimum. In this case you won't be allowed to make the window smaller, so it throws an error. I've also seen it do odd things when there are splitters and multiple panes on a UI, where it will try to scale the window to the largest decoration, but that decoration is only on one pane. I've also seen where there is a minimum pane size, and again the decoration is too small. I'm sure there are other reasons this VI can throw an error. Because of these types of issues I don't use this function too often any more. I also heard someone mention this function does nothing, and returns no error on the new cRIOs running embedded linux, with a monitor plugged in, but I didn't get a chance to debug it.
  14. I'm interested less in making MDI applications, and more in knowing that NI has provided the tools, to make any application my imagination can come up with. Put another way, I'd like to have the ability to take any existing program, on any platform, and be able to recreate it's UX. I want users to use my program and not know it was written with LabVIEW. Exposing the HWND, or providing wrappers to similar cross functional APIs is one step towards that. And to be fair the window management properties in VI Server is a decent step in the right direction.
  15. I don't completely agree with your Always statement. If JKI didn't want us to be able to enqueue at the end then they shouldn't have included that feature. They obviously saw a need, or their users saw the need for it. Oh and jcarmody said without launching an actor.
  16. Oh that's a great idea, and a case I haven't really thought of because I generally have had another actor doing the actual work, and the state machine is just the UI, but there are plenty of times the quick and dirty is to have it be in one state machine.
  17. For me I don't ever add an "Idle" to the Add States. It just goes there after it is done doing what I asked it to do. So you go to the Macro Initialization. It does the states you tell it to, and then when it's done it goes to Idle, where you may have a timeout. In the timeout it might go to another Macro to do stuff, and after all of the states I add are done it goes back to Idle. It does this because when there are no more states to pull out, it passes out an empty string, so you should go to the "" case. Drop down the JKI template and run it. If you press the OK button or close the window it should react to your request by going to the Macro Exit case. It does this because it was in the idle case polling the event structure. You could add you own "Idle" to the states but I have never had a need for that, it will just go there when I'm done. And going to the idle case doesn't need to wipe away your string queue. If you go to the "Idle" case then perform an event with a button press, you can still use the Add States to add more. But in my software, since I never add and "Idle" case, to the states to go to, I will only go to the Idle case if all state have been processed.
  18. Interesting read, and LabVIEW definitely falls into this category, and not just with threads. Ever allocate memory for a variable in LabVIEW? Maybe you initialized an array and used replace instead of build, but this is not the same kind of memory allocation other languages think about. What about parallel tasks? Memory cleanup? Obviously being a higher level language many things are hidden away, and with a really advanced compiler even more things are hidden from the developer. I was talking to a friend yesterday and he made the statement about how easy software programming is, compared to previous decades. And while I agree I think the challenge has shifted. You no longer need to worry about the things that are abstracted away (until you do), but you do need to worry about much larger systems, with a much smaller team. We need to have more architect skills, and be thinking about how the pieces plumb together, and worry less about the low level, and assume they are water tight. When they aren't, we struggle.
  19. Here's some information on the .net functions called. https://msdn.microsoft.com/en-us/library/bb299773(v=vs.110).aspx https://msdn.microsoft.com/en-us/library/system.directoryservices.accountmanagement.principalcontext.principalcontext(v=vs.110).aspx https://msdn.microsoft.com/en-us/library/system.directoryservices.accountmanagement.principalcontext(v=vs.110).aspx
  20. Unofficially they do, but yeah you may want to post over on the NI forums, for higher visibility.
  21. I'm guessing there is a tiny border around your string control. Is it possible that this string is in a cluster? If so you could try to minimize this by using the 1 pixel border cluster. https://lavag.org/topic/5013-compacter-cluster-arrays-tables-with-controls/#entry28056 If that is just a string control I'm not sure why the label doesn't position itself right. Actually I just tried it on another XControl and it is the same. I'd say this is a bug and needs NI's attention so they can make a CAR.
  22. Oh also fun with parent children relationships. http://screencast.com/t/LjlkYzTWKr8J https://www.youtube.com/watch?v=-i3iaWm_Jiw http://screencast.com/t/P9SJ1anR https://www.youtube.com/watch?v=bqNVbSn7nKg http://forums.ni.com/t5/LabVIEW/How-to-run-an-exe-as-a-window-inside-a-VI/m-p/3113729#M893102 https://lavag.org/topic/17046-multi-panel-interface/
  23. So today I found another method that in my opinion should be made public. Obviously NI has more information than us, and maybe they have a good reason to not make them public, like they crash LabVIEW if you do XYZ. But here is a couple I've found and thought were odd that they were still private. These are functions that from what I see work just fine, and have little danger to a developer using it. Please add others you find. Class:VI Property: FP.Native Window This returns the HWnd in Windows to the front panel window, which can be used for low level window manipulation. Many functions for window manipulation are in VI Server but not all of them which is why on occasion the HWnd is needed. Class: Ring Property: Flavor This returns the type of Ring a reference is. Text Ring, Picture Ring, or Text and Picture. Class: VI Method: Synch In All Contexts I'm not sure this actually works, but it looks like it should sync a VI to all contexts. Maybe this isn't needed because a Save Instrument also syncs but some times you may not want to save the VI. Class: Control Property: Grouped / Group Member Refs This returns if a control is part of a group and the other references in the group
  24. On modern Windows the folder is something like C:\ProgramData\National Instruments\MAX\Data Not sure where ProgramData maps in XP I think it was something like C:\Documents and Settings\User\AppData\Roaming\National Instruments\MAX\Data but you'll have to look around to see. I think DAQmx settings are saved in config3.mxd, I don't remember what file the traditional DAQ is saved in but I'd bet it is in that same directory. If this doesn't work is it possible to deploy that image to a temporary PC or a virtual PC, then do a MAX export, and then import it back on the new PC? EDIT: Oh here is some more information. http://digital.ni.com/public.nsf/allkb/DAD981AFEF149B458625778100775987
×
×
  • Create New...

Important Information

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