NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem using c/c++ dll from adapter

Im using an i/o card that came with an c dll, with included functions in order to read and write to 8 bit ports.
 
When i need to read from it from c++ i connect to the IO card and reads the value on it with the following function:
 
[CODE]

unsigned long DIValue = 0; // returned DI value

err = DI_ReadPort(cardID, DIPort, (U32 *) &DIValue);

if

(err!=NoError) {

//Error occurs !!

//ToDo : Handle error here

}

[/CODE]

Works fine.

 

Now if i want to use the IO Card dll in teststand instead, i get a problem. I connect fine to the card and can output to it, but how do i get the value from this function, which makes use of reference/cast, which gets placed in DIValue.

Ive tried using the reference/pointer options there is under c/c++ adapter when assigning parameters, but surely thats not enough.

 

 

 

0 Kudos
Message 1 of 3
(2,986 Views)

If the type U32 is a 32-bit integer, then what you are doing sounds right. See the attached screenshot of the specify module dialog.

-Erik

0 Kudos
Message 2 of 3
(2,958 Views)
Thx for the answer.
 
I have done what you showed me, but it never worked, so i made a wrapper for the DLL i was using, which avoided pointers and  now it worked Smiley Happy
0 Kudos
Message 3 of 3
(2,945 Views)