?????? (Communication) - PowerPoint PPT Presentation

1 / 33
About This Presentation
Title:

?????? (Communication)

Description:

(Communication) A. LabVIEW . – PowerPoint PPT presentation

Number of Views:36
Avg rating:3.0/5.0
Slides: 34
Provided by: ace3YcA
Category:

less

Transcript and Presenter's Notes

Title: ?????? (Communication)


1
??????(Communication)
2
A. ? ?
  • ?? ???? LabVIEW? ??? ??? ??? ?? ?? ?? ??? ????.
  • LabVIEW?
  • Serial I/O,
  • GPIB I/O,
  • VISA I/O
  • ? ???? ??? ?? ???.
  • LabVIEW?? ???? instrument ????

3
B. Serial ??
  • Serial ??? ???? ?? ?? ?? ??? ?? ??? ??? ?? ?? ??
    ??.
  • serial ??? 1?? 1bit? ???? receiver? ???? ??
    transmitter? ????. ? ??? ??? ?? ??? ???? ???? ?
    ??? ????? ? ? ??.
  • Serial ??? ??? 1?? serial??? 1?? device?? ??.
  • ?? ?? ??? string???? ???? ?? ?? ???? ????? ??.
    ???? ?? ??? carriage return, line feed, semicolon
    ?. ?? ??? ????? ?? ??? ??.

4
LabVIEW? Instrument I/O? Serial ?????? serial ??
??? ??? ???? ????
  • ??? serial ??? ??? ??? ???.
  • Flow control? handshaking ???? ??.
  • Buffer size? VI? ???? ??? ?? ?? ??.
  • Port number? ??? ???? ??.
  • Baud rate, data bit, stop bit, parity? ??? ???
    ???? ??
  • port number? ???? serial ??? string(??? ???)? ??

5
  • port number? ???? serial ??? ?? buffer? byte??
    byte count? ????.
  • port number? ???? serial ????? requested by
    count? ??? ???? ???? ???
  • ? Serial ????? ???? ?? ??.
  • 1. ?? Serial Port Init VI? serial ??? ???.
  • 2. Serial Port Write VI? ??? ??? ???? ??.
  • 3. Bytes at Serial Port VI? ??? serial ?? ??? ??
    ??? ??? ?? ??.
  • 4. ?????, Serial Port Read VI? ???? ????? ????
    ???.

6
(No Transcript)
7
C. IEEE 488 (GPIB) ??
  • GPIB ?????? 488.2 VI? ??? GPIB VI? ????.
  • GPIB 488.2 VI? LabVIEW? IEEE 488.2 ???? ?????.
  • ?? VI? National Instruments? NI-488.2?????? IEEE
    488.2? ????. ???, ???? ??? GPIB VI? ???.
  • GPIB? ?? ??? ?? ? ?? ??? ??? ???? ??. ?? GPIB?
    ???? ??, ??? ??, ?? ??? ? ?? ???? ??.
  • 1970?? ?? HP? General Purpose Interface
    Bus(GPIB)? ??, 1975?? IEEE? ???, GPIB? IEEE 488
    ???? ???.
  • GPIB, HP-IB, IEEE 488?? ??? ?? ?.
  • GPIB? 24?? ???? ????parallel bus. 8?? ????, 5??
    ?? ?? ?(ATN, EOI, IFC, REN, SRQ), 3?? handshake?,
    8?? ???? ??? ??.
  • GPIB? 8?? parallel, byte serial, asynchronous ???
    ?? ??? ??. ?? ???? ?? ???? ????? handshake?? ????
    ?? ??? ?? ?? ?? ??? ????? ??.
  • GPIB?? ???? ??? byte(8 bit)??, ???? ??? ASCII
    string?? ????.

