-
Posts
3,413 -
Joined
-
Last visited
-
Days Won
286
Content Type
Profiles
Forums
Downloads
Gallery
Everything posted by hooovahh
-
I changed the Window appearance first. Hit CTRL + I or go to the VI Properties window, then I went to Window Appearance and selected Dialog, then hit customize and made the window non-modal (default), and allowed minimizing the window. Then I colored the panel by bringing up the paint tool and selecting the System Color "Window" which is the system color that a normal Windows program will have as a background. These steps help make the UI more Windows like.
-
Without knowing the scope of the application it's hard to say if an OO approach is necessary. What question by the way do you have about the "Execution"? Be more specific what feature you want to know how it was done.
-
Attached is what I think you want. It has the close fix mentioned by Tim. It also handles a close to stop as well. Basically I added a Mouse Down? event and then discard the click if it was in a column other then the Control Value. I still set the Value Signaling event so that when a row is clicked the value changes and gets the data from that set and does the string conversion you already had. I also set the listbox to highlight the entire row. Visually I like this better. I also changed the data type back to a scalar because you only allowed them to select 1 item anyway. MCL test Hooovahh Edit.vi
-
How to convert millisecond time to current time and vise verse.
hooovahh replied to pravin's topic in User Interface
Several issues with your code. The first is a race condition where you are converting to string, then try to convert back using a local variable. You are reading that variable, and writing to it at the same time and you have no idea who read or wrote to it first. I see you pulling out all of the components of time then adding them, then converting to a U64. A U64 doesn't have a fractional component, but you are adding fractional seconds. This means your resolution will only be 1 second not 1 millisecond. I'm also not sure why you are only interested in the time component and not the date. This maybe a requirement of some kind but I thought it odd and actually didn't notice until just now but I already wrote a working conversion to a hex string and back that contain the date. I'd also use a time constant or control for the time stamp instead of current time. Current time changes each time you run and having a constant (or control) allows you to run it and see where the conversion isn't working. My attached code takes the time stamp. Multiplies it by 1000 so we are now looking at the number of milliseconds not seconds. Then put that into a U64, and convert to string. The reverse is just as simple. Convert string to hex, divide by 1000 then convert back into a time stamp. hex to String and back.vi -
CSV is a flat file structure. You can open it in notepad and see the data in the 2D format separated by commas and new lines. CSV does not support a third dimension of data. To store data in a way that Excel opens it and has multiple tabs you'll need a different file structure. Using the Report Generation Toolkit you can have control over the file and save it as an XLSX which has support for worksheets (tabs). Also you may be interested in generating a TDMS file using the build int TDMS write VIs. NI then has a free add-in that opens TDMS in Excel and it also supports groups which is shown as workbooks when opened in Excel.
-
Clusters being static is by design. If you data type is flexible at run time then you don't want a cluster you want a variant (which may or may not be a cluster). But at some point you need to know what you are dealing with.
-
This is the only thing I can think of that would work as well but it probably is very error prone. Lets say your control size is 100px high according to the Housing Size property. That will likely include the borders, and any small spaces around the slider, and possibly things like the label/caption and digital display. These things will need to be taken into account and the range from min to max on the control and may not be very accurate.
-
Just ran into this one personally. Not sure what the offending VI is but replacing the one in the vi.lib with the one you posted fixed it. Can't wait until SP1.
- 21 replies
-
- 1
-
-
- error
- generating
-
(and 3 more)
Tagged with:
-
Edit Tree Items.Move Item functionality implementation is tricky
hooovahh replied to sdserlin's topic in User Interface
Please do not double post. If you are unhappy with your first post you are welcome to edit it, or us the Report to Moderator button to get posts edited or deleted. On topic could you post some code of what you have. It's still a little difficult knowing what you want. You are saying what method can you use to move an item that the user selects up or down? Okay so I think I found what you were talking about, and I think I have a solution. I don't know if there is a better way of using it, but what it will do is find the parent of the current tag, then find all children under that parent. Then find within that list of children, where does our current tag exist. Then move that position. Alternatively you could allow the user to click and drag to move items around, but I admit that getting this to work the way you want can be a pain. Tree Move Item Up.vi -
A user complained that these links are dead. I don't have the original VI but I implemented some code that is similar in functionality. You click cells in a Table, or Multicolumn Listbox and the color changes. There is also a Clear Color button that changes all cells back to white. Saved in 2011. This cannot be done with an array control because the only thing that can be different between elements of an array is the value. If you try to set the background color it will set it for all elements in the array not just the one cell. Color Cells Mouse Click.vi
-
Preventing duplicate entries in a single column scalar listbox?
hooovahh replied to sdserlin's topic in User Interface
I don't fully understand the situation. You have a listbox that the user can edit and you want to know when they make an entry that is already an entry and prevent it? OpenG array tools has Remove Duplicates from 1D array and this can help determine if there are duplicates. If you can post a simplified version of what you are doing and I think we can help. -
Application Task Kill on Exit?
hooovahh replied to hooovahh's topic in Application Design & Architecture
If taskkill doesn't work you have bigger problems. I'm guessing you aren't performing a taskkill but instead are politely asking the application to exit. And if it isn't responding it won't exit. In task manager go to the Processes tab, find your application and click End Process. This is a taskkill and will remove the application from memory. If you are on the Applications tab and try End Task this does not perform a taskkill but instead tries to close the application more gracefully and may take longer or not work at all. Again as discussed in this thread task killing an application is not something to be taken lightly, and under the right circumstances may have no ill effects. Generally this is only used when an application isn't responding and you don't want to reboot your computer to get back to a usable state. -
I agree, I was just trying to give the most complete answer.
-
This is true, and I would also recommend an actual database, but that doesn't mean you can't do it with TDMS. I've seen someone use TDMS as their configuration file format, replacing INI files. Of course that was crazy and it didn't catch on but it could be done.
-
The shortcuts are in the LabVIEW.ini (as you have discovered) and are under the key QuickDropDiagramShortcuts and QuickDropPanelShortcuts. Copying just these items to the new LabVIEW.ini will bring along the shortcuts. Internally we have a package with added quickdrop functions. Packages can have a PostInstall VI called and my post install VI will add these lines to the current LabVIEW.ini.
-
The original post can clarify but I think the complaint is that when the VI from the tools menu is ran from the project explorer, the App.MenuLaunchApp doesn't return the application instance that the project is using.
- 8 replies
-
- tools menu
- dialog
-
(and 1 more)
Tagged with:
-
Please do not make duplicate posts. If you make a post and want it moved, use the Report to Moderator button. Sorry I don't have anything to add to the issue you are having.
-
My windows form application on Labview front panel
hooovahh replied to witny's topic in LabVIEW General
The first method that comes to mind is using Windows DLL calls to set the parent window as the LabVIEW front panel, and the child window as your C# application. This will work but looks a little ugly because you will have the title bar of your C# program inside your front panel and looks unnatural. I did a quick search and found this post that I think has some code on setting parent/child windows. http://forums.ni.com/t5/LabVIEW/Set-Parent-window-using-User32-at-lv7-1/td-p/1950469 To do this you'd need the HWND of both the parent and child windows. I'm betting there is a nicer way to do this and I hope someone else answers because admittedly this feels like a hack method. -
I'm not a DataFinder expert so what I say may not be accurate. DataFinder does not index the values of signals. At least with TDMS data you cannot perform a search on if a channel has a value that is in some range. You can only perform searches on the properties of the data. In TDMS this is easy because the file, groups, and channels have properties and searching based on if a property of a file is in range is easy. I assume for DataFinder to index the properties of a CSV file you must write a data plugin which allows DataFinder to know what properties are. Let say your first row of a CSV is property names, and the second row is the values. This is something that DataFinder just can't know without you telling it and you do that by making your own plugin. I've never made a plugin and wouldn't know where to start but my guess is this is the only way for DataFinder to allow you to find information on the file. I think the only exception to this is the file name, path, and date. This appears to be something that DataFinder infers without needing a custom plugin being made.
-
I had something similar happen. Before today I have never ran a tools menu item from the project window not that I think it is a bad idea. I have a tool that takes an array of string and makes an enum based on it. It will make it in the application instance that the VI calling it is in. When I run it from a VI it works as expected making it part of the project that VI is in. But similar to your issue when I run it on the project window it makes the enum not putting it in the project instance. Not sure if this is expected or not just wanted to let you know you aren't crazy. By the way I see this in 2012 SP1.
- 8 replies
-
- tools menu
- dialog
-
(and 1 more)
Tagged with:
-
Error Reported by LabVIEW Exe
hooovahh replied to pravin's topic in Application Builder, Installers and code distribution
Please do not create duplicate posts asking the same thing. If this was a mistake then don't worry about it. Please contact NI directly with this type of question. We do not have the tools to help understand what happened but NI does. -
What third party LabVIEW tools do you use the most?
hooovahh replied to David_L's topic in LabVIEW General
Not specifically LabVIEW but I'm a fan of DisplayFusion. I've seen alot of LabVIEW developers use multi-monitor setups and having quick shortcuts to moves windows between monitors is nice along with multi-taskbars. Custom Quick Drop items. Several of the more popular ones. Custom scripting functions that I put in the Tools menu. Simple things like Array to Enum, and Configure SVN with my settings, or setup LabVIEW.ini a specific way. I don't think I've ever had just a single version of LabVIEW installed on my main development machine. Things like the custom LabVIEW icons help differentiate between versions. Abort All VIs function. Variant Probe. WinAPI functions. How much time has been lost by accidentally opening a 2011 project in 2012, and clicking save all, only to realize it later. SCC helps but it can still be a problem. I use a updated program similar to my old LabVIEW Tray Launcher which high jacks the execution of .vi files. Also adds an Abort All VIs, Launch LabVIEW (version specific), and Kill LabVIEW (version specific). -
Some prefer one development style over the other. Some see right click menus a break in the development flow slowing down the developer. If I know the function names I want to use, traversing through the palette takes alot longer then it does just typing it in quick drop. I did use the RCF and know it can be used for things that seem clunky in QD. Honestly I don't know which I prefer. I think I can adapt to either given enough time. But when it comes down to it using an official feature that isn't quite perfect, is better in my opinion, then using a more cumbersome method with more flexibility. Often times I see NI develop some new thing that obviously gets inspiration from the community (the Icon Editor is one). When the NI method gets good enough we as a community start to abandon the older way of doing stuff, with the knowledge that we no longer need to support and maintain a project, and instead NI has sorta taken over it. This then helps the community focus on other cool new projects that NI hasn't tackled yet. And so the cycle of ever improving software development continues.
-
OpenG LabView Datatype Palette Documentation & Examples
hooovahh replied to Zygle's topic in OpenG General Discussions
For the data to be usable you have to know what it is at some point. Sure you can say you have a variant but if I'm going to get an average of a variant I need to know how to interpret the data. Should this be a string, that is then transformed into a numeric? Or is it a boolean and should be treated as a bit? Or is this an enum which corresponds to some value? If you don't know what the data type is just yet, but you know that in two places the data type is the same, I highly recommend a type def. Using the OpenG Write Key (Variant) and Read Key (Variant) under the Variant Configuration palette I can write and read any thing to a file. Quite nice but at some point I'm going to need to turn that variant into a usable data type. Variants are great for a transport layer where we don't really care what the data is we just send it and then the place that receives it needs to convert the variant back to something usable. The Write and Read Key can be thought of as the transport layer where we send some data as a variant to a file, then we receive it back when we read it. For it to work properly ideally the write and read have the same data type. If these are both linked to the same type def, then that means updating the one type def will update both the write and the read to use the new data type. We may not know that data at design time, but we know what ever we write, we are also going to want to read and the data had better be the same. I've seen variants used in Queues, User Events, TCPIP, File I/O, FIFO, and several other transport layers. These all work great because they don't care what they are given they just send the bytes and who ever gets the bytes is responsible for getting usable data out of it. If you aren't dealing with a transport layer, and instead are just passing data around a VI but don't know what it is yet, there isn't really a need to use a variant, just stick with the type def and update it when needed. -
Perfect XKCD for all us 'Automation Engineers'
hooovahh replied to John Lokanis's topic in LAVA Lounge
Often times I find myself being distracted by the thoughts that the work I am doing would be faster if I just did it instead of spending time scripting it. There are a few times where I spent a long time working on some scripting tools that I figured would never be used or only be used once or twice. I was quite delighted to find that not only I had been using these tools, but other developers have been. Now these tools are part of my companies application building process and saving tons of time. They aren't all like this of course but I know now that my intuition on if a scripting function is worth it or not can be incorrect at first. Only time will tell if it is worth it.