LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

I, along with many others, am new to programming in LabWindows. Can someone please help me with getting a variable into the command-li

ne of a piece GPIB equipment? I am wanting the user to input a decimal value and then send that decimal value in the command line string to the equipment. Am I going to have to do some data conversion here or is there an easier way??? Thanks in advance!
0 Kudos
Message 1 of 3
(3,151 Views)
ne of a piece GPIB equipment? I am wanting the user to input a decimal value and then send that decimal value in the command line string to the equipment. Am I going to have to do some data conversion here or is there an easier way??? Thanks in advance!I copied this from one of my GPIB instrument drivers.
Once the instrument is installed in the system (that's
the bd[InstrID] part), just print the value into a string
in the format dictated by the instrument manual, then use
ibwrt to upload it to the instrument.

ps. As a beginner you might want to use sprintf() rather
than Fmt(). I have never yet found anything that
sprintf() and sscanf() couldn't cope with, and the
learning curve on Fmt() and Scan() shouldn't be
attempted without oxygen!

Fmt (WriteBuffer,"%s



// write formatted string to GPIB - set desired units
ibwrt(bd[InstrID], WriteBuffer, NumFmtdBytes ());

"KHolland" wrote in message
news:506500000008000000A0160000-98367778
4000@quiq.com...
> I, along with many others, am new to programming in LabWindows. Can
> someone please help me with getting a variable into the command-line
> of a piece GPIB equipment? I am wanting the user to input a decimal
> value and then send that decimal value in the command line string to
> the equipment. Am I going to have to do some data conversion here or
> is there an easier way??? Thanks in advance!
>
>

0 Kudos
Message 2 of 3
(3,151 Views)
ne of a piece GPIB equipment? I am wanting the user to input a decimal value and then send that decimal value in the command line string to the equipment. Am I going to have to do some data conversion here or is there an easier way??? Thanks in advance!In the UIR place a numeric control onto the screen and then double click it. Call it something unique. That name will be the control ID. In your program use GetCtrlVal(panel, controlID, value);
Then the value of the numeric control will be saved in the parameter called value. Manipulate that number however you want. You will need to define the variable somewhere in the top of the FCN.
0 Kudos
Message 3 of 3
(3,151 Views)