Jump to content

CraigC

Members
  • Posts

    54
  • Joined

  • Last visited

Posts posted by CraigC

  1. Hi,

    couple of things.  When building an executable the path of the executable is now inserted into the path so 

    C:\MyProject\MyFile.txt

    becomes

    C:\Myproject\MyExecutable.exe\MyFile.txt

    If this is already accounted for then the easiest way to find out what is happening is to create a debuggable executable which enables you to debug as you would normal do in LabVIEW environment.  See here

    https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000PAiTSAW

    Craig

  2. Hi Bira,

    Your data is being accumalated by the use of the Feedback and Concatonate string nodes.  You are essentially appending each "packet" with all the previously received packets which is why your REsponse indicator is growing every time round the outer loop.

    You also need to think about how your "packet" is defined.  As you mentioned in your first post the "packet" is terminated by a Carriage return, hence you should terminate your read with a Carriage Return.

    See attached VI

    EDIT as you have stated 

    "The first data packet ends with a <CR> and my boards repeats that every 3 seconds. "

    Then you will need to increase the timeout value in my VI to something greater than 3000ms, say 5000ms or so.

    Craig

    String.vi

  3. This boils down to Nyquist, which essentially says you can resolve an original signal at twice the sampling rate (According to the mathematics at least).  However it is recommended best practice to use a sample rate at least 8 times that of the signal you are trying to measure.  So for your 8KHz signal you will need to Sample at 24KHz at least.  If you are trying to look for other features within the signal (Rise times, Overshoots, Ripple noise etc) then you will probably need an even larger sample rate.

    With the output signal the same thing applies but in reverse.  If you want to produce a 8KHz Output signal you really need to clock the data out at 24KHz at least, I believe the output clock rate can be set on those cards (It has been so long since I used AO)

    In both cases though the more you over sample the smoother and more representative your aquired/generated signal 

    Craig

    NI white papers are usually pretty solid at explaining these types of things.

    http://www.ni.com/white-paper/2709/en/

    and Wiki

    https://en.wikipedia.org/wiki/Nyquist–Shannon_sampling_theorem

  4. Hi Rolf,

    On 25/07/2017 at 8:59 AM, rolfk said:

    I"m not quite sure if you mean to advocate a class hierarchy for an "has" relation. Part of the sentence sounds like it, then again the other part seems to indicate you mean not.

    One of the first principles in OOP anyone needs to understand is that two objects can either have an "is" relationship or a "has" relationship. For an "is" relationship inheritance is usually the right implementation, for "has" you should make the "owned" object a value/property of the owner, which could be by composition.

    Thats a handy way to think about it thanks for the tip.

     

  5. Hello,

    Time for a little update maybe.

    On 21/04/2017 at 5:23 PM, smithd said:

    Since I didn't see it mentioned elsewhere, it sounds like you might be in need of https://en.wikipedia.org/wiki/Composition_over_inheritance

    This little comment helped me realise the solution for what I was attempting to do.  By using composition the problem with merging classes back into a hierarchy was absolved.  I did end up using DVRs as again the need to merge was absolved.  I could of just used clusters to split and merge from the onset but I have learned a little of OOP on the way so all is good.  Also  using DVRs made saving and restoring data into named attributes fairly simple (using the unique tree tag as a name).

    On 21/04/2017 at 5:23 PM, smithd said:

    A measurement isn't a type of limit check, and a limit check isn't a type of execution behavior.

    I still feel a little uncomfortable about putting things into a hierarchy and although smithd is technically correct... measurements can all have limits and each test all has execution behaviour.  Having said this composition is fine and there is no real need for hierarchy here.

     

    On 14/06/2017 at 8:29 PM, Stagg54 said:

    Looks like you are doing sequencing.  Instead of reinventing the wheel, perhaps consider using Teststand...

    Hi Stagg54,

    Yes we use TestStand on other projects.  The main focus on this sequencer was to allow Hardware engineers who are not familiar with TestStand or LabVIEW the ability to make sequences quickly and easily from within the same application.  I am not trying to build the monolithic one size fits all application.  This sequencer does not cover a lot of features available within test stand and is much more limited in its capabilities.  It is designed to run on specific hardware (at the moment), with the philosophy of being easily modified to target other pieces of test equipment as the need arises.

     

    Thanks for all the input, I have much more of an insight into OOPy stuff.  I think my inital downfall was trying to be too strict on the design by using only by value and forcing the design into a hierarchy when the final solution didn't quite fit either of those methodologies.

    Craig

    Also of note, not being able to hide or set column width in tree controls to 0 is most frustrating!!

  6. If you use the type filter on the Get All Descendants method you can get files of a particular type.  Library will find *.lvlib etc.

    This should help with speed as you should not have to loop through every item, just the ones you are interested in.

    As a side note i Remeber having to drop down to "My Computer" first although "Root" seems to be working for you also

  7. Hi smithd,

    Thanks for the advice.  I have had a quick look at composition vs hierarchy and it does indeed look like this is more suited to my needs.  My initial reasoning for inheritance was that during the execution of a test plugin it parent data should be readily available and bound as such to the test subject (to test limits etc).  However it looks like the same objective is achievable if I use composition so will give it a go and see what works best.  Better to try new things now at the early stage of learning!

    Thanks

    Craig

  8. Hi Smarlow,

    Thanks for the comments, I am also not a fan of the one Framework fits all and in my particular instance the trhee panels are pretty static and wont be loaded in different places all over my code etc.  However using the techniques above I have ended up with quite a dynamic flexible configuration screen.  I often take the approach that the most direct effort (while still using patterns) is often the best and avoid using bigger frameworks.  I also have experience in automation machines which dont tend to like being shoe-horned into a large fits all framework.

    This is more of an exercise to learn some OOP and as it happens some DVR stuff also.  I am actually using a "framework" that i have already written and used successfully but was a bit clunky storing configuration data so was looking to see if i could simplify this process both on the configuration screen and the "Run Sequence" screen.  I think now I have these objects stored and their data readily at hand I will help in the creation and execution of new tests.

    I dont know,  all this is subjective, and I am all ears

    A_Panel.png

    Newer Version of the configuration screen using techniques as above.

    old_Panel.png

    Old Version of configuration screen with data stored in the tree control.

  9. Hi All,

    The DVR Method seems to be working well, although it has raised a couple of questions on best practice.

    Currently I take a reference of the object in the parent class and cast this in the children as per this thread for guidance https://forums.ni.com/t5/LabVIEW/Combining-LVOOP-DVR-with-Asynchronous-Dynamic-Dispatch-and/td-p/2254600. I am thinking this is the correct way to go about this.

    Also I am using the preserve Runtime engine in the "Test plugin" class to retrieve my object and maintain runtime class on my DD wire, first time using this primitive and just wanted to double check I am not misusing it.

    The attached mockup works for demonstration but has an issue with the subpanels not loading, I am not concerned with this as my main application does this in a different manner anyway (It was just the quick and dirty to get this example running).

    Thanks for all the help

    Craig

    Lava_Temp.png

    Lava Temp.zip

  10. Hi Shoneill,

    Thanks for the input.  I was thinking about DVR but initially thought that I should be able to do this in a traditional "split wire and merge" approach.  If you are saying that DVRs are the way forward then I am guessing I have hit an actual hurdle rather than me missing something easy which is what I was fearing.  I have not played with DVR much which is another reason for my initial hesitation although this seems to be the perfect scenario to give them a go.  I will refactor the mockup I have made and keep you both updated.

    Craig

  11. Hi Tim,

    Thanks for taking the time to have a quick look at this with me.

    It is essentially configuration of a plugin type structure of a class Hierarchy A->B->C.  For each plugin say "classC:modifyUI.vi", is for modifying its own internal data.  It also calls via call parent method "classB:ModifyUI.vi" which takes care of handling meta data, which then calls "classA:ModifyUI.vi" which takes care of globally configured data.  I am able to load every class "modifyUI.vi" in the hierarchy in parrallel such that user essentially just sees a configuration page.  All good so far.

    My initial reasoning for having this hierarchy in this manner is that the child object is held in a list of other child objects or "plugin Tests".  The test is merely concerned with its data for running a test or taking a measurement etc.  Its parent method deals with meta data associated with that test, "limits", "Requirements" and other references associated with that test instance.  The top level in the hierarchy deals with other flags such as "on fail options", "abort", "repeat conditions", "test type" etc.

    Merging the Data when there was only two classes was fine as I only needed one VI in the child class which was static dispatch.  However merging the data between N classes throughout the hierarchy requires dynamic dispatch and this is where this structure is currently falling over.

    If I were to set the hierarchy as you suggest would I not break the ability to run the "plugin Test" and be able to call upon its parent data for handling the test instance?  Apologies, I should of explained this in my initial post as it is pretty much a big part of what I am trying to achieve.  I am in this twilight zone of trying to keep my classes by value.  I understand I could send the modified data via Queues to a collection VI like say with rendezvous.  However I think I am missing something in OOP which is blindsiding me to the correct way of achieving what I am trying to implement.

    Craig

  12. Hello,

    Bit of an odd one and I am probably doing something fundamentally wrong however I am fairly new to OOP.  Essentially I have a hierarchy of 3 items say A, B and C.  I have a DD VI called "ModifyUI.vi" in each class and I am calling this VI and its parents in parrallel (Probably not a great idea but it is my end goal).  After each "ModifyUI.vi" has completed doing what it needs to I would then like to collect each VI's data as they were all run in parrallel back into the initial class that called them all.

    I have attached an overview of what I am trying to achieve in a mockup of my problem.  I am willing to change tack as long as the same goal is reached (Modify all class data in parrallel).

    Thanks in advance

    Craig

    Lava Temp.zip

    Overview.png

  13. Either way, if you are using SQL or files for configuration there is usually some sort of trigger chain.  By this I mean that there is an order in which the files (or SQL tables) must be re-loaded if any file in the chain is changed.  Thus if your config dependency is sort of hierarchical as you suggest then my usual approach to this problem is to brute force all of the loading.  For example if you have files (or tables) A->B->C->D then no matter where in the chain a file is changed the whole chain is refreshed.  So for example if file C is changed and it has no impact on A, I dont really care I just re-load everything (A,B,C and D).

    An advantage with databases is that these triggers can be attributed to fields within tables.  This can often require some careful thinking and is worth doing with larger databases.  However if it takes a minimal amount of time to reload everything then at least you know all of your tables / config data has been refreshed and you're not using old fields.

    On the other hand if you are constantly changing values within your files (which I dont think you will be for configuration) then you may well want a finer amount of control as to which properties / fields you want to refresh within your application.  If this is the case I would argue that these changes should not really be held in configuration files and a database or memory structure which is written periodically back to file should be used instead.

  14. Often in vision if a picture is analysed then the original is overwritten / destroyed.  Is it just a case of taking the image reference before the processing and then overlaying the analysis result onto the original Image.  Difficult to explain and I do not have the vision toolit to hand.

    You often have to copy the original image and use one copy for image processing, then overlay the results onto the original Image, not the processed one.

    • Like 1
  15. I have wanted to try this for sometime, hence I have one of these ZYBO

    I know Zedboard do other alternatives from avnet.  Being as it is the same target family it seems to be a path of least resistence.  It was just supposed to be a means of getting my head around building linux sources and cross compiling.  I am familiar with linux desktops and a few commands but not much else.  I am however quite well versed in Verilog HDL.

  16. On 28/10/2016 at 0:46 AM, Porter said:

    I am communicating with multiple instruments over a single serial port. These instruments are different but share a common communication protocol. Therefore, it makes sense to handle their data acquisition in separate loops. To do this, I open duplicate VISA sessions on the serial port (one for each loop). To avoid one loop interrupting the other's serial transaction, I am trying to use VISA locking:

    Ahhh so I was missing something!!

    Well it Looks like you need to lock the resources then.  I was trying to understand why you would do this on a single Resource.  However as you say if you need to lock it for expansion etc fire away.

    Craig

  17. Nope, I tend to use templates or re-entrant drivers for numerous Resources.

    By This I mean that he is trying to lock a single resource (Serial Port) and has multiple addressed instruments hanging off of some kind of bus.  Therefore you can still have a single "Core" Write Read VI which is non-rentrant rather than lock the Single resource he is using here.  I am no stranger to using multiple instruments but this is why I asked if I am missing something. So to re-iterate, It seems unnecessary if he is trying to lock a single resource.

    And I also do this in a similar fashion when I need to lock multiple resources using the same driver.

    I was merely trying to keep things simple if that is all that is needed.

    Craig

     

     

    temp.png

  18. Yeah I can see why you potentially would want to lock the Resource if it was being called asnychronously at run-time.  

    I am just a little confused as it appears overly complicated unless there is some specific use case that I am not getting.  And historically I have found manually attempting to lock resources in this way is great but can lead to other headaches (Aborting the VI, and consideration of startup locked states etc)

  19. Why not Just put the Write/Read into a non Re-entrant VI (Action Engine) and have this called in your three threads?  Am I missing Something?  At the moment it looks like you are essentially doing what a non re-entrant sub-vi does for you..

×
×
  • Create New...

Important Information

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