LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dll parameter setup

 


@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?

 

Rolf Kalbermatter
My Blog
0 Kudos
Message 11 of 19
(884 Views)

hi ,

 

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"

0 Kudos
Message 12 of 19
(858 Views)

But where did the INT64 type of Attribute suddenly go????

Rolf Kalbermatter
My Blog
0 Kudos
Message 13 of 19
(852 Views)

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

0 Kudos
Message 14 of 19
(833 Views)

 


@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???????????????????????????

 

Rolf Kalbermatter
My Blog
0 Kudos
Message 15 of 19
(830 Views)

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...

0 Kudos
Message 16 of 19
(820 Views)

 


@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.

 

Rolf Kalbermatter
My Blog
0 Kudos
Message 17 of 19
(817 Views)

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

0 Kudos
Message 18 of 19
(813 Views)

 


@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 Smiley Tongue 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.

Rolf Kalbermatter
My Blog
0 Kudos
Message 19 of 19
(804 Views)