Presentation is loading. Please wait.

Presentation is loading. Please wait.

LabVIEW-Based SRS Data Acquisition System

Similar presentations


Presentation on theme: "LabVIEW-Based SRS Data Acquisition System"— Presentation transcript:

1 LabVIEW-Based SRS Data Acquisition System
Lesson # Lesson Title LabVIEW-Based SRS Data Acquisition System Riccardo de Asmundis INFN and Università «Federico II» Napoli, Italy Certified LabVIEW Developer & Certified Professional Instructor National Instruments Austin (TX)

2 Lecture Map LabVIEW as a complete DAQ tool Overview of a DAQ System
Lesson # Lesson Title Lecture Map Short Lesson 1 Overview of a DAQ System Short Lesson 2 LabVIEW as a complete DAQ tool Laboratory 1 The LV DAQ-SRS under the magnifying glass Laboratory 2 Taking data with LV DAQ-SRS

3 Lesson 1 Overview of a Data Acquisition System
DAQ System Overview Sensors Signals DAQ Hardware Signal Conditioning DAQ Software

4 A. DAQ System Overview Purpose To measure an electrical or physical phenomenon such as voltage, current, temperature, pressure, or sound Data Acquisition (DAQ)–the automatic collection of data from sensors, instruments, and devices in a factory, laboratory, or in the field. Data acquisition hardware adds inputs and outputs (I/O) to standard laptop and desktop computers, turning a general-purpose PC into a flexible, high-performance measurement system. By taking advantage of the fast pace of standard PC technology improvements, you can achieve progressively faster processing, more memory, larger hard drives, and graphics displays for system visualization at increasingly lower costs. Standard PC buses like USB, PCI, and PCI Express provide a path for sensor and voltage measurements to be streamed directly into your computer for processing, analysis and visualization. The purpose of data acquisition is to measure an electrical or physical phenomenon such as voltage, current, temperature, pressure, or sound. PC-based data acquisition uses a combination of modular hardware, application software, and a computer to take measurements. While each data acquisition system is defined by its application requirements, every system shares a common goal of acquiring, analyzing, and presenting information. Data acquisition systems incorporate signals, sensors, actuators, signal conditioning, data acquisition devices, and application software.

5 DAQ System Overview Signal Conditioning Sensor Or Signal DAQ Hardware
Software I/O Bus This graphic displays the components in a DAQ system for the student. Point out each component briefly and mention that each component will be covered in more detail later in this lesson and in the rest of the course.

6 B. Sensor Overview What is a sensor? Types of sensors
Signal Conditioning Sensor Or Signal DAQ Hardware DAQ Software I/O Bus Mention that the term “sensor” and “transducer” are sometimes used interchangeably. In our discussion of sensors, you will learn what a sensor does, and what types of sensors to use for measuring the following physical phenomena: Temperature Light Sound Force Pressure Position Fluid flow pH levels

7 What is a Sensor? Physical Phenomena Signal Sensor A sensor converts physical phenomena into measureable electrical signals The purpose of a sensor is to convert a physical phenomena (light, temperature, pressure, position, sound, etc.) into a measurable electrical signal, such as voltage or current.

8 Types of Sensors Phenomena Sensors Temperature
Thermocouples, Resistive Temperature Devices (RTDs), Thermistors Strain and Pressure Strain gages, Piezoelectric transducers Sound Microphone Vibration Accelerometer Position and Displacement Potentiometers, Linear voltage differential transformer, Optical encoder Fluid Head meters, Rotational flowmeters pH pH electrodes Light Vacuum tube, Photo sensors Particles and Radiation detection in general Ionization-proportional-Geiger chambers, Scintillators, Silicon detectors,… Sensors exist for a variety of applications from measuring temperature to pressure to fluid flow. The above list is only a sample of the types of sensors that exist and the types of applications they can be used for. If you have a physical phenomena to measure, a sensor probably exists to measure it. For more information on sensors and where to get them please visit

9 C. Signal Overview Signal classification Signal information
Signal Conditioning Sensor Or Signal DAQ Hardware DAQ Software With the help of a sensor, we have converted a physical phenomena (light, temperature, pressure, sound, etc.) into a signal. Or perhaps, we are not using a sensor and are just acquiring a voltage signal. Not all signals are measured in the same manner, so we will need to learn how to categorize our signal as one of two types: Digital Analog Once we have categorized our signal we need to figure out what type of information we want out of that signal. The possible types of information we can obtain from a signal are: State Rate Level Shape Frequency The next section will discuss all five types of information that can be obtained from a signal and give real world examples. Note: Our discussion of signals assumes that we are acquiring the signal. However, most of the points apply to generating a signal as well. The only exception being that you don’t need to do analysis to generate a signal with a specific frequency. I/O Bus

