Download presentation
Presentation is loading. Please wait.
1
LabView Universal Driver Presentation Part A Shmulik & Pia Zobel Advisor: Mony Orbach
2
Project Goal Build a universal driver to connect between LabView and any type of hardware This semester we built a specific driver for a Physics Momentum USB Chip Based on this driver, we are building the full driver
3
Driver Architecture The universal driver receives the interface from the user and builds a specific driver for each chip The specific driver is built from two parts: Pseudo hardware – VIs in LabView Software – C++ code The two parts communicate through DLLs
4
Driver Architecture
5
Psuedo Hardware Architecture An application in LabView is called a VI - Virtual Instrument A VI is built from subVIs (i.e. other VIs )
6
This Semester’s Driver Built from four main VIs: Open Driver Close Driver Write Driver Read Driver
7
Open Driver
8
Close Driver
9
Read Driver
10
Write Driver
11
Momentum USB Chip Driver A driver for a chip which measures position The chip is connected to the computer through the USB Functionality: I.Opens a connection to the chip II.Configures it III.Reads the data IV.Closes the connection
12
Momentum Chip Hierarchy
13
Block Diagram
15
Front Panel
16
Main Software Architecture The main program is activated by a DLL from LabView using createproccess() Runs in memory continuously Initializes the DLL Manages: Hardware – through Hardware Driver Data in memory for application
17
Communication DLL – Dynamic Link Library Called from LabView through DLL VI Once the DLL is loaded into the memory, any proccess can call DLL functions
18
DLL Interface _declspec(dllexport) long open_driver(void); _declspec(dllexport) long close_driver(void); _declspec(dllexport) long read_driver(long, long ); _declspec(dllexport) long write_driver(long, CSTR );
19
Momentum Driver Interface class Usb { public: static int iDevice_; // number of device static DWORD numDevs_; // number of devices connected Usb(); // default constructor /class methods: void openUsb(); void closeUsb(); BOOL readUsb(DWORD bytesToRead, void* read_buffer); BOOL writeUsb(DWORD bytesToWrite, void* write_buffer); BOOL setRecQueEventNot(); void StopUntilRec_4(); char* serialUsb(); void errorUsb(); FT_HANDLE getHandle(); BOOL setLatency(int latency); BOOL setTimeOut(int timeout); ~Usb(); protected: char serial_[16]; // serial number BOOL deviceOpen_; // TRUE = open, FALSE = close FT_HANDLE handle_; // FT_Read/FT_Write parameters: FT_STATUS r_w_status_; DWORD num_bytes_s_r_; // number of bytes that was sent/recieved correctly // FT_ListDevices parameters: FT_STATUS ftStatus_; // Event notification paramaters HANDLE hEvent_; DWORD EventMask_; //class protected methods };
20
Schedule 15/11/04 – Finish momentum driver 10/01/05 – Finish architecture of universal driver 28/02/05 – Finish writing code
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.