Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

I have a dll Problem with a Built labview vi

I have a VI I have built that Counts rising edges and returns some very simple math.  The program works fine in Labview but when used in Matlab returns a -200474 error, as if it did not see any rising edges.  I am using the corrent pointers.
0 Kudos
Message 1 of 4
(5,425 Views)

Hi haploanddogs,

 

Can you give more detail about how you are interfacing between ML and LabVIEW? Did you build the LabVIEW VI into a DLL and then are now calling it from ML? Is this all occuring on the same computer?

 

Thank you for choosing National Instruments.

 

Aaron

National Instruments

Applications Engineer

http://www.ni.com/support 

0 Kudos
Message 2 of 4
(5,411 Views)

I have built the vi into a .dll.  I have a very simple script that creates pointers for the program to use, then passes them by refrence.  Attached is the matlab call to the dll.  Interestingly if I pass by pointer I get a -200474 error, however if I use a direct refrence I get a -50352 error.  I am not quite sure what is going on.

 

 

 >> loadlibrary('check_speed_jitter','check_speed_jitter.h')

>> meanHZ=libpointer( 'doublePtr', 0 );
>> std_dev=libpointer( 'doublePtr', 0 );
>> MAXtime=libpointer( 'doublePtr', 0 );
>> MINtime=libpointer( 'doublePtr', 0 );
>> ErrorCode=libpointer('int32Ptr',0);

>> get(ErrorCode)
       Value: 0
    DataType: 'int32Ptr'

>> [a,b,c,d,f,g,h]=calllib('check_speed_jitter','Check_Speed_Jitter',40,ErrorCode,meanHZ,std_dev,MAXtime,MINtime)

 

 >> get(ErrorCode)
       Value: -50352
    DataType: 'int32Ptr'

 

 

>> num_in=libpointer('int32Ptr',40)
>> [a,b,c,d,f,g,h]=calllib('check_speed_jitter','Check_Speed_Jitter',num_in,ErrorCode,meanHZ,std_dev,MAXtime,MINtime)

>> get(ErrorCode)
       Value: -200474
    DataType: 'int32Ptr'

 

 

 

Regards,

 

0 Kudos
Message 3 of 4
(5,408 Views)

Hi haploanddogs,

 

Have you checked out this Developer Zone? It talks about using the Math Interface Toolkit to convert VIs to MEX-files which can be used by ML.

 

Regarding error -200474 and -50352, can you tell at which point (which VI) the error is occuring in your copiled DLL?

 

Thank you for choosing National Instruments.

 

Aaron P

National Instruments

Applications Engineer

http://www.ni.com/support 

0 Kudos
Message 4 of 4
(5,377 Views)