Jump to content

0_o

Members
  • Posts

    194
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by 0_o

  1. Back to topic (a month later)... I'm using LV 2011 and I have kinda the same problem. I added the same subvi to all my write member access vis with property nodes. Even though is was a regular subvi, once I tried writing to multiple property nodes from the same property node block LV said I tried a recursive call and stopped the execution of my project without even getting to an error wire, simply finished the execution on the spot. I guess inline should solve it since once I copy/pasted the code it wirked just fine. However, for some reason, I can't find the inline subvi option anymore under the execution option in the properties menu. I can understand why LV didn't like me doing it, even though it should have been more polite, yet, turning the vi into reentrant should have solved it and it doesn't. You simply can't call a recursion from inside a member access vis and from what Jon wrote it seems it is not the only place this option causes problems. To sum it up, I guess LV can't handle a parallel recursive call to the same class from inside some blocks and NI needs to document this scenario more. P.S. - moreover, you can't call a property node of the same class from within a member access vi of the same class that has a property node.
  2. Hey James, Not only that the code looks like a sample from the post about spaghetti code but it is also not just a case of cut and paste because of all the references, for example. Most companies won't give you a complete list of requirements up front. They ask for one thing and keep changing/expanding their demands under a very short time schedule, resulting in a code that looks patched and glued all over with many versions for the same operations since you don't even remember that you once wrote a kind of patch that you just now need to write again. The separation level of the old code is basically a separation between the highest level of tools in the product with all the resources being handled and shared from the main ugh product that has similar a bit changed and smaller versions of itself. Anyhow, my question is what's wrong with the design I suggested? Can I use the class control as a DB and just update the front panel as a GUI while the block diagram is the Logic? This way each class has its own db, logic, gui separated and it can be inherited as if a db was an API as long as the FP labels are locked. The final code looks like several parallel loops with a single db wire running in the middle of them all supplying whatever information the logic needs. I know that the traditional way is different but I don't really understand the benefit of using it and I haven't heard of someone using my way, thus, if there is no LV architect here that can help, I'll have to find it's downside on my own. The main problem that bugs me is: will the class be fast enough as a db (what happens if the class is big? will it be copied to sub vis even if I use DVR? Is the access to it fast as the access to a tdms/binary file or slow and serial like a text file? Will it remember past values and eventually make the app bigger? What should I watch out of while using it: rename/typedef...) and will the esf protect me from race conditions without slowing my code or even freeze it completely by pausing a code that is needed for the code with access to the db to finish for example or even some hidden issues with reentrant vis or something more devious. Thanks.
  3. Hey James, I agree, in an ideal world I would do just that. However, in order to decide what is a separate class, like a camera, inside an old project with >1000 vis I'll need a year of designing. It will be unrealistic since the time it takes both to create a new design and to go down and understand why the old code was implemented the way it was is not something most companies will consciously do. Just trying to separate one class out of a non OO design without a proper design of the entire architecture is a door open for bugs and endless redesign. Thanks for taking the time! You are right that without an example my post is very hard to understand. I need to know if my way is simply possible or will I have trouble accessing the class control fast enough almost simultaneously. I'll try and upload a simplified example till Monday. DD.
  4. Finally!!! A reply!!! Thanks!!! P.S. - on the way I found several LV bugs like, for example: 1. Property node of a control with label that has two lines - impossible. 2. Property nodes of arrays might cause memory crash because of access violations. 3. Changing the name of a class in an auto populating folder is a bad idea. 4. vi in a sub panel has less permeations in the vi server 5. Build reference -> property node (name) is read only and won't update once I change the build reference's tag that contains the name thus creating a build with one name in the project explorer and a different name in the build description wizard. I’m still waiting for an input about the entire design. Thanks in advance, DD.
  5. What was I thinking writing such a long post?! Will a zip with a project example to test on help? It will take me till the weekend to write one down...
  6. As I wrote in my second post, you might have to pass a lot of wires or the data you need is limited to the caller like in the case of local variables or events. Besides that, you might have to deal with reantrant problems or race conditions / neck / parallel issues.
  7. Shaun, I understand that this is how it works, yet, the state machine hooovah sent behaves the same way. My question was: what is the proper way to do the operation I gave in my example using a state machine / event loop? Neither do I want to signal events nor do I want to queue string commands since in both ways the logical order of operation is broken. Replacing the code with sub vis solves it yet I feel that it is not optimal. I'll try and explain my motivation again. Regular cases are the basic operation of the system, however, the cases that call other cases are a higher level of operation, a kind of automation in order to make my system idiot proof. I could either set this automation using the sub vis or I could use a parallel loop that waits for the first loop to idle between operations. Is there a more elegant way to implement it without the down side of the limitations of a sub vi or the risk of race condition in the parallel loop? Thanks in advance.
  8. Thanks for the vi. I have a few problems with this solution: 1. First of all it doesn't implement MVC; the GUI will freeze while a previous event is handled, so, I separate the loops with a producer consumer. 2. It still doesn't answer my main issue. Event 3 should have called event 3, then event 1, then event 1 again since this is what event 2 does and then event two, yet, the event case 3 doesn't trigger the event but simply calls the cases. The logic of an event is separated in your way into two parts: predefined sequence of operations and an action. I want to call an event, analyze it's output and then call another event, how will you do it? Can a case trigger an event or is it not allowed? 3. There is a great chance you'll have a typo in the events names (even just a simple lower/upper case) and it's hard to change an event's name even if you turn it into a typedef. Besides that, it is hard to debug queued state machines even after I add a proper logger, error hendler and a good stop mechanism. Paul, I attached a vi with an example of the bad way to use an event loop. press "add and multiply" (result is 2 - numeric fields are set to 1,2,3) (x=(x+1)*2) press "call add and multiply and then div" (result is 3.333 instead of 2 since div was called first) (x=(x/3+1)*2 != x=(x+1)*2/3)) my current solution is having each event in a sub vi and instead of signaling an event in "add and multiply" and in "call add and multiply and then div" I simply add that event's sub vi. bad event loop coding.vi
  9. If this wasn't long enough then I wanted to add that I pass the class between parallel loops as a DVR which is controlled as a singleton through ESF. Thus, each section of the logic that needs access to the db will ask for permission and lock the db till it is finished doing what it wanted to do. LV is great with classes inside a DVR, you can use properties on it just as if it was a regular class.
  10. Do you mean that the user triggers the event while each event usually just triggers a case? This way my main code is in cases and if I need to trigger another case from one case I won't be using value signaling. However, each case will still have the problem I described: if case one needs to run case 2 and 3 during its execution then those cases will still be triggered when case 1 is done. If I understand you correctly you want either the cases to be pure so they won't need to call another case until they are finished or you wanted me to copy all the sequence of operations into a single complex case which might cause multiple copies of the same code (with small changes or bug corrections between them). As I said, I'm working on a VERY large scale program with >1000 vis. The solution I had is turning each event content into a sub vi and if I need to create an event/case that calls another event then I won't call that event but rather place it's sub vi inside my event's sub vi. However, this solution also has it's drawbacks: I have to pass to this sub vi many connectors with data that it is sometimes problematic to pass (local variables for example) and if I need to call this vi from parallel loops then I need it to be reentrant which might also bring along some other problems. Could you tell me of a post that describes your solution in details with examples?
  11. I'm using an event structure inside a while loop with a class and a queue input in a shift register. Am I right that I shouldn't signal an event from another event? For example: Event 1 triggers event 2 and then event 3. Event 2 triggers event 4 Thus, if I trigger event 1 the result sequence of events will be: 1,2,3,4 instead of what I would like to logically which is 1,2,4,3. 1. What is the right way to use a state machine? 2. How do I add automation over a state machine (change values and trigger events as if a user pressed a combination of options, analyzed the results and did something complex). The current way I do it is by adding a wait for idle vi in a parallel loop that sends the next event once the state machine reaches the idle state (and thus I know the previous sequence is done). The problem is that this way is far from reliable since it might still contain race conditions. I tried using queues to organize the data flow, however, I found handling them might be a bit tricky. For example, if I add to a queue and along the program I forget to remove the message (I added the message twice by mistake somewhere) the queue might use more and more memory until the program becomes unstable and crash. Using the new analyzing tools I can find the problem yet it is still a bit of a headache. I hope there is a classical simple solution documented in one of your wonderful posts.
  12. Hi, while redesigning a large scale app from an old non LVOOP code I thought about the next design for a quick upgrade that will include Model-View-Control architecture with an alternative to FGs. Besides using frameworks like Hardware Abstraction Layer (HAL/DSSP) and the UI Framework along patterns like Factory and Singleton to allow abstraction and feature changes to my system I wanted to add the same abstraction to my inner modules so that the vi loaded into the UI Framework, for example, will be MVC and be used as a father for future versions without using external FG that can't be LVOOP. The solution that I thought of and I need feedback for (since I never heard of anyone using it) was using the class control as the db (model) for the vis while the front panel is the GUI (view) and the block diagrams are the logic. I'll try and explain through an example: The old code used controls on the front panel as the state of the system while the block diagram used the front panel both as a db of states (some hidden from the user) and as a GUI (which is actually also a DB most of the time). I created a vi that went over all the controls of the front panel (recursively looked inside each control) and created a typedef that contains all the controls names and refs. I then added this typedef into the class control and added to that class control all the front panel controls. The next step was to automatically add member access read and write to all the elements in my control. The result was about 90 vis of member access with the same names as the name of the front panel controls (LV currently can't handle property nodes for controls with label that contains two lines so I had to fix the names first). By changing the template of the member access I was able to add to all the write member access vis the ability to update the front panel and even to signal value change or add request to a queue depending on any rule that I decide on while using the typedef that I previously described. Now, all I had to do is to take the old code and remove all the references mess in it and replace it with a class wire that is actually my db. Any action on the db/class is handled through a property node (I like to set the option to no name to save space). The result is a MVC since the logic doesn't interact directly with the GUI and update it only on request. Each user action triggers an event so the logic will update the model in the class control. In this way I don't need FG since my class is the db and each member access implementation can contain protections like Singleton. Many tasks become trivial this way like saving/loading the status of the system for each user or even documenting/logging an error and even recording operations to use later as a test vector with metrics above it not to mention the fact that using G# for example I can expand my class to implement another API/db. I could go on and write the logic using the class wire, however, I might want to use the db in multiple loops and thus I converted the class wire into a DVR wire. Besides that, if I would like one day to upgrade the system I simply have to inherit from this class, the child will have access to the same db and could override the member access vis. The problem I have now is that I'm not protected from race conditions on my db and I wonder if the class control is fast enough and what will be the implications. For example, if I access the class db from a parallel loop or from a reentrant sub vi or if I pass the class dvr as a parameter for another class control or both a child wire and a parent wire try to access the same data etc... The regular approach from the LVOOP examples (cars/bike/truck) along with FG, Factory and so on is also ok but I find it both less robust and harder to use for a system upgrade since the time it will take you to redesign an old non LVOOP program, so it will contain all the new standards, is unacceptable (just defining the classes and the inheritance takes months) while in my way most of the work is automatic, I simply recycle old code to be more expandable and user friendly. To sum it all, I love the idea yet I'm afraid to use something that was never tested before and thus, I need feedback from you guys. P.S. - thank for reading
  13. Great post! Do you know how to integrate test unit, rspec, cucumber and fitnesse into LabVIEW? I'd like to manage my tests from Ruby since it's free tools are much more advanced than what I found in LV. Do you think this is a good idea? Is it possible at all? If not, do you know how to best implement the agile process in LabVIEW? Thanks in advance, Dror.
  14. Hi, I wonder if there is already an implementation of a rule based engine like Drools with some backward chaning based on the Rete algorithm in LabVIEW. I find the state machine to be hard to managed once you have more than 50 states and a rule based state machine could work like magic with its rule checking and backward chaning that makes it easy to add a new rule and track what happened when and why. I started writing a tool of my own and once it got complicated I checked out the if/then block from the fuzzylogic toolbox however it will take me at least a month to come out with a basic good implementation. BTW, I'm working with G# and since it makes LabVIEW and Java more alike I started wondering if I can integrate Java tools like Drools or UniCase from Eclipse into LabVIEW by building an Eclipse plugin for LabVIEW for example Thanks in advance, DD.
  15. Hi, At the moment I'm running TSVN on the server and commit/update/checkout every day manually through windows explorer. My goals are to make my work more efficient by: 1. Making TSVN accessible from the tools menu like JKI TSVN is. 2. Adding Hackystat telemetries into TSVN. 3. Adding TSVN to LabVIEW's source control providers. 4. Making TSVN work with LabVIEW blocks from the pallet Connectivity->Source Control like SCC Open SCC Project vi. 5. Adding a Bug Tracking capability to TSVN. The way I thought to implement it is: 1. Since I can run TSVN from the command prompt and since I can add vis into LV tools menu I thought I can add update/commit to the current vi/project I'm using. 2. Hackystat http://en.wikipedia.org/wiki/Hackystat is supposed to integrate with TSVN. I don't yet know how. Did anyone here try it before? Do you guys use any kind of a metric system both to collect data about the work being done and for the way users are using your code like time efficiency parameters and so on? 3. I have no clue. Help someone? 4. I guess it would be possible only after I complete stage 3 since I got an error trying to detect with those block if I'm using TSVN. Am I right? 5. I created a structure that allows me to handle bugs by each user to each project with permissions and all. Now I only have to write a GUI that allows users to report a bug that will save not only the description but also the programs state and a video by Jing. Then, I would like to load the report folder that contains LVM file of the configuration and the video to TSVN. Once I update the bug folder I will run Data Finder on it to display the list and apply blocks like Merge Queries to find whatever I like. However, I don't know if it is the smart way to do it mainly because I didn't do such things in the past and I wonder what will happen if two people commit with conflicts. I'd love to hear any comments and advice. Thanks in advance, Dror.
  16. Cool!!! it worked like magic! Instead of searching the property node under this vi I should have searched for it under this application. Thanks!!! I also took a look at DataAct and it appears I just wrote down something very similar to what they did only my project also takes care of Builds and TSVN. I don't know what to do now. I was about to share my work here for free but now I just feel bad for those guys since it is their only merchandize. Anyhow, thanks again for always coming to my rescue. Dror.
  17. Hi guys, what am I missing? I was trying to get the default owning app version of an external vi yet I always get an error 7 for giving a bad path unless I connect the path from This VI. I attached a snippet. where is ??? represent the option to connect the upper option or the constant option to the path connector. If you wonder why I need it then this is the reason: I wrote a vi that opens my projects in the requested LabVIEW version (among other stuff). However, there are some projects that always open with the older version for example, thus, instead of writing it down I'd like to LV to tell me which version it was last loaded with so I could open it correctly. BTW, I'm using System Exec.vi to open projects yet even though I specify the LabVIEW version and and the project's path, many times LV still opened the project in the wrong LV (opens with the last LV version that was opened). Do you know how to deal with that maybe? Thanks in advance, Dror.
  18. Hello everyone. What do you guys think of IntelliJ Idea in comparison to Enterprise Architect? I'm working on LAbVIEW 2010 32bit and I like the design pattern, refactoring and JUnit integration capabilities of intelliJ. Yet, I guess LabVIEW won't try to integrate with such a tool since it will turn profitable tools like TestStand redundant. Thus, I tried to download Symbio's Endevo yet I didn't find the download link on their site. Moreover, there are references to GDS, G#, goop, Endevo, Symbio, LVoop etc and I don't understand which is relevant for LV2010. What a mess. Anyhow, I would like to use a UML tool both for a basic design and for auto documentation of my actual code. However, I think those usefull free OOP tools out there won't help me much until LabVIEW meets the basic requirement of OOP by adding multiple inheritance or at least allow me to implement multiple interfaces. Still hopefull, Dror.
×
×
  • Create New...

Important Information

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