Jump to content

Mahbod Morshedi

Members
  • Posts

    37
  • Joined

  • Last visited

Posts posted by Mahbod Morshedi

  1. Thank you for the reply,
    Well, I'm very new at Labview, and the software I am developing is for my use. The problem with that is that I know the work and am learning more and more tricks that push me to add more features to the app, and now it has become too big. I am carrying too many unsorted clusters throughout the app that need proper organisation. I also am carrying too many wires in the shift registers (dynamic data, hardware and acq parameters, raw data, copy of the original raw data, worked and formatted data and copy of the original of those for history and undid purposes. I am also adding a completely new experiment to this software, which treats data differently, but the internal would be the same.
    As you can see, I am out of my depth, and this is a way for me to manage the data across the VIs in different formats and unbundle on the fly based on technique and application.

    This a the original post I made a while a go that lead me to this decitsion, thanks to ShaunR and the data has gotten bigget since:

    I was just wondering about the "array with tag" or "Var attribute" since there is not much information about the latter. I am unsure if the data is more susceptible to corruption, gets lost, or if there are other complications I do not know about. 
    Really! I appreciate your reply. It took a while for someone to reply to this one.


    Cheers,

    M

  2. Hi All,

     

    I had a question about variant data and variant attributes specifically. I have different datatypes, and for having a nice and neat wiring, I am storing an array of clusters made of a variant and a data tag, so I can insert a new datatype w/o changing anything and with no i/o problems. I use normal search for tag and retrieve data VI, and the same thing for adding new data or changing data.image.png.9fa148114328d21d0e77cb0940ede817.png

    My qusetion was: can i Just use variant attributed to do the same? something like this?

    image.png.4ec7094f78c4ae16b5929794e72e0b0d.png

     

    Are there any draw backs that I do not know of? 

     

    Cheers,

    M

  3. 2 hours ago, Darren said:

    What is your use case for needing this behavior?

    Hi Darren,
    Well, admittedly, it is my lack of experience with programming.
    I wanted to use one wire to carry all my data, so I made an array of clusters, a variant typed and a tag string' to' and did a tag search to find the data and get the variant. To convert that back to my data, I will have to have the original data type feed to "var to data". I want to get this done programmatically. Case structure is a no-go, so I was thinking of bundling all the data, finding the order of the data via the tag, and unbundling that way. Now, I think it was my naivete, and I should not be so lazy and manually do it when I add a new data type.

     

    Cheers

    image.png.fe84cd681b9665a4a4dc24ec60f737a6.png

  4. 14 hours ago, ensegre said:

    something along these lines?

    c.png

    Hi. Thank you for putting this together.
    It is not like this actual unbundle but like indexing an array, using the cluster control order to unbundle the item to get it as a control like unbundle by name does.

     

    cheers 

    M

     


  5. Hi All,
    Thank you for your help and sorry for confusing things on my part.


    I am only one person and am still very much new in programming. I am a chemistry researcher who does a lot of laser instrumentation. I have developed two applications for my own experiments and am going to developed some more and wanted away to combine them all in one application since they have a lot of communalities. 

    I was wondering if the best way is to use LOOP and to do that, I thought that SMOs give more formulised frame for writing HAL. Then I was going to Use DQMH for the rest of the software (UI, Workup, Representation, Data save, export and import and anything else that requires inter Module communications). I have attached a very rough UML diagram (Please don't judge too harshly I am not a programmer; it is done in PowerPoint and right now).
    So, I was thinking if it is a good approach or should I stick only to one. Bear in mind that I am using the project to also learn LabVIEW.

    Cheers,

     

    MM

    UML_HRS_ZSCAN2.jpg

  6. HI BramJ,

     

    thank you for the solution, tut that would not work for what I need, as you see I had to add a separate one and off for my plots that is used to select the selected plots for further calculations. I wanted to replace this Booleans with the plot is visible on legend and use that property in its place.

    Wich in you solution is a little (programmatically) more work that it is worth.

     

    Cheers,

    MM

  7. 16 minutes ago, X___ said:

    You would have to add a dummy graph that you would only show the legend of and fill that with half of your plot names (e.g. adding one empty plot for each pair).

    And of course hide the legend of your original graph.

    And respond to actions on the dummy graph to update your original graph.

    Hi X__,

    I am not quite sure I understand dummy graph. Do you mean the graph is going to be nit visible?

    and I use that only for the legend?

    Cheers
     

  8. Hi Sam,

    I understand what you say and that exactly how I generate my graph (I programmatically assign colour line style point style and legend label). The problem is this graph is a combination of two sets of plots: As I said, scatter plot (points) and fitted (lines) plots. In other words, every two plots belong to the same data. Problem is that I cannot find a way to only show one legend for both plots or away to combine the two plots and show as one plot group. Also, visible apply to plots not the legend for that plot. My question is if there is a way to hide every second legend (not plot) and only the legend. I have tried the legend properties, but the visible property is applied to the whole legend rather than my specified plot legend.

     

    Cheers,

    MM

     

  9. Hi All,


    I'm not sure if what I need is even possible in LabVIEW. As you can see in the pic, I have a scatter and fitted data presenting in the graph. What I really need is a way to show only legend for one since they are coupled and not independent. I was thinking it is possible either by somehow combining them or turning off the legends for one but so far, I have not been successful. I was wondering is there a way to achieve that?

     

    Cheers,

     

    Fitting Graph_LV.png

  10. Thank you ShaunR,

    That variant looks promising, and I will give that a try a try. I could also use a user even framework such as JKI state machine or DQMH. 
    Any good material you can suggest for me to start with GOOP would be appreciated in the meantime.

     

    Cheers

    Mahbod

  11. 10 hours ago, ShaunR said:

    If you are going they way I think you are, all you will do is swap [un]bundles for VI's and add a lot of boiler plate. To be fair. You monster cluster isn't really that much of a monster-more like a tribble.

    My advice (if you're not going to re-architect) would be just to split out the data from the config. Your All Scan data BG and HRS is actually an identical format so you could rationalise that into a single array which will make adding more of the same format easier (just add and index into the array-no need to modify the cluster to add more data). Everything else seems to be config data.

    I totally Agree and in fact i had that format originally. However, arrays gets rid of the cluster names and replace them wit the first item's name and for me keeping track was becoming difficult even with documentation. it was just easier to have the clusters that can have different name. I know that i could also use a simple enum for indexing but that would add an extra data that needed to add to my system.
    I also have a duplicate of BG and HRS as an original data and manipulated data. This way when want i can revert back by replacing the data with the original.

    I am very new to programming and do not have experience in data organisation and almost nothing about labVIEW classes and the NI documentation is just too simple and is not covering any real life application.
    That is why I was asking for help.

    Cheers,

     

     

  12. Thank you both for your comments,

     

    I undrersatnd that my dta organisaion is a mess here. however i use these almost every where and wanthet to use only one wire across. I am not sure if there is a better way to do that since that can programatically change or vis UI. That is why I wanted to use a class to help me with ubn and bbn of the cluster data.

    Cheers,

  13. Hi All,
    I am currently facing some challenges with my application for data acquisition and processing. Specifically, the data cluster in the system has grown quite large, making it difficult for me to manage, especially when I consider adding new features. I have heard that converting everything to a class is the best approach, but I am unable to find any suitable resources or examples for it. Most of the available information pertains to simple and uncomplicated data types. Can anyone please guide me towards the appropriate resources or provide an example?

     

    Thank you,

    P.S. The data cluster in question is the subject of my inquiry look like this:

    image.png.76e7298b45991be3f40124b7755ecb41.png 
    and this is the class I atempted:
    image.png.518bf15c2f89d058be28249393e23bee.png

  14. Hi All,

    Can you please give me some information about how and where I can take the CLAD in Australia please. There is nothing in the NI site. Or where to find that information please.

     

    Thank you in advance if you know.

  15. Hi all,

     

    I am trying to do re produce  the python dblquad fanctrion in labview with no luck. I just cannot get my head around how to generate the 2d array for this function. the python is running smoothly and gives me accurate valuse for What I am generating:

               while i<nop:
                xi=x[i]
                wz=beamwaist*np.sqrt(1+xi**2)
                q0=T*delta_phi0/(2*np.pi)       # n=2, q0= (2-1)*gamma_2*Ii*Leff
                q=q0/(1+x[i]**2)
                def f(r,t):
                    I_input=np.exp(-t**2)/(1+xi**2)*np.exp(-2*r**2/((beamwaist**2)*(1+xi**2)))
                    f=2*np.pi*I_input*r                
                    return f
                quad0,err=dblquad(f,0,3*wz,0,4)            
                   

    This is as far as I have gotten, but all the rsults are incorrect.

    I have devided the integrand into wo parts f(t): np.exp(-t**2)/(1+xi**2) and f(r): r*(np.exp(-2*r**2/((beamwaist**2)*(1+xi**2)))) and a vi for generation the r[i] and t[i] as in pic the rst of the inputs ar generated and feed into the VIs. I tried to use quadrature.vi as well how ever that same problem exists since I have to prepare tha vi to generate the 2d array of (f(x), f(y)) or an string of integrand which present the same issue.

    Please, I appreciate any help or suggestions.

    image.png.2864ccfa2161cd5aa6177ef298590c70.png

  16. Hi PiDi,

    Firstly, Thank you for thaking  the time.

    As I mentioned, I am not a programmer, and I have no notion of how big of a data package to carry on the shift register on every iteration is acceptable. 
    So far, I have to carry an array of size 3 ( consisting of 20+ arrays of data) for each "fitting" tab data, i.e. silica, solvent, sample, separately and carry that through the whole software and also take transfer that data to the next loop, e.g. acquisition loop --> analysis loop -> Display/(FileI/O) loo. I will eventually add more loops as more capabilities are added to this software. I am not sure about this, but I think in this way, I have three or more copies of the same data set carried on the register each iteration.
    I would also need to run acquisition asynchronously with the fitting section. 

    When it comes to oop, I thought it would be easier to break data for each of (silica, solvent and sample) and use override VIs since some of the data fitting parameters differ for the different packages, e.g. silica fits independently, but sample uses data acquired from silica to fit its data. This way, When I am writing the samples fitting VIs (OA and CA fitting), I only need to worry about messing up the samples fitting equation and if I know that the silica VI runs with no issues. I assume that is the purpose of using OOP (unless I misunderstood, which is possible). Right now, when I mess up an equation, I have to chase up which data was affected.

    This an example of of of the VIs right now.

    737875418_getIzero.png.c24bd82613939c871a5a2d26e9566d03.png


    I have not seen any real-life DQMH or Actor based applications apart from "TOM's LabVIEW adventures" on youtube, and the thanks are very much to his channel. Unfortunately, I don't know where to look for these applications; the examples packages with LabVIEW are lacklustre, and there are not many tutorials on the subject as far as I have been able to look.

     

     

    I am not sure if this was enough information.

     

    Cheers,

     

    Mahbod

  17. Hi All,


    I m trying to build a software, and data management has become too complex. In short, it is acquiring data from three channels and doing some calculations and then showing and reporting that data for the user to make a fitting decision. The user then, can save the file and import the saved worked-up file later to view or manipulate.

    The data consist of three interdependent data set, and so far, I have collected the dat as an array of clusters (size 3) for three sets and kept user input data in the same manner. I am also using a simple "producer/consumer" design. However, I think that may have been a mistake, and I might be able to do a better job using either actor or QMH design, especially since I need to think about adding the acquisition part (which is not yet developed). The thing is that I have not used oop before at all and am not quite sure if this is the correct approach and how should I bundle my data. Considering that the data (not all but some) need to be accessed by other classes if I goo with oop.

    For example, should I keep the data as separate class data and use methods for override or keep it as an array in the parent class and use static methods and only use child classes for graphing. These are the type of questions I am struggling with. Also, can anyone help me decide between DQMH, Actor or just standard Producer/Consumer patterns, please? I am completely lost.

    Thank you in advence.

     

    This is how the front pannel looks like:

    image.png.b0ec9ae97cf7a1c4ce920f1c4f3eb375.png

    And this is the data set for the system (which I am keeping as an array) there will me more data added to this as the capabiliy grows.

    image.png.cf63be5275ee811ed08c415ba8dcf8bf.png

×
×
  • Create New...

Important Information

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