Rigol DS2000 Series Specifikace Strana 594

  • 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 593
RIGOL 3 Programming Demos
3-4 DS2000 Programming Guide
3-4
C# Programming Demo
The function of the program: read the device information.
1. Build a project. Find visa32.cs in the installation directory of VISA and add it to
the project. After that, visa32.cs is added to the Solution Explorer and the
type visa32 is introduced in.
2. Open the resource manager and then turn on the instrument (you need to set
the descriptor).
Const string
Cdevice_INSTR=@"USB0::0x1AB1::0x04B0::DS2A0000000001::INSTR"
viError=visa32.viOpenDefaultRM(out viDefRm);
viError=visa32.viOpen(viDefRm,cDEVICE_INSTR,0,5000,out viSession);
3. Send the request and read the data.
visa32.viPrintf(viSession,"*IND?\n");
byteReadBuf = new byte[128];
visa32.viRead(viSession,byteReadBuf,128,outretCnt);
The data read (in byte format) needs to be converted to string.
StrIdn="";
For(i=0;i<retCnt;i++);
{
strIdn=strIdn+Convert.ToChar(byteReadBuf[i]);
}
4. After the communication finishes, turn off the instrument and the resource
manager.
visa32.viClose( viSession );
visa32.viClose( viDefRm );
Zobrazit stránku 593
1 2 ... 589 590 591 592 593 594 595 596 597 598 599 ... 615 616

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

Žádné komentáře