8
  • ??? ??? ???? ??? 3??.
  • 1. ?? ?? ???? ???, GPIB? ??? ???? ???? ????
    ?(EOI)? ???? ?.
  • 2. ??? ?? end-of-string(EOS)? ??? ???? ???? ?.
    ?? ??? EOI ?? EOS? ?????, EOI? EOS? ?? ??.
  • 3. Listener? handshake?? ???? ??? ??? ???? ? ????
    ?.
  • ??? ?????? ??? ?? ??? 030??? ??? GPIB????? ???
    ??? ??.
  • ????? ???? 0? GPIB ????? ??? ??. GPIB??? ?? ??
    ??? ???? 130? ??.
  • GPIB? ??? ???? ? ?? ????(???)? ????.
  • ?? ?? ???? ???? ??? ???? ??? ????? 1?? Talker? 1?
    ??? Listener? ????.
  • ??? string? ??? ?? Talker??? Listener?
    handshake??. LabVIEW? GPIB VI? ????? ????? ????
    ???? ?? ?? ??? ????.

9
  • GPIB VIs
  • LabVIEW? GPIB??? ?? ?? ?? ?? VI? Instrument ????
    GPIB? GPIB 488.2 ?? ???? ????. ?? VI? Low-level
    488.2 ????? ???.
  • ???? GPIB?? ????? ?? ????? string? ???? ?? ???
    ??????.
  • ??? ???? GPIB Write? GPIB Read.

10
  • Data string? address string? ???? GPIB??? ??.
  • Mode? GPIB write? ???? ??? ??.
  • ??? timeout ms?? ???? ??? ? ??? ????.
  • Error In? Error Out cluster? ??? ???? ?? error
    handler VI? ?? ????.
  • Status? 16-element Boolean array? ? ??? GPIB
    ????? ??? ??.
  • ?? GPIB Write VI? string VDCMEAS1?? GPIB
    address? 2? ??? ??.
  • mode(0)? timeout ms(25000)? ????? ??.

11
  • ??? address string???? byte count? ?? ??? ?? ????
    ???. ??? ?? ?? ???? ?? byte count? ?? mode? ??? ?
    ??. ?? ???? data string?? ??.
  • ? GPIB Read VI? ???? 2? ?? ????? 20???? ????
    ??. mode(0)? time-out ms(25000)? ???? ??.
  • GPIB Read VI? ??? ?? ?? ? ???? ???? ??.
  • (1) VI? ??? ??? ?? ?? ?? ??,
  • (2) VI? ??? ??? ??,
  • (3) VI? time limit? ??? ??,
  • (4) VI? END??(EOI asserted)? ??? ??,
  • (5) VI? end of string (EOS)? ??? ??

12
???? GPIB VI? ???? GPIB??? ??
  • ?? GPIB ?? ??? ???? VI? ???.
  • ??? GPIB VI ? GPIB write? GPIB read? ??.
  • ??? idn?? IEEE 488.2 ?? ?? ???? ????. ? ????
    ???? ??? identification string? ????.

??? ??
13
  • 1.File???? New? ???? ??? Panel? ??.
  • 2.?? ?? ?? Panel? Control? indicator? ???.
  • ?? Control? indicator? ?? ??????? pop-up? ??
    Create Control ?? Create Indicator ? ??? ?? ?? ?
    ??.
  • 3.Write Data string? idn?? ??. Read Byte Count
    numeric ????? 100? ??.

?? ?????
14
  • 1.Diagram Window? ??.
  • 2.??? ?? ?? ?????? ????.
  • GPIB Write??(Instrument I/O GPIB ?? ???) ???
    string? GPIB ?? ??? ??.
  • GPIB Read??(Instrument I/O GPIB ?? ???) GPIB
    ?? ????? ???? ???.
  • General Error Handler VI(Time Dialog ?? ???) ?
    VI? ?? cluster? ????, ?? ??? ????? dialog box?
    ????.
  • 3.??? ??? ?? VI? ??.
  • Identification string ?? Read Data? ?? ??? ??.
  • ?? ???? ?? ??? GPIB ??, EABO ?? error6? ????. ??
    ?? ??? idn????? ???? ???? ????.
  • ??? ???? ?? ?? ?? ??? ???? ????.

