-
Posts
3,892 -
Joined
-
Last visited
-
Days Won
267
Content Type
Profiles
Forums
Downloads
Gallery
Everything posted by Rolf Kalbermatter
-
I'm sure you are not working with Windows anymore, since Windows changes the way of working and data formats with every new version. Not sure you will find another solution though without at least some of that problem too . As to flattened dataformat changes, lets see, one incompatible change at version 4.0 since LabVIEW was introduced as multiplatform version in 1992. (Version 4.0 was around 1995.) Sounds at least to me like a VERY stable dataformat.
-
Looks almost like an implicit (and definitely not legal) I8 cast is done somewhere. This is something NI really will want to investigate, since such errors are a terror for any LabVIEW user.
-
Weird reasoning. The LabVIEW variant is not the same as an ActiveX Variant. LabVIEW does wrap ActiveX variants in its own variant to make them compatible diagram wise, but the actual internal implementation of LabVIEW variants is NOT an OLE/ActiveX Variant. And the same applies to the flattened format which is just as proprietary as the other flatten formats, although fairly well documented, except for the Variant. NI usually does a good job in maintaining compatibility with documented behavior but reserves the right to change any non-documented detail at any time. In case of the flatten format they changed the typedef description internally with LabVIEW 8.0 and in the mean time even documented that new format but maintained a compatibility option to return the old flatten typedef. The actual flattened data format stayed the same, except of course was extended to support new datatypes (I/U64, Timestamps, etc.). The only real change in flattened data itself was in LabVIEW 4 when they changed the Boolean to be an 8 bit value instead of a 16 bit value (and boolean arrays changed to be arrays of 8 bit integers, whereas before they were packed). Other changes in the flatten data format were in various versions in how refnums got flattened but NI does not document most refnums internals and therefore it's internal implementation is private and can not be relied upon. But if you know where refnums are you can usually skip them in the datastream without version dependency (almost ). And claiming ActiveX Variants are a standard is also a bit far reaching. It's a Windows only implementation and many other platforms don't even have such a beast.
-
I left it open on purpose. It can be quite a decision
-
Things like this give Mondays a bad name...
Rolf Kalbermatter replied to Daklu's topic in LAVA Lounge
Any plans on moving to Europe? -
Contratulations Daklu. The next 1000 posts will be a charm .
-
Congratulations François. Nice achievement.
-
you clearly missed some, mostly from february 2010 but also later. I reported them but not sure who gets those reports. I think I reported some of them already last year.
-
Reinventing the Image indicator
Rolf Kalbermatter replied to brainmort's topic in Machine Vision and Imaging
Just to confirm! There is no way you can create your own custom control for LabVIEW. While the image control is located in kind of an external resource, some sort of DLL, it uses a completely proprietary and undocumented interface to integrate into and interact with the LabVIEW user interface. And all the meaty functions which do the real image drawing and what else of that control, are implemented in the LabVIEW kernel itself. Since we can't extend that kernel - it is located inside LabVIEW.exe - there is no way for people outside NI to do something like that. -
What are the most useful vision functions?
Rolf Kalbermatter replied to brainmort's topic in Machine Vision and Imaging
Well as you go on with this project you will soon find that it takes A LOT of time and effort to write such a thing, and therefore it is likely that your Open Source library is only ever going to support a fraction of the functionality of IVision and you will understand why they didn't make the entire OpenCV API fully accessible in LabVIEW. IVision as it is, is a really large task in itself to accomplish already and contains quite a bit of work to make the OpenCV API work with good performance from LabVIEW. Sure you could go and simply create LabVIEW wrapper VIs for the OpenCV functions directly without any intermediate DLL but you will soon find out that the VIs created in such a way are kind of hard to develop and maintain and the performance of such a solution is likely going to suffer. The LabVIEW ecoverse is kind of small, and while Open Source can and does work in some areas image acquisition is probably not the most likely one. It requires quite a bit of domain knowledge, a very good programming knowledge and a large amount of time to maintain, and all that for a very small user base. Small because the professionals will use IMAQ Vision anyhow, since it is backed up by NI support, semi professional might go for IVision because of the cost, and the poor students will take whatever is there if they can get it for free, but only really do the minimalistic stuff of accessing a webcam and storing an image to disk, with an occasional simple image analysis function if they even have the time and guts to dive into the theory of how to use that. -
EMP/Ethernet
Rolf Kalbermatter replied to Ravikumar's topic in Remote Control, Monitoring and the Internet
Besides that there are examples in LabVIEW that show you how to do simple TCP/IP communication as already mentioned by Tim, this request is so unclear and brutal at the same time that the only thing I can come up with is "Homework hustler". -
Sending an array of clusters to a C dll
Rolf Kalbermatter replied to c_w_k's topic in Calling External Code
There are some serious trouble and some minor nitpicks. First thing is your initialization of the string cnt value before you allocate the string handle with NumericArrayResize(). This can't work, since the cnt element is just another element inside the memory buffer of the handle. Therefore it does not yet exist. In fact the (*((*(CamArray))->CamInfo[deviceIndex].SerialNumber))->cnt = strlen(String); must crash since you dereference the (*(CamArray))->CamInfo[deviceIndex].SerialNumber value which is still a NULL handle from the previous DSSetHSzClr(). And if you hadn't used the function with Clr in it, the value would be not necessarily NULL but still as invalid a memory address as NULL is. So you can't initialize cnt before you allocated the string handle with NumericArrayResize() and in fact I make it a rule to always only initialize cnt AFTER I have filled in the data. The same potential error is done in the FillError function. Potential because the string may be not NULL if the VI that passed in the error cluster had put a non-empty string in there. Another issue although not fatal is that you do not need to account for the 4 bytes of the dim (for string its the cnt) integer when you use NumericArrayResize(). This function accounts for the dim integer already when allocating the necessary memory handle (but it doesn't fill in the dim/cnt value. You do need to account for the dim/cnt size when using the DSNewHandle(), DSNewHdlClr() and DSSetHandleSize() functions since this are low level memory manager functions that make no assumptions about the content of the handle. Last but not least strncpy() is a rather tricky function. It's semantics happen to work for this specific case, since a LabVIEW string does not need to be NULL terminated and strncpy() does not insist on adding that NULL character to the end if the count value happens to be equal or smaller than the actual characters in the source string. So while strncpy() actually works perfect for this use case with LabVIEW string handles I try to avoid this function at all costs since when used with normal C strings it often can result in unterminated strings in the memory buffer which can cause all kinds of buffer overrun errors. Call of MoveBlock() or memcpy() is much more clear in this respect since it does what one expects and nothing more or less. -
Then let it send you a confirmation email. In there all activation codes are listed and can be copy-pasted enblock into the activation wizard. Had to do that here because the wizard seemed not able to connect to the activation server, while it could actually have me send the email, so go figure .
-
And it's a long way to be anything but Windows only. I know of Moonlight but sorry guys that is not cutting it yet for use in an application like LabVIEW on non-windows platforms. Even Mono is still lacking quite a few things to be a true .Net replacement.
-
It's your application, at least I would hope that, so the answer to both questions can only be given by you. The only thing we can tell you are generic advices or in other words: 1) It's time to close your VI FP when you don't have to show anything to the user or don't have to get information from them anymore. 2) Invert number 1) and you have the answer to that as well.
-
Well you can access the data and therefore export it to some other place but ODBC indeed is not meant as a management interface to a database. Each database implementation has very different ideas about how its data needs to be managed and that would be almost impossible to put in a generic API that fits all. So this is really mostly left out of ODBC (and ADO and DAO and JDBC and what else generic database APIs you have). A database usually comes with it's own management application that is meant to be used for this task. For MySQL there are also PHP based management tools since MySQL is often used as backend for web servers. Trying to do real management of a MySQL database from within LabVIEW would require a specific VI library to access the MySQL management API. Certainly doable but not something that could be done in a weekend or so. And that is why it most likely hasn't been done by anyone so far.
-
Filling a cluster with strings and arrays dynamically
Rolf Kalbermatter replied to jbone's topic in Calling External Code
Well that the DLL call is done in the UI thread may be just a byproduct. What I was meaning to say is that the execution of the entire XNode may be forced into the UI thread. I have never bothered to look into XNodes and how they work, but it wouldn't surprise me if they are more of a quick and dirty hack added to LabVIEW than a properly designed feature, which might be one of the reasons that it never made it into a public feature. And taking the shortcut of executing XNodes in the UI thread would make creating such a feature much easier. Of course it's not ideal to do it that way but hey I have no idea what the intended use cases were so it may have made perfect sense. -
The logical and real "fix" would have been to use user refnums, which are available since at least LabVIEW 7 or so. And allow us mere mortals to use them too, without having to revert to reverse engineering them!
-
My point is that the password does disallow looking at the code, but does not encrypt it in any way. And why should it, if it did this would serve almost no purpose at all, since it would be functionally almost equivalent than removing the diagram altogether. The only difference with that would be that if you remove the diagram and loose the original then you lost all your work, with the password protection as long as you remember the password you still can get at it, even if you loose the unprotected original. But that is a minor difference that would not justify spending much resources at all to be put in LabVIEW, since loosing a password is actually easier than loosing original VIs, if you do some kind of useful backup, and we all do that, don't we? As far as LabVIEW is concerned the password protection still allows LabVIEW to load the diagram and compile it, that is a given and not just an assumption. As such NI can create an internal LabVIEW prototype that would allow opening password protected diagrams. Of course they don't just as there is nobody out there who admits openly to have broken the password protection yet. Bottomline: If the security of your diagram is life threatening to you, don't distribute it, password protected or not. LabVIEW can get at the diagram and so could a sufficiently determined hacker. It's not easy but certainly not impossible. Is it safe enough to prevent usual theft? Yes I believe so! But then I have not used the password feature at all so far and don't feel it useful for the work I do, and I have even released quite a bit of code as open source, so maybe I'm just not paranoid enough to care about the password protection of LabVIEW diagrams .
-
Consequences of unreliable run method
Rolf Kalbermatter replied to Mads's topic in Application Design & Architecture
It's no help I know but this has been an issue as long as LabVIEW has had the Run method (and even before VI server when there was a CIN based VI library to do some simple VI Server like things, around LabVIEW 4). -
Please not that this is not exactly a cheap way of determining an array size. The value extraction will create a copy of the array, potentially using quite some memory and also costing performance to do the copy. No problem if your array contains only a few 100 elements but definitely something to think of with an array that could contain 1 million values.
-
Well, it is unfortunate but not really a problem. If the VI needed recompiling at all, it already is recompiled when opening its reference and if it didn't need, well then why to try to force it anyways? Well and that is where you go wrong. What you propose is no different than removing the diagram code altogether. There LabVIEW can't recompile the diagram on load anymore since it isn;t there so loading a VI into a LabVIEW system that is not the same version or platform breaks the whole hierarchy. With password protection the diagram is still there and LabVIEW can access it for recompilation when necessary. It simply won't let anyone open the diagram to look at the code. Is it absolutely safe? Of course not, the only way to be 100% safe is not to distribute the diagram at all in any way and even better yet not distributing the VI at all since theoretically anyone with enough time at hand can go and try to find the compiled code, analyze that and reverse engineer the original diagram. The only safety here is that locating that compiled code and reverse engineering it is a lot more complicated and time consuming than doing the same with a normally compiled C/C++ program.
-
Check for data on TCP connection
Rolf Kalbermatter replied to mike5's topic in Remote Control, Monitoring and the Internet
No my library wouldn't really help with that although it could probably add such a poll feature somehow. The library really is meant to make use of SSL and other TCP/IP socket functionality almost as simply as the original TCP nodes do. For IPv6 that is already mostly there, ping also with the additional limit of the required administrative rights, that is basically impossible to avoid on most modern OSes. SSL is another issue. SSL supports a lot of different kinds of operations and parameters that all need to be somehow supported. However most of them are obscure, with no examples at all and often seldom used. So for the time being the library supports opening SSL sockets with default settings, but not yet custom certificates and other stuff such as authentication since that requires a way to enter parameters when creating the socket. I have some ideas how to allow doing that but that requires quite some infrastructure and then the chances that anybody is going to use it are still very small. My library doesn't currently support accessing native TCP refnums other than a somewhat hidden feature with separate Get and Set Attribute VIs that can access any of the supported socket attributes also on native TCP and UDP refnums. Unfortunately there is no way of supporting that through the publicly exposed property nodes itself but only through the special VIs, which is not as convenient as the property nodes. Just one more comment. The error handling with WSAGetLastError() is probably never gonna return a meaningful error. (WSA)GetLastError() retrieves a thread local storage value set previously by another function. That assumes that the previous function and GetLastError() are called in the same thread and without any other function in between that could set that value. Since the CLN's are set to execute in any thread this is absolutely impossible to guarantee and in my experience actually almost never happens either. Not even setting both CLNs to execute in the UI execution system would be able to guarantee proper operation, since theoretically there could still execute another call to an API that influences this value, between when LabVIEW calls the recv() function and when it eventually calls the WSAGetLastError(). The only way to guarantee that this is working properly is by locating both calls in an external call library in one single function and call that through a CLN. -
How to know the available function's parameter list?
Rolf Kalbermatter replied to Breakpoint's topic in Calling External Code
Ohh dear a sourceforge project! Well I simply assumed that someone resorting to API export applications for a DLL would certainly not do that for an open source library. Talk about hiring an expensive detective to find out about "secrets" that are in the public domain!!!