Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

viVPrintf can't use "&"

Solved!
Go to solution

hi:

I want to save image from VISA

I use 

 

status = viVPrintf(vi, ":DISK:SAVE:IMAGE " "FALE1"",JPEG,SCR,ON,INVERT" + vbCrLf, 0) 

 

it can save image.

but i use 

 

 Dim filename As String = VI_filename.Text

status = viVPrintf(vi, ":DISK:SAVE:IMAGE " & filename & ",JPEG,SCR,ON,INVERT" + vbCrLf, 0) 

 

it can't work!

why?

0 Kudos
Message 1 of 3
(2,625 Views)

Hi xiochouyu,

 

What is the IDE you are using to use VISA calls?

Applications Engineering
National Instruments
0 Kudos
Message 2 of 3
(2,600 Views)
Solution
Accepted by topic author xiaochouyu

  status = viVPrintf(vi,  ":DISK:SAVE:IMAGE """ & filename & """,JPEG,SCR,ON,INVERT" + vbCrLf, 0) 

 this's right way!

0 Kudos
Message 3 of 3
(2,580 Views)