-
Posts
590 -
Joined
-
Last visited
-
Days Won
26
Content Type
Profiles
Forums
Downloads
Gallery
Everything posted by ensegre
-
http://rationalwiki.org/wiki/Not_Even_Wrong#Examples
-
Growing large arrays in loops, which is what you're doing, is slow at any rate, because it involves reallocating and copying at each iteration. I would preallocate the array Y and fill it in the loop with replicas of the basic chunk.
-
inspect queued events in a compiled application
ensegre replied to ensegre's topic in Development Environment (IDE)
So ditto: it is an opaque implementation, there is a critical password-protected subvi, hooovah though about three weeks before me, I don't really need it but why not asking... I kudoed the idea.- 12 replies
-
- event inspector
- dynamical events
-
(and 1 more)
Tagged with:
-
inspect queued events in a compiled application
ensegre replied to ensegre's topic in Development Environment (IDE)
Much plausibly so. By now I've found the reason for my bug, actually elsewhere than in the time difference between the events. Nevertheless, the discussion helped. I have among the rest used what pawhan suggested to exclude simultaneity in the application, and went on pondering the faulty logic to find the true reason. @shaun: yes, it was an academic question... I used queues with timestamped data too, when I needed so.- 12 replies
-
- event inspector
- dynamical events
-
(and 1 more)
Tagged with:
-
inspect queued events in a compiled application
ensegre replied to ensegre's topic in Development Environment (IDE)
Right, that is a quick way and fits well my need of knowing the event fired timestamp; and when it is about filtering out just a couple of events out of many, it's really easy to set up an additional concurrent while loop with an event structure for them two. Thanks. However, remark, this doesn't give access (not that I really need it) to further information visible in the Inspector, such as the event and queue number. I would have expected some queue accessor from the Events Palette, like Preview Queue Element or Get Queue Status for regular queues. The only one of this kind, on the Events palette, is Flush Event Queue.- 12 replies
-
- event inspector
- dynamical events
-
(and 1 more)
Tagged with:
-
Debugging an application of mine, I ran into a very possible occurrence of https://lavag.org/topic/9986-out-of-order-events-is-not-a-bug-sort-of/ . Now, I have reasons to suspect that, due to some race, while in the IDE I have a positive timestamp difference between one certain dynamic and another user event, in the compiled application the two can be nearly simultaneous. Enough for treating the race in the first place, but academically wondering: in the IDE I can help myself out with the Event Inspector; can anyone suggest a way to filter and display information from the event queues in the apps? Looking at the GUI of the Event Inspector, that looks like one of these many tools written in G, modulo using password protected blocks, I haven't been diligent enough to search for its whereabouts yet. LV2014.1. Otherwise, for the present case, I suppose that just sequencing the event generating blocks together with a Clock Tick and displaying the results may do, for the debugging I need. TIA, Enrico
- 12 replies
-
- event inspector
- dynamical events
-
(and 1 more)
Tagged with:
-
LabVIEW RS232 Serial Read Write Application Com Port Freeze Up / Stuck
ensegre replied to Tim888's topic in LabVIEW General
Another potential factor is EMI. Supposedly interference may set those chips in odd modes, so improving grounding and shielding might help. But all together, I think the cheapest and fastest option is to try out different usb-232 dongles. -
LabVIEW RS232 Serial Read Write Application Com Port Freeze Up / Stuck
ensegre replied to Tim888's topic in LabVIEW General
cheap usb adapters are known precisely for that problem, and I run into every now and then. The only cure known to me is to unplug/replug the usb, or reboot the computer. I remember long shaming threads on ni fora, on the topic "but VISA write should timeout". "No, it's not NI's responsibility, it's the driver function". "yes but" and so on. ETA: for instance http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/VISA-Read-hangs-Get-Resetting-VI-dialog-on-abort/m-p/2004797#M53616 -
Since the day I upgraded I haven't seen the problem any further, so perhaps that would be your best option too. It is ubuntu 14.04 here.
-
Right, it works. I thought I also tried that, with the continuously running subvi. Oh, I see -- I set the subvi property as "run when opened" and just inserted it in the subpanel -- forgetting that VIs in subpanels are not "open". Thanks for the tip...
-
I ran into this; I wonder if I'm misunderstanding, or it's a bug. 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
-
Apparently, xml for an empty variant is different than that for a variant with some typed data content; you can circumvent that flattening the variant:
-
comprehensive project metrics
ensegre replied to ensegre's topic in Application Builder, Installers and code distribution
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 -
Would this do, then? The assumption is that the first column of the line is the pin number, then further columns can only be ON, OFF, a waiting time in ms or empty to end the sequence.
-
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.
-
Several ways. Two for example: in edit mode, click twice on the eighth button, which populates the array. Left click, Data Operation->Make current value default, Save VI.
-
comprehensive project metrics
ensegre replied to ensegre's topic in Application Builder, Installers and code distribution
I see. Yes, maybe someday I'll play and will put together a tool of my taste. Indeed I see that to get odd vi properties is not difficult; I quickly put together the following as a proof of concept without bothering for recursive descending of the project hierarchy and item discrimination, maybe on some rainy day. -
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?
-
I would be looking at something related to <lvdir>/resource/dialog/PreferencesDialog/PreferencePages/prefPage_Misc.vi, but haven't yet figured out what.
-
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: 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. 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...
-
inverter voltage and ampere data taking with usb rs485
ensegre replied to petrusgunawan's topic in LabVIEW General
If your instrument talks modbus (you say), then you have to talk modbus to it. This has little to do with the programming language. I attach a snippet of mine which I've used in the past to check basic communication using the library referred above, hope it helps. ModbusTester.vi -
inverter voltage and ampere data taking with usb rs485
ensegre replied to petrusgunawan's topic in LabVIEW General
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. -
Text control- text color gets reset after char append.
ensegre replied to Sharon_'s topic in LabVIEW General
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. -
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]
