# Mahbod Morshedi

Members

15

• Version
LabVIEW 2016
• Since
2017

## Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

## Mahbod Morshedi's Achievements

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.

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. 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

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: 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.
4. ## xygraph Moing plots againt one another in XY graph

Thank you very much @hooovahh, That was helpful; however, I think my issue was misunderstanding the purpose of offset managed to fix it like this, and now it works fine. Thank you very much, though. Cheers
5. ## xygraph Moing plots againt one another in XY graph

Hi All, I am trying to plot three XY scatter data and move one against the others. It does work when I make a new x-axis and change the scales of one manually. However, when I try and use it programmatically, the numbers of the scale change, but the plots do not change, meaning the one that was moving is not anymore. I could just recalculate X values separately and replot every time I change scale, but I don't think that should be the only way to do this. Any help would be appreciated.
6. ## combo box Indexing combo Box for both value and String

Thank you, Bryan; I will keep that In mind. Thank you, Neil, as well; Indeed I know about clusters and TypeDefs and Do use them, and I think overall, I will be leaning towards making Classes and storing all the native app data in the class, so they remain private. At this time, I am implementing top-down, bottom-up piece by piece since this is my first real-world programming experience. I appreciate all your comments and help and am very grateful. Cheers,
7. ## combo box Indexing combo Box for both value and String

Hi Bryan, You are absolutely correct the file processing and updating the combo box will happen out side, and the info is will be send to the vi (but since the rest of the app is not developed I left it here to test if it works fine). I am also going to use the same setup to get several other constants and initialisation conditions as another combo box. This was done so I can just save new conditions as new procedures later and reload when needed. I am just not sure if I should open, update the combo only, close the file and then release the reference to save memory. Then when the user selects from the combo box reopen the file and generate the required data for initialisation and only keep that info and close the file again and empty the array, again to save resources. The program have a long way to go and I'm too slow in learning (not a programmer as you can tell) Cheers, Mahbod
8. ## combo box Indexing combo Box for both value and String

Thank you Sam and Bryan, Great help I did not realised that I could just get the label form lable I tought that is the label of the combo box lol. I ened up needing mor info and had to use arrays. Let me know what you think if interested and have the time to spare.
9. ## combo box Indexing combo Box for both value and String

Hi All, I'm new to LabVIEW and overall programming. I wanted to use a combo box to extract the string and associated value to use later for calculation and presentation. I have come up with this one below, which works fine and is very modular (I can just add the solvent info, and it is good to go with no other change, unlike implementation as case structure). However, I wanted to know if this is good or is there a better (more straightforward) way to achieve the same thing? Cheers, Mahbod
10. ## Pyhton or C to do For Daq and DSP?

Thank you Rolf, Great comments. I think I will be going with C++ as well; as I said I am willing to put the work in and am not in a rush I will take my time, since there are many other things I need to learn along side this, such some electronics. Cheers, Mahbod
11. ## Pyhton or C to do For Daq and DSP?

Thank you, JKSH, For the comments, and I hear you. Unfortunately, having a tutor is out of the question, no low-level programmers at the research school of chemistry. But I will take your advice to heart. Cheers, Mahbod
12. ## Pyhton or C to do For Daq and DSP?

Hi Sam, A very fair question that I have been struggling to answer too. I am (at the moment developing a z-scan experiment which in reality an f-scan, focal point scan using an Optoune variable focal lens, the driver of which is written in LabVIEW). Apart from that, I am an electronic enthusiast (just starting, really) and have a few additions to the project in mind; and instead of using commercial systems, I want to build them myself using Arduino (not yet FPGA, and I don't think I have the talent or the knowledge to touch DSP processors). That is why (since LabVIEW mostly have made the job of DAQ easier) I think I would be using Labview as the primary language and call either scrips or DLLs from within the Labview programme. As you can guess, I am not a programmer (just a chemist), but I would love to develop my own experiments. So far, I have been developing with existing pieces of equipment, but I am keen to learn how to make some of them myself. Maybe I am taking the wrong approach here, and if so, please feel free to let me know. Cheers, Mahbod
13. ## Pyhton or C to do For Daq and DSP?

Hi Jacobson, Thank you for the advice. I think the way it goes; I may have to just suck it up and go with C/C++. I have used call DLLs from Labview very briefly, and I know it works, and from What I have seen, G language in its core does the same thing for many of its VIs. Cheers, Mahbod
14. ## Pyhton or C to do For Daq and DSP?

Thank you for your reply ShaunR, Indeed, I already know about python's prim itive connections. However, this does not answer my original question. The question was if I have to put my efforts into a text-based programming in combination with LabVIEW for my particular needs, which would be a better option, C or python, given that MatLab (price-wise) is out for me? Cheers,
15. ## Pyhton or C to do For Daq and DSP?

Hi All, I am a Physical Chemist and am just starting Labview (a long way to go, as you may suspect). I would need to do a lot of Daq and DPS but with a low budget (using Arduino and NI-Dev boards for my projects). I would like to have the option of going hybrid programming (text-G) and since I do not have much programming experience i wanted to know which one would suit my purposes better, C/C++ or python. I have worked with formula nodes, and it is easy for making base computations and mathemathical formula and I was sad by the fact that you either have to use C/C++ syntax or Mathscript as in Math nodes; meaning MatLab inside labview codes. I am fully willing to put work in if C/C++ is the answer, but I wanted to know which should I pick? I really appreciate any help you can provide. Cheers, Mahbod
×