03-25-2011 07:24 AM
@Bit880 wrote:
MIL_ID MbufAlloc2d(
MIL_ID SystemId,long SizeX,long SizeY,long Type,MIL_INT64 Attribute,MIL_ID *BufIdPtr)
I read some files,so I can give
MIL_ID ----INT32
MIL_ID systemid ---INT32
long sizex ---INT32
long sizey ---INT32
long type ---INT32
MIL_INT64 Attribute ---INT64
only this I really confuss how to setup it
--------------------------
MIL_ID *Ptr
-------------------------
Well it's a pointer to the variable, also regularly called a parameter passed by reference, and if you look in the parameter setup for the Call Library Node you will notice that when you select skalar datatypes you can also select if the variable should be "passed by value" or "passed by pointer". Which of the two would you think is the right?
03-25-2011 10:24 AM
hi rolfk,
I setup this function below, you see whether it is right.
int32_t MbufAlloc2d(int32_t MIL_ID, int32_t SizeX, int32_t SizeY, int32_t Type, int32_t Attribute, int32_t *BufIDPtr);
the last parameter is "pass by pointer"
03-25-2011 10:44 AM
But where did the INT64 type of Attribute suddenly go????
03-26-2011 09:24 AM
hi,
it is an Enum var, we can reference with it's document, it has M_array,m_image,M_kernel.....,so it is not problem, but I really want to know how to setup pointer to variable in labview ? I just first to use matrox card to acquire image.
thank you
03-26-2011 09:53 AM
@Bit880 wrote:
hi,
it is an Enum var, we can reference with it's document, it has M_array,m_image,M_kernel.....,so it is not problem, but I really want to know how to setup pointer to variable in labview ? I just first to use matrox card to acquire image.
thank you
???????????????????????????? What are you suddenly talking about???????????????????????????
03-27-2011 03:24 AM
1. attribute is an enum variable, we just need to get it's value will be ok.
2.this function is one of image acquire card "dll".
3. if you can setup parameter "pointer to variable" pls tell me how to do.
thank you...
03-27-2011 03:33 AM - edited 03-27-2011 03:34 AM
@rolfk wrote:
1) Where is there any enum in this explanation????
@Bit880 wrote:
I read some files,so I can give
MIL_ID ----INT32
MIL_ID systemid ---INT32
long sizex ---INT32
long sizey ---INT32
long type ---INT32
MIL_INT64 Attribute ---INT64
2) irrelevant for now
3) You did it right already in your attempt. What I did wonder however, is about the INT64 that suddenly got a int32_t.
03-27-2011 05:08 AM
rolfk 已写:
@rolfk wrote:
1) Where is there any enum in this explanation????
@Bit880 wrote:
I read some files,so I can give
MIL_ID ----INT32
MIL_ID systemid ---INT32
long sizex ---INT32
long sizey ---INT32
long type ---INT32
MIL_INT64 Attribute ---INT64
2) irrelevant for now
3) You did it right already in your attempt. What I did wonder however, is about the INT64 that suddenly got a int32_t.
it is hardware describe , I can not guess,but attribute type is INT64
03-27-2011 09:27 AM - edited 03-27-2011 09:30 AM
@Bit880 wrote:it is hardware describe , I can not guess,but attribute type is INT64
Yes but that is not the point. From it's naming I would assume it to be an 64 Bit integer but I can't be sure. INT64 is not an official C datatype, long long would be! However in your first dialog screen shot it clearly shows that you had set the Attribute parameter to be int64_t which would seem consisistent with that assumption but you had the last parameter not by reference but by value.
Now in your latest solution you fixed the last parameter correctly to be by reference but also changed the Attribute parameter to be int32_t which according to the previous explained "assumption" would seem like an error. Of course you can go on and fix something and change something else at the same time, that is likely causing a problem but you should not do that. Only one change at a time and then test it otherwise you never will get to a working solution.
Have fun with the rest of your Matrox API. This is one of the easier functions, once you have to pass buffers to the API to receive data the real fun starts for you And that is not even taking in consideration that you might have to deal with callback functions too. If you end up there, take a good advice and hire someone with real C knowledge. Or hammer Matrox to provide you a fully working LabVIEW API, but unless you can show them you are going to buy a few hundreds of their boards over the next year if they do, it may be hard to convince them.