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: 

LVRefNum *VISAResourceName in DLL

Hello,
 
I'm busy with a new project where i want to communicate with a labview DLL. The DLL is a device driver with a specified interface. My first test was with a yokogawa WT230 where i tried to receive the voltage. I declared everything as a constant and the function only returned a pointer to float value (voltage). This works quite nice and i want to expand the function. The DLL declares my new function as: void YWT_GetVoltage(LVRefNum *VISAResourceName, float *MeasureValue)
 
Just like previous example I will look at the MeasureValue which is my result. However labview requires that i provide the DLL with LVRefNum *VISAResourceName and i don't understand how to send this to the dll. In the previous test I Hardcoded this in the VI as: GPIB0::1::INSTR
 
Im using Delphi and I've tried to send a pchar (pointer to character), Cardinal (unsigned 32-bit) and pCardinal (i've tried to do more things but same result) in an attempt to test this myself. I've read through the forums but i haven't been able to figure this one out.
 
Could someone please explain to me what/how to access the DLL with the LVRefNum *VISAResourceName. What type of value does this function expect from me?
 
With kind regards,
 
Erik Zwollo
0 Kudos
Message 1 of 3
(3,446 Views)
Continueing the quest for a viable answer led me to: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000PAl8SAG&l=en-US 
 
It seems that it's impossible to externally control the Visa Resource Name. I wonder if there are any other options to somehow tell the VI that it needs to connect to Device 1 on GPIB0?
 
With kind regards,
 
Erik
0 Kudos
Message 2 of 3
(3,426 Views)

Dear Gentlemen,

Somehow i managed (so it seems) to solve my issue.

First I deleted the "VISAResourceName input"  and changed it into a "string input" and was able to connect it to the VISAResourceName input of the "VISA WRITE" (complicated sentence i know).

I then updated my DLL and tried to send the string "GPIB0::1::INSTR" to the DLL and it worked.

If anyone would like more information please let me know.

With kind regards,

Erik  

0 Kudos
Message 3 of 3
(3,424 Views)