Jump to content

HeLo

Members
  • Posts

    19
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

LabVIEW Information

  • Version
    LabVIEW 2009
  • Since
    1989

Recent Profile Visitors

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

HeLo's Achievements

Newbie

Newbie (1/14)

  • Week One Done Rare
  • One Month Later Rare
  • One Year In Rare

Recent Badges

3

Reputation

  1. Hi mhenz, thank you very much!!!! I corrected this and - it works 😃. For all, who maybe have a need for it, I attach the corrected code (only the file "Faddeeva.c" was changed). Herbert Faddeeva.zip
  2. As the faddeeva function is not available in LabVIEW, I have compiled the code of Steven G. Johnson into a DLL using the GCC compiler in Code::Blocks - and it works (the same code is used also in SciPy, Matlab and others). In order to improve in speed, I would like to run the function in a for-loop "enabling loop parallelism" or have it called by multiple clones of a reentrant "Faddeeva.vi". However calling the function that way produces erroneous results - it looks like there is some interference between the different calls. As native LabVIEW functions like "Integral x(t).vi" can do exactly this and as these functions also call a dll, I must have some statements in my dll that are not thread save. Can anybody point me to the mistake, that prevents a correct multi threaded call? Herbert P.S.: Please find below a part of the c-file attached #include <math.h> #include <windows.h> /* The Faddeeva.cc file contains macros to let it compile as C code (assuming C99 complex-number support), so just #include it. */ #include "Faddeeva.cc" BOOL WINAPI DllMain (HINSTANCE hInst /* Library instance handle. */ , DWORD reason /* Reason this function is being called. */ , LPVOID reserved /* Not used. */ ) { switch (reason) { case DLL_PROCESS_ATTACH: break; case DLL_PROCESS_DETACH: break; case DLL_THREAD_ATTACH: break; case DLL_THREAD_DETACH: break; } /* Returns TRUE on success, FALSE on failure */ return TRUE; } /* LabVIEW created typedefs */ #pragma pack (1) typedef struct { long dimSize; double elt[1]; } TD1; typedef TD1 **dArr; double *Re_zArr, *Im_zArr, *RelErr_Arr, *Re_wArr, *Im_wArr; double complex z, w; int Npts; int i; _declspec(dllexport) void FaddeevaW(dArr x, dArr y, dArr RelErr, dArr Re_w, dArr Im_w); _declspec(dllexport) void FaddeevaW(dArr x, dArr y, dArr RelErr, dArr Re_w, dArr Im_w) { Npts = (*x)->dimSize; Re_zArr = & (*x)->elt[0]; Im_zArr = & (*y)->elt[0]; RelErr_Arr = & (*RelErr)->elt[0]; Re_wArr = & (*Re_w)->elt[0]; Im_wArr = & (*Im_w)->elt[0]; for (i=0; i<Npts; i++) { w = Faddeeva_w((*Re_zArr + *Im_zArr*I), *RelErr_Arr); *Re_wArr = creal(w); *Im_wArr = cimag(w); Re_zArr++; Im_zArr++; RelErr_Arr++; Re_wArr++; Im_wArr++; } } Faddeeva.c Faddeeva.cc Faddeeva.h
  3. And it is here again: I just installed LabVIEW 2016 on a Windows 10 virtual machine (Parallels 11.2.2) on a mac with OS 10.11.6 - and - none of the above procedures work: Ctrl-Shift-A does not work at all, others from time to time. Then I also noticed that scrolling in the macintosh version of LV 2016 does no longer work reliably - I can't use the scroll wheel anymore to browse through event-, case- and other structures (I need to try 3 to 5 times, until something happens). It looks to me as if NI uses its own special functions to receive keyboard and mouse events instead of using the standard operating system functions - as all other programs work fine. Now, as there is obviously a non negligible number of LabVIEW-developers using virtual Windows-machines on a mac, I would really enjoy NI to check into these issues. Herbert
  4. I converted the QuickDrop plugin into a JKI RCF-plugin. Herbert
  5. Hi Eric, I saved the vi for 8.2 Regards Herbert Wire to BuildArray_Bundle 8_2.vi
  6. Hi all, having suffered a lot from cleaning code of somebody that had not heard anything about Loops or Clusters, I sat down to study scripting and produce my first Quick Drop plugin. Use of the Plugin: Select the objects you want to wire to a BuildArray or Bundle function and invoke the Plugin ("shift" for Bundle). The Plugin then creates the function with a matching number of input terminals and connects the objects to the function. For sure, there are ample possibilities to improve/expand the Plugins functionality. Herbert Wire to BuildArray_Bundle.vi
  7. hi torekp, this solution looks to me simple and lean. Another solution would be to run a Telnet server on your spec computer and start your program through that server. I implemented this about a year ago in a virtual machine in order to simulate an instrument, with which we communicated through Telnet and FTP. However, this would only be an advantage, if the Telnet server were running anyway and was eased in my case by having the Internet-Toolbox of NI available. Herbert
  8. Hi, I would like to prepare a collection of runtime menus for graph indicators, store them as .rtm-files and load them during runtime, depending on the data displayed. However, I could not find a possibility to do this. Am I right that the only way to do this is by using subvis with appropriate strings, fed into the menu functions? Thanks Herbert
  9. Thanks Aristos, so I just have to plunge into LVOOP and do some tests. Herbert
  10. Hi! as my projects become larger, I feel that OOP is the way to go in the future. However my concerns are with memory management. I have to deal with large data junks, means 4x2 MB of 16 bit integers that need to be converted to doubles, in order to do the number crunching needed. In total that makes 64 MB just to hold one copy of the data. Following the recommendations, published on the internet, I actually store the data in smaller junks in a queue and do all "junkable" operations in for loops. Now my question is: Using OOP, do I have to use queues as well to avoid unnecessary data copies or is OOP freeing me at least from some of my concerns? In other words, is there some resource to find out, when data copies are produced in OOP and when the processing occurs in place? Thanks
  11. Hi all, although knowing and profiting from the forum for quite a long time, I used it mainly as a source to improve my LabVIEW coding and felt that the professionals for sure know better than myself. Now, as a possible contribution please check my teaching software written in LabVIEW on my my website. If anyone is interested in getting the source code, please ask. By the way, I started to write such code with mathematica in 92 but soon discovered that it was much easier to do it in LabVIEW. Although doing heavy math in LabVIEW is not the thing I would recommend to others, the ease of creating a nice and handy user interface outweighs the disadvantage of difficult to read formulas. Furthermore, the longer you do it the more you get used to it. Another advantage I noticed is the speed of LabVIEW. In my tests, my LabVIEW code always outperformed equivalent Matlab, Mathematica or other code. Recently I transcribed a program from Java and got a speed increase of at least a factor of 2 (I did not check whether the published Java code was optimized). At last thanks for the invitation to speak up in this forum, dominated by LabVIEW cracks. (I think thats just normal in as much the forum calls itself "LabVIEW Advanced Virtual Architects" ) Herbert
  12. Hi Cris, I am guessing that in your matlab code you minimize the square of the distance of experimental and theoretical values. This means, you are minimizing the sum: "sum of (Re_theortical - Re_experimental)^2 + (Im_theoretical - Im_experimental)^2). This means that you should be able to easily implement this with reals only: Arrange your experimental data for example such that y0=Re(z0) and y1=Im(z0), y2=Re(z1), y3=Im(z1), .... and the acquisition times are t0, t0, t1, t1, ......... Now, what you have to do is write your fitting function such that it computes the real part of the theoretical function for even indeces and the imaginary part when the index is uneven. In terms of speed, I would use a case structure and toggle between false and true. Then, if it is possible to calculate the derivatives analytically, I would code them in the same manner. Maybe, this description is a little short but please ask again, if I am not clear enough. Herbert
  13. Thanks's a lot to the great LAVA-Team! Herbert
  14. Hi Community, in some applications, I would like to give the user the option to leave some windows open that have received data from a master-vi. As far as I know there are several concepts, for example starting independent vi's that then communicate through shared variables and so on. However, in order to have full access to all the methods and properties (trigger events by writing a "value signaling" ...) in the independently running vi, I came up with the attached solution. Do you think this is too complicated and how do you solve such request? I hope that the code is pretty self explaining and I included a compiled version in order to show that it works also as a compiled application. Herbert
  15. Hi, although it works this way, it is not working as expected: I have put another transparent, green triangle in between the two existing, observing that you can see through both blue and green only, if the green triangle is added to the scene before the blue. Then I checked and tried to see through both from behind. Looking from behind however, transparency is lost. Transparency thus seems to be implemented as an optical diode - not what you normally observe in nature. Herbert
×
×
  • Create New...

Important Information

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