03-15-2006 02:37 PM
03-16-2006 11:53 AM
Louis,
Have you tried using a CIN function to for the Moveblock call?? Here are some LV 8.0 links related to your question that migh also help:
-MoveBlock (CIN Function)
-Connectivity VIs and Functions
-Memory Manager Functions
-Creating a CIN That Concatenates Two Strings
Best of luck!
03-16-2006 01:07 PM
You don't need to go to the CIN, because that is for straight C systems, not ActiveX. Like VB, LV uses the TypeLib to understand what methods are exposed by the component and provide automatic data mapping. If you can call this method from VB, I'm assuming that the array is actually a SafeArray type (an oleautomation type).
Go to the ActiveX palette and use the Automation Open to create the instance of the component. When you wire the resulting refnum to the ActiveX Invoke Node, you should be able to see the list of all the methods you can call, along with the mapping to LV types. Does this get you where you need, or did I miss the problem?
03-17-2006 04:35 PM
Mark and Brian,
Thank both of you for taking time to reply. You have both been helpful. I am looking at setting up the CIN call and that may be what I need to do. In answer to your question Brian placed an ActiveX container on the page and then created a reference to that and the selected the method as you had indicated. I had done this before the problem is that the argument they are looking for is a pointer to an array of uint8. I can create that array and give init it to some size but when you try to pass that to the method it is looking for a u32 (pointer) not the [uint8] array that I have. Since there is no way to get the pointer to the array of uint8 in labview I am thinking that the CIN route may be what is needed.
Possibly I am not understanding how what you are sugesting is different that what I am doing.
In C this would be very simple,
long size = 0;
char *pBuf=NULL
m_pGrab->GetCurrentBuffer(&size, NULL); // Null pointer flags it to return the buffer size
pBuf = new char[size] ; // allocate space for the data based upon the size returned
m_pGrab->GetCurrentBuffer(&size,(long*)pBuf); // get the data from the buffer
Basicaly that is it.
In labview I have a reference to the ActiveX component.
I make a call to the Method GetCurrentBuffer and that has arguments pSize and pBuffer both Int32.
I pass a int32 (zero) to the pBuffer to request the buffer size. This should be the same as a Null
I pass the int32 size value which should be the pointer to the size not the value
( I should get the size of the buffer returned but this does not work because size is not a porinter to the size but
rather the size value)
If however I were to get a returned size I would then use this to allocate the array for the return buffer data
I pass the size returned from the above call and the buffer value from the init array
this unfortunately does not work because the call is looking for and int32 (pointer) and not the [int32] that I get from
the array init.
Does all that make some sense?
Thanks , Louis
03-17-2006 04:45 PM
03-21-2006 02:14 PM