Jump to content

Rolf Kalbermatter

Members
  • Posts

    3,772
  • Joined

  • Last visited

  • Days Won

    241

Everything posted by Rolf Kalbermatter

  1. QUOTE (MSpidey @ Jul 1 2008, 11:20 AM) Are you sure it is the MSP430 itself. I would expect problems with C runtime libraries that use string formatting to format data to be sent over a serial line but the low level interface hopefully doesn't care about such details. Rolf Kalbermatter
  2. QUOTE (DrTrey @ Jun 30 2008, 04:41 PM) You give indeed to little information about the type of device and such. If it is some DAQ device or similar however the standard mode of operation is to write a device driver and the according user space DLL wrapper. That can be easily imported into LabVIEW through the call Library Node in a way that is completely independant of the LabVIEW version. Other means would be to use libusb to control your device. Interfacing LabVIEW to libusb through the Call Library Node is about the same in terms of version dependance but the libusb API is not really meant to be interfaced by high level applications like LabVIEW or VB and you will run in some issues that are usually most easily solved by writing a wrapper DLL that translates between the low level API and the LabVIEW Call library Node. Last but not least there is USB Raw device support in NI-VISA. Not sure though from which version of LabVIEW this VISA feature is properly supported. While the feature is completely implemented in VISA, LabVIEW needs to support some extra API access modes to use this feature. A quick look in LabVIEW 6.0 shows that the necessary Nodes to use USB through VISA are not present. LabVIEW 6.1 is the first to support this interface but you will need a recent version of VISA installed on your computer. The first VISA versions had lot's of difficulties supporting USB device RAW access. Princiapially option 1 will require you to really write C code. The other two options won't but can't be really considered a lot easier. You will simply implement the bit level protocol of your USB device in LabVIEW itself. Option two will still require some serious C knowledge to be able to properly interface to libusb through the Call Library Node. From that perspective using VISA to control your USB device would be probably the simplest solution but don't expect it to be trivial. One disadvantage of the two last options will be that you can't really leverage off that solution for non-LabVIEW users such as Visual Basic, Visual C, etc. Rolf Kalbermatter
  3. QUOTE (Tomi Maila @ Nov 9 2007, 07:58 PM) User defined tags and user defined refnums are in fact quite like normal LabVIEW refnums. The Tag variant looks like a VISA resource and can have a text label that identifies the instance of the object. The refnum type looks similar to a file refnum. Those refnum types allow creating an object/method/event hierarchy using *.rc files in <LabVIEW>/resources/objmgr. The ultimate implementation of that object hierarchy has to reside in a DLL that exports certain functions that are defined in the according rc file. I believe they exist since LabVIEW 7.0 and some of the necessary methods for that DLL to interface to LabVIEW exported C functions seem to have been accidentially? documented in the LabVIEW 7.1 and 8.0 extcode.h file. Still trying to get something working here is a very tiresome exercise with lots of crashing and obviously involves external C programming. Rolf Kalbermatter
  4. QUOTE (Michael Ashe @ Sep 29 2004, 01:27 PM) When doing some debugging of my own DLL's I ran across some references hanging around in memory and looking further into this I believe that are the controls like ImageControl in <LabVIEW>\resource\PlugInControls when you have IMAQ Vision installed. Basically it seems the IMAQ control itself implemented in an external component as DLL. I do believe however that this DLL makes quite a few very specific callbacks into LabVIEW exported functions so without access to the LabVIEw source code to add specific support functions for a new type of Plugin control it would be very difficult to create a really useful control in that way. Also this looks like a mixture of VISA resource object scripting (the ImagControlRC) file and a DLL method (visible from ImageControl) that loads a C++ like object virtual table into LabVIEW. Without the actual header file for that virtual table definition AND lots and lots of documentation, there is simply no way to create such plugins. Also it is clearly a mostly C based implementation so probably not what most people here would even consider to be creating. Rolf Kalbermatter
  5. QUOTE (rharmon@sandia.gov @ Jul 1 2008, 07:05 PM) This is a standard LabVIEW VI and I don't think there is anything wrong with it itself. It's probably more in what is passed to it in terms of parameters. This VI reads the registry from a place that is defined by an earlier VI in the chain. It's C:/.... input is only a default input to be used if the inidcated key value could not be found in the registry. Obviously it can be found and for whatever reasons is set to E:/... Who did initilize that key, when and where with that value we can't tell you. But I would assume there should be a menu entry, configuration tool or something for this application that lets you configure that value. Rolf Kalbermatter
  6. QUOTE (Thang Nguyen @ Jul 1 2008, 05:40 PM) I'm afraid you missed the point that this is a function declaration and the parameter in question is a function pointer. And the OP should be advised that this is not possible in LabVIEW (well it is sort of if you create a LabVIEW DLL that exports a function with the right protoype, then LoadLibrary and GetProcAdress that function and pass the resulting pointer as an uInt32 to the Call Library Node that calls this function). Sort of because there are many caveats to this approach not the least is the difficulty about maintaining the whole thing. Another one is that it will play very badly once the DLL is created and you upgrade to a new LabVIEW version since the LabVIEW DLL VI can only run in the same LabVIEW process if the caller is exactly the same version as the LabVIEW version used to create the DLL. So while it is possible the solution is a nightmare to maintain in the long run. Instead the OP will have to create a wrapper DLL in C that translates between this callback function and another LabVIEW callback mechanisme such as occurrences or user events. Good luck. Rolf Kalbermatter
  7. QUOTE (Daklu @ Jun 26 2008, 11:39 PM) He may be competent but whenever I see a Selector function used on Boolean wires I have a feeling of: Öhhh no, one more person that has missed the Boolean Algebra classes or doesn't bother to think about creating a logic state table for a boolean problem. It is so much easier to think in terms of OR and AND for boolean problems that I simply can't understand how someone could think about using the selector instead for that. Rolf Kalbermatter
  8. QUOTE (Yen @ Jun 23 2008, 12:06 PM) Actually Windows does have pipes and they are quite like Unix pipes. The problem is that they are not really Posix compliant and the semantics are therefore slightly different. The OpenG library I created sort of works but has certain issues on startup such that the first read can sometimes timeout and similar things. The situation where this happens seems to depend on the machine used, OS version involved and quite likely also other things out of control of the programmer such as moon phase, time of day and such things I guess it could be made to work 100% reliable but I do not have the time nor currently any incentive to spend the necessary time into this also because for the situations I do use it is seems to always work as I need it to work. Rolf Kalbermatter
  9. QUOTE (Yren @ Jun 20 2008, 02:22 AM) Its most likely just wrapping some .Net functionality built into Vista. Don't know more about it though. Rolf Kalbermatter
  10. QUOTE (ned @ Jun 12 2008, 08:27 AM) From the function names and the model name I would think they really use ModBUS TCP as underlaying protocol. Sorry no experience with those modules myself. The last Adam hardware I used were I believe Adam 3000 modules and that might be about 10 years ago ;-) Rolf Kalbermatter
  11. QUOTE (PhattieM @ Jun 25 2008, 04:03 PM) It's VC++ but which version? And also do you generate an ActiveX library or a function library instead. The first needs to be accessed from LabVIEW through the ActiveX nodes after the DLL has been registered on the computer on which it is to be used and you also need to make sure to create a type library for the DLL and include it in the registration. If it is a functional library then there are a few things you need to take care of. First you cannot import C++ objects through the Call Library Node. This would be difficult to create but most important impossible to support since there is no binary standard how C++ objects are exported from a library. Each C compiler does it in a different way. Instead you need to export every single method of the objects you want to access and write accessor methods for public data you want to access and export them too. Then you should make sure that your C compiler exports thos methods as standard C symbols to avoid name mangling c.q "decoration". To tell a C compiler to export functions as Standard C symbols you either prepend the function declaration or implementation with extern "C" or surround all the exported function declarations between the extern "C" { your function1() your function2() etc. } Last but not least you need to make sure those functions really get exported from the DLL. This can be done by either creating a .def file that lists all symbols that you want to export or by adding the __declspec(dllexport) statement in front of each function declaration that you want to be exported. Other C compilers while nowadays often supporting the Visual C syntax use different declarators to mark symbols as being exported from a shared library such as attribute(export) that is for GCC and I believe Borland C used that too. Rolf Kalbermatter
  12. QUOTE (Zoyo @ Jun 23 2008, 05:29 PM) In addition to what Yen said you will not use the IRCOMM->USB cable at all. That USB interface is a real USB device interface that needs a USB host controller to interface to and that probably gets installed in your PC as a virtuel COM port. The software that makes this USB interface look like a serial port to your PC program is a driver on your PC. There is no way to directly connect that USB cable to an RS-232 port. That said your IRCOMM port is in fact most probably a serial port but as its name would indicate most probably an infrared one. So you would need to find an IRCOMM to RS-232 adapter for your device. Then you might need to figure out the pin 2 and 3 configuration as is common for serial comm and after that the real fun starts by implementing the Moeller serial communication protocol, which according to Yen there is little documentation for. Since the PDA is not x86 based an existing DLL to communicate with the PLC will not help as you can't run it on the PDA. So implementing the protocol on your own using the serial port functions on the PDA is the only solution. http://pinouts.ru/PDA/acer_n30_pinout.shtml' rel='nofollow' target="_blank">Here is the pinout of the connector but I couldn't quickly find a manufacturer of a cable that provides the RS-232 part of this proprietary connector on an DSUB-9 connector. Rolf Kalbermatter
  13. QUOTE (baman @ Jun 24 2008, 10:46 AM) What overhead that you need to change are you talking about? LabVIEW has UDP nodes and should be able to implement just about any UDP based protocol. However implementing an RTP protocol is no easy task at all, be it in LabVIEW or C(++) so if you have already some C(++) code to do that protocol, it would be definitly a lot easier to simply wrap that code into a functional DLL (or God beware, maybe an ActiveX component) and import this into LabVIEW through the Call Library Node (or the ActiveX interface). Rolf Kalbermatter
  14. QUOTE (marp84 @ Jun 23 2008, 12:38 PM) This forum does not work like this! We are all doing this in our own spare time and are not paid to support anyone here. So support is given based on the interest in a particular topic, experience with it and also about the general impression a post makes. Posts that ask open ended question like "I want to know how XYZ works" or "Send me an example to do XYZ" are almost for 100% sure to not receive substantial responses. What would work is describing what you want to do, AND ALSO VERY IMPORTANT what you have already done to achieve what you want to do. Show us that you have done some effort to get working what you want. Read manuals, documentation, examples etc. etc. Taking courses to get up to speed on using LabVIEW might help too. Then come back with specific and targeted questions. Rolf Kalbermatter
  15. QUOTE (crelf @ Jun 21 2008, 07:14 AM) Ahh well! Some people are sometimes so hung up about something they can't see that it's just a good or sometimes not so good analogy. Guess he wasn't into software at all, so that may explain it a bit. I did know programming as it was part of my study and I wasn't to bad in it either. Just never really liked it very much until I encountered LabVIEW. Rolf Kalbermatter
  16. QUOTE (Aristos Queue @ Jun 10 2008, 02:26 PM) I have an electrical engineering background and when I first encountered LabVIEW the similarity of it's diagrams with an electrical schemata was what made it very easy for me to grasp the idea and even like it very much. The rest was just getting used to specific LabVIEW ideas such as how loops, cases and such were done and here traditional programming theory from my Pascal days which used to be thought in rather formalistic ways back in those days helped of course. Thinking of wires as variables only occurred to me later when I tried to come up with explanations of how LabVIEW works but it never struck me as something elegant and I never really tried to push that idea much further. Rolf Kalbermatter
  17. QUOTE (Antoine @ Jun 19 2008, 05:56 AM) I think your DAQ board is a bit at the low end of the NI spectrum. The higher end DAQ boards support analog triggering including pretriggering and with a long enough post trigger period you will get the entire three chirps in one acquisition. You could even route the internal trigger signal from the analog trigger to some output signal through RTSI and have that signal available external too in that way if you needed. Rolf Kalbermatter
  18. QUOTE (Jim Kring @ Jun 19 2008, 12:55 PM) Well, if you are talking about IT departemetns of big multi billion dollar companies that might happen. But in a smaller company of 20 or so developers if the IT departement gets an annoyence they get a problem very fast I've been bitten by IT departements at customer sites being more difficult then they should have been IMHO, but if our own would be to difficult they would have a problem. Rolf Kalbermatter
  19. QUOTE (Anders Björk @ Jun 18 2008, 09:11 AM) VB DLLs are normally ActiveX DLLs. They do not export normal functions (excpet 4 for instantiating and controllling the ActiveX server) but ActiveX objects and consequently can not be imported by the shared library wizard. Casting references might work in older LabVIEW versions, not sure about the most recent ones since LabVIEW got a lot stricter in allowing to cast object refnums into other refnums. Basically you chose a class that is the least common denominiator of all the classes that are "polymorphic" and cast each resulting refnum into that refnum class before you leave the case structure. You need to make sure that you do not use a class that allows to select properties or methods that certain classes do not implement as that would certainly cause nasty side effects if you ever execute code to access such a class property or method on a refnum that was casted from a class not implementing these. All in all not a very good idea in LabVIEW really and if casting doesn't work (anymore) you will have to change your VB object hierarchy. Personally I would think this kind of technique be a poor mans implementation of inheritence. Rolf Kalbermatter
  20. QUOTE (jebus @ Jun 18 2008, 11:54 PM) And now with everybody knowing that this server is an open proxy it will either be changed to require login soon or it will end up on every single blacklist on this planet, resulting in you not being able to send your LabVIEW mail to many recipients, since they will often use those blacklists to filter out incoming mail for spam. I know our servers are configured to filter out mail originating from IP adresses on those blacklists. Much easier and better would have been to point your local email server to proxy for you to your ISP. Your email server should certainly be able to use proper authentification to contact your ISP SMTP server so that you have a hopefully firewalled to the internet, open SMTP server on your local network that will allow your LabVIEW program to contact it without authentification and will take care of the authentification towards the ISP instead. Rolf Kalbermatter
  21. QUOTE (menghuihantang @ Jun 17 2008, 03:55 PM) Jason's solution is the best of course. Another more quick and dirty solution is to use the timeout input to the Listen VI. Set it to a value that is not to slow for user interaction (250ms is usually quite small enough). Of course the listen node then wil return if there has a connection arrived AND also if the timeout has expired and in the second case accordingly return a timeout error which you have to filter and ignore and go back to listening again. But as mentioned, Jason's solution is the more robust one and definitly has my preference by far. Rolf Kalbermatter
  22. QUOTE (ned @ Jun 12 2008, 12:57 PM) Your last suggestion is the only real solution. ActiveX has in theory the possibility for a library to be invoked in various modes. One is out of process invokation in which case the ActiveX object is instantiated in its own server process and communicates through RPC and a proxy library with the client. However almost no ActiveX component supports this mode and they are almost all in-process servers. This means they run inside the process that is instantiating them and therefore can affect and also take down that host process. I'm not even sure if LabVIEW does support out of process instantiation of ActiveX components. If it does it won't be a well tested scenario since there are so few ActiveX components that would even support that. Rolf Kalbermatter
  23. QUOTE (PhattieM @ Jun 12 2008, 11:02 AM) This should be fairly simple. For every function in the object library that you want to be available in LabVIEW through a Call Library Node you would have to write a small wrapper. Something like this: Original function as exported from the lib: int MyFunction(int param1, int param2); Your new function: __declspec(dllexport) int LV_Myfunction(int param1, int param2) { return MyFunction(param1, param2); } Then compile it into a DLL, linking this with your object library. Possibly you could maybe suffice with a modified header file in a DLL project without any other source files where you add the __declspec(dllexport) in front of each function and simply link in the object library but I never tried that. If you want to persuade the Python solution you could look at LabPython. It is on sourceforge. Rolf Kalbermatter
  24. QUOTE (one734 @ Jun 12 2008, 04:39 AM) There is enough discussion about this. All in all this is a very clear case where trying to do everything in LabVIEW is a masochistic exercise at best. Go and write a wrapper DLL that wraps the HALCON DLL API and provides a more LabVIEW freindly interface. If you want to pass in LabVIEW native data like string or array handles you can use the LabVIEW memory manager functions as described in the External Code Reference Manual to prepare, resize, allocate, deallocate, etc. the memory blocks necessary. And by the way some good C programming basis is not only beneficial but in fact an absolute requirement to get a result that would be usuable in a real application. That is even more true so if you would want to try to avoid the wrapper DLL since you will have to deal with things in LabVIEW that are normally taken care of by the C compiler. Rolf Kalbermatter
  25. QUOTE (menghuihantang @ Jun 11 2008, 12:36 PM) Either I'm misunderstanding you or you are misunderstanding the event handling here. The data from the Event trigger is actually passed into the VI in "Event Data". If this parameter is by reference and the event is meant to pass some data back to the trigger function I would suppose your callback VI needing to supply this data back in "Event Data Out". There is no way you will ever see data from the event trigger source in "Event Data Out" since this is an indicator and meant to pass data back to the caller. Could it be that you did not understand that the Callback VI is invoked by the external event trigger but rather think it to be the event trigger itself? (Which would not make any sense by the way). Rolf Kalbermatter
×
×
  • Create New...

Important Information

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