Jump to content

Maksim Kuznetsov

Members
  • Content Count

    7
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Maksim Kuznetsov

  1. Thank you James for a prompt reply. Indeed the "Timeout Watchdog" will make it clear to the main if something goes wrong and if the code used is well-written there should be no occasion when actor becomes totally unresponsive (in the ideal case). Thanks again for everything.
  2. Dr Powell, First of all thank you for developing a dream library (framework), I've been using it for 2 years already. It is incredibly powerful and elegant. There are no words to express my admiration of your work! For couple of days I've been thinking about one scenario: Imagine there are 5 actors, each of them is dedicated to one particular piece of hardware or software component. They are launched by Main actor. Each of 5 actors has a state and it is updated once action is performed. Now, what if one of the actors gets into an infinite loop (or an action that will make it stuck). In this case it won't be able to update it's state. However my Main actor doesn't know about it, it only remembers that the last state of that frozen actor was, for example "good". 1. How to make the Main actor realise that one of its sub-actors is frozen? 2. What to do in this case with a frozen actor? How to restart it? P.S. I've been thinking about using the "Watchdog" actor. Create 5 of them in Main actor and share with subactors. Then inside of subactors constantly reset the Watchdogs. If watchdog wasn't reset, Main actor gets a message. Not sure if this is the most elegant solution. And there is still question 2 left. It would be great if you could share your thoughts about this. Thank you! Kind regards, Max
  3. Dear TestStand Developers and Users, I spent quite a while trying to figure out one thing and still haven't found a satisfactory solution. This is why I am here. At work I have to maintain hundreds of TestStand sequences which use many custom steps. Every time I launch a sequence it takes 2-3 minutes to preload all the modules (custom steps). If something goes wrong and I need to change one of the custom steps I need to unload required VIs from TestStand engine before I can edit them: 1. Go to File -> Unload all modules or 2. Go to Types Palettes -> find required custom steps -> (right click) -> Properties -> Substeps -> Specify Module -> Edit VI The first option is nice and quick, however after the VI is edited it takes another 2-3 minutes to preload all modules back. The second option takes 40-50 clicks to do what I want. Both options are not desirable and I am looking for a quicker way to load/unload specific modules. What I recently did was I made a VI Action Step (Module Monitor), which is executed in the very beginning of the sequence. It analyses recursively every sequence, every step and stores references to VI modules in the TestStand User Directory. Then I can open that file with a developed Module Manager and unload the particular VI. Please find the code attached. This approach works, however every single sequence has to be modified and as soon as the sequence file is closed all modules' references are dead. However references to the Custom Steps are still alive in TestStand's Engine cache, regardless of the sequence file being in memory or not and VIs are obviously reserved (not editable). As a result, this approach only works for VI Action steps. Another approach is to use StationCallback (Pre or PostStep) to create a database of steps that executed. It has the same issue as the approach above (only works for VI Action steps). The listed approaches also don't work for Edit VIs of custom steps, because these are loaded not during the sequence execution, but during the development. I did a lot of research and it seems that TestStand doesn't have an API to get the data stored in its cache (since 2003): https://forums.ni.com/t5/NI-TestStand/Getting-a-list-of-loaded-sequence-files/td-p/76801 Does anybody have any idea of how to access TestStand memory to see what is loaded and to get references to these modules? P.S. I have also posted the same question on NI Community Forums: https://forums.ni.com/t5/NI-TestStand/List-of-TestStand-modules-loaded-in-the-engine-cache/m-p/3817336 Thank you! Kind Regards, Max teststand-module-manager.zip
  4. This is great James! I have just tested and everything works perfectly! Thank you very much for being so responsive and helpful. Max
  5. Hello! In my project I created couple of tables with foreign keys. I enabled them using "PRAGMA foreign_keys = ON;". Foreign key constraints work when I try to add a row containing non-existent parent element, such query simply gets ignored without reporting an error. It makes it difficult to debug which query failed and why. After doing some research on why it happens, I found that foreign key constraint errors are part of "Extended Result Codes", (don't confuse with "Extended Error Codes"). By default "Extended Result Codes" are disabled as written here: Enable Or Disable Extended Result Codes In order to enable extended result codes the following function has to be called on the database handle: int sqlite3_extended_result_codes(sqlite3*, int onoff); Unfortunately I couldn't find an accessor method to get the database handle, so I had to modify your class and add additional method to it which enables the "Extended Result Codes". It is not the best solution and makes it difficult to share the code between machines. Is there a way to enable extended result codes without modifying the SQLite library source? SQLite is a great library, thank you James for it! Max
  6. Thank you very much for a prompt reply James! Your solution makes sense and it works nicely for errors that occur in the sub-actor when there were no messages sent to it (error triggered inside by some other events). However, imagine the main actor is registered for all errors with a translator and I send a synchronous request to it: The request potentially could result in an error which will go directly to the error handler, but since the main actor is also registered for all errors it will get another message with the same error. Basically, the error gets reported twice. Similar thing happens when there is an asynchronous reply coming into the main actor containing an error: In this case I receive an error by a separate message (registered for it) and also as a reply to my asynchronous request. Both messages will have different labels, one is 'Inst 1 -> Error' another will be 'Inst 1 --> Reading'. I spent couple of days thinking of the way of handling errors in one place, because my system is designed to act autonomously on some particular errors, on other to ask user what to do. I still can't think of the elegant way of doing this. It would be great if you could share your thoughts with me. Thanks again! Kind Regards, Max
  7. Dear James, Recently I started to use your elegant messaging library, it is something I always wanted to have and even invented my own wheel before I found what you have done. Imagine I have 3 actors: 1. Launcher 2. Two instances of the instrument actor. To make the code easy to read I use the message translator for each instrument. However when error occurs in one of the instruments it goes directly to the 'Launcher' actor to its 'Error Handler'. My questions are: 1.How do I know which instance of the Instrument actor triggered an error? 2.How do you handle errors in your multi-actor systems? Thank you! Kind Regards, Max
×
×
  • Create New...

Important Information

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