Jump to content

ensegre

Members
  • Posts

    582
  • Joined

  • Last visited

  • Days Won

    25

Posts posted by ensegre

  1. I ran into this; I wonder if I'm misunderstanding, or it's a bug.

     

    post-28229-0-87144600-1442835444.png

     

    I have a FP, with buttons I want to toggle with keys, and I have string controls in a subpanel, like in the attached minimal example. I'd like to toggle the button while the focus remains in the subpanel string. While this is no problem for a control on the FP, pressing F1 while focus is in the subpanel string rises the focus to the whole subpanel container. What is wrong? If a bug, how to workaround? Setting KeyFocus to the sbubpanel string ref doesn't seem to help.

     

    Seen in 2014SP1 linux and 2014SP1f3 windows.

    main.vi

    subvi.vi

  2. Well, this is what I'm coming up with, I may later embellish it (for instance differentiate treatment of controls, globals, polymorphic).

     

    ETA: an improved version which treats VIs, controls, globals and reports some statistics, and on which items can be opened with double-click.

     

    LabviewProjectList-dda9fc0069d62440001862aad0be0301d4ed1f93.zip

  3. If you want something complex, you need to write a complex program which parses each line of your spreadsheet file, and and controls all the possible execution options accordingly, there is no escape from that. For example do you want to write pin-status-wait-status-wait-status-wait... or pin-status-wait-iterations... Maybe you should start there, defining what is to be expected on a line, and what is intended to happen; then you can think at possible implementations which satisfy your constraints.

    I don't even understand, should the lines of your file be executed sequentially or simultaneously? The examples above assume sequentiality; I previously deleted a reply of mine in which I was answering you understanding simultaneous start of all pin cycles, then thought that perhaps it was not the case.

  4. I was wondering --

    I would be curious to get full metrics for my latest project -- including not only number of .vi, .ctl, .lvclass (these I can grep from the file list, or from ls -R * |grep \\\.vi | wc -l ), but also number of global variables and where used, list of unused project items, optionally some complexity metric for all vis, which vis are password protected, which are on which execution system, and whatnot. I suppose that it would be possible with a bit of effort to put together a script for that, but is there out somewhere something ready made?
     

    • Like 1
  5. I just ran into this oddity, which might lead me to revise a little a logger of mine. Now, I know of two easy ways of getting a number of seconds from LV:

     

    post-28229-0-37389900-1436890344.png

     

    The doc is not too eloquent about the high resolution one and its cross-platform implementation, it only says "with 14 digits of precision after the decimal separator". Which would imply, if the representation is double, a span of only something like 100 sec, and this seems not the case (something like 14 significant figures and us resolution instead might be it).

     

    What is a quirk is that, if I convert the numbers in linux I get exactly the same time of the day, just a difference of 66 years and a day, not under windows, at the very least on just two machines I have tried. Hence under linux I could use the high precision timer to provide an useful 24h clock too, under windows not. The doc warns that the former is "relative" and "short time", true.

     

    post-28229-0-95816900-1436890068.png post-28229-0-75795100-1436890080.png

     

    I think I remember some discussion about, haven't searched yet. I think I was sort of aware that the two OSs use a different time structure for storing the system clock, which is probably exploited differently.

     

    ETA: yeah, https://lavag.org/topic/16198-timestamp-behavior/#entry98843 and http://www.ni.com/tutorial/7900/en/ , but they don't explain the 24107 days difference.

     

    ETA2: uhm, 1/1/1970 - 1/1/1904 = 24107 days...

  6. Shaun has given you the link.

     

    What seems that is unclear to you, is what is involved. Modbus is a communication protocol. A way do do things like for example reading or writing numeric values to "registers", by sending formatted messages to the instrument across the serial line, across ethernet, or anything else. As such, you have probably to go to the manual of your instrument, and look up which register corresponds to reading V, I, or what else you need. You can't just expect to write the character "1" to the serial port and expect that the instrument responds in no time with a string, as you're doing in your VI. The modbus library referenced above has VIs for accessing registers, the rest of the information (which register, which port, when, what) you have to provide yourself.

  7. To my understanding, String values consist only of the characters of the string, and either getting them as referenced control value or as indicator content, they won't include formatting any better than they would include any other property of the indicator they came from. I think you'll have to pass the coloring information along by some other means, such as index arrays containing the start and end positions of your coloring. Or, augmenting your string with "control characters" acting as escape sequences determining the colors. As such, they will need to be parsed and filtered out down the line.

  8. I think you can (in fact probably you might be better to) skip the AvailSampPerChan, and just read a suitable fixed number of points. The way I understand continuous DAQ works, is that data is acquired into a ringbuffer internal to the DAQ device at it's own pace, and the DAQ driver cares for transferring enough data to the computer memory as long as the ringbuffer is half full/ there is enough data/ etc. Asking the DAQ to give all its available data just now leads you to interrogate the daq at a rate dictated by the time it took to plot the previous chunk, not at a rate determined by real display need or load balance. I suspect that if you would monitor the number of points which you're getting at each iteration and the time for it, you'd discover that you're ending up still asking too frequently few points at a time, with 100% cpu load.

     

    ETA: I missed the Wait 100ms block. However, a fixed number of read points has the same effect, actually better since it is deterministic and dictated by the daq clock, not dependent on whether the GUI thread is delayed by concurrent processes. [Ascertaining, that the time needed for plotting these points is in average shorter than that for acquiring them]

    • Like 1
  9. Can your display and your eye keep up with updating 1000 times per second a graph with one point? Wouldn't it be more sensible and less cpu & gpu intensive, not to mention timing exact, to update it 5 times per second with 200 new points?

     

    Remember that also Chart History Length gets in the way. Default is 1024 which is much less than 10sec * 1000Hz.

     

    Ah now that I think, for a waveform chart you don't even need to bother setting dynamically x axis limits. Update mode Strip chart does it.

    • Like 1
  10. Thanks Thomas and Jörg, I agree on both, and partially thought at them myself. Indeed a text file relieves from a changed project vi, and can be inspected without launching the program; and a tag allows complete freedom about version format; perhaps though, tagging should be reserved to "meaningful" versions, i.e. one might want to tag only semistable distributables and not systematically every snapshot, which involves a subjective decision.

    What I take home from this is - it's not that I haven't yet discovered some advanced option in the project explorer, it's that if I want something specific I have to program it myself with an automated build script.

    • Like 1
  11. I devised a lame way, which sort of works with some manual steps, but which I fear is the source of frequent odd compilation errors which I observe; for my current project it holds and I'm not enough motivated to perfection it, but on longer term I think I'll have to.

     

    I use git. I still rely on the project build specifications, not on a build script, so I have a build EXE and build installer step which I launch manually, normally just after committing to git. The former has a pre-build script which reads the HEAD identifier and the current date, and saves it as default value to a simple VI providing a string output; that VI is part of the project. One of the main panels of my application gets the version string from the small VI and displays it somewhere.

     

    Drawbacks I see are that modifying a VI part of the project as part of the build creates unnecessary source diffs; and that the git SHA is quite criptic to end users as version identifier.

     

    I also miss a way to name installers in a way reflecting their version; that I currently do manually renaming the Volume directory, I guess a build VI could take care of that easily too.

     

    Pre-Build Action.viGetGitSHA.viVersionString.vi

  12. drjd preceded me, I wanted to point at that too. Despite my asking there, at the end of the story for that case I'm using a generous number of copies of my cluster, like suggested, playing with visibility and position to show only those I need; accessing individual "elements" and manipulating their cosmetics via an array of their references, and opportune property-by-reference accessors.

  13. I'd also bet that a repair install of LabVIEW will fix any new VIs made, but doubt it will fix any VIs saved that were in this broken state.  You're probably going to need to contact NI for any real support.  But thanks for sharing.

    Seems that repair-install has fixed it, indeed; I'm going now through the cycle of re-upgrading to 2014SP1 after having install-fixed and f1-patched. Code fortunately is all RCS and routinely pingponged across three other platforms, so no tears. But anyhow, turns out that code was ok, local LV not. Same code opened regularly elsewhere.

     

    Thanks for the feedback!

  14. On one system I'm working on, which is not under my sole control, I suddenly noted that the default case of the Event structure is not anymore Timeout, but OpenBinaryLibrary. Moreover, in the Edit Events dialog, I see events for <Application> which I haven't yet seen, and get an error if I try to create a Timeout case with connected timeout terminal. Never ran into such a thing so far.

    Existing code using the Timeout event fails to compile, (Event data copy, err=1), or loads with messed up event structures (e.g. FitControlToPane instead of ValueChange). This is LV2014SP1.

     

    Anyone has any clue about what could have happened? Keywords to search for are perhaps too generic. I have already cleared the compillation cache and rebooted the machine, next to try would be reinstall LV, but I'm wary of starting a long cycle.

     

    TIA, Enrico

     

    post-28229-0-98608900-1435585137.png

×
×
  • Create New...

Important Information

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