Jump to content

Lipko

Members
  • Posts

    46
  • Joined

  • Last visited

Everything posted by Lipko

  1. Sorry for the stupid choosing of words. I meant just normal for loops. With "post-process" I wanted to emphasize that I would decouple this empty-cell-filling logic from the logic that produces the table. Because you seem to have solved the much harder part of the full algorithm. It would be much harder to fix your existing code that generates the result table than to have another separate section that works on the already produced table. sigh... It's easier to write and post the code than to describe it. Place this one where you have your disabled structure now. In general, I prefer to have a sequence of loops that do one or a few tasks on the data at once than to have one complicated God loop that does everything. The performace loss of more loops is usually not that significant, unless you have huge data (an image for example). Even in that case the performance loss can be accepted for certain uses in favour of code maintainability.
  2. It's not clear for me what you are after. You simply want to fill the emply cells of the report table for presenting the data (second table in your post)? Or you want the data also be inserted automatically into the database you are referring to in your first paragraph? If the first, then fill the cells in a post-process loop (where you have the disabled structure), I think that would be simpler than handling this in the table generator code (the for loop in the middle). Go through the table row-by-row. Go through the cells in the row. Check if the cell is emplty. If it's emply, fill it with the previous cell value (that you store as a shift register and initialised as "0%").
  3. I implemented undo several times in my applications, mainly because I usually do editors. I did it many ways, usually I check if the data/state changes (after the event structure) and push the data on a FIFO. For most of the time, simply putting all raw data was sufficient. Once (in C win32, not in Labview) I had too much data, so I had to use "command pattern", which means only commands with relevant parameters were pushed on the undo stack and the initial raw data was saved with the undo "object". It had limited depth (depending on available memory), so the initial datas had to be updated if memory would run out. So the oldest command was performed on the initial data. Of course in some cases the "parameters" of the commands were bigger data (like paste from clipboard), but it worked pretty well. One caveat: it was quite slow to undo, since all the commands in the command stack had to be sequentially applied on the initial data. If all commands are reverseable without computing errors (which pretty much rules out math operations and delete and such), the stack could re reversely traversed so no slowdown. Back to labview: I can't really exmplain after all these years what's happening, so I'll just post the code of "the most sophisticated" undo I did. It pushes the complete state to the undo stack, because the data was small (sequence editor). The word "manager" in the name is a bad sign, but here it goes. Note1: it's implememted in a way that selection changes are not added to the stack, only the last one, or I don't really remember. So you can just ignore the "overwrite" case. Note2: it's an old code from my newbie times. It fails the single responsibility principle badly, I think both "undo stack" and "stack index" should be action enginified, the outputs besides "output data" is only for optimizing recalculation of data so simply ignore them. EDIT: I've found a later implementation, so changed the vi. The data change check is outside the vi. pic_man_undo_manager.vi
  4. In my opinion, subVi-ing is only a small thing. There are so many ways something can be solved, and in a long term project that was started as a newbie it can mean a huge mess if you start mixing these ways. SubVI-ing only makes it prettier but the underlying architecture is still going to be a huge mess. These messy mid-sized projects are very hard to refractor, because it's simply very hard to test throughoutly if you didn't document testing all the way through the project, which you probably haven't if you made such a mess in the first place. Most of my late cleaning-ups ended up in a buggy software. Sure, those few bugs could be fixed easily but these occured not during testing but during usage. But I'm no pro, maybe I'm totally wrong. I know that my software testing knowledge is very weak.
  5. Yes, I forgot to add this notion to the post. Not a biggie though, it means that's it's not so practical to subVI this function. My other concern about such a solution that I'm not sure it works on older platforms if the dummy is off-screen. That's why I placed the dummy on screen and toggled its visibility, but it's not needed nowadays. But I didn't care to test...
  6. Okay, I did it with the dummy picture method and I found a borderless picture control here:
  7. Hi all! My brain and google skills stopped working and I can't believe there's no simple solution to this. I have image data (not a displayed image) and I want to copy it to the clipboard. All solutions I found was using getimage or exportimage, which means a dummy indicator and also a small border around the picture (I would use it if I could get rid of that border). Is there a more sophisticated/simpler method to copy the actual image data/picture? I'm on Windows so it can be platform dependent. Wrapping Clipboard.SetImage would be a solution but maybe some of you have a code sitting around. Thanks in advance.
  8. I usually """solve""" this kind of thing with placing a full-window transparent control over everything and showing it on mouse down and hiding on mouse up event. Fails miserably with multi-pane front panels and have to be extra careful for z-order. Quick n dirty, the way I do LV.
  9. Hmm. I would have answers for (almost) all questions I see in these interview question threads (many "dunno but I'd approach the question like this and that" answers), I even know hooovahh is not really Homer Simpson, but I don't feel any competent for a real Labview job. I can solve problems, made many mid-sized applications (control+daq, data analizers, report generators) that are team uses on a daily basis, I struggled with many architectures, fixed errors in 3rd party APIs, I know error handling is not simply connecting serially every crap with an error terminal to make a huge yellow snake (a thing that I see even in APIs of serious equipment from respected companies). Sounds promising. Yet my code and especially the architectures get so f... spagetti after a while, you'd get brain aneurysm just by looking at. These questions are only good for first stage screening. If I were hiring, I would definitely go for a test Labview project in some way.
  10. As long as there will be any kind of support and it will run on my machine and executables will be buildable with it and runtime engines will run properly, it will be my primary application/tool builder environment. The ability to qickly throw together GUI intensive (and not so intensive) specialized applications is still unmatched for me (though I admit I haven't looked into recent tools). The intuitive parallellism is also good, but to be honest there were only a few occasions where I did actually need it (control with DAQ). Okay, my career is not based on Labview at all.
  11. Thank you! I don't have experience with python and I'm stuck at point 3. I have Anaconda, I run the windows command prompt and started python (I see the >>>), I navigated to the plylabview folder (os.chdir), I think I have pillow (typed pip3 install to anaconda promt and it said something about I arelady have it), but no matter how I try to type in .\readRSRC.py -x -i ./2, I get inalid systax errors. Tried .\readRSRC.py -x -i ./2 in the anaconda promt too.
  12. Hi, How can you do this (LV 2015)? I have lost some VIs I haven't touched for years so I don't really need their block diagrams. Thanks in advance!
  13. Is it still an issue or have you solved it? It's not entirely clear that the error is random, or occurs "reliably" after the 3x45 hours. How is your time sampled? Is it possible that the hardware clock and software clock not being perfectly synchonized causes the problem? Is there any middle data processing bewteen DAQ and voltage checking? The 0.0000 is in the middle of a DAQ read chuck or at the begining/end? Or maybe a whole chunk, so for some reason the buffer is not ready when you read it? Sorry, I'm no expert in NI DAQ, for little quircks like this (and it seams to have a "soul") we are not using NI for DAQ...
  14. If you are a student, I'm pretty sure there are boring tasks that can be automated. Something that's special so you are not likely to find existing tools. But since you are a student, simply reinventing something, cloning a board game you like (I make minesweeper in pretty much any programming languages I work with), remaking msPaint is not a "stupid" decision as it would be as a pro. For example for work, I did a picture manager program. Pictures can drag+drop sorted, comments can be assigned, picture entries can be colored (for marking purposes), images can be cropped with arbitrary angled rectangles. And all pictures can be inserted into a Word document using the report generation toolkit and some VB scripting. This is just a small tool but it can be extended infinitely and has lot of areas that you can practice. And doesn't need any hardware (measurement or controller devices). Just a computer. EDIT: in general, Labview is a pretty productive language for GUI heavy applications. Graphs are very typical Labview things and they can be customized beyond a mere measurement plotting widget. So for a student project I would prefer something that involves graphs in some ways, usual or unusual ways (like some task scheduler or fancy calendar-thing, just throwing ideas). Another idea is making some cellular automata, like Conway's game of life. You could and controls to it, maybe even drawing the initial filled cells (you have to solve the rendering of the field: table?/graph?/picture? and you have to handle mouse clicks) and add some additional graphs that plot some interesting data vs. time diagrams. Like the percentage of alive cells, or whatever. Maybe you could also make some overlay heat map on the field to see if there are places that alive cells are more common. You could add a menu to switch between different automatas. Maybe adding an option of hexagonal field. Man, now I want to make it 😣
  15. I just couldn't resist. Not optimized in any way, but I guess for data that has to be visualized, this is not a problem.
  16. Yup, that's pretty messy. One mistake: you don't have auto indexing on the input but do have on the output of the outer loop. Or the code is that messy I misunderstood. I would use auto indexing, and have a bool flag (shift register) inside the outer loop. Init it to false and set it to true if the cell is not emply (otherwise don't change it's value). Then fill the cell with "0%" if it's empty AND the flag is true.
  17. Hi, What I would like to see (sorry it I missed that and there is a workaround) is to be able to load only data that is relevant for displaying. I don't know how do explain properly, like google maps, for example. Given the width of the graph in pixels, the min and max time value the graph would display only what is relevant (min and max value of the data at a given pixel and only in the given timerange). And of course this should be quite fast, running in the background I will look into the functions in the toolkit, thanks for posting!
  18. I'm sure other's have more general solutions, and I thought open-sourcing is not just tossing the code into the wild. Programming is not my main task, so maintaining an open-source project is out of question. Once I shared a project for fun (okay, it was only a fun game projecjt) and I got zero feedback. Maybe I can post in the code-in-development section though. But I can tell you the code for all my projects is very messy. As programming is only a tolerated activity of my job, all my projects are rapidly prototyped stuff.
  19. I could, if anyone is really interested. And I know my comment was OFF, but many comments were similar (story telling with no actual use for the OP), sorry.
  20. We also went for home-grown test controllers and sequence editors as the task for us was too simple and specific for the Test Stand mammoth, and all members of our test team has to create and run their own sequences (no dedicated sequence coder person). Coding a sequence controller for our certain controllers (NI cDAQ +0-10V AOs and DOs, native Labview support) and for our preferred measuring aplifiers (HBM QuantumX, pretty good Labview support) was only a matter of days with Labview. Coding a simple sequence editor was also a matter of days. Sure, it was a bit tedious to use at the beginning but incrementally the thing became a very effective and user friendly environment. I agree that the "not invented here" syndrome is a bad thing but it has a great advantage: the developer fully understands the requirements down to the tiniest details, as he is also an active user of the environment. Now it also controls climate chambers, tests can be scheduled, sequences has loops/branches/popups/etc, can run endurance tets reliably for weeks or at lest it's easy to recover (on a Win10 PC under corporate firewall!!!!11), it has automatic evaluation and reporting, editor can export to DiAdem Reports, etc. Actually, it is a base that can be used for making dedicated/specialized test bench control application in days, which still takes weeks currently for the test bench programming team. Sure, only our team uses the system (5 persons at the moment). I can imagine it would horribly shit itself if it was deployed without some programming on a slightly different system... It will never become a commercial product, not even used by other groups within the company (luckily no one was interested enough when it won the internal company innovation contest).
  21. Hmm, it looks totally different on my system. Nevermind, the disabled structures have to be removed (I don't know why they are there)
  22. It's not entirely clear what you are trying to do, but I don't see anything in the code that makes sure that the Y coordinates of the two sub-groups are different. I mean the ActualXxxxx bars are simply obscured by the other stack. When bulding the ActualXxxxx stack, add some offset to the i iterator inside the last loop to offset Y a bit. You have to fiddle around the other stack too probably, it will by quite tricky to fine-tune the properties to get the graph you want, but should be doable if the number of stacks and the size of the graph is fixed. I think... For these types of diagrams I usually go for the normal "fill to plot" method with a normal line diagram (not a bar plot!), I build both the top and bottom line of the bar. This way I have full control of the sizes of the plots.
  23. Hi all! This is a small miesweeper clone, a game that I implemented in every major languages I programmed in. The code is not pretty I only had a day to make it, the game itself is a bit slow and I didn't optimize it (not sure if it's the logic, or that a huge table control is being formatted cell-by-cell), but I thought I share it anyway. The window setup may be a bit strange but this is actually just a dialog in a bigger project, an easter egg. All controls of the original Windows Minesweeper are implemented, flags and auto-explore (simulaneous left+right click on a discovered cell with matching number of flags around it) too. Enjoy, if you are patient enough and try not to vomit if you look at the block diagram... minesweeper.zip
  24. Are you sure there's no race condition of some sort? Calling this VI parallel with another instance of it? Though it would mean that you set it reentrant and I think it would throw file permission errors, but at first glance I don't see other problems. Another idea is that your wiring is wrong but fooling you: you have a junction of file_handle and error before the case structure, and the close VI is not after the case but parallel (sometimes before).
  25. By "then something else broke" what kind off breaking do you mean? If replacing that Mean with my own solved the problem for me (no .dll error, the exe runs without obvious strange behavior), can I feel safe? My role is not a programmer, but a mere test engineer who makes tools for making test processes more convenient. So I don't really have the time to dig too deep into stuff like this, I need to have solutions for problems ASAP. Solving actual problems is not an easy task with a soo rigid IT department over me. I was surprised that I could add that environment value (which didn't solve the issue...)
×
×
  • Create New...

Important Information

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