10 Signal Classification
Analog Digital A signal can fall into one of two categories: Digital Analog Next we will see what makes a signal either digital or analog. We will also see how the distinction of either digital or analog affects the way we will measure our signal.

11 5 Ways to Measure the Same Signal
ANALOG Domain DIGITAL Domain Now that we have learned the five different types of information that we can extract from a signal we will take a look at deriving all five types of information from the same signal. Let us look at a pulse train. If we treat our signal as a digital signal, we can measure the state of the signal as either ON or OFF, and the rate at which are states are changing. If we treat our signal as an analog signal we can measure the level of the signal at any point in time, the shape of the signal as it rises or falls from one state to another, and we can determine the frequency of the signal through software analysis. Measuring both state and level may seem redundant, however the two measurements are different. When we measure the state we only know if the signal is ON of OFF. As we learned earlier for TTL digital signals, ON can be a range from Volts and OFF can be a range from Volts. By measuring the level of our signal we can determine the exact voltage of our signal. Frequency and rate are also very similar. However, the difference here is that when we measure rate we are measuring how often a portion of our signal occurs. For instance we can count the number of rising edges as shown above. When we measure the frequency of a signal, we are getting the frequency content of our signal. We need to perform analysis such as an FFT to accomplish a frequency measurement. As we will learn later, we can accomplish all five of these measurements using a DAQ device and LabVIEW.

12 D. DAQ Hardware Overview
Purpose of DAQ hardware Transfer data between your sensor/signal and your software Signal Conditioning Sensor Or Signal DAQ Hardware DAQ Software I/O Bus

13 Typical General Purpose DAQ Device Architecture
Features Analog Input Analog Output Digital I/O Counter DAQ Circuitry Clock&Timing, FIFO,… Data Transfer Bus USB, PCI, PCI Express, PXI, PXI Express Synchronization Bus Used to synchronize multiple DAQ devices Allows sharing of timing and trigger signals between devices A typical DAQ device will have three interfaces for receiving and sending signals: the I/O Connector, the Computer I/O Interface Circuitry, and the Real-Time System Integration (RTSI) Bus. I/O Connector The I/O Connector is the means by which your signal enters or leaves your DAQ device. The I/O Connector will have either 100, 68, or 50 pins depending on the device. You can find the specific pinout in the hardware manual for your particular DAQ device. Computer I/O Interface Circuitry The Computer I/O Interface Circuitry is designed to transfer information back and forth from your DAQ device to your computer. Depending on the bus protocol you are using the Computer I/O Interface Circuitry could be very different. For instance, with the PCI bus you have connection leads as shown above, but with a USB connection you use a cable. Real-Time System Integration (RTSI) Bus The RTSI bus is designed to share signals between multiple DAQ devices in the same computer for the purpose of synchronization. For instance, if you wanted to have two devices taking analog input at the same rate, you could share a clock signal over the RTSI bus so both devices are using the same clock signal. Unless you are using the PXI platform, a RTSI cable is needed to connect the devices together. The PXI chassis backplane acts has a built in RTSI bus that can share signals between any module in the chassis.

14 General DAQ Devices vs Specialised ones
General DAQ Devices are suitable for DAQ in «simple» situations Physics presents different challenges Weak and fast signals Bad as both voltage or current sources !!!  need very special signal conditioning Charge integration amplification Low noise techniques Wide frequency band with the risk of EMI &/or auto oscillations Signal timing Fast signals, short rise and fall time Triggering techniques needed Testing lab Industrial test bench Virtual instrumentation Long term DAQ (environmental, structures, homeland security,…) Monitoring systems Non real-time control systems NON-standard signal conditioning! Custom front-end electronics Very specialized custom or industry-made DAQ electronics Easy or standard signal conditioning needed

15 The LabVIEW DAQ-SRS “RD51-srs” LabVIEW Project UDP connection
Chambers  ON Board Electronics (signalconditioning)  DAQ System  Bus connection  PC running LV (≥ 2012) mMGas, GEM,… chambers UDP connection “RD51-srs” LabVIEW Project

