Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by Zyga

  1. We did such a thing for dalsa camera. It indeed require to write wrapping functions, but there is a help which describes how IMAQ image is stored in the memory so you should be able to cast vendor image format to LV IMAQ. If you do not need any suphisticated camera and acquisition control this library is pretty basic and I have used it with success. I might be missing something but I do not think that OpenCV has a good cam acquisition support.
  2. Hello, On a debug purposes I would like to open reference to a privately scoped vi from outside class (or from parent class vi). But while I am trying to do this I am getting error 1390. Which makes all sense. But is there any way to walk-around this? Without ofcoure adding code to the class. I see that Caraya developers has encountered similar issue and did not resolve it. Anyone who has an idea? Thanks for your help.
  3. Thank you for your answers and sorry for not being here for a while. Based on information from you, I have achived what I needed, but there are still things that are mistery for me. That was my thinking before I wrote this post. But it somehow did not fit to what was happening in my project. I was loading a class, changing its VI properties and then call this VI using dynamic dispach mechanism. It wasn't modified as I expected. So I suspected that LV preallocate clones for dd VIs while loading class (and I wrongly assumed that those are VI with "instance" suffix). And this would fit to what was said after: So I have created this example: And this is what happens when I call this VI first time I open the project: What supprised me most is that even though LV has allocated single clone for dd vi right after class loading, changes made on reference to its prototype applies to the clone as well (which, for some reason, is not the case in my project..). And changes applies to clones that are created afterwards which is expected. Exactly the same behaviour can be seen in executable built based on this example. Second run after project loading, has both clones in the memory from the beginning. Now operating on the reference has no effect on both clones.
  4. I wonder if someone has found a way to retrieve reference to a vi that is overriding method and has reentrancy set to shared clone. What exactly I am trying to do is to change properties of this VI controls by using externally opened reference. Actually I would like to localize FP at application loadtime (without placing code on "to be localized" VI blockdiagram). When I list all VIs in memory I get stuff like this: sDataAcquisition.lvclass:editWindow.vi:Instance:6cc60448-8771-4aea-ad60-5635b7cb9c6a.vi sDataAcquisition.lvclass:editWindow.vi:Instance:b60c6bed-8161-4566-ab34-ae4092625b90.vi sDataAcquisition.lvclass:editWindow.vi sDataAcquisition.lvclass:editWindow.vi is a method that overrides one from parental class. sDataAcquisition.lvclass:editWindow.vi has not yest been called when above list has been populated, just owning class loaded into memory. Can someone explain what Instance:xxx-xxx.vi suffix mean? Can I be sure that if I find all of instances there will be no more alocated at app runtime? I also can find stuff like that, which has longer suffixes tree: loadDrivers.lvclass:execute.vi:Instance:ed894b20-902d-486d-ae3e-062689901cdc.vi:Instance:c1440502-af17-4937-acbe-a4f891f270d2.vi loadDrivers.lvclass:execute.vi:Instance:ed894b20-902d-486d-ae3e-062689901cdc.vi loadDrivers.lvclass:execute.vi I assume that this is correlated to ancestry hierarchy somehow, but is there any documentation how/when this clones are created? Getting back to my original goal. I would like to change properties of e.g. sDataAcquisition.lvclass:editWindow.vi and all its clones.
  5. I do not believe this is a disadvantage. Serialization is special... if the parent is not serializable then the child is not serializable. Requiring inheritance from a base Serializable does not seem to me to be a bad requirement. Even in other languages where serialization is an interface, mostly they have to add special syntax checking to make sure that the interface is implemented by the eldest class or else it doesn't work. Serialization isn't functionality that can be injected on a descendant level. It's all or nothing to be meaningful because failure to preserve parent state means you aren't actually saving the state of the object. Thus the requirement to inherit from specific base seems absolutely reasonable to me... indeed, it is an advantage because it syntactically assures that the ancestors are included. Now when I am thinking of it, it sounds obvious. I am possessed by flatten to/unflatten from xml ease of use.. Flattening the names of the complete ancestry into every flattened string would be an incredible bloat of the flattened size of data. Once again, now mentioned it is perfectly plain. For me it is hard to imagine using more than 3-4 inheritance levels, but looking on e.g. VI Server I see it is reasonable to have more than that.
  6. From what I see they are not. Correct me if I am wrong, but this lib enforce "serialize" method to be overwritten and then calls it through whole hierarchy. Disadvantage of that solution is a need to change inheritance. Ok, but enough of moaning. We will use one of existing solution. Just wanted to point out where retrieving ancestry list would be useful (wonder why this information is not in the class flattened string?).
  7. I was looking for getting ancestry list at RT solution for a while. Found few posts, did some coding - no success. I just reply to this old post as @Aristos Queue asks why would someone need that information. I wish to flatten/unflatten object to other format than xml. Surely this post is a grate start, but still unable to get TD even whole data is there. If flatten/unflatten to xml function can do the job, there must be solution hidden under the hood.
  8. Zyga

    NI DAQ alternatives

    These are questions that have to be answered before every single project. And assumption is that if I choose decent vendor, he will provide me with any of above options (I wouldn't dare to demand DIO96..). More important for me is to find solution tested with pc based systems.. With NI I am sure of community and NI support. Whole bunch of pitfalls already discovered and resolved or walkaround found. If about LINX license, this is plainly answered in FAQ authors site. So Yes, you can use LINX to programm arduino for commercial usage.
  9. Zyga

    NI DAQ alternatives

    We do not have strict requirements. This question do not apply to any specific project we are going to implement in near future. This is question in general, but basically I cant think of something that 100Hz, single point measurement wouldn't be sufficient. Actually we have few industrial eol testers based on Windows PC + cdaq, and they works perfectly well. These are not always harsh environments and cDaq does well. Few matters which needs to be balanced and analyzed carefully. Depends on many factors really. Surely if you would have had few implementations over year, you could consider writing your own, good quality driver. It sound like an idea, but it might be very hard to make customer believe this is robust solution. I have never programmed Arduino by myself either, so I would't feel very confident with this solution.. I was looking on Advantech before and did not find any tempting hardware there, but Phoenix and Moxa looks way better. Yes, but getting deeper in this direction we do not need LV at all.. remote IO modeules easily controllable via LV software.. That is the main goal. From what I see there are solution that I was't aware of, but not yet tested in LV. Now most difficult question to answer to is the one from @smithd. Whether it is path worth of exploration or it is just waste of my time and money..
  10. LAVA users, We are looking for alternatives for NI DAQ devices for industrial automation. Since NI has its devices mostly focused on advanced/high speed/high precison data acquisition/processing its prices are inadequate to simple automation tasks. I would also say that NI PC based daq systems are expensive if need to be distributed systems (found this but still relatively expensive cRIO required). Just now we need to extend our compactDAQ based system with two DIO modules. We even have free chassis slots for this, but station that needs this IOs is few meters away from PC. How easier would it be if we could use single ethernet cable.. Ofcourse we can add another small cDAQ (what we probably going to do) but this is slightly expensive solution for our customer. Does anyone have some experience with 3rd party solutions? Any known daq devices vendors? Standalone ethernet daq modules? Regards, Zyga
  11. Hi, I think you might want to read this paper. I am afraid that if you do not have access to the dll sources you will not be able to retrieve this data correctly. At the first place I would split up complex data into simpler types, then pass it to dll as separated arguments. That will make things easier in your dll code. Regards, Zyga
  12. OK, If you will not be able to do so, it is not a big deal, at least I know that it is possible
  13. Hello Porter, I've been looking on this library for a while, but I wasn't able to make it work with labview. Would you share your code? Zyga
  14. Tested and it works. With multiple images stored in a single file it doesn't work. Looks like win uses them just for better apperance. All of them list in the resource hacker as a single group. When we take a look e.g. on LabVIEW, there is a group for a single file type icon. Nevertheless specifying icon path explicitly solves my problem. Thanks!
  15. Hi, I would like to associate icons with file types that are handled by a LabVIEW built application. To do so, "defaultIcon" key has to take a value of executable path with parameter "resource ID". The question is how to build in more than one icon with executable? Examples of LabVIEW keys: -library: ..\LabVIEW.exe,-8 -llb: ..\LabVIEW.exe,-3 Is it even possible with app builder? Any workaround?
  16. As far as I know ActiveX should be plan "z". It might cause unexpected problems, just like .net. It's hard to imagine how you can exchange data with compiled code without exact knowledge how it's made. I'm not experienced it this kind of things but it sounds hardly to be done. Shared variables are used to communicate e.g. with PLC systems, so it suggesting this should work way faster than mentioned 50-300ms (for sure more stable). You can also take a closer look on shared memory. I have seen some LV implementations, not only for RT targets on which it is native LV functionality.
  17. Could you provide us more details? Any particular reasons? I've used .net in my project twice or three times already, and there were no problems occurring.
  18. Why dont you do some post-build actions? e.g. https://decibel.ni.com/content/docs/DOC-19943
  19. Thanks for reply. I'm not using any Call Library Function Node directly. lvanlys.dll jumps into dependences automatiacally when I place some standard LV functions, e.g. mean.vi. Similar situation takes place when I use one of NI Vision VI but with this difference that "vision.dll" isn't included to my source distribution. Best regards, Zyga
  20. Hi all, I wrote some code that uses functionalities from lvanlys.dll, so it appears as dependant item in project explorer just like other dlls that I'm linking to (e.g. nivision.dll). When I want to distribute my code as lvlib, lvanlys.dll is copied to destination directory (and worse it becomes part of the lvlib) what causes future conflicts in a project where I use created library. No other dlls are acting like this, only lvanlys.dll. What is the difference between them? How i can avoid of copying this file? Best regards, Zyga
  21. Thanks for repty. my function ptotype: float Calibrate(float *APoints, int32_t *Asize, int32_t width, int32_t height, float squareSize); And LabVIEW call: If I remove: double rms = calibrateCamera(objectPoints, imagePoints, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs); from compiled code, functions works. Non of from LabVIEW data is used to call this function. objectPoints is a vector created from Apoints by arr2vect() while Asize is used to properly place elements in mentioned vector.
  22. Hi everyone. I wrote wrapper in Visual Studio for OpenCV calibrateCamera() function. Every operation like converting 1D array of points to vector<vector<Point2f>> etc, works ok, except most important thing. When function ()calibrateCamera is called, LabVIEW crashes. When this line is commented out, dll works ok (at least labview is still alive). Im out of ideas. I suspect that this is problem with memory management but i dont have an idea where it cames from. Function do not operate directly on data passed from LabVIEW. Ultimately I can compile code as exe and call it via cmd, but I'm curious why such a thing appears. Thanks for your precious time! Zyga dll source (if you need i can enclose some sample input data): #include <opencv2/core/core.hpp> #include <opencv2/calib3d/calib3d.hpp> #include <extcode.h> using namespace cv; using namespace std; static void calcBoardCornerPositions(Size boardSize, float squareSize, vector<Point3f> &corners); static void arr2vect(float *APoints,int *Asize, vector<vector<Point2f>> &imagePoints); extern "C" { float __declspec(dllexport) Calibrate(float *APoints, int *Asize, int width, int height, float squareSize) { //initialize variables vector<vector<Point2f>> imagePoints; Size boardSize; boardSize.height = height; boardSize.width = width; Mat cameraMatrix = Mat::eye(3, 3, CV_64F), distCoeffs = Mat::zeros(1, 1, CV_64F); cameraMatrix.at<double>(0,0) = 1.0; vector<Mat> rvecs, tvecs; vector<vector<Point3f>> objectPoints(1); Size imageSize; imageSize.width = 2040; imageSize.height = 2040; arr2vect(APoints, Asize, imagePoints); // prepare imagePoints calcBoardCornerPositions(boardSize, squareSize, objectPoints[0]); //prepare objectPoints objectPoints.resize(imagePoints.size(),objectPoints[0]); //calibrate double rms = calibrateCamera(objectPoints, imagePoints, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs); return rms; } } //definitions static void arr2vect(float *APoints,int *Asize, vector<vector<Point2f>> &imagePoints) { int page = *(Asize); int row = *(Asize+1); int col = *(Asize +2); Point2f pointBuf; vector<Point2f> vectBuf; for (int i = 0; i<page; i++) { for (int j = 0; j<row; j++) { pointBuf.x = *(APoints + (i*(row*col))+j*2); pointBuf.y = *(APoints + (i*(row*col))+j*2+1); vectBuf.push_back(pointBuf); } imagePoints.push_back(vectBuf); vectBuf.clear(); } vectBuf.clear(); } static void calcBoardCornerPositions(Size boardSize, float squareSize, vector<Point3f> &corners) { corners.clear(); for( int i = 0; i < boardSize.height; ++i ) for( int j = 0; j < boardSize.width; ++j ) corners.push_back(Point3f(float( j*squareSize ), float( i*squareSize ), 0)); }
  23. Stick to C# entirely is nat an option for me (at least for now). I don't know c#. But i'm familiar enough with labview to do things i want to do. I'll do some test and we will see. Thanks for help and for useful references. If I handle with this I'll post my solution.
  24. Right, but Constructor Node says that ISldWorks class has no public constructors. I assume that IsldWorks class is an abstract class. A Few weeks ago I faced the same problem. How to use .net abstract class in LV and I did that just by creating .net reference and pointinting that specific class. Im not real OO developer so my reasoning and might be wrong but it worked. Thanks to your tips i came across on information that i can create some wrapper in c# that could return proper reference. Do you think it is possible and it could work?
  25. There is online documentation under this adress. For now i just want to create top-level object ISldWorks from SolidWorks.Interop.sldworks.dll and for example, simply call RevNumber() method. Same action in Visual Studio works fine. Sub Main() Dim app As SldWorks = CreateObject("SldWorks.Application") Dim revNmb As String = app.RevisionNumber End Sub Only thing i did is to add SolidWorks.Interop.sldworks.dll to a reference library. In LabView i acces to a ISldWorks class by creating .net referece and manually browsing to dll (static class? Not sure that is proper naming). As a result is empty reference. By the way, thanks for reply!
  • Create New...

Important Information

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