15
D. VISA
  • VISA? Virtual Instrumentation Software
    Architecture.
  • VISA? VXI, GPIB, RS-232, ?? ??? ??? ?? LabVIEW?
    ???? ??? ????? ????.
  • VISA? VXIplug play System Alliance? ????, 35??
    ?? ?? ????? ???? ?? ?? ????.
  • VISA ??? ??? instrument I/O ??? ???? ?????? ????
    ??? ? ?? ???? ? ??? ??? ??? ???.
  • ?? ???? Function ???? Instrument I/O? VISA ??
    ???? ??.
  • ???? VISA ????? ??? VISA session ??? ??. VISA
    session? ??? ??? Path and Refnum ?? ???? ??.

16
  • VISA session? ??? session? ?? identifier??.
  • ??? VI? ?? ??? ???? I/O? ?? ?? ??? ??
    configuration ??? ????.
  • VISA session? VISA Open ????? ????? VISA
    primitive ??? ?? ????.
  • VISA Open ??? ?? VISA ??? session? ????.
  • ?? ????? ???? ??? file I/O ???? ???? file refnum?
    ????.
  • VISA session? ????? Instr class.
  • VISA session? pop-up?? class? GPIB Instr, Serial
    Instr, VISA/GPIB-VXI RBD Instr, Generic Event,
    Trigger Event, VXI Signal Event, Resource Manager
    ??? ??? ? ??.
  • ???? VISA?? VISA Open, VISA Write, VISA Read,
    VISA Close? ??? ??.

17
  • VISA Open ? Resource Name? VISA session(for
    class)? ???? ??? device? ??? ??.
  • ? ??? session identifier? VISA session? ???? ??
    device? ?? ??? ? ? ????.
  • Resource Name? I/O ?????? ??? ?? ???? ??? ???? ??

18
?? ??? ???? ??
  • GPIB ??? ????? GPIB keyword? ??.
  • Embedded ?? MXIbus ????? ?? VXI ??? VXI keyword?
    ??.
  • GPIB-VXI ????? GPIB-VXI keyword? ??.
  • Asynchronous serial? ????? ASEL keyword? ??.

19
  • VISA Open? primary ???? 2? ?? ??? GPIB ??? ?? ??
    GPIB20INSTR? instrument descriptor
    string? ??
  • VISA Write? write buffer string ?? VISA session?
    ???? ??? ??. dup VISA session?? ??? handle ?? ??.
  • UNIX?? ???? synchronously?? ????, ?? ??? ????
    ???? asynchronously?? ????.
  • return count? ?? ??? ??? ?.

20
  • VISA Read? VISA session? ???? ????? data? ???.
  • byte count ? ?? data? ??? ?? ? ?? read buffer?
    ??.
  • dup VISA session?? ??? handle ?? ??.
  • UNIX?? ???? synchronously?? ????, ?? ??? ????
    ???? asynchronously?? ????.
  • return count? ?? ??? ??? ?
  • VISA Close? VISA session? ???? ??? close.

21
VISA VI? ???? GPIB/Serial ??? ??
  • ? ?? VISA write? VISA read ?? VISA VI? ???? ??
    ??(GPIB ?? Serial)? ??.
  • ??? idn?? ???? GPIB ?? serial ??? ??? ? ??, ?
    ???? ??? identification string? ??.
  • ??? VISA ??? Fluke 45? ???? ????

22
  • 1.??? Panel? ?? ?? ?? ???.
  • VISA session ???? ??? ???? Path Refnum ?? ????
    ??. ?? ????? ????? VISA Open ??? pop-up?? ?? ??
    ?? ? ??.
  • 2.Resource Name ???? ??? ?? string ??? ??.
  • ????? 2? GPIB ?? GPIB20INSTR
  • COM1? ??? serial?? ASRL1INSTR
  • Note VISA Open ??? Online Help? ???? ???
    Resource Name ???? ? ? ??.
  • 3.Write string Contrl? idn?? ??. Byte
    Control?? 100? ??.

23
  • 1.????? ???? ??.
  • 2.?? ??????? ?? ?? ???.
  • VISA Open ??(Instrument I/OVISA ?????)
    communica-tion session? ?? VISA session refnum?
    ??.
  • VISA Write ??(Instrument I/OVISA ?? ???) ???
    string? ??? ??? ??.
  • VISA Open ??(Instrument I/OVISA ?? ???) ???
    ????? ???? ???.
  • VISA Open ??(Instrument I/OVISA ?? ???) ???
    VISA session? ??.
  • 3.??? ??? ?? VI? ??.
  • VISA session ???? INSTR? ???? ??? ??. ??? ?????
    VISA session ???? pop-up? ? VISA class? ??.
  • Resource name ??? ?? ?? serial ?? GPIB ??? ??.
  • 4.VI? VISA. vi? ???? ??.

