Jump to content

Lipko

Members
  • Posts

    56
  • Joined

  • Last visited

Everything posted by Lipko

  1. 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.
  2. 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!
  3. 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.
  4. 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.
  5. 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).
  6. Hmm, it looks totally different on my system. Nevermind, the disabled structures have to be removed (I don't know why they are there)
  7. 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.
  8. 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
  9. 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).
  10. 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...)
  11. I wonder if that mean function has advantages over a self implementation apart from returning some error codes and (I guess) no float overflow errors.
  12. I have the same problem on random machines (the same type though), though the application is built in LV 2015 (32bit), at it was built months ago, not nwelí built. I figure setting enviromental value means setting it in windows. That didn't solve the problem. I will replace all Mean functions, but meh.... EDIT: Sorry for bumping, I didn't realize it's not 2020 any more... Anyways, replacing the Mean function solved the issue. Another argument for reinventing everything for yourself 😋
  13. Same trick can solve flickering of the cursors of a graph when the graph data is updated. However, it can result in seemingy unrelated errors, for example triggering an autoscale on an axis with property-node doesn't work the same way as without the transplarent overlay, so far as I remember. This is obviously just a simptom of some updating (order) thing. So if you have any "special" behaviour of your control/idicator, you better test everything (which is close to impossible), or try to recall this hack if something that once worked stops working as expected.
  14. Hi, Do you have specific examples of the data you want to process? How do you get zero pulse width? Do you want to ptocess the whole data or just a portion of it "real time"? If your data is that special, why don't you do the anlysis yourself? It's clear how you define pulse width of a rectangle, but how do you define it for a smoother data? If you always have special data (rectangular or triangluar), then I think your best bet is to calculate everything by yourself, or detect whether the data is special or normal "waveformable" data and handle the two kind separately. Also, have you considered fixing the data before analysis? For example a simple resampling with much higher frequency to have a "waveformable" data? With a frequency that complies with the time measurement accuracy you aim for.
  15. If I want to have lossless data for processing but also want to display data on the GUI then I simply have a processor loop with a queue and a display loop with notifier and the producer loop feeds both. This means copying some of the data, but usually the not the huge part of it that has to be processed. If the GUI state depends on processing the data, some GUI updates go into the data processor loop, so it's not an unstained arcitecture.... But I try to keep the number of GUI elements updated from the processor loop as low as possible, and also I try to use the terminals of the indicators instead of property nodes. So far it has worked for me quite stably even if any of the loops became slow or laggy. Though in my system GUI input is never affected by the data or processed data.
  16. Note to codes: I'm am only a hobbyist tinker, and I don't know how nice LV code is written. And I hope I posted every relevant things. You don't have to care much about the "alive_clients" thing. It's there to make sure the reply buffer doesn't overflow if a client gets lost before the server' reply gets forwarded to the client by the webservice. The server program that reads the request queue and writes the reply buffer is too complicated to be useful. And to point out again: The client ip is sent by the client itself. Then you have to keep track of the ips in the server program logic. Chamber_comm_main_webservice.vi chamber_request_queue_FGV.vi chamber_reply_queues_FGV.vi chamber_server_reply_type.ctl reply_buffer.ctl chamber_webservice_msg_type.ctl
  17. ImageMagick has command line interface so you can use "System Exec.vi". ImageMagick works with files (at least the command line thing). So you have to save the picture, call "System Exec.vi" with the proper command and parameters, this will make another file (or overwrite), then you have to load this file to Labview. For not high resolutions, this will probably fit the 0.5 second time (and based on the picture you posted, the resolution in pretty low). I have to ask the usual question though: what is your final goal? Maybe you could go the other way around and barrel-distort the whatever instead of the picture? Maybe you'd only need one transformation during the whole program run.
  18. Some other constrains of my use case, so we can see if it's really similar to yours: a client always waits for a proper reply (be it success or error) before issuing other commands to the server a few dozens of clients at a time stable communication is much more important that speed, so it's accepteable for the client to wait even for fours for a "success" reply (in case the server restarts due to an update and the IT's asdfg...), but usually reply comes in a few seconds. writing is even rarer, since a client has to reserve the machine first (reservation is handled by the server), so commands to a not reserved machine will result in "not reserved" response, and will not be forwarded to the machine (no write) very small requests and replies. Such as "ip loginname Thermotron set -50" and "set -50 act -49.5 run" I did not make the web service reentrant, that's why I made it "thin" as possible: it only does the two things that I wrote earlier. I don't remember why, I have to dig up the code, but the IP of the clients were sent by the clients themselves appended to the request (more precisely in a cluster that was converted to request text). Similarly the ip is appended to the replies in the "reply buffer". What code would you see specifically?
  19. I'm not sure I understand the problem correctly, but I had a seemingly similar situation. The clients send two request types: "write xyz" and "status?" The server side has two layers: a thin webservice: for "write" requests: queues the requests (write queue) with client ip and immediately responses with "acknowledged" for "status?" requests: immediately responses with the last message for that client from the reply buffer, or empty string if no replies for the client are available the main server program: sequentially write the elements to the database from the write queue (making sure that writing was finished for each element*) writes status (success/error/whatever with the ip of the client who initiated the write) to the reply buffer (in the exe, these are built in one application so the reply and write buffers are simple functional globals) Client side: send write request (and wait for acknowledge) keep sending "status?" request (and wait for acknowledge) until timeout or appropriate answer (for an aggressive client, appropriate may be only "success". For a fully automated program, this is required, for a user interaction based program, "error" can be an acceptable answer) This may be a little over-complicated (and I hope I remember well), but this was the only way for my application to work reliably in a not-so-fast-and-stable network. *in my case, it is a complicated matter by itself because writing means sending messages through com ports to climate chambers with VISA, and this communication is asynchronous and takes unpredictable time for the chamber to complete. So in one write, this means sending command to the machine then requesting command state of the machine and repeating this until the command state is the same as the requested state (or timeout). Maybe in your case some things are handled automatically by SQL...
  20. Hello, If it's okay to use 3rd party free tools, you could look into ImageMagick. It has command line interface. L.
  21. It can be solved with a fairly simple macro. Sub ReplaceTextWithImage(findText as string, imagePath As String) If Selection.Find.Execute(FindText:=findText, MatchWholeWord:=True, Forward:=True, Wrap:=wdFindContinue) = True Then Selection.InlineShapes.AddPicture FileName:=imagePath, LinkToFile:=False, SaveWithDocument:=True End If End Sub EDIT: added checking if text found and MatchWholeWord and continue search if out of selection range. Other checks should be added to the labview code (image file exists and findText not empty). Note, that the Selection.Find.Execute will ignore MatchWholeWord if there are special characters in the findText for some reason. I haven't found a reference to what charaters are "special". Special characters I tried and found: &, #, _ So I gueass pretty much every non alphabetical....
  22. Hi all! How do you implement mouse capture for controls? This is more of a philosophical question about your solutions, you did you learn to live without it etc. By mouse capture I mean mouse capture: A control receives mouse events even if the pointer is not above the control. It's useful for dragging among controls, or for a graphical user interface (mousedown>mousemove>mouseup event chain). Without mouse capture if the user accidentally leaves the drawing area during a drag-like operation and mouseup occurs outside, the drawing area gets stuck in dragging mode (mostly). This is a very annoying phenomenon. However, this is usually only needed in 1-2 controls (or 0 in most cases), so obviously not for everything you have on the front panel. Mousecapture in win32 programming is very easy. You call Setcapture(control_handle) on mousedown, and call releasecapture() on mouseup. It does have problems (system releases capture because another window gets on top for whatever reason), but these can be handled. And usually the problems are not that severe, or at least doesn't happen whenever the user moves the mouse too fast… So how to deal with it in Labview? No, calling the winapi with setCapture won't work as it works with windows (win32 treats controls as windows) but in Labview by default there is only one window: the front panel. Somehow replacing drag+drop functions all controls have some sort of? Creating user events for mouse handling and all controls have to handle mouse events and propagate them to the user event? Somehow make the control you want to mousecapture a separate window but mimic it's not? +winapi Some mouseleave/mouseenter hack and checking button states (but how? you shouldn't mix events with polling)? Ditch event structure and go for polling? Or even worse: polling only the mouse in a separate loop and generate user events? Some special control (ActiceX?) that has mousecapture using function that's easy to replace and place it invisibly on to of your control? Confine the cursor to the control (that's the worst one yet…) other... Thanks for any hints and ideas or stories on the topic and sorry for the inaccuracies in technological terms, it was very long ago when I did win32 programming.
  23. Hi all, I'm trying to insert images at specific texts in a Word document with the Report Generation Toolkit. Kind of like search and replace, but with an image as replacement. All I found that inserting a picture can be either done at bookmarks or into table cells. I want to avoid Bookmarks because it's easier to add some hashtags than editing bookmarks if there are dozens of images to be inserted. I didn't find any way to either set the cursor or add bookmarks programmatically. Actually, I don't find any usage of the cursor in the built-in RGT functions… I thought it's a basic thing I want to solve but didn't find appropriate answers. Thanks for any hints in advance!
  24. Hi again! I'm having a hard time to get the position of a found text in a Word file. I'm able to use the Report Generation toolkit to search+replace text, but I want to highlight the replaced text one way or another. Using the "track changes" option of MS Word would be the best, but changing the font of the replacement and leaving the original text too would also suffice. The reason I'm struggling with it is that there are several text to search for and replace and the texts are sometimes contain other search text (so for example I want to replace X01 with Y but X01.01 with Z). This can be solved by sorting the search texts reversed alphabetically. Since I can only search and replace, I have to turn off Track Changes (because the original text will be found again), and replace the found text with a trackable unique dummy text first, than I have to search and replace those with the original+final texts. This means Track Changes will not be effective (or the user would see the horrid dummy texts too). So I would at least apply a different font to the replacements, but I don't know how to set the "Format" parameter of the Document>Range>Find>Execute method. A preferred method would be to get found ranges first, exclude found ranges from the next searches, then delete the ranges+insert the search string in place of them. This way the changes of the document would have a very nice highlight. Thanks for any hints or better approaches in advance!
×
×
  • Create New...

Important Information

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