16 E. Signal Conditioning Purpose of signal conditioning
Signal conditioning tasks and examples Signal Conditioning Sensor Or Signal DAQ Hardware DAQ Software We have now taken our physical phenomena, converted it into a signal with our sensor, and decided the type of information in our signal we want to measure. However, it is not always possible to immediately measure the signal. We might need to condition the signal to make it suitable for our DAQ device to measure. We can prepare our signal with signal conditioning hardware. I/O Bus

17 Purpose of Signal Conditioning
Signal conditioning takes a signal that is difficult for your DAQ device to measure and makes it easier to measure Signal conditioning is not always required Depends on the sensor or signal being measured Signal Conditioning Many sensors or signals need some sort of signal conditioning in order to be properly measured. For example, the signal from the sensor could be noisy, or if could be too small or too large for the range of our DAQ device. For instance, thermocouples, strain gages, and microphones all produce a voltage in the millivolt range making it hard to detect changes in the signal. This is why filtering and amplification are common signal conditioning techniques used with these sensors. Noisy, Low-Level Signal Filtered, Amplified Signal

18 Signal Conditioning Tasks
They depend on the type of signal, but in principle Analogue domain: Voltage measurement Amplification Attenuation Isolation Filtering

19 F. DAQ Software Overview
After acquiring data, you usually still need to do more Signal processing, generate a report, interact with data, etc. Signal Conditioning Sensor Or Signal DAQ Hardware I/O Software Bus After you have acquired your data, you usually still need to do more. For example, you might need to add signal processing, generate a report, display the data analysis, interact with the data, log the data, etc. This functionality and flexibility can be done in software.

20 Lesson 2 LabVIEW as a complete DAQ tool
What is LabVIEW Learning LabVIEW LV Design Patterns Event programming LabVIEW SRS DAQ program structure

21 A. What Is LabVIEW? A graphical programming environment used to develop sophisticated measurement, test, and control systems. LabVIEW: Interfaces with wide variety of hardware Scales across different targets and OSs Provides built-in analysis libraries LabVIEW is a graphical programming language quite different from traditional programming languages like C++ and Visual Basic. As we’ll learn, one of the greatest strengths of LabVIEW is how intuitive it is to program. We’ll see how the Virtual Instrument approach to programming, employed by LabVIEW, makes it possible to create sophisticated and powerful programs with elegant, graphical user interfaces. LabVIEW interfaces with wide variety of hardware devices. In this course, you interact with DAQ and GPIB hardware.

22 Some LabVIEW Features Fully Graphical programming
Natural interface with NI hardware Easy interfacing with third part hardware Built in Advanced Analysis functions Built in C, Matlab, Mathematica compatibility Plug-ins for different processing Sound&Vibration, Simulation models, Datalogging & Supervisory Control,… Real Time & FPGA programming Xilinx families FPGA

23 B. Learning LabVIEW Two main approaches: “Sit & go” Training program
Due to the graphical programming, most people think it is simple or even trivial to develop with Knowledge of few elements induces beginners to think “all is understood so I can do everything” The result can be a disaster Training program Systematic approach: allows user to learn about available language elements gradually Presents features which would be totally ignored otherwise

24 Some other “spaghetti diagram”
Sometime people are proud of such a job and this is extremely dangerous. If you draw something like this in your past, please: trash all away forget everything restart from beginning !

25 Available LabVIEW courses
Lesson # Lesson Title New User Experienced User Advanced User Managing Software Engineering in LabVIEW Advanced Architectures in LabVIEW LabVIEW Core 1 LabVIEW Core 2 LabVIEW Core 3 LabVIEW Connectivity Object-Oriented Design and Programming in LabVIEW LabVIEW Performance Certifications Certified LV Associate Developer Exam Certified LabVIEW Developer Exam Certified LabVIEW Architect Exam <Remove this slide if your class is not in the LabVIEW series.> Other Courses LabVIEW Real-Time 1 LabVIEW Real-Time 2 LabVIEW Instrument Control LabVIEW Modular Instruments LabVIEW FPGA DAQ & Signal Conditioning

26 LabVIEW Education Instructor Led Training
LabVIEW Performance Object-Oriented Design and Programming in LabVIEW Managing Software Engineering in LabVIEW Advanced Architectures in LabVIEW RealTime and FPGA Data Acquisition Self-Paced Online: Accessible 24 hours a day, prerecorded video training modules, interactive quizzes, and challenging exercises with solutions. Printed Course Materials: a variety of instructional packages and tools designed to educate you at your own pace Customize this list according to the software and the level of your course. Take time to STUDY: time spent so, acts as a credit for the future !

