Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

convert string to ViChar* in function viOpen

Hello,

 

I try to use viOpen function with an IP Adress stored in a variable.

The function wants a ViChar*

 

I tryed all i can imagine : converting in string, c-string and byte array to cast in ViChar* but all failed.

Sometimes, the compiler tell me an illegal cast, other times le program crashs when executing the function.

 

Can someone to help me ?

 

(P.S : I work in C++).

0 Kudos
Message 1 of 4
(3,905 Views)

Have you looked at the included examples that are installed when you install NI-VISA and NI-488.2?

 

In XP, they are located at  C:\Documents and Settings\All Users\Documents\National Instruments\NI-488.2\Examples  and   C:\Documents and Settings\All Users\Documents\National Instruments\NI-VISA\Examples

0 Kudos
Message 2 of 4
(3,902 Views)

I don't have those examples because I use Windows 7.

 

I found programming samples in C:\ProgramData\Agilent\Agilent IO Libraries Programming Samples\ but that not help me because no one show how to use a variable to give the adress string to the viOpen function.

0 Kudos
Message 3 of 4
(3,893 Views)

@Hlodwig wrote:

I don't have those examples because I use Windows 7.

 

I found programming samples in C:\ProgramData\Agilent\Agilent IO Libraries Programming Samples\ but that not help me because no one show how to use a variable to give the adress string to the viOpen function.



The NI examples will be in a different directory for Windows 7. They are there. I have Windows 7 on a laptop at home.

 

EDIT:  Since you are using Agilent's software, why are you here????

These message boards are for NI software and hardware.

Agilent has their own message boards.

 

 

 

 

 

0 Kudos
Message 4 of 4
(3,887 Views)