ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing parameters to Labview DLL from VB.NET

I have tried running VISA calls in DLL based on both examples provided by Rolfk and BTC_Admin. Unfortunately, I could not find the right way to read back into VB refnum *VISAResourceName and was getting error.

 

* VISA_Open

 */

int32_t __cdecl VISA_Open(char ComName[], int32_t ErrorValIn,

            uintptr_t *VISAResourceName);

 

I had more success with the other option with VISA_Open prototype

void __cdecl VISA_Open(char ComName[], int32_t ErrorValIn);

/*!

VISA_Open seems working correctly with error=0.I have also tried to run it in Labview front panel and I could see my COM port resource name does show up in "VISA_ref.vi”  

 

However, when calling  this VISA_Write function from VB

int32_t __cdecl VISA_Write(char TxStr[], int32_t ErrorValIn);

 

I am getting an errorOut = -1073807346. The same error I am getting if I run this VISA _Write.vi directly from the front panel. I thought that the reference is kept in "VISA_ref.vi" and is visible to all attached VISA functions in the DLL, but it looks like VISA_Write does not get the resource reference from "VISA_ref.vi”. Or could it be anything else I am missing?  

0 Kudos
Message 21 of 21
(538 Views)