27 C. Design Patterns Why use Design Patterns?
They have proven themselves useful for developing software. You don’t have to start a program from scratch. They make it easier for others to read and modify your code. Design Patterns – Code implementations and techniques that are solutions to specific problems in software design Design patterns represent techniques that have proven themselves useful time and time again. Furthermore, as a pattern gains acceptance, it becomes easier to recognize. Pattern recognition helps other developers (and you!) to read and make changes to your code. Design patterns typically evolve through the efforts of many developers and are fine-tuned for simplicity, maintainability, and readability.

28 Simple VI Pattern Single VI that takes a measurement, performs calculations, and either displays the results or records them to disk. Usually does not require a specific start or stop action from the user. The image in the upper right-hand corner is to denote that the Simple VI architecture completes a single action. This image is built upon in the next few slides.

29 General VI Framework

30 State Machine Framework
The decision-making code will contain: State functionality code (execution), then A decision on what the next state of execution will be (transition) Notice that the Stop button is polled each loop. This represents a “polling” based solution. As we learned in the last lesson, an Event based solution is more efficient.

31 Producer/Consumer Design Patterns
The producer/consumer design pattern separates tasks that produce and consume data at different rates. The parallel loops in the producer/consumer design pattern are separated into two categories, those that produce data and those that consume this data. Data queues communicate data among the loops and buffer data among the producer and consumer loops. A buffer is a memory device that stores temporary data between two devices or multiple loops.

32 Choose of a Design Pattern through templates
“Create Project…”

33 D. Event-Driven Programming
Event — An asynchronous notification that something has occurred Event-Driven Programming — Method of programming where the program waits for an event to occur before executing one or more functions User Action on Front Panel Block Diagram Execution Event-Driven Programming LabVIEW is a dataflow programming environment where the flow of data determines the execution order of block diagram elements. Event-driven programming features extend the LabVIEW dataflow environment to allow the user’s direct interaction with the front panel and other asynchronous activity to further influence block diagram execution. Use event programming to synchronize user actions on the front panel with block diagram execution.

34 Polling versus Event Structures
Method of event-based programming where a loop must continually run code to check if changes have occurred. Polling the front panel requires a significant amount of CPU time. Polling can fail to detect changes if they occur too quickly. Event Structures Events in Event structures eliminate the need to poll the front panel. Benefits of using Event structures: Reduces the CPU requirements of the program. Simplifies the block diagram code. Guarantees that the block diagram can respond to all interactions the user makes. Event-driven programs usually include a loop that waits for an event to occur, executes code to respond to the event, and reiterates to wait for the next event. Events allow you to execute a specific event-handling case each time a user performs a specific action. Without events, the block diagram must poll the state of front panel objects in a loop, checking to see if any change has occurred. Polling the front panel requires a significant amount of CPU time and can fail to detect changes if they occur too quickly. By using events to respond to specific user actions, you eliminate the need to poll the front panel to determine which actions the user performed. Instead, LabVIEW actively notifies the block diagram each time an interaction you specified occurs. Using events reduces CPU requirements of the program, simplifies the block diagram code, and guarantees that the block diagram can respond to all interactions the user makes.

35 E. LabVIEW SRS DAQ Program Structure

36 The LabVIEW DAQ-SRS “RD51-srs” LabVIEW Project UDP connection
Chambers  ON Board Electronics (signalconditioning)  DAQ System  Bus connection  PC running LV (≥ 2012) mMGas, GEM,… chambers UDP connection “RD51-srs” LabVIEW Project

37 Program Features Event Building Example of event monitor 3-D
UDP Codes data monitor Formatted Event UDP data frame in graphical representation: channels in color, 1 sample per visible slot; Incoming Event Event Building Example of event monitor 3-D Fast data stream link via UDP protocol (on Ethernet) Monitors for data packet, event building, online events analysis sampling 2-D and 3-D plot representations Online histograms construction Data file saving Data acquisition Run management User friendly (as possible…)

38 Structure and techniques
Based on: A Producer-Consumer (Event driven) Design Pattern for the UI commands [lossless] A Producer-Consumer (Data driven) Design Pattern for DAQ, Run handling and data file saving [lossless] A Master-Slave Design Pattern for online data analysis (where samples of events are treated) [lossy] In total: 5 parallel loops Initialization and shutdown

39 See you in the Lab this afternoon For demonstrations
Than You See you in the Lab this afternoon For demonstrations


Download ppt "LabVIEW-Based SRS Data Acquisition System"

Similar presentations


Ads by Google