24
E. LabVIEW? Instrument ????? ??
  • Instrument ????? ??? ?? ??? ???? S/W? ???.
  • LabVIEW? instrument ????? ???? ?????.
  • ??? ??? ?? ??? ??? ??? ???? ??? ? ??.
  • ??? ???? ?? ?? ?? ???? ??.
  • ?? ???? ???? ???? Instrument ????? ?? SubVI? ??
    Sub VI? ??? ? ??.
  • Instrument ???? Templates
  • LabVIEW example directory? ?? VISA instrument
    ???? template VI? LabVIEW? EXAMPLES ?INSTR
    ?INSTTMPL ?.LLB ?????? ????.
  • ??? ?? ???? ?? ???? instrument ???? VI??,
    instrument ????? LabVIEW? ??? ? ???? ????.
  • Instrument ????? ????? ? ? LabVIEW instrument
    ???? template VI? ??? ???? ??. Template VI?? ??
    instrument ???? ??? ???? ??, ? VI? ??? ??? ????
    ?? ???? ????.

25
F. LabVIEW? ????? ??? Instrument ????
  • HP34401A Getting Started instrument ????.
  • ?? HP34401A Multimeter? ?? ??? ? VI? ??? ? ??.
  • LabVIEW? EXAMPLES ?INSTR ?HP34401A.LLB?? HP34401A
    Getting Started VI? ??.
  • HP34401A Getting Started VI? instrument ???? ??
    VI.
  • VI? ??? ??? ???? ??? ??? ????.
  • Help???? Show Help? ???? Help ???? ??.
  • HP34401A Getting Started VI? ??? ???? ??? ????
    indicator? ????? ? ??? ??? ? ? ??.
  • instrument ????? ????? ??? ? documentation? ??
    ????.
  • High-level VI? ?? ??? configure??? ?? ? ??? ? ??.
    ?? VI? HP34401A? ?? ?? instrument ???? ?? VI??
    ???? ??. ?? ?? VI? ?? ??? ?? VISA? ????.

26
(No Transcript)
27
??? Instrument ????? ??
  • ?? 3-2?? ?? VISA.VI? ??? Instrument ????? ??.
  • ?? ??? VISA.VI? ??? ???.
  • ??? ??
  • 1. ?? ??? VISA.VI? ??.
  • 2. ??? ??? ???? ???.

28
  • ?? ?????
  • 1. Diagram Window? ??.
  • 2. ?? ?? Diagram Window?? ?? ??? ??.
  • Edit ???? Create SubVI? ??.? SubVI? ??.

29
  • 3. ????, ?? ?? ?? ?? ??? ???? Edit ???? Create
    SubVI? ??.

30
  • 4. ?????, ??? ??? ???? Edit???? Create SubVI? ??.
  • 5.???? instrument SubVI? ?????, ??? SubVI ???? ??
    ???? Instrument Initialize .vi, Instrument
    Application. Vi, Instrument Close. vi? ??
    Seminar.llb? ????

31
(No Transcript)
32
  • Note ?? VI? ????? ???? ???, ??? ?? ?? ??? Icon
    Editor? ??. ?? ??? ???? pop-up?? Icon Editor?
    ???? ??

33
  • 6. Instrument ???? SubVI? ?? ? Seminar.llb? ????,
    SubVI? ?? ???? ???? ??? ??? ?? ??.
  • 7.??? ??? ?????. Resource Name string ????
    GPIB20INSTR? ????. VI? ????.
  • ?? 2? ?? GPIB???? ?? ???, 2? ??? GPIB????? ???.
  • ????? ?? ???? ??? Write Buffer string ???? ??.
  • 8.VI? Instrument driver.vi? ???? ????.
Write a Comment
User Comments (0)
About PowerShow.com