Jump to content

Graeme

Members
  • Posts

    59
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Graeme

  1. Apologies if this is dead and done, but searching the forums for something else, I stumbled upon a few postings regarding this from 2004 and and 2005. I could have benefitted from this feature a lot, but clearly it never got off the ground. Can anyone shed any light as to why this suggestion was deemed unworthy? Regards, Graeme.
  2. Had a quick play with 8.6 in NI UK HQ today. Normandinf is quite correct. I wonder if it was reported or just happened to be corrected as a result of some other action. No matter. Graeme.
  3. Hi all, The attached VI and its comments say it all, but briefly, if you have an Enum constant wired to a Case Structure selector and the Case Structure has had "Add Case For Every Value" applied, then if you are commenting in a case for which the Enum constant is not set, then the comment does not behave properly (it only updates when you click outside of the comment). Trivial in the greater scheme of things I know, but threw me a curved ball for a while. Responses welcome. Regards, Graeme.
  4. Thank you for your reply and attached VI. I'll try it out. Regards, Graeme.
  5. Hi all, I write relatively simple ATE programs in LabVIEW. A pre main routine subVI I always put in is one that checks if all expected VISA resources are present in the ATE system. This works very well if NI-VISA, and in my case NI-488.2 too, are installed on the host machine, but if they're not it can be a bit mystifying to the user. They see that the instruments are present but my ATE program can't find them because those drivers aren't installed. My question is, what is the best way to check programmatically, that prior to an ATE test that requires (say VISA and 488.2) drivers to be present, the presence of these drivers can be verified? My first thoughts are to execute some File I/O on their expected path to see if they are there. Then I think this may require some regular expression work as version numbers may differ, but (possibly) be irrelevant. Latterly, I wonder can you programmatically query MAX? I would be interested if others have encountered the same same problem and what solutions they came up with. Regards.
  6. Hi guys, I've now had a closer look at your suggestions. MATTW provides a very good solution, very neat indeed. This solution srcolls much faster than mine, with less code too. I think tnt alluded to the same thing, but I needed it spelling out to me! My requirement was to keep the cluster frame in the same position, but scroll its elements up and down within the frame. I may have misled some here. Apologies if I did. Problem solved and thank you all for your inputs. As ever, I've learned more about LV from you. Graeme.
  7. There are some good solutions here. Thank you. On a broader (somewhat off topic note) this brings something home to me. There's not much in LV that I haven't been able to do what I wanted to do. However, again and again, when I ask you guys for your solution, your solutions are so much neater and simpler than mine, using a fraction of the code that I do. I don't think I investigate Property and Invoke nodes as well as I think I do. I have another post on User Interface at the moment that I've only just managed to realise that my maths can be ditched and replaced with one Invoke node. Thank you all again for your replies. I'll be following your leads with vigour! Regards, Graeme.
  8. tnt, Apologies for my incorrect profile. Appropriate action taken. tcplomp, I haven't tried your code yet, though I will. I did find a solution for mine, however. If you're scrolling up (cluster moving down) then reverse the array of cluster control references and reverse the array of control positions, i.e. process the cluster elements backwards, bottom to top. However, having done that, and now seeing your solution, this puts your solution at about 1/10th the size of mine!!! I'll try your code though I've never done anything multiple panes (knowingly!) so may need a pointer if (when) I get stuck. Thank you both for your replies. Regards, Graeme.
  9. Hi JDave, Thanks for the prompt response. [0] Looking into it. [1] That's what I thought, but it doesn't do it for me. I'll investigate further, particularly your link, thanks (although the list box looks like an array to me, not a cluster - willing to be corrected) [2] Very badly worded question on my part, and I shouldn't've asked it here. I know the OS doesn't return to LV, but I just wondered if, say, Windows, programmers had to calulate a right-click event, do they have to work out co-ordinates or do they simply get returned a reference to the right-clicked control automatically? Idle curiosity, really. Thank you again JDave.
  10. Hi all, I have a Listbox for a user to input numerous strings at run-time (lists of recipients for one of the SMTP VIs). Double-click allows editing of a row. Right-click brings up a user menu, some of whose selections are row dependant. Thus, I have to calculate (albeit simply) in which row the mouse pointer was when the menu was brought up. It seems to work. I have two questions regarding this technique, though, both vaguely related, although only one is LabVIEW, the other is OS. First, LabVIEW. In the Listbox event "Shortcut Menu Selection (User)" there is available the reference "SubObj". I'd hoped that this might be a reference to the row where the menu was brought up, thus sparing me the maths. However, although I can wire this reference to various nodes, they all produce the run-time error "Object reference is invalid". I can't do anything with it. Can someone tell me what this refrence is and how it should be used? Second, a right click on an object in an OS (say a folder): does the OS return a reference to the object or do you still have to calculate the mouse pointer position to determine which object has been clicked on? I'm really looking for best practice techniques to employ in LabVIEW, where available. I attach my listbox VI. Regards, Graeme,
  11. Hello everybody, I have a cluster of string indicators, arranged vertically. There are too many indicators to fit on the screen. So, I knocked up something simple that would scroll the indicators up and down, to bring the ones I want to see into view. When I move the scrollbar down (scroll the indicators up) performance is satisfactory. However, when I do the opposite, there seems to be a sort of refresh problem that results in annoying flickering of some of the string indicators as they're scrolled. Difficult to describe, so try the attached VI if you're interested. I'm puzzled as to why the cluster scrolls nicely one way but not the other. If someone could explain what's happening, and even offer a solution, I would be forever in their debt. Regards, Graeme.
  12. Thank you for the replies, gentlemen. I don't you how you find out all this stuff, but it's greatly appreciated that you pass your knowledge on. The VIs I posted are a snippet from a large top level VI of mine. In that, there are VIs in False-constant-selected cases that are returned by Callees Names, although those case structures sit within other case structures, which in turn sit in event structures in while loops. Maybe there's some sort of difference there. I'll try to post. I'd always assumed that Callees Names was akin to View-VI Hierarchy, but obviously not. This throws my simple VI cloner that I'd put together. Thanks again. Graeme.
  13. Hi all, With regard to the attached top level VI (Untitled 2) and its subVI (ClusterValueShifter), can anyone postulate why, when the case structure (in which the subVI sits) selector is False, and Callees Names is run on Untitled 2, Callees Names returns no subVIs. Yet, when the case selector is True, Callees Names returns ClusterValueShifter. Incidentally, the unsupported Callees Paths exhibits the same behaviour. Regards, Graeme.
  14. Thanks for the reply Ben. After a bit of inspiration I've moved forward, maybe. I attach two VIs: SlowTabCaptionWriter and FastTabCaptionWriter. SlowTabCaptionWriter is my original effort that updates the Tab control captions (relatively) slowly. FastTabCaptionWriter is my new way of doing it. Some observations. Slow is sequential and Fast is parallel. Given that, you might well expect Fast to be the faster, which it is: it updates the Tab control captions instantaneously, which is what I want. However, sometimes, Slow DOES update the Tab control captions instantaneously, although not often. Odd! Odder still, earlier in my top level VI Slow works fine every time. The last spanner in the works is this: once, Fast updated the Tab controls backwards once, and slowly (relatively), 9 to zero, but I've never seen it since. I don't know how the Index Array function works, but perhaps Fast could do with error cluster wiring, or sequence structuring, to avoid it going backwards. I can't help feeling there's something buggy here, but I doubt I could ever prove it. It may just be bad LabVIEW programming practice on my part. Regards, Graeme.
  15. Hi all, I have a complex (by my standards, ~ 100 VIs) top level VI. At its most basic level it contains two tab controls, each with multiple pages. It's essentially my effort at a test executive (didn't fancy learning, or paying for, TestStand). When the test sequence is complete, I write to one tab control's tab captions some (irrelevant here) default values. Problem is, instead of those values appearing simultaneously and instantly, they appear at about .5s intervals, i.e. I can watch my tab control's tab captions being updated one by one, half a second apart. The functionality of the top level VI, of course isn't affected, but it's very irritating. It's difficult to post the whole code because of its size, especially as it's such a trivial matter. Earlier in my code, I can update the tab control's captions instantaneously, as you would expect. To, summarise, has anyone seen a slow update of tab captions, and if they did, did they ever find out why? I'm chopping my code down bit by bit to see what might be causing it. Thanks. Regards, Graeme.
  16. After much thrashing around I've come up with something that does exactly what I want. It's a bit rough and ready, though, but demonstrates the principle. I'm posting it to see what others think. Hopefully, it might be of use to others too, even if only as a basis for something better. Constructive criticism most welcome. Regards, Graeme.
  17. PJM_labview, Many thanks for your postings to my topic and my deepest apologies for the outrageous delay in replying to you. Pressure of work and other LabVIEW projects have side-tracked me, but I hadn't forgotten the issue. Only this evening (well evening in the UK) have I had a chance to seriously look at your solution. However, I can't get it to work for me. Undoubtably operator error, of course. I was hoping if you, or others, might enlighten me. I've tried to attach a .png which shows the error message I see. I've not tried this before so if it all goes wrong, apologies and I'll re-post with something else. Many thanks again. Regards, Graeme.
  18. For what it's worth, a front panel grid size of 4 gives me the results I like best. Tried a few but this came tops. Dunno why, but it works for me. Surely, the larger the grid size, and with snap to grid, the less control you're going to have over you GUI. Not snapping to any grid leaves everything too fluid, in my opinion, at least for a quick development Graeme. BTW, this is the sort of thing that really narks me about LV. I can do some really neat, complex BD stuff in LV so easily and tidily, but then I'll spend ages just aligning/sizing FP objects to make the GUI look good. Not a moan, just an observation, but I do spend a lot of time on neatening my FPs. The fact that this question had to be asked in the first palce demonstrates the point adequately (in my opinion).
  19. Hi all, I have a top level VI. It contains many (to me, ~50) sub VIs. It is a test template which can be used as a building block for producing different yet similar test applications. When a new requirement for a new application comes in, I start by renaming (usually by adding a prefix for the new job) the test template's top level VI and all its subVIs. I then have have to go through the new, renamed top level VI and tell it to point to (replace with) the new, renamed subVIs (for all ~ 50 subVIs) and not the old, original template ones. Very tedious indeed. Surely this can be done with some code? The best I've managed so far is to rename and copy my top level and subVIs, but of course, the renamed and copied top level VI still points to the original subVIs. How can I get it to point to the newly renamed and copied subVIs? I attach a VI that is my sum achievement to date. Awaiting inspiration, Graeme.
  20. Hi all, Recently upgraded from Base to Professional. Replacing some of my polling While Loops with these 'new' (to me, and therein lies the problem perhaps) Event Structures, but have become a bit perplexed. A top level VI contains some numeric/string/path controls. These control values are checked for validity (file/dirctory exists, for example) whenever the user changes their value, before they're passed on. Okay so far. Event Structure fires as a result of the change and executes the relevant code. However, I wish to do the following: I want to check the control values at top level first run (they may have been valid once but not now). No value changes of course, so no events fire, so nothing happens/is checked. The user can set the control values from file. I would like to check the values after that. The user can set the control values to their default. I would like to check the values after that. The latter two cases I thought might cause the events to fire, but of course I now know that the Event Structure responds only to GUI changes, not programmatic ones. I know this because a colleague pointed me towards the Val(Sgnl) property node. This seems the way forward, but how to implement it 'best practice' I'm not sure. It seems to me, for every situation where I want to check control values that have changed (maybe) programmatically, I must wire their Val property to their Val(Sgnl) property to fool the Event case(s) into thinking there has been a value change, even though there might not have been! Fortunately, all my controls are in clusters, and there are not many clusters, so this wouldn't be too onerous. I attach a VI that does do what I want. My problem is that this method seems very untidy and clunky, particularly as no value changes may have occurred at all, rather defeating the point of the Event Structure. I can't help feeling that there must be a slicker way of doing what I want. Tell me I've missed the option on an Event Structure pop-up that says "respond to value changes however occured and at first run" :thumbup: . Alternatively, tell me I'm barking up the wrong tree completely . Any ideas, anyone? Regards, Graeme.
  21. Hi all, Once again I seek the wisdom of those a little more clued up on LV than I am! I have a main VI that runs some automatic tests. On the VI's front panel there are some control clusters, via the elements of which the user enters test condition information prior to running the test (operator name, path loss, test frequency etc., all that kind of stuff). The test results are written to file but I would like to write the test conditions (i.e. the cluster element values) to file as well. So the problem is converting a cluster's elements, which may be mixed data types (but are most likely to be Numeric, String, Path or Boolean), to strings. I have a VI that I've attched that seems to do the job nicely. However, I look at it and can't help feeling there must be a neater way of doing it. Something using variant data nags away at me but I can't get anything going with that (never been much good using variant data!). One last stipulation, the conversion of a Numeric must result in a string that appears exactly as the number appears in its Numeric control, not any different format. I'd be interested if any of you have any suggestions. Many thanks. Regards, Graeme.
  22. As ever, many thanks to those that replied. Well, you learn something every day, don't you! Thanks for your comments and links. Reading these it all seems rather obvious now, but it never crosses your (well, my) mind initially. So, unless I've misread the links, floating point maths is fine but, be careful comparing such numbers. Regards, Graeme.
  23. Hmmm...interesting. I get the same. Very slow first time Help window appearance on my work PC but no such problem on my home one. I'll try what you've done and see if that cures it. Thanks. Regards.
  24. Hi all, Stumbled across this today in a larger application that I'm working on. Have stripped out the core and put it in the attached very simple VI. The VI takes a double precision number (which should be a multiple of 0.1) and, via a While loop with a shift register, successively subtracts 0.1 (also a double precision number) from it. When the result is zero the While loop should stop, except it doesn't: the result is never zero, only very nearly, e.g. 1.23456789E-16, or something similar. I'm a bit baffled. As ever, you can work around it, but I'd like to understand what's going on. If anyone can enlighten me I'd appreciate it. Regards.
×
×
  • Create New...

Important Information

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