Rigol DS2000 Series Specifikace Strana 595

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 616
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 594
3 Programming Demos RIGOL
DS2000 Programming Guide
3-5
5. C# program
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace IDN
{
class Program
{
const string cDEVICE_INSTR =
@"USB0::0x1AB1::0x04B0::DS2A0000000001::INSTR";
static void Main(string[] args)
{
Int32 viError;
Int32 viDefRm;
Int32 viSession;
Int32 retCnt;
Int32 i;
String strIdn;
byte [] byteReadBuf;
viError = visa32.viOpenDefaultRM(out viDefRm);
viError = visa32.viOpen(viDefRm, cDEVICE_INSTR, 0, 5000, out
viSession);
visa32.viPrintf(viSession, "*IDN?\n");
byteReadBuf = new byte[128];
visa32.viRead(viSession, byteReadBuf, 128, out retCnt);
strIdn = "";
for ( i = 0; i < retCnt; i++ )
{
strIdn = strIdn + Convert.ToChar( byteReadBuf[i] );
}
Console.WriteLine(strIdn);
Console.ReadKey();
visa32.viClose( viSession );
visa32.viClose( viDefRm );
}
Zobrazit stránku 594
1 2 ... 590 591 592 593 594 595 596 597 598 599 600 ... 615 616

Komentáře k této Příručce

Žádné komentáře