Upload
gittel
View
28
Download
0
Embed Size (px)
DESCRIPTION
Useful LabVIEW 8.20 Features. CS Workshop 2007 February 2nd, 2007 Holger Brand, GSI. Project Explorer Libraries Shared Variables Custom DSC IO Server Periodic OnChange Classes Simple class hierarchy Online Tutorial: How to create and inherit from LVOOP classes - PowerPoint PPT Presentation
Citation preview
Useful LabVIEW 8.20 FeaturesUseful LabVIEW 8.20 Features
CS Workshop 2007 February 2nd, 2007
Holger Brand, GSI
January 1st, 2007 [email protected] 2
ContentsContents• Project Explorer• Libraries• Shared Variables• Custom DSC IO Server
– Periodic
– OnChange
• Classes– Simple class hierarchy
• Online Tutorial: How to create and inherit from LVOOP classes
– LVOOP Examples, Graphics.lvproj, Board Testing.lvproj
– LVOOP DesignPatternshttp://wiki.gsi.de/cgi-bin/view/NIUser/LabVIEWObjectOrientedProgramming
• Referenced Object, Singleton, Agent• Factory, Hierarchy Composition, Delegation, Aggregation, Specification,
Channeling, Visitor
• XControls -> Talk of D. Beck
January 1st, 2007 [email protected] 3
Project ExplorerProject Explorer
• A Project contains all project resources–Documents
• *.vi, *.doc, *.html, *.c etc.• organized in Folder and libraries
–Hardware configuration• Local hardware• Remote systems
– Documents
» *.vi, *.doc, *.html, *.c etc.– Hardware configuration
–Dependencies–Build Specifications
•A Project is an Application instance–closed shell or sandbox!–e.g. Queues with the same name are different in different application instances and do not know each other!
- You can supply a project description an define condtional disable symbols
January 1st, 2007 [email protected] 4
LabVIEW LibrariesLabVIEW Libraries
• A Library defines a namespace– Like package in Java– So, different libraries can contain different VIs with the same name.– A Library-VI name is always automatically prefixed with the library name– A Library-VI is part of the owning Library and can not be opened without.
• It has a version numer, default icon, etc• Library items can have public or private scope
– Private items can be accessed from within the library only
• A library has its own DSC settings
January 1st, 2007 [email protected] 5
Shared Variables IShared Variables I
• Successor of DataSocket variables• Variable Types
– Single Process• Time stamped, Real-Time-FIFO
– Network published• Buffered, Bind to Source, e.g. OPC item, Single Writer, Real-Time-FIFO
– Time-Triggered• IEEE 1588-Standard, Deterministic Ethernet
• Data Types– All standard data types and array of them, Variant, Bit-Field
– Custom Typedef
• Can be linked to DataSocket, OPC, ChannelAccess, Custom-IO Server• Can have DSC properties: Scaling, Alarming, Trending, Security etc.
• Shared Variable are alway part of a LabVIEW Library
January 1st, 2007 [email protected] 6
Shared Variables IIShared Variables II
• Tools– Shared Variable
Variable Manager, Multiple Variable Editor, Front Panel Binding Mass Configuration
– DSC-Module• Monitor Variables, View Historical Data
• Migrate: Configuration (.scf), Front Panel Security
• VI Based Server Wizard– On Input Change– Periodic
• Examples– Help->Find Examples...->Browse by Task->Fundamentals->Shared Variable->
Shared Variable Client – Server.lvproj– Help->Find Examples...->Browse by Task->Toolkits and Modules->DataLogging
and Supervisory Control->Fundamentals->DSC Event Structure Demo.lvproj
January 1st, 2007 [email protected] 7
Custom DSC IO Server ICustom DSC IO Server I
• An I/O server is an application that communicates with and manages input/output devices such as programmable logic controllers (PLCs), remote input/output devices, remote Shared Variable Engines, and data acquisition (DAQ) plug-in devices. These servers read selected input items and write to the selected input items on demand.
• The I/O server starts running when you deploy the project library that defines the server and stops when you stop or undeploy the project library.
• Applications can be used as OPC Server if the Installer includes the Shared Variable Engine
January 1st, 2007 [email protected] 8
Custom DSC IO Server IICustom DSC IO Server II• You might want to create a custom I/O server in the following example
situations: – You do not have an OPC server to handle communication between hardware
and LabVIEW. Custom VI-based I/O servers can interface directly with the hardware and expose data items through the Shared Variable Engine.
– You want to create a simulation server to emulate hardware connections.
• You can create two types of custom I/O servers: – Periodic I/O Server
• does not need controls or indicators on the connector pane• is running continuosly
– On Input Change I/O Server• needs controls and indicators on the connector pane• is called on change of input control value
• MyIOServer.lvproj– MyPeriodicIOServer, MyOnChangeIOServer, MyOnChangeDIMServer
January 1st, 2007 [email protected] 9
Custom DSC IO Server IIICustom DSC IO Server IIIPeriodic IO Server On Change IO Server
January 1st, 2007 [email protected] 10
Simple Class HierarchySimple Class Hierarchy
1. Create a new LV-Project: MyFirstClass
2. Create a new class: Automobile1. Add Description
2. Edit Icons
3. Add Attributes: Number of Gears, Number of Doors, Make, Model
4. Add Methods: setAutoAttribute, getAutoAttribute, Start, Stop
3. Create Subclasses1. Truck
1. Add Attributes: Short Bed?, Four Wheel Drive
2. Add Methods: setTruckAttribute, getTruckAttribute
2. Car1. Add Attribute: Number of Seats
2. Add Methods: setCarAttribute, getCarAttribute
4. Create a Main.vi and use that classes