LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass Visa Resoure Name parameter to labview dll in labwindows/cvi

Solved!
Go to solution

Hi, everyone

I build a dll from labview, the prototype is : double  getchannelpower(double f, uintptr_t *VISAResourceName);

I don't know how to pass VISAResourceName to this function.

Is it related to the paremeter ViPSession in function viOpen(ViSession sesn,ViRsrc rn,ViAccessMode am,ViUInt32 ti,ViPSession vi)?

 

BRs,

lotusky

0 Kudos
Message 1 of 7
(3,958 Views)

This was already discussed earlier:

1. Thread - Passing a VISA resource to a DLL created in C or LabVIEW

2. Can I Share Open VISA Sessions in LabVIEW with External Code?


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 2 of 7
(3,947 Views)

Hi,moderator1983

I think this question is a bit different from what you listed.The items you list are about calling dll in labview, not in labwindows/CVI or in Visual Studio. In labview , we have visa resource name control,it contains lots of data types.

But in cvi or visual studio, it's different. We have to point out which type it is.So, I think it's meaningful to discuss this question.

 

lotusky

0 Kudos
Message 3 of 7
(3,936 Views)

Ohhh, I'm sorry...!! Smiley Surprised


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 4 of 7
(3,930 Views)

Still thanks for your attention. I want to make use of a functional module from labview in my current labwindows/cvi project, it will save much time. I thought it was easy. However, I spent  half of a day and haven't figured out.

I can get the string of visa resource name (via viFindRsrc()) and also can get visession of visa resource name (via viOpen()),but I don't know how to pass the parameter.

0 Kudos
Message 5 of 7
(3,923 Views)

Anyone can help me? I'm going to continue tyring

0 Kudos
Message 6 of 7
(3,902 Views)
Solution
Accepted by topic author lotusky

Hi, guys:

 

I have figured out how to pass the parameter.

In labview, you should replace visa io control with string control. In this way, the generated dll function has the input of the string type.

Hope this will help others!

 

lotusky

0 Kudos
Message 7 of 7
(3,865 Views)