LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Concatenate integer to string for?

Solved!
Go to solution

 

Hi,

I am new to LabVIEW.

For my internship I have to control equipment over GPIB and take some measurements.

I am using the GPIB Write VI which takes a string for its Data input.

 

The command I want to send is of the form: " Apply 5, 1 "

I was thinking of concatenating a string ("Apply_"), an integer ("5"), a coma and space (",_") and the last integer ("1"), so that I can increment the integers in a loop if needed.

 

However, the Concatenate String VI does not accept integer inputs.

 

Also, I feel that I am going the hard way about this (I was thinking of appending the integers as strings, but then I won't be able to increment them at each iteration).

 

Can someone help me?

 

Thank you very much,

 

Nicolas

0 Kudos
Message 1 of 6
(8,492 Views)
Solution
Accepted by topic author htnicolas

You can use the Format Into String function.

 

Ben64

 

Use Format Into String.png

Message 2 of 6
(8,487 Views)

Have you first used the Instrument Driver Network to see if there is an existing driver? You should also look there to see what an instrument driver is and how to write one. Also, use the VISA functions instead of the low level GPIB.

0 Kudos
Message 3 of 6
(8,468 Views)

Thank you Ben64.

@ Dennis Knutson:

Yes, I installed the instrument driver. The problem is not communication with the instrument. I can send it commands and it works fine. I was asking more about the actual LabVIEW program and how to deal with the different functions/modules.

As for the VISA functions, do you have an example in mind or a tutorial you would recommend?

I'm currently using GPIB Write and Read. I'm still a beginner, so I don't know the advantages/drawbacks of each option. If you don't mind elaborating...

Thank you for your help!

0 Kudos
Message 4 of 6
(8,451 Views)

If you have the driver, you probably don't have any need to create your own string concant or Format Into String.

 

You don't mention the instrument but most drivers come with example. Open Help>Find Examples. Go to Hardware Input and Output>Instrument Drivers>LabVIEW Plug and Play.

 

Also, make sure your context help is turned on. You will see a brief description of each function when you move your mouse over it's icon and the same is true as you move the mouse over the controls/indicators on the front panel of each function.

 

I don't have a link to a VISA tutorial. Perhaps something here. VISA was probably used to write the instrument driver. It abstracts the actual hardware used. So, a VISA driver can be used with little or no change with a GPIB, Serial, USB, Ethernet, etc connection. It makes the code portable.

 

0 Kudos
Message 5 of 6
(8,436 Views)

Interesting. I will look into that.

Thank you for taking the time to help a beginner, I deeply appreciate it!

0 Kudos
Message 6 of 6
(8,426 Views)