Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

writing a serial macro

What would be the easiest way to go about writing a serial macro in labview 7?  I'm familiar with c++, c and java 5.0, but I'm new to labview.  What I want to do is fairly simple in those, but I can't figure it out in labview.  I want to basically have a line sent through serial connection that is like "#01G+400\r"  where the 01, + and 400 are inputs from the user.  In java or c you could just input the numbers to a variable a, b and c and do something like cout>>"#"a"G"bc"\r";   except that it would be the serial command, not cout.  Sorry if this doesn't make much sense, any help or a point in the right direction would be greatly appreciated though
0 Kudos
Message 1 of 3
(3,354 Views)
Use the Format Into String function - it does the same thing. Depending on whether a,b,c are supposed to be anything, or whether a and c are supposed to be number-only inputs, you would modify the format string as needed.
0 Kudos
Message 2 of 3
(3,353 Views)
hi isukevin,

Since you are new to LabVIEW, here a couple links that will get you going with serial communication. Here is a link to the NI Development Zone on Serial Instrument Control. There are also some well documented examples for serial communication in the LabView Example finder.

Basic Serial Tutorial:
http://zone.ni.com/devzone/cda/tut/p/id/2897

LabView Examples:
[In example finder] »Hardware Input and Output » Serial

Cheers,
-Marshall R
0 Kudos
Message 3 of 3
(3,327 Views)