04-19-2007 05:27 AM - edited 04-19-2007 05:27 AM
Message Edited by aajjf on 04-19-2007 05:34 AM
04-20-2007 09:35 AM
Hi,
I'm not sure if I understand you correctly. It sounds like you want to pass the image array from your subvi to your main vi. If this assumption is correct, then you've got a simple fix:
First, in your subvi, make sure that the image array is displayed as an indicator on your front panel (the format of this display doesn't matter). Locate the vi icon in the top right corner of your window, right-click on it and select Show Connector. The icon now has changed to block of rectangles. When you hover over it, the cursor morphs into the wire spool; click on one of the rectangles and then click on the image array indicator. Now this subvi has a terminal that will pass the image array to the main vi that you place it in. Save the subvi, place it in your main vi and you'll see that it now has a wire which you can connect to and retireve the array. You'll do the same for your cluster of bundled data types.
Let me know if I've misunderstood. I'd like to be of help.
Cheers,
Emilie Kopp | Applications Engineer | National Instruments
04-20-2007 10:17 AM
You say nothing about how your cluster looks but I'm afraid you did the standard error here and placed arrays in it. That is not what the C structure is representing for several reasons.
@aajjf wrote:
Hi friends,
I am new to labview. I need to create a demo program in labview ,for displaying image from our own image capturing system. We have a DLL ( build in VC++) containing functions for capturing image from our system. Now I need to create a VI library for some of functions in DLL and Create a Demo program using those created subvi library . I used "Call Function node" and created some of subvi's.
Some of our DLL functions need to pass struct pointers. Our function prototype will be similar to the following function.
__declspec(dllexport) int __stdcall Initialize( unsigned char *imagebuffer,struct config *Configuration);
The passed struct is similar to
struct config
{
double val1[3];
unsigned short val2;
bool val3;
bool val4[3];
unsigned char val5;
unsigned char val6[3];
bool val7[26];
};
For passing "unsigned char *imagebuffer" I initialized array with "Numeric constant " and set the size of the array and send to the function.
The problem here is, I used this array in one of the subvi.
How can I use the returned imagebuffer array in my main demo program. How to connect the image array to subvi "Connecter Pane"
And which control can I use to display the image. The image data I get is form of 1-D Array .
The second problem is,
For passing the structure, I used "Bundle " and filled the bundle with all the datatypes as in my struct and passed to the function. Is it correct ? How to access this bundle after returned from function in another Vi. ie.) How to connect this bundle to the connter pane ?
Thanks for your valuable suggestions.
aajjf.Message Edited by aajjf on 04-19-2007 05:34 AM
04-21-2007 06:22 PM
04-22-2007 12:47 AM
You can display it as an array of bytes. That is fast. If you want to see the image itself you will have to convert it either into a Picture Control or an IMAQ Vision picture. The first will never be able to give you 30 fps and the second is not free.
@aajjf wrote:
Hi friend thanks for your replies.
Since I felt difficult with the structures, I created a wrapper Function in my DLL , without using sturct. So my second problem is solved.
Hi Emilie Kopp,
Thanks for the suggestions. I have a problem in displaying the 1D array image data. I have attached my part of code that displays the data .Have a glance and inform me incase of any error I have made. Or suggest any other method to display the image. I will display 30 frames in a second.
My imageCapture() declaration is : "__declspec(dllexport) int __stdcall ImageCapture(unsigned char *DisplayBuffer);"
In " Call Library Function node" I have initialized as follows :
Function Name : ImageCapture "Run In UI Thread "
Calling Conversion : stdcall(WINAPI)
Parameter : Type : DataType:
ReturnStatus Numeric Signed 16-Bit Integer
DisplayBuffer Array unsigned 8-Bit Interger.
My function is shown in Function prototype window as : " short int ImageCapture(unsigned char *DisplayBuffer);"
Am I making any mistakes ?
Thanks for the help.
AAJJF.
04-22-2007 07:56 AM
04-22-2007 12:48 PM
It all depends on the format of your bitmap in the byte array. What I meant with displaying is just a simple array control shell with an uInt8 integer inside.
@aajjf wrote:
Hi Rolf Kalbermatter , thanks for your reply.
Can you suggest me , how to display the array of bytes ? which control should I use?
As I have given in the block diagram code, I used Reshape array to convert 1 D array to 2D array , pass the 2Darray to the Draw Flattent Pixmap, and then pass the picture to the picture control. Is this correct method ? or is there any other method to do it.
In the current method, the Reshape Array always gives data of "0".