jdunham
Members-
Posts
625 -
Joined
-
Last visited
-
Days Won
6
Content Type
Profiles
Forums
Downloads
Gallery
Everything posted by jdunham
-
QUOTE (Donald @ Apr 18 2008, 03:43 AM) Donald: Without real analysis of your data it is hard to suggest a better codec than the general-purpose ones you have tried. Different data will have better or worse compression with different codecs. If you want to approach the limits of Shannon's Law, you will have to find algorithms which can squeeze everything predictable out of your particular kind of data. If WAV compression (it supports many codecs, but ADPCM is pretty good for audio) is working well, I would just use it. Why don't you just keep all of your channels in separate WAV files at separate data rates, keep the metadata in a text file (XML?) and dump all of that in to a ZIP file just to keep it together as a coherent package. In our application we put metadata in a custom section directly in the WAV file, but I have been very disappointed how poorly this is handled by other software that claims to support WAVs.
-
QUOTE (ASTDan @ Apr 17 2008, 03:52 PM) It's sorting in alphabetical order, not numerical. "0", "10", "5" is in correct alphabetical order. Do you owe me a beer?
-
Conditional Disable in build settings
jdunham replied to Ton Plomp's topic in LabVIEW Feature Suggestions
QUOTE (Doon @ Apr 15 2008, 12:14 PM) I totally agree. We are actually reading the lvproj file (it's XML) and modifying the Conditional Disable symbols programmatically and then reloading the project so that we can build multiple flavors of our product. It's not terribly hard, but there should most certainly be VI server access to the symbols. -
Hi Irene: Thanks for starting a dialog. At the risk of embarrassing myself and making other people angry, I'll try to chip in. It gets diffiicult because I think you are mixing some of the issues between people and cultures on one hand and governments on the other. I will also present a 'Western' view point in a mostly positive light, but most people don't think our culture is 100% good, and we certainly don't think Chinese culture is bad at all. QUOTE (Irene_he @ Apr 10 2008, 12:13 PM) Every government has ideals and standards which are difficult to live up to. A huge number of the people where I live (and everywhere in the US nowadays) oppose the Iraq occupation and are upset by the untruths that were told on the way into the conflict. But despite that, everyone here hopes that the Iraqi people will end up with less misery and suffering and more freedom and opportunity then they had before. Promising this is the only way our politicians can keep funding the war effort. It does seem likely that Tibetans have better access to healthcare and basic necessities with Chinese administration. Of course we don't really know if that makes Tibetans want to be part of China. I have read that it is against the law for Tibetan people to support independence at all, so we're not going to find out how they feel unless they start rioting in the streets, or unless Tibetan people can escape and tell their stories in other countries... Part of what you see as a double standard is Americans not wanting to see our own mistakes repeated. At one time, half of the states in our country no longer wanted to be in the USA and the horrible war that happened as a result was just the start of over 100 years of problems. Before and after that war, American pioneers wanted the land occupied by Native Americans and solved the problem with extreme brutality and ultimately a genocide. A lot of Americans are ashamed of this, and since we can't fix the past, we can try to prevent it in the future, even if it means we will be criticized for hypocrisy. QUOTE (Irene_he @ Apr 10 2008, 12:13 PM) 2. Certainly there are deep misunderstandings about China and it's people, thanks for massive western media. For many people that never travel and see the other part of world, media is certainly the only window they see the world and build up their mind. From my experience, minority nations in China such like Tibet (if you don't know, China has many different minor nations, not just Han) gets priorities in school and extra benefits and discrimination had never crossed my mind when they were my classmates, I didn't know any difference between them or others. There is a long history about Tibet being part of China, why is western so exciting and passionate to separate it from China?? Would you like to give a piece of your country land to others? Although I do hope through this incident, Chinese government has to think about what more they can do for Tibetan people and how to best handle this issue. One thing that is different between our country and some others is that every state, city, and village in the USA is filled with an overwhelming majority of people who are proud and happy to be US citizens and would not want to break away and be an independent state. We don't have exiles spread over the world seeking to change the government from afar. Is the same true for Tibet? QUOTE (Irene_he @ Apr 10 2008, 12:13 PM) Would you like to give a piece of your country land to others? If China returned Tibet to the Tibetans, how would that be 'giving it to others'? Protesters are not asking them to give Tibet to anyone, but to let the people who live there determine their own form of government. Kosovo just declared independence from Serbia. Other countries including the US encouraged this, not to harm the Serbian people or to insult their culture, but because the vast majority of Kosovars yearned to stop being Serbians. The Serbian government denounced and blamed the US, EU, and UN, but never seemed to acknowledge that their own behavior and oppression caused the situation. I think there is a lot of sympathy as well for Kurds, who would much rather form their own nation than be suppressed by their governmental 'owners' in Turkey, Iraq, and Iran. Whether governments get involved or not depend on money and politics (unfortunately), but Americans generally think that people should have a government that they choose. This very short Wikipedia definition sums up a core belief of many Americans, and I believe that includes many of the Chinese-Americans who are my friends and neighbors. QUOTE (Irene_he @ Apr 10 2008, 12:13 PM) 3. Human rights and freedom has a limit, how much do you want? Again, I agree China has to improve more, but how worse is it at all? Is it like hell like what western media has told their people (especially those never see other part of the world, they would believe it so firmly)? The answer I guess is no. My parents and my sisters are in China, they live in a comfortable harmony. The untrue report from western media actually angers more normal chinese people, the dishonest media just help them to realize that the once admired western world is actually quite "evil" and people will open their eyes and the colorful ring about western's democratic disappears. Some of the other postings were skeptical about western news organizations and I would agree. News companies need to make money, and stories about how everyone is happy and friendly don't sell newspapers. I think most Americans understand that Chinese people work hard and love their families and are patriotic for their country. At the same time, I'm also not sure what you are referring to. I'm sure that some media reporting is severely biased, but can you give some examples about Tibet? The media often reports what the Xinhua News agency releases, and a lot of it doesn't sound very nice. There is certainly "evil" in the western world, or anywhere in the world. Anywhere there are people and money, there will be evil, and that includes China, the USA, Canada, Germany, Saudi Arabia.... Democracy doesn't appear to be able to solve all our problems, but do you think it's evil? Do you think places without democracy are less evil than places with it? QUOTE (Irene_he @ Apr 10 2008, 12:13 PM) 4. Why does western want so desparately to push China to think as they think, get the same value as they do. Maybe afterall, it is still a culture thing, and western thinks they are the best, everybody else thinks differently should be cleaned out. If everybody thinks the same, same culture, what a boring world that we would have! Well there is definitely some culture there. Western society and government has been dominated by Christianity for at least 1600 years, and going throughout the world and converting others is a core belief. A lot of Western people might agree with you that this is bad, and it was the driving force behind some profound evil in the past, but you asked for the reason. I have to say that many more Chinese people come here and want to be citizens of the USA, and Americans are proud of that. I haven't heard about too many Americans who want to change countries and become citizens of Communist China. Some of our success in attracting immigrants is purely economic, but some people desire freedom, even if they get here and things aren't as free and easy as they expected. QUOTE (Irene_he @ Apr 10 2008, 12:13 PM) 5. At the end, self center, individual value, distance between human beings is important in western world's value. I miss so much the close distance between human beings, the harmony and good willing between human beings, everytime I visit my parents, the warm feeling of human touch overwhelm me and I want to say, please don't try to turn chinese people into the same value as western's just because the westerns don't know or even taste the wonderful feeling of human touch. I get those feelings around my family too. It might be a cliche, but I have to say that our cultures are more alike then they are different, especially between individual human beings. It's possible you found different experiences here and in Germany, and I'm sure it's hard to live so far from home. Like many Americans and just about all immigrants, I now live in a place thousands of miles away from where I grew up. I don't think we want to turn Chinese people into Americans or Westerners. If I go to Shanghai, I don't want to see McDonalds and Starbucks and Nike every time I turn around (too late, probably). That's globalization, and governments on all sides (except Iran) seem to want to make it happen as quickly as possible, since there's good money in it for the elites. OK, I'm stopping there. Someone else can 'carry the torch' on that one. I hope you aren't offended that I argued with each of your points. I think it is likely that we would agree on many things, both politically and personally (especially that LabVIEW is cool). Jason
-
Map, implemented with classes, for 8.5
jdunham replied to Aristos Queue's topic in Object-Oriented Programming
QUOTE (Q^Q @ Apr 11 2008, 09:42 AM) Well that's great news. I don't know what it would take to get into a real LabVIEW release, but that would be welcome. If the tool can never graduate from NI Labs in to NI LabVIEW (shipping version), it really isn't much help. Did you find/fix the problem where deletes got into an infinite loop? If you wan't some extra homework, it would be extremely useful to be able to independently lock items read from the map so that a save read-modify-write cycle could be performed on a LabVIEW diagram. This can be done with LabIEW semaphores, but then you are adding an O(n) performance hit to get the semaphore. Thanks for your efforts Q^Q; it's very encouraging. -
Map, implemented with classes, for 8.5
jdunham replied to Aristos Queue's topic in Object-Oriented Programming
QUOTE (Aristos Queue @ Apr 9 2008, 11:40 AM) The Xnode version is the pink line. I think it's safe to say it needs some performance tuning, though it's not as bad as my original version of the balanced binary tree map. Also, the delete operation would freeze up every few tests, ending up in what seemed to be an infinite loop (didn't have infinite time to verify that). http://lavag.org/old_files/monthly_04_2008/post-1764-1207818730.png' target="_blank"> -
Map, implemented with classes, for 8.5
jdunham replied to Aristos Queue's topic in Object-Oriented Programming
QUOTE (Aristos Queue @ Apr 9 2008, 03:20 PM) Yes. Those tools are pretty close. The implementation seems to be by-value, which is not as useful as the queue/notifier by-reference model. Of course one could use a notifier to implement the name lookup and referencing. The biggest problem with the NI Labs code is that it hasn't been released yet. The NI pre-release license is very specific that they are not to be used in production code or built into any application I might distribute to anyone. The benchmarking and other fiddling around is just about the only thing I can do with them. There was also some weirdness with cluster element name changes not propagating, but that's not very harmful. That was reported in the discussion forum http://forums.ni.com/ni/board/message?board.id=nilabs&thread.id=5' target="_blank">here. I don't really care for the oversized icons, but I guess that just makes me a whiner. That could be overlooked if the library were releasable. Jason -
Map, implemented with classes, for 8.5
jdunham replied to Aristos Queue's topic in Object-Oriented Programming
QUOTE (Aristos Queue @ Apr 9 2008, 11:40 AM) OK. QUOTE (Aristos Queue @ Apr 9 2008, 11:40 AM) Oh, I'm pretty sure this solution will beat all others someday. From the theory side, it'll blow just about everything else out of the water. We're still in unexplored territory with this, and there may very well be some stupid implementation detail that is getting in the way. In school, I was once debugging a program that should've been blazing fast, only to find that in my delirium I had written code that instead of calculating a constant and storing it was recalculating a constant every time I needed it. It wasn't even relevant to the algorithm, just happened to be a needed constant. There is almost certainly something like that somewhere in the LVClass code. I'll grant that it may take a few years to iron out, and in the meantime, enjoy the acceleration of the variants. Well the tree rebalance requires a few conversions between generic map nodes and branch nodes, and there is a buffer allocation at each of those. As far as I can tell that's killing performance, but I don't know enough about the inheritance implementation to know whether that conversion could be done without a copy. There are other branch class subvis that also show buffer allocation on bother input and output, and I don't know why, since a dynamic dispatch terminal is used on both input and output and the wire does not branch. QUOTE (Aristos Queue @ Apr 9 2008, 11:40 AM) It might be because I've never heard of this idea before. What exactly would this be? Well I know various people have asked for a hash table. I asked Brian Powell for this at the last NI Week and he basically said the idea of wrapping up the C++ STL (which includes maps) had been batted around for a while. I realized we could just wrap up STL's hash_map ourselves, which we are working on (I doubt I will be able to release it though, sorry). When thinking about a LabVIEW API, I am trying to make it as close to the Queue and Notifier API as possible, since those work pretty well, and LabVIEW users are accustomed to how they work, with respect to named versus unnamed references, and the timeouts, and the release or destroy . Whereas queues are FIFO access to a by-reference data collection, the hash map could be associative (named) access to a by-reference data collection. One feature that I am going to add is that you can request a lock on an item so that it can be modified on a block diagram and reinserted into the map without danger of a race condition. If you want more input, maybe we should start a new thread about the design, but I thought the need has been evident for a while. (given the amount of time and energy which has been put in by various people inside and outside of NI). Anyway, if you did this in LabVIEW with polymorphic (strictly-typed) functions, it would be way better than what I am going to make. [this is exactly what Jim Kring just wrote. +1] -
Map, implemented with classes, for 8.5
jdunham replied to Aristos Queue's topic in Object-Oriented Programming
Ok, I have also been curious about some of the issues raised by Tomi, so I added some more map types and improved the benchmark tester with some dynamic dispatching wrappers. I fixed some of the problems with the AVL-rebalanced binary tree, but it still is not as fast as the unbalanced tree. I tried to play a game of hide-the-dots to get rid of unnecessary buffer allocations (usually data copies) but with only limited success. It's possible that it could be fixed, because a lot of time is spent rebalancing the tree. There might be tweaks to make it rebalance fewer times, or to eliminate some of the memory copies made during rebalancing. Overall it seems like a lost cause. Sorry, AQ, but I think some problems were just not meant to be solved with by-value objects Variant Attributes still have the best performance. I know that in older LV versions they were terrible, so kudos to NI. The graph on the left shows the best performers, and the graph on the right is the same data, zoomed differently so the worst performers can be compared (Right graph's X axis shows smaller data sets and its Y axis shows times a couple orders of magnitude slower) I made another map consisting of a hash table of queues, which is a reasonable pure-G implementation. The hash lookup returns an unnamed queue containing the stored value, so the hash map only stores the queues and their keys, rather than the actual data. Each hash bucket contains an array of queues, so if there is a hash collision (two items hash to the same bin) then the map has to do a search for all the items in the bucket. Since queue references are pretty fast, this method gives the variant attributes a run for their money. The insert and delete times were not as great as the fetch times, but for my application that's perfectly acceptable. Since it uses singleton queues, there is also a locking feature, so you can safely modify an item and replace it in the map while other threads can either preview the data or wait their turn for a locked copy. At the end of the day, I don't know why NI won't prioritize adding a nice associative array function to the Queue and Notifier palette. It would be extremely useful to have a fast and polymorphic set of built-in functions, and the strong typing of the queues and notifiers would be a big improvement over using variant attributes, not to mention that variant attributes can't do locking and seem like a crazy hack anyway. Here are the VIs so that you can play along at home... Download File:post-1764-1207693477.zip -
Calling a dll that returns a buffer full of data
jdunham replied to george seifert's topic in Calling External Code
QUOTE (george seifert @ Apr 4 2008, 09:08 AM) At least as imporant as loading the DLL would be posting the function prototype from the Keyence header file (and other C typedefs it uses). -
Wire Style Guidelines for LVOOP
jdunham replied to Norm Kirchner's topic in Object-Oriented Programming
QUOTE (Darren @ Apr 4 2008, 09:55 PM) I agree that it would be great to have the wire color match the banner color, since I always change them to match. However the banner is colored for black text on the color, so it should have a high value (HSV color model). In contrast (lame pun intended), the wire (and the matching bundle/unbundle text) is almost always against a white background, so it needs a low value with the same hue. Unfortunately the best value numbers vary a bit with hue, but your local graphic designer should be able to tell the best way to get around this. My preference is to use gray wires and banners for abstract classes, which are always intended to be overridden by an inheriting class -
How to create a tree structure without using the control?
jdunham replied to Daklu's topic in LabVIEW General
QUOTE (Daklu @ Mar 24 2008, 12:17 PM) Don't be scared. You don't have to do anything with the classes. I modified part of that library and one of the things I did was to clean up the API so that you can use it right out of the box. Maintaining it should be extremely easy. The only thing is that initial reports (see the end of that forum thread) say that it doesn't run as quickly as expected, and AQ apparently hasn't yet had time to figure out why. -
Are you using the IMAQ driver for acquisition? If so, that's what IMAQ Copy Acquired Buffer.vi is for. You also should be using a Ring or Sequence Grab, so that you can make a buffer large enough to let your program recover if it falls behind a bit. Did I understand your issue correctly?
-
How to create a tree structure without using the control?
jdunham replied to Daklu's topic in LabVIEW General
Have you checked out the Map Class? -
Best way to interface LabVIEW to SQL Server
jdunham replied to John Lokanis's topic in Database and File IO
QUOTE (jlokanis @ Mar 13 2008, 04:33 PM) John, We log tons of data to SQL server, sometimes a few dozen statements per second. The main optimization we use is that all statements which don't require a reply are sent in to a LabVIEW queue. Then a separate process flushes the queue once per second, concatentates all of the query statements, and inserts them a single ADO call. This process is not using a significant percentage of the CPU, so we could probably be logging a lot more. If you need to return results, then it seems like you are doing more than just logging. Our system also needs results sometimes, and while those calls can't be batched together, we can still call several queries per second. Good luck -
I stuck with the tab key and auto-tool off, because it seemed like the hot-spots were too sensitive. I know which tool I want and it is easier to make it happen with the tab key then to try to find the hot-spot with my mouse hand. I also end up using a trackpad more than I'd like, and I think it is more of a pain with the autotool. However if some of you are saying it's better, maybe I should give it another go.
-
If you are getting paid to do this, then you should use a real database. Microsoft and Oracle and Sun/MySQL have solved this problem. They spent billions of dollars doing it. If you are compelled to do this the hard way (that is, for homework), than I would look more closely at LabVIEW's "Set File Position" primitive. Good luck, Jason
-
QUOTE(lizimunro @ Feb 25 2008, 04:08 AM) I think you will do yourself a favor by getting rid of the express vi. just read the system time before you start, and loop every 100ms. In every iteration, check the elapsed time the old-fashioned way: subtract the start time from the current time. You will also get a pleasing side-effect in that your STOP button will be polled at the new faster loop rate, so you can stop the loop right away rather than waiting for a minute.
-
QUOTE(JOliver @ Feb 25 2008, 10:08 AM) What kind of timing do you need? Does the motor need to be polled, or does it constantly send position updates? Serial ports are inherently asyncrhonous, so there isn't usually a means to trigger a serial reading via a hardware trigger signal. I would probably write labview software to poll the analog input for your trigger condition, and then request a new reading from the motor. The problem is that this will usually take 10-100ms to get a response, but maybe that is good enough. To get a bit faster, you could set up the motor to stream position updates at you and grab the latest one when your analog trigger condition is satisfied. It is pretty easy to do this with a LabVIEW Notifier. The serial reader loop puts readings into the notifier, and a separate analog trigger loop reads the notifier and uses the value. If you need more deterministic (guaranteed) response time, you may need a different kind of motor controller.
-
QUOTE(JDave @ Feb 25 2008, 11:18 AM) A different way is to run the local variable into an Array Subset function with none of the other inputs (index or length) wired. You will always get an empty subarray out of that, which is fine for initializing your shift register. You may get a bit of a memory penalty on using the local variable, but 99.9% of the time it doesn't matter. I usually use the block diagram constant (always a typedef!) crammed into a small sequence structure, rather than making a subvi, but the local variable trick is fine too.
-
QUOTE(Tim_S @ Feb 25 2008, 03:30 AM) The median filter is probably the best at removing spikes. It doesn't add any phase delay. The filter is nonlinear, so it's harder to analyze than a moving average or butterworth filter, but if your only goal is to remove noise spikes which are polluting your data, then it's the best.
-
Replace constants with icons on block diagram
jdunham replied to Daklu's topic in LabVIEW Feature Suggestions
QUOTE(crelf @ Feb 19 2008, 03:23 PM) Chris is 100% right about not wanting diagram constant values to be hidden. The best LabVIEW diagram is one you can look at and see how it works with a minimum of opening stuff, right-clicking and mucking around. Theoretically you should be able to print out a VI and have a record of how it was coded, even if the various case structures have to be printed in that weird way. The express VIs don't really show any evidence of how they operate, unless you change them to icons. However, I never fill in any of the contents in a typedef cluster constant. If you delete an item from the cluster, then often the cluster will revert to all default values. It vaporizes whatever you had stored in the constant, without the slightest warning of course. I just tested this, and actually it only seems to destroy your block diagram values if you delete an earlier item in the cluster. Anyway, this has burned me a few too many times. So now I always use a bundle function to explicitly initialize non-default items in a cluster. That way it is very clear which values I care about initializing and which values I don't. I would prefer the actual constant to be hidden behind an icon, so I'm not tempted to change the values in there. -
QUOTE(eaolson @ Feb 19 2008, 11:08 AM) Sorry, your code isn't accurate. Your graph reads in milliseconds, and you are assuming that your 20ms excursion is divided evenly among all 1,000,000 iterations of your empty FOR loop. It's much more likely that just a few of those iterations are taking the a large part of the excursion. I ran the code anway, and I found excursions between 200-350 ms when I opened up Excel, Word, or Acrobat Reader. So if you can keep any of your users from ever running other applications then you are more likely to get deterministic performance. If there isn't risk of human life or limb, you can still try to run a quasi-real-time acquisition and control loop, and it will work pretty often. OK, I see that the original question referred to QNX. Note that if you use an NI-DAQ board, you can get more accurate timing with a Timed While loop
-
Replace constants with icons on block diagram
jdunham replied to Daklu's topic in LabVIEW Feature Suggestions
QUOTE(Daklu @ Feb 19 2008, 11:52 AM) My solution to this is just to drop the typedef contant into a sequence structure, and then resize the structure to something I can tolerate. If I'm feeling organized, then I also label the sequence structure with the name of the typedef. I agree it would be nicer to have a "display as icon" option. You other option is to convert the cluster to an lvclass, but I am a bit down on classes since the data is not visible on my front panels. -
QUOTE(neB @ Feb 1 2008, 10:17 AM) Well you are probably right, but just because DECnet may not have used TCP or UDP doesn't mean it didn't implment some of layer 5. Even if they rolled something proprietary, the point of the OSI Model is that whatever knows about the data is classified as layer 5 and above and you are not going to be able to get access to the data without vendor documentation or an open standard on how they implemented layer 5.