Jump to content

Steve

Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Steve's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Perhaps you could give a bit more detail about exactly what you want to do? What data do you want to send to a spreadsheet? Does something prevent you from using the simple VI that writes to a spreadsheet file?
  2. Success at last! At first I was trying to write some C code and make a DLL that would handle my variant and change the array values. I found out that what was being passed was not actually a pointer to a pointer, but I still don't really know what it is. There may be a way to make this work with C, but I am not good enough at C to figure it out. Likewise with C++. I realized that the company that provided me with the API used Visual Basic to do all of their example programs, so I made an ActiveX DLL in VB and used that to change my array values. I would strongly recommend using VB if you have to mess with Variants - it is really not picky about what you give it, and the code isn't too hard to write. Here is the function I wrote to take care of things: Public Function ArrayEdit2D(NewArray As Variant, Cal2DTableData As Object, Rowsize As Integer, Colsize As Integer) As BooleanDim data As ObjectDim matrixData As VariantDim res As BooleanDim row As IntegerDim col As IntegerSet data = Cal2DTableData.GetValue()matrixData = data.GetDoublePhysValue()For row = 0 To (Rowsize - 1)For col = 0 To (Colsize - 1)matrixData(row, col) = NewArray(row, col)Next colNext rowres = data.SetDoublePhysValue(matrixData)res = res And Cal2DTableData.SetValue(data)ArrayEdit2D = resEnd Function Thanks to everyone who offered their help, and I hope that some day I'll be able to make such useful contributions!
  3. Hi Ton, I really appreciate your help! Yes, it would be really nice to know what this variant is holding. The probe shows "Value -> Array(Non Displayable)". Flattening it to a string produces a type code that doesn't make sense to me (using the LabVIEW Data Storage Appnote) and a string that is full of whitespace. The type code array has 3 elements. In hex format, they are: 0006, 0084, and 0001. Trying to convert the variant directly to a string gives me a runtime error and no results. The literature with the ActiveX component claims that it returns a handle to an array. So, since I'm not all that comfortable using ActiveX, I thought I'd try and pass the desired array into a DLL function. In the function, I'd make a pointer to a pointer to the array, and then pass that pointer out. I'm not sure how well this will work.
  4. Actually, I realized that I can convert the variant directly (using variant to data) to a 2D array that contains the values. So if I understand correctly, all I need to do is change the array, and then send its values to the location that the handle is associated with? I suppose then I'd need an ActiveX component to take the handle to the array and the new values, and then set the array that is pointed to by the handle to the new values? Thanks so much!
  5. Hello everyone, This is my first post, so please bear with me. I'm working with some Activex functions, and one of the invoke nodes returns a variant that is a handle to a 2D array. I need to give this array new values, and then pass a variant containing a handle to the changed array into another invoke node. Can anyone please advise me about how I would go about doing this? I've attached a picture that shows what I'm talking about. Any help whatsoever is much appreciated! Steve
×
×
  • Create New...

Important Information

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