Jump to content

jaehov

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Posts posted by jaehov

  1. QUOTE (mesmith @ Mar 17 2009, 03:42 PM)

    Nope, that's what you have to do. Unless you're trying to access static methods or properties, you have to instantiate the object with the constructor node before any object exists that has any methods or properties.

    Mark

    ok sounds good. But just out of curiosity, what did you mean by access "static" methods or properties? What Labview controls would I use then?

    thanks

    J

  2. post-7622-1237317801.jpg?width=400



    Hello Techies

    I wanted to make a reference to a .NET .dll for use in Labview.

    I started out by creating a .NET Refnum control and then connecting that to a Property Node. I could see all the properties, but when I ran the VI, I got Error 1172

    (see the attachment)

    My 2nd idea was to use a Constructor (for the object I wanted), then connect that to the Property Node. Now this seems to work with no error.


    My question is:

    1) Is there a better way of referencing the dll in my VI other than using a Constructor (...then getting the properties?) or am I doing this correctly with the 2nd idea?


    thanks

    The Rookie

  3. QUOTE (Mark Yedinak @ Feb 17 2009, 04:54 PM)

    This will work nicely provided he has 64 bit integers. Based on an earlier post of his he needed to do this on without 64 bit integers for numbers larger than 32 bit integers. That was the reason I was suggesting converting the string to a byte array and processing that. That solution will work for abitrarily large numbers.

    Yes. I am in the labview 7.1 environment. So I am without the use of the Labview U64 capability.

  4. Hey techies

    I am working with a pre-existing test tool with LV 7.1

    I need to convert a Decimal String "1234567899" to an Integer equivalent (no truncation or other formatting)

    Essentially I want the string "1234567899" to be converted to the Integer (1234567899)

    I know in LV 8 this would be a breeze with U64. But how can I perform get same result in LV 7.1 ?

    thanks

    The new guy on the block

  5. Jeff

    Problem Solved! .....No more Error 1172 !!!

    I had to go to the Block Diagram and create a constructor. Once I created the constructor, I then imported the .NET dll.

    The constructor was then wired to an Invoke Node....exposing the dll methods and properties

    I attached a word document for viewing pleasure ;)

    ~jaehov

    Can you show us any of the code that you're using? (at least a screenshot?)

    One thing that I forgot to include in my post yesterday is that you need to call the .NET constructor before you can use the reference. On your block diagram pallette -- Connectivity -> .NET -> Constructor. Use this to create your .NET reference instead of dropping down and using the .NET refnum control on the front panel (You'd use this method to pass the already created refnum to a subVI after you call the constructor to create the refnum).

    See if the constructor fixes your problem. There's also a few .NET examples with LabVIEW that can give you an idea, too.

    Download File:post-7622-1170452589.doc

  6. Hello All

    I have a dll that was created in .NET

    I can open the dll within LV8 and I can see the methods and properties.

    One of the methods is called "Multiply". Multiply takes 2 inputs (x,y) and then gives a result.

    x and y are both int32

    I input values for x and y , run my program, "RPSTestLibrary.VI" , ...then I get the Error code 1172.

    "Error calling method RPSTestLibrary.RPSInfo.RPSMultiply of NULL ObjectId, (System.ArgumentNullException: Key cannot be null.

    Parameter name: key) in RPSTestLibrary.vi"

    Does anyone know how to fix this error?

    ~j

  7. Hey Jeff

    Thanks for the response!!...I can see the methods and properties for my .NET dll !

    .NET refnum in LV 8.2 is found under the "Modern" controls palette >> "Refnum"

    Have a Great Day

    ps. I did have .NET 1.1 SP1 installed

    ~J

    First of all, make sure you have the latest .NET framework off microsoft.com (You need at least .NET 1.1 SP1 for LabVIEW). If you have VS.NET, you're probably OK.

    Drop a .NET refnum on your front panel. On your block diagram, right click it and select "Select .NET Class" > Browse... You can select the DLL to use and the .NET class inside the DLL to use. From there, wire up a property node or invoke nodes to use the properties/methods of the .NET DLL.

×
×
  • Create New...

Important Information

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