Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/05/2011 in all areas

  1. I had almost finished composing a message last night when I accidentally hit the "Back" button on my keyboard. Ah, the joys of browser-based text editors. Note that "QSM" means different things to everyone. I don't use what *I* consider the QSM, but I do use queued message handlers. QMHs look a lot like QSMs, but the difference is in how they're used and what's expected of it. In this post I'm primarily referring to a dual loop "producer-consumer QSM" Absolutely not true. The QSM is the most common implementation seen because that's all most people know. And truthfully, it probably is sufficient for most Labview users. There are lots of architectures and patterns available. Though Labview is different from common text-based languages, it's still software. The patterns and architectures that apply to those languages can apply to Labview as well. As an aside (and I'm probably in the minority) I don't think the QSM qualifies as an "architecture," though people often refer to it as such. The QSM is an implementation, not an architecture. Calling it an architecture is kind of like saying my house is built using a screwed butt joint architecture. A "screwed butt joint" (and the QSM) is a construction technique, not an architectural description. So when someone says their app uses a "QSM architecture," I read that as, "My app has no architecture." Usually I'm not far off. There's nothing inherently wrong with state machines. When used appropriately they are very useful. Queued State Machines, however, aren't state machines at all. They're a convenient construct for sequencing code segments. Your question implies you're looking for a single, general purpose design that works across all requirements. So no, there is not *a* architecture that works well. Like Ben said, there are lots of architectures and design patterns, each with their own strengths and weaknesses. The software engineer's job is to pick those that meet the requirements. Pick one that's too complex and you have to implement a lot of useless code. Pick one that's too simple and you have to resort to hacks to support functionality the architecture isn't well suited to provide. My apps are composed of several different architectures/patterns, depending on what level of the code you're looking at. Event based, Model View Controller, object state machines, active objects, etc. Lately I've been moving towards highly decoupled components that use messages to send and receive information with a mediator handling all message routing and translation between the various application components. 1. I got tired of the messes that resulted from using QSMs. 2. They are fragile. Many implementations have inherent flaws that can't be fixed. 3. They are hard to follow. QSMs are a lot like GOTO statements in text languages. 4. They don't provide any structure. Good architectures are designed with clear extension points for adding functionality. 5. There's often no easy upgrade path to something more suitable when the requirements outgrow the QSM's abilities.
    3 points
  2. I don't really like playing with event references like that, because they have unpredictable behavior under these circumstances. For example, I modified your example by adding this event and case structure before the loop: If the event structure executes (case T), the array is empty. If it doesn't (case F), it's full. Can you explain why? You're welcome to have a look here for more details (including from the horse's mouth) about the relation between reg refs and structures, but I don't pretend to safely understand all the intricacies, but that's possibly because I never had a need for such an architecture. I'll leave you guys alone to hash it out.
    1 point
  3. They are fun until you see things like this: ^(?((Jan(uary)?|Ma(r(ch)?|y)|Jul(y)?|Aug(ust)?|Oct(ober)?|Dec(ember)?)\ 31)|((Jan(uary)?|Ma(r(ch)?|y)|Apr(il)?|Ju((ly?)|(ne?))|Aug(ust)?|Oct(ober)?|(Sept|Nov|Dec)(ember)?)\ (0?[1-9]|([12]\d)|30))|(Feb(ruary)?\ (0?[1-9]|1\d|2[0-8]|(29(?=,\ ((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)))))))\,\ ((1[6-9]|[2-9]\d)\d{2})) Regexlib.com is a great place for 'em. And each one has a test button so you can try it out on your own strings
    1 point
  4. No. It's probably because I was beginning to play around with them and thought they were fun. (I still do. ) Bonus link.
    1 point
  5. No, so here... jcarm-ReqHatch.zip Run jcarm-ReqHatch/Code/ReqHatch.vi to see it work. Let me know if y'all think that it can be extended into something useful. There's a lot of work left for me to do, and I hope to work on soon it with my next ATE project.
    1 point
  6. I'm not an auto-tool fan either. It wires when I want to select and you have to select breakpoints and colour chooser anyway.... drives me mad. I'm a Tab and space-bar freak.
    1 point
  7. Ok, this is cool. It's not exactly LV, but it is computer science, and since LabVIEW is dedicated to making CS more accessible to non-programmers, I decided this fits the Design & Architecture theme. Background: There are different processes that can be used to sort data. Some LV users may just know the Sort 1D Array primitive, but under the hood, that primitive implements a particular sorting algorithm. Different sorting algorithms have different performance characteristics. Some algorithms are categorically worse than the others. Some are really efficient on different types of data -- some work well when the data is completely random, others when the data is already nearly sorted, some are very efficient when the data is too large to fit in memory and has to be occasionally loaded from disk. Understanding what is actually going on with each algorithm is sometimes hard to grasp for students, especially if they're just reading source code. Someone has taken various sorting algorithms and set them to music and video. How? He sorts an array of randomized numbers, and every time two values are compared, he plays a tone of the frequency of the value. For some sorts, as the array gets closer to sorted, you can hear the sound becoming ever more like a single rising scale. For other sorts, it gets closer to silence since those sorts don't have to keep checking back to see if they have all the data sorted. Here are the Youtube links: Insert, bubble, selection, merge, and a gnome sort: Heap sort:
    1 point
×
×
  • Create New...

Important Information

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