Jump to content

Omar Mussa

Members
  • Posts

    291
  • Joined

  • Last visited

  • Days Won

    10

Posts posted by Omar Mussa

  1. QUOTE (jcarmody @ Oct 31 2008, 11:36 AM)

    :question: To the JKI folks & others that are familiar with the http://jkisoft.com/state-machine/' rel='nofollow' target="_blank">JKI State Machine, would you comment on what I've done? I've read the discussions here and on JKI's site, and I've (nearly) finished an application at work based on this (just working on getting Software Quality Assurance approval). I've gotten my feet wet and would like to learn more.

    I've added some states to let me sequence through test steps. I've added a "Sequence: Wait" step that causes the program to loop for a specified time so other operations can continue ("Sequence: Wait >> 10" will loop for ten seconds before continuing to the next step). I've added a "Sequence: Wait for button" that will wait until a named button is pressed during a particular test step. "Sequence: Wait for button >> pbx" will loop, holding this place in the sequence, until a button labeled "pbx" is pressed. I'll probably add the option to specify a final state using a command argument. It doesn't handle the event; it just waits until it's pressed. I've put a cluster of control references outside the main loop (so I can set indicators w/o resorting to local variables) and I've added target & elapsed time indicators to the Front Panel.

    Do you think I'm OK with these approaches?

    Thanks,

    Jim

    Hi Jim,

    I reviewed what you did. I have a few comments for various states in your state machine -- a lot of my comments would require re-designing the code so take try to think about them from the perspective of 'design' considerations rather than purely from an implementation perspective:

    Macro: Initialize -- While it is possible to use the state arguments for things like cycling through stations, and setting the wait times, it is not really a scalable solution. For example, let's say I want to have 100 stations -- I can't see scaling up Macro: Initialize to handle this situation -- so I'd try to redesign the code to handle N cases

    Sequence: Wait -- You may be doing too many things in this frame -- you are waiting, starting to wait and checking if wait is complete -- maybe more frames would make this easier to follow -- for example: Sequence: Start Wait, Sequence: Wait, Sequence: End Wait -- personally I don't like to have a frame do too many things or it gets hard to manage later because you have to remember what the frame is doing in a given context. You could also add a state variable boolean called 'Waiting' that could make the code easier to use in other cases... Also, generally it is a bad practice to have a state send the state machine to 'Idle' because at that point a user may click a button and your 'sequence' will get interrupted -- its better to do some work, when done, go to Idle case

    Sequence: Wait for button --This is actually not how the JKI State Machine is intended to check for button presses. You should handle all button presses in the event structure that is in the 'Idle' frame. You should be able to use the Boolean.Value Changed event to know when a button value has changed and the event will return the exact button-- set the boolean to 'Latch when released' to get the same results as what you are doing. There shouldn't be a need to 'find' the button that was pressed. For example , the Exit button (OK) is more appropriately set up.

    Sequence: Next station -- Really this is a 'Sequence: Increment station' case. Maybe a better solution is to have a 'Sequence: Set Station' case where the station can be an argument. Why limit yourself to incrementing?

    Good luck and hope this helps with future designs for your applications!

    Omar

  2. QUOTE (Aristos Queue @ Oct 22 2008, 04:11 PM)

    To help you visualize the situation... if all the green nodes in this picture are VIs under source and the red nodes are VIs under dependencies, and I ask for all the sourcenders of node E, then I should get B, C and F (marked with blue stars) as the result. There does not appear to be a word in English for these things.

    I'm not sure why B, C, F are the 'sourcenders' for node E -- I would have thought from your description that 'B, C, D' are 'sourceneders' and the word I would really use to describe them is 'intermediaries'. I'm confused why you are forced to make up words. I thought you had to be POTUS to do that ;)

  3. QUOTE (jlokanis @ Aug 28 2008, 01:04 PM)

    JKI has a really easy to use toolkit called the JKI EasyXML Toolkit. Its designed such that all you have to do is to define a cluster that matches your XML structure and you're basically good to go. You can find out more on www.jkisoft.com/easyxml.

    Here are screenshots of how the data would be parsed using our tool, I've also attached the VI that was used in the screenshots.

    [Front Panel]

    post-5746-1219961297.png?width=400

    [block Diagram]

    post-5746-1219961306.png?width=400

    In order for the attached VI to run, you'll need to install the evaluation (or professional) copy of EasyXML. You can get it from the jkisoft website here: http://www.jkisoft.com/easyxml/download/

    Go to jkisoft.com if you have additional questions on our solution.

    QUOTE (Omar Mussa @ Aug 28 2008, 03:12 PM)

    .

    Here are screenshots of how the data would be parsed using our tool, I've also attached the VI that was used in the screenshots.

    [Front Panel]

    post-5746-1219961297.png?width=400

    [block Diagram]

    post-5746-1219961306.png?width=400

    In order for the attached VI to run, you'll need to install the evaluation (or professional) copy of EasyXML. You can get it from the jkisoft website here:

    Go to
    if you have additional questions on our solution.

    Apparently Philippe posted at the same time I did, but luckily our solutions are the same ;)

  4. QUOTE (Rammer @ Aug 28 2008, 06:26 AM)

    I have been trying to put BLOB data into a SQL database with the parameterized query for a stored procedure. I choose the binary data type, however at some level NI must be converting to a string, because it limits me on how big this blob can be (to a very small value < 1000 data points). Has anyone overcome this?

    I worked on a project in the past that used an Oracle database and we found that we couldn't write more than 1000 points either so we basically broke up our data into chunks of 999 points. I didn't like the solution because it made it hard to get the data back (had to join multiple rows from the same results table), but it worked.

    On a side note, there's another issue that is sort of related that you can sometimes run into - I think there is a limit to how long of an SQL string you can execute using the ADO based toolkit VIs so you might want to be aware of that as well. I don't recall what the string length limit is.

  5. QUOTE (Gabi1 @ Aug 25 2008, 12:37 PM)

    And also before getting into the hassle of installing LV to PDA: does it all worth it?

    As long as it is your hobby/passion than it is worth it as you'll get the joy of a 'do it yourself' experience. If you are thinking it will cost less than going out and buying a 'universal remote' I think you are better off plunking the $ due to the time investment you'll inevitably make.

  6. QUOTE (Daklu @ Aug 22 2008, 12:26 AM)

    Actually, passing the string is probably better than writing it to file -- as you can keep everything in memory. Good one.

    QUOTE (Daklu @ Aug 22 2008, 12:26 AM)

    Is the workaround flattening the variant to a string?

    That might work -- you should try some prototyping and see for yourself ;) Make sure to reply to this thread on whether it worked for you or not!

    In my project where we planned on using variants, the goal was to pass configuration data clusters of wildly varying types between LabVIEW/TestStand as variants. We ended up using a functional global in LabVIEW that stored the configuration data and having to basically create a custom TestStand type for each configuration (which sucks because it is harder to maintain as now our 'Types' are defined in 2 places -- a LabVIEW Type Definition and a TestStand Type Definition). Another thing that is bad is that TestStand doesn't have an equivalent to LabVIEW's 'Apply Changes' when it comes to changing the TestStand Type definition so you have to manually update every step that uses your custom type whenever the type changes.

  7. QUOTE (eaolson @ Aug 21 2008, 08:08 AM)

    Over at some other thread, crelf said, " I strongly suggest that this topic go to a new thread." And, lo, there was a new thread.

    So when is it a good and bad idea to use a sequence structure? Should they be ?

    The are occasionally necessary to help enforce data flow. For this reason alone, they should not be banned. But they should be avoided for almost all other cases in my opinion due to their inflexibility.

  8. QUOTE (Daklu @ Aug 20 2008, 05:21 PM)

    Actually, this is not a silly question. I don't know if NI has even tried using LV Classes in TestStand. You may be sort of stuck in a sense ... TestStand can't even properly pass Variant data to LabVIEW... A workaround exists but it kindof sucks ... I think your best bet will be to flatten the class to string and basically write it to file and just have TestStand pass around a filepath to the Class data. I have a feeling that this is your best option. On the plus side, if TestStand has issues, you'll be able to inspect your LV Class data and have a really good idea of what happened during the test that crashed. On the negative side, you can't use TestStand to actively 'use' the data in your LV Class. I'm not sure exactly what you intended to do with the classes from within TestStand -- hopefully your only goal was to pass them from one step to another. If you had other ideas, please post and maybe a solution exists but I'd be surprised.

    QUOTE (Daklu @ Aug 20 2008, 05:21 PM)

    I designed and implemented an entire class heirarchy with the idea of using TestStand to glue it all together. I plunked my first VI using a class and discovered TestStand doesn't know what a class is. Any idea how to pass an object from one VI to the next?

    (I sure hope the last months of work hasn't been wasted.)

    Well, no offense but the lesson learned is PROTOTYPE before you dive in too far (a month is WAY too far). If you can't get a prototype to work, you need to find a solution or redesign -- tech support or forums are helpful for that too.

  9. QUOTE (NeverDown @ Aug 19 2008, 07:44 AM)

    I actually found a workaround, I deleted the files 'test.vi.r2′ and 'test.vi.r3′ after merging. The menu entry "Conflict resolved" isn't available any more, but I can do a normal SVN commit and it seems OK. We'll see. I get tired of doing manual stuff with tools. Maybe I'm just spoiled using LV. :-)

    Thank you.

    That's one way to do it -- but you may end up missing out on something and can lose work.

    The whole reason that you get the .r2, .r3 is so that you can choose to resolve the conflict with 'use mine' or 'use theirs'. Also, sometimes its really helpful to be able to tell what the differences are in the conflicted VIs (you can open them with LabVIEW and use their comparison/merge tool). When you are done you can mark the conflict as 'resolved' (I believe this will delete the .r2, .r3 files but not sure). This gives you the power to not lose work by comparing what the differences are in the conflicted files.

    Another way to get rid of conflicts is to delete all your local changes (or move them to a temp folder), and do a revert on the folder. That will get you to the latest state (based on the update that gave you a conflict). Now you can copy the files back from temp folder into your source folder and they will appear 'changed' (as opposed to 'conflicted') and you can commit them to your repository.

  10. QUOTE (pallen @ Aug 19 2008, 06:40 AM)

    Disk space is cheap. At the worst case, buy an external USB or Firewire drive and transfer data.

    QUOTE (pallen @ Aug 19 2008, 06:40 AM)

    Seeing as how it's possible to save for previous versions, is it necessary to keep both 8.5.1 and 8.6 installed on the same machine if I want to provide occasional support for a couple of 8.5.1 programs?

    If you can't test the code, how do you know if it works?

  11. QUOTE (Ton @ Aug 2 2008, 05:53 AM)

    Anybody succesfully installed LV 8.6?

    I can't I get the following error:

    I don't know why (the incompatible software isn't mentioned :headbang:

    Ton

    I had the same issue :thumbdown: . The only way I got around it was by installing LabVIEW on a virtual machine that had no other NI products installed.

  12. QUOTE (jgcode @ Aug 1 2008, 04:30 PM)

    This is cool! I've been looking at the examples and I have one question for anyone else on the bleeding edge...

    I can't for the life of me figure out why the 'Weather' data service data output renders into an html table but the 'LV Queue Server' renders straight XML. Is there something I'm missing? I want to display the raw XML output from the Weather example in my browser, I don't want an html output. Is it because the weather service is using shared variables? Is it because the variables are in a library? I don't get it.

    QUOTE (Omar Mussa @ Aug 1 2008, 10:19 PM)

    I actually found out something useful from an NI webcast :thumbup:

    So I'm posting the link to it here:

    http://zone.ni.com/wv/app/doc/p/id/wv-810

    (the solution to my problem is in this webcast)

    ... ok just in case you're too lazy, there is an option under 'Source Files' and the only way to get there is via the 'Configure' button on the 'Source Files' tab in the build rules of the web service.

  13. QUOTE (Aristos Queue @ Jul 29 2008, 02:24 PM)

    I'm glad you caught this :thumbup:

    I noticed having performance problems (especially for classes with a large amount of data -- such as a picture control with a large image on it) but never knew why... I use this node all the time in my LVClass code so I think I now have the answer.

    I don't know if I like the workaround though:

    QUOTE (Aristos Queue @ Jul 29 2008, 02:24 PM)

    LV
    class developers should avoid using the To More Specific node to do type testing -- use dynamic dispatch subVIs instead

    One thing I've been meaning to do for a while but not had a chance to do is to understand exactly 'when' a LabVIEW class becomes locked. For example, if I have a plugin system, I don't want my class to be locked until the class has been 'plugged in'... (because I want to be able to edit the class for as long as possible). However if I have a Dynamic Dispatch VI, the class is immediately locked in my project (whether or not I have instantiated it) as soon as the plugin-loader runs. This behavior makes it hard to work on plug-in classes while the plug-in loader is running (if you're using Dynamic Dispatching). Hence, I've been avoiding dynamic dispatching on plug-ins... (I know, that sounds like a silly statement but my plug-in interface is pretty simple).

    Am I basically stuck now having to go back to the dynamic dispatching world and having my classes getting locked un-necessarily just because they happen to be in my .lvproj file? Or is there some way for me to get a class to become 'unlocked' while the plug-in loader is running?

  14. QUOTE (GreatVIEW @ Jul 28 2008, 11:20 AM)

    I have a question for you. How do you change the background colour of a numeric control based on the value of the control as you enter the data. I want the control to change colour when the value of the entered data is outside the coerc range. when the data is within the range I would like to know that the value I have typed is going to be accepted before I move the mouse off the control or press enter.

    Maybe what you should do is look at your application design more carefully. You may need to separate the GUI layer (for example, the value that is input on the front panel) from you application logic (ie, don't just automatically use the value the user entered in your application). This could be done in conjunction with using Norm's "brat" concept or an Xcontrol.

  15. QUOTE (iowa @ Jul 23 2008, 11:54 AM)

    I could really use working VI example which uses Windows API to control Windows Calculator..

    Its really unlikely that anyone is going to have the time or interest in building an example that controls the Windows Calculator... However if you feel it is worth your time to do this and post the resulting VI(s) to this thread, then other people will very likely look at your code and try to tell you how to improve it.

  16. QUOTE (neB @ Jul 20 2008, 06:26 AM)

    The Trace Execution Toolkit is something I have only used in the RT environments but is supposed to run under Windows now. It works by putting hocks into all of the code before you run it and will produced detailed reports of everything that called when for how long and also gives you an idea if anything goes idle waitng for memory management. That toolkit may be helpful.

    Cool, I will try to check it out.

  17. QUOTE (neB @ Jul 19 2008, 06:52 AM)

    If you are looking for gloabl solution that finds which of all of the VI's in memory are running, (note: there maybe more than one running) it seems you would have to interact with the OS's scheduler to do that since LV utilizing the OS to schedule VIs and for that matter the multiple possible threads within each VI.

    I have no idea how to check an OS scheduler to see which VI is running. I guess I only care about Windows apps in my case.

    Here is my goal... I have a state machine UI. I want to be able to run a supervisory VI that monitors the state machine and can log every VI that was actually run/called (as opposed to just being in memory) until the state machine completes. I was just about to give up on this but then I realized that the LabVIEW VI Profiler basically does what I need to do (and more). Unfortunately I am not sure how it does this... Any ideas? (Is it checking the OS scheduler? -- that would be surprising since it would mean there would be a different flavor of the VI Profiler for each LabVIEW OS version supported).

  18. QUOTE (crelf @ Jul 18 2008, 12:17 PM)

    I saw that page and somehow missed this:

    QUOTE

    [MyApp]

    allowmultipleinstances = TRUE

    I knew that worked for LabVIEW.ini but I forgot that it could be used in 'MyApp.ini'... :P

    I'll try that later and see if it works for me.

  19. QUOTE (normandinf @ Jul 18 2008, 12:00 PM)

    I do it to test my tcpip communications, so I'd say yes. The same EXE copied in two separate directories can be launched at the same time and run separately as long as they are not using the same port or other potentially shared resource.

    Excellent method, and it works. I also realized I could just copy my EXE and rename it and it was good enough for me in this case and it allowed me to run in same folder.

×
×
  • Create New...

Important Information

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