dsdsdfVC
Projekt „Rozwój Innowacyjnych Działań Naukowych w Ramach Średniego Kształcenia
Zawodowego Celem Zachęcania Uczniów do Kariery Naukowej i Edukacyjnej STEM”, nr odn. 2017- 1-BG01-KA202-036327
DROGA DO KLASY NAUKOWEJ
PROGRAMOWANIE GRAFICZNE
Licencja Creative Commons - Uznanie Autorstwa - Użycie Niekomercyjne - Na Tych Samych Warunkach CC BY- NC-SA
1
Wprowadzenie 2
Koncepcja aktywności i plan zajęć 3
Tematyka zajęć
Poziom trudności / wiek uczniów Wymagana wcześniejsza wiedza Czas wymagany na realizację Prowadzący
Uzyskana wiedza i rozwinięte kompetencje – studenci Uzyskana wiedza i rozwinięte kompetencje – nauczyciele
Uzyskana wiedza i rozwinięte kompetencje – pracownicy lub studenci uniwersyteccy Materiały niezbędne do realizacji działań
Podział działań
Przydatne linki do zasobów Sugerowane dalsze opracowania Źródła stosowane do rozwijania zasobu
Arkusz wiedzy dotychczasowej 5
Redaktorzy
Wprowadzenie do tematu
Znaczenie dla życia codziennego / gospodarki / społeczeństwa Szczegółowe przedstawienie tematu
Wytyczne dla prowadzących w zakresie przekazywania wiedzy naukowej
Arkusz planowanie wykładów 8
Cel Warunki
Miejsce wystapienia / wykładu
Możliwe zaangażowanie studentów w działanie Plan zajęć
Arkusz planowania działań pratycznych / eksperymentów 9
Cel Warunki
Możliwe zaangażowanie studentów w działanie Zakras działań praktycznych
Plan zajęć działań praktycznych
Załącznik I: Zasoby wiedzy 11
Załącznik II: Wzór praktycznego arkusza informacyjnego 14
Spis Treści
2
Opisana w niniejszym dokumencie droga do klasy naukowej została opracowana w taki sposób, aby mogła być realizowana przez pracowników uczelni i studentów wolontariuszy jako działalność pozaszkolna dla szkół średnich VET.
J A K K O R Z Y S T A Ć Z T E G O Z A S O B U
Wprowadzenie
3
Wprowadzenie do LabVIEW w celu umożliwienia jego wykorzystania w działalności inżynieryjnej.
To ćwiczenie jest odpowiednie dla uczniów szkół średnich II stopnia.
Uczniowie powinni posiadać podstawową wiedzę z zakresu technologii informacyjnych, matematyki i fizyki.
4 godziny astronomiczne dla całej działalności, ewentualnie podzielone na godziny akademickie w zależności od preferencji studentów i nauczycieli.
Instruktor powinien być wykładowcą uniwersyteckim z doświadczeniem w danej dziedzinie.
Uczniowie szkół średnich nauczą się podstaw programowania graficznego za pomocą programu LabVIEW. Bardziej ogólnie, zdobędą oni zrozumienie i wiedzę na temat tego, w jaki sposób wykonywane są nowoczesne komputerowe pomiary i pozyskiwanie danych.
Nauczyciele VET zaangażowani w to działanie zdobędą wiedzę na temat programowania graficznego za pomocą LabVIEW i będą mogli odtworzyć tę klasę w laboratoriach szkolnych dla innych zainteresowanych uczniów.
Dla personelu uniwersyteckiego bezpośrednio zaangażowanego w działalność, pokazy te poprawią umiejętności komunikacji naukowej.
Do części teoretycznej zajęć potrzebna jest tablica z projektorem multimedialnym.
Laboratorium komputerowe z wystarczającą liczbą komputerów (z zainstalowanym systemem LabVIEW) jest niezbędne do praktycznej nauki.
M A T E R I A Ł Y N I E Z B Ę D N E D O R E A L I Z A C J I D Z I A Ł A N I A
U Z Y S K A N A W I E D Z A I RO Z W I N I Ę T E K O M P E T E N C J E – P R A C O W N I C Y L U B S T U D E N C I
U N I W E R S Y T E C C Y U Z Y S K A N A W I E D Z A I RO Z W I N I Ę T E K O M P E T E N C J E - N A U C Z Y C I E L E U Z Y S K A N A W I E D Z A I R O Z W I N I Ę T E K O M P E T E N C J E - S T U D E N C I P R O W A D Z Ą C Y C Z A S P O T R Z E B N Y N A R E A L I Z A C J Ę W Y M A G A N A W C Z E Ś N I E J S Z A W I E D Z A
P O Z I O M
T R U D N O Ś C I / W I E K U C Z N I Ó W
T E M A T Y K A Z A J Ę Ć
Koncepcja aktywności i plan zajęć
4
Ta klasa naukowa jest podzielona na 2 części:
1. Wykład - 2 godziny lekcyjne, prezentacja Power Point z prezentacją oprogramowania LabVIEW i jego funkcji.
2. Nauka praktyczna - 2 godziny lekcyjne, edukacja wspomagana przez instruktora w szkolnym laboratorium komputerowym.
www.ni.com
http://www.ni.com/academic/students/learn-labview/
http://www.ni.com/pdf/manuals/373427j.pdf
W Internecie jest wiele darmowych informacji na temat programowania graficznego i LabVIEW.
Szukając słów kluczowych "programowanie graficzne" i "LabVIEW"
studenci mogą znaleźć wiele darmowych książek w formacie pdf, podręczników, programów przykładowych, demonstracji i samouczków.
Bezpłatne źródła dostępne na stronie www.ni.com
Ź R Ó D Ł A
S T O S O W A N E D O R O Z W I J A N I A Z A S O B U S U G E R O W A N E D A L S Z E
O P R A C O W A N I A P R Z Y D A T N E L I N K I D O Z A S O B Ó W B R E A K D O W N O F A C T I V I T I E S
5
Stefan Ivanov (Technical University of Gabrovo, Bulgaria)
Programowanie graficzne jest innowacyjnym podejściem do rozwoju programów komputerowych. Jest ono skierowane do osób, które nie są programistami, ale muszą wykonywać zadania wymagające programowania. Programowanie graficzne ma zastosowanie w dziedzinie akwizycji danych i pomiarów. Komputerowe pomiary wspomagane są obecnie ważną częścią przemysłu. Parametry produkowanych wyrobów są mierzone, analizowane i przechowywane na komputerach lub serwerach.
Klasa ta pomoże uczniom szkół zawodowych w nauce podstaw programowania graficznego w środowisku LabVIEW. Po ukończeniu tego kursu będą wiedzieli jak zbudować prosty wirtualny instrument LabVIEW (VI) oraz jak korzystać z elementów sterujących, wskaźników i funkcji.
Definicja programowania graficznego:
Graficzne podejście do programowania pozwala komputerowi przetwarzać reprezentacje przestrzenne w dwóch lub więcej wymiarach. W przeciwieństwie do programowania tekstowego, które wykorzystuje linie kodu, programowanie graficzne zastępuje tekst obrazami lub symbolami rzeczy fizycznych.
(https://learn.org/articles/What_is_Graphical_Programming.html).
Programowanie graficzne ma ogromny wpływ na codzienne życie.
Znajduje zastosowanie w przemyśle, biologii, medycynie, robotyce, lotnictwie i edukacji. Dobra znajomość programowania graficznego poprawi konkurencyjność studentów na rynku pracy i zwiększy ich możliwości rozwoju zawodowego.
LabVIEW został wprowadzony w 1986 roku jako graficzny język programowania używany do pozyskiwania danych i kontroli instrumentów pomiarowych. W kolejnych latach oprogramowanie zyskało na popularności i może być obecnie najbardziej zaawansowanym graficznym językiem programowania dostępnym na rynku. Jest szeroko stosowany we wszystkich dziedzinach przemysłu i nauki. LabVIEW jest regularnie udoskonalany, a każda nowa wersja daje nowe możliwości dla klientów.
Kurs dostarczy wiedzy wstępnej z zakresu programowania graficznego.
Obejmie on następujące części:
1. Wprowadzenie do programu LabVIEW
2. Właściwości elementów sterujących i wskaźników na panelu przednim
S Z C Z E G Ó Ł O W E P R Z E D S T A W I E N I E T E M A T U
Z N A C Z E N I E D L A Ż Y C I A
C O D Z I E N N E G O / G O S P O D A R K I / S P O Ł E C Z E Ń S T W A W P R O W A D Z E N I E D O T E M A T U R E D A K T O R Z Y
Background knowledge sheet
6
3. Podstawowe funkcje wykorzystywane na schemacie blokowym 4. Rodzaje danych w LabVIEW
5. Jak zbudować wirtualny instrument w LabVIEW?
6. Pod-VI - podprogramy w LabVIEW 7. Praca z plikami
8. Zajęcia praktyczne. Ćwiczenia realizowane przez studentów Wprowadzenie środowiska LabVIEW
Programy LabVIEW nazywane są instrumentami wirtualnymi lub VI, ponieważ ich natura i działanie imitują instrumenty fizyczne, takie jak oscyloskopy i multimetry. LabVIEW zawiera szeroką gamę narzędzi do pozyskiwania danych, analizy, kontroli i wizualizacji.
W LabVIEW tworzysz interfejs użytkownika lub panel przedni za pomocą elementów sterujących i wskaźników. Elementami sterującymi mogą być obiekty sterujące, przyciski, suwaki i inne urządzenia wejściowe. Wskaźnikami mogą być różne wskaźniki graficzne, diody LED, pola tekstowe itp. (Rys. 1).
1 2
3 4
Rysunek 1. Główne elementy panelu przedniego - pasek narzędzi (1), ikona i zaciski wejściowe/wyjściowe (2), elementy sterujące (3), wskaźniki (4).
Po utworzeniu interfejsu użytkownika, do tzw. schematu blokowego Wirtualnego Instrumentu dodawany jest kod. Kod składa się z obiektów graficznych, które pełnią określone funkcje (rys. 2).
7
1
2
3
4
Rysunek 2. Podstawowe elementy diagramu blokowego - narzędzia do usuwania błędów (1), pętle (2), funkcje (3), ikony sterowania i wskaźniki (4) LabVIEW może być używany do komunikacji ze sprzętem, takim jak urządzenia do eksploracji danych, urządzenia do sterowania ruchem i obrazem, GPIB, PXI, VXI, RS-232 i RS-485.
Jedną z największych zalet LabVIEW jest możliwość łatwego tworzenia aplikacji do akwizycji i przetwarzania danych. Pozyskiwanie danych odbywa się najczęściej za pomocą tzw. sprzętu DAQ. DAQ (Data Acquisition) jest procesem pomiaru wartości elektrycznych lub fizycznych takich jak napięcie, prąd, temperatura, ciśnienie, itp.
Wykorzystywane są specjalnie zaprojektowane urządzenia, a wyniki pomiarów są przetwarzane i przechowywane na komputerze osobistym. Urządzenia DAQ zazwyczaj zawierają przetworniki analogowo-cyfrowe i cyfrowo-analogowe, timery, wejścia i wyjścia cyfrowe, jak również interfejs komunikacyjny do podłączenia do komputera osobistego.
Bardziej szczegółowe wskazówki dotyczące tworzenia instrumentów wirtualnych znajdują się w załączniku I: Zasoby wiedzy.
Uczniowie średniej szkoły zawodowej powinni być na ostatnich latach nauki. Wszystkie tematy na kursie są przygotowane w taki sposób, aby były zrozumiałe dla uczniów w tym wieku. Materiał będzie zawierał wzory matematyczne i równania, które są dobrze znane studentom i które są już studiowane w szkole.
Terminologia techniczna użyta na kursie będzie jasno objaśniona przez wykładowcę.
W Y T Y C Z N E D L A P R O W A D Z Ą C Y C H W Z A K R E S I E
P R Z E K A Z Y W A N I A W I E D Z Y
N A U K O W E J
8
Wykład powinien przedstawiać terminologię, podstawowe pojęcia oraz podstawy teoretyczne i techniczne niezbędne do rozpoczęcia korzystania z LabVIEW.
Oczekiwana liczba uczniów wynosi od 20 do 30 osób. Należy je podzielić na mniejsze grupy, w zależności od dostępnych stanowisk komputerowych. Jeśli w szkole jest więcej uczniów, którzy chcą wziąć udział w kursie, konieczne będzie zorganizowanie drugiej edycji dla drugiej grupy.
Cały kurs powinien być realizowany w pracowni komputerowej na terenie szkoły. Dla wykładowcy potrzebny będzie komputer z multimediami.
Optymalny czas trwania wykładu teoretycznego to 2 godziny astronomiczne.
Wykładowca potrzebuje tylko komputerów z zainstalowanym systemem LabVIEW. Wykład będzie najbardziej efektywny, jeśli studenci będą mieli dostęp do programu w czasie wprowadzania.
Wykładowca powinien mieć dostęp do komputera z projektorem multimedialnym przez cały czas trwania wykładu.
Laboratorium komputerowe w szkole goszczącej
Studenci uniwersytetów mogą być zaangażowani w te działania jako prezenterzy lub moderatorzy.
Faza
nr. Opis fazy Przydzielony
czas
1 Wprowadzenie do LabVIEW 20min
2 Właściwości elementów sterujących i
wskaźników na panelu przednim 20min 3 Podstawowe funkcje wykorzystywane
na schemacie blokowym 20min
4 Rodzaje danych w LabVIEW 10min
5 Jak zbudować instrument wirtualny
(VI) w LabVIEW? 20min
6 Sub-VI - podprogramy w LabVIEW 10min
7 Praca z plikami 20min
P L A N Z A J Ę Ć M O Ż L I W E
Z A A N G A Ż O W A N I E S T U D E N T Ó W W D Z I A Ł A N I E M I E J S C E
W Y S T Ą P I E N I A / W Y K Ł A D U W A R U N K I C E L
Arkusz planowanie wykładów
9
Celem szkolenia praktycznego jest umożliwienie uczniom szkół zawodowych praktycznej realizacji tego, czego się nauczyli. Powinno to zwiększyć ich pewność w rozwiązywaniu problemów za pomocą graficznego programowania i środowiska rozwojowego LabVIEW.
Oczekiwana liczba uczniów wynosi od 20 do 30 osób. W trakcie szkolenia praktycznego powinni oni zostać podzieleni na małe grupy liczące od 2 do 3 uczniów, aby skutecznie rozwiązywać zadania we współpracy.
Optymalny czas trwania szkolenia praktycznego i pokazów praktycznych wynosi 2 godziny astronomiczne.
Szkolenie praktyczne powinno być zorganizowane w pracowni komputerowej. Wykładowca powinien korzystać z projektora multimedialnego w celu zademonstrowania i wyjaśnienia szczegółów dotyczących pracy w środowisku programistycznym.
Studenci uniwersytetów mogą pełnić rolę moderatorów. Powinni skupić się na doradzaniu studentom w kwestiach technicznych.
Najlepiej byłoby, gdyby każdy z moderatorów był zaangażowany w nie więcej niż 3 grupy studentów.
Podczas tego zajęcia uczniowie szkół średnich zostaną zaproszeni do graficznego zaprogramowania i poznania bogatych możliwości programowych LabVIEW. Będą oni zachęcani do poszukiwania oryginalnych rozwiązań problemów zawartych w ćwiczeniach.
Pierwsze dwa ćwiczenia powinny koncentrować się na stworzeniu wirtualnego instrumentu. Ostatnie ćwiczenie powinno koncentrować się na pozyskiwaniu danych za pomocą urządzenia DAQ. Ćwiczenia orientacyjne przedstawiono w załączniku II: Modelowy arkusz ćwiczeń praktycznych.
Faza
nr. Opis fazy Przyznany
czas
1 Ćwiczenie 1 25 min.
2 Ćwiczenie 2 25 min.
3 Ćwiczenie 3 25 min.
4 Ćwiczenie 4 25 min.
5. Dyskusja na temat głównych wyzwań stojących przed uczniami i prezentacja osiągniętych wyników.
15 min.
6. Autorefleksja
Uczniowie powinni być zachęcani do dzielenia się tym, 5 min.
C Z A S I A N A L I Z A D Z I A Ł A Ń
P R A K T Y C Z N Y C H Z A K R E S D Z I A Ł A Ń P R A K T Y C Z N Y C H M O Ż L I W O Ś Ć Z A A N G A Ż O W A N I A W D Z I A Ł A L N O Ś Ć S T U D E N T Ó W U C Z E L N I W Y Ż S Z Y C H L O K A L I Z A C J A I W Y P O S A Ż E N I E W A R U N K I C E L
Arkusz planowania działań praktycznych / eksperymentów
10
czego się nauczyli i w jaki sposób ich zdaniem ta nowa wiedza pomoże im w przyszłej karierze i nauce.
11
Editor: Stefan Ivanov (Technical University of Gabrovo, Bulgaria)
Creating Virtual Instruments
The following steps will create a Virtual Instrument that will generate a signal and display it on the front panel.
1. Start LabVIEW
2. In the LabVIEW dialog shown in Figure 1, select BlankVI
Figure 1: The LabVIEW launch window
The user interface or the front panel (Figure 2) is a gray-background window placed on the so- called controls and indicators.
Figure 2: Front panel
Note: If the front panel is hidden, it can be displayed by selecting Window >> Show Front Panel.
Annex I: Knowledge Resource
12
The block diagram is a white-background window (Fig. 3) that contains functions for controlling the operation of the Virtual Instrument.
Figure 3: Block diagram
Inserting controls and indicators in the front panel
To insert controls and indicators in the front panel, right-click the front panel box.
Figure 4: Selecting controls and indicators
Inserting features in the block diagram
To insert functions for controlling the operation of the Virtual Instrument, right-click in the block diagram field (Fig. 5).
13
Figure 5: Selecting functions in the block diagram
The operation of the Virtual Instrument is controlled through the toolbar (Fig. 6).
Figure 6: The toolbar
The toolbar includes buttons for running the Virtual Instrument, for looping the Virtual Instrument, for stopping the execution, and for pausing. They can be used to control the operation of the Virtual Instrument.
14
Exercise 1
Development of a Virtual Instrument for calculation based on the Pythagorean Theorem
To demonstrate how to work with LabVIEW, let us create a Virtual Instrument that can be used to calculate the hypotenuse of a right-angled triangle according to the Pythagorean theorem, using formula (1).
𝑐 = √(𝑎
2+ 𝑏
2)
, (1)where a and b are the catheti of the right-angled triangle and c is the hypotenuse.
Let us create a new Virtual Instrument. Using the controls from the Modern menu (Fig. 7), we will create the front panel of our application.
Figure 7: Controls from the Modern menu
From the menu, we select Numeric >> Numeric Control to enter catheti values and Numeric
>> Numeric Indicator to derive the estimated hypotenuse value. From the Decorations menu, we can select objects that complement the interface of our Virtual Instrument. Figure 8 below shows the created front panel of the application.
Annex II: Model hands-on activity sheet
15
Figure 8: Front panel of the Virtual Instrument
We need to insert functions in the block diagram in order to implement the formula for calculating the hypotenuse. The functions from the Programming >> Numeric menu should be used for this purpose (Fig. 9).
а) b)
Figure 9: Menus used: a) Programming b) Numeric
We select the following functions included in the Numeric menu: square root calculation, raising to the power of 2 (Square), and addition (Add). We connect the individual elements in the way shown in Figure 10.
16
Figure 10
We run the application from the loop start button and change the input parameters. We will observe how the output result for the hypotenuse length will also change.
Exercise 2
Write a program for calculating the cost of travel
We will develop a Virtual Instrument to calculate the cost of fuel when traveling a certain distance by car. We are given the average vehicle consumption, the distance to travel and the cost of 1 litre of fuel.
The front panel of the Virtual Instrument is as shown in Figure 11.
Figure 11: Initial front panel view
To generate the controls and the front panel indicator, we use the Modern >> Numeric menu, and respectively Numeric Control and Numeric Indicator.
The formula we should use to calculate the cost of a trip is:
(2)
To run the formula in the block diagram, we will use the so-called express features - Express (Figure 12).
17
Figure 12: Express functions
With these express features, it is possible to develop Virtual Instruments quickly, simplifying the programming process and reducing the time required for development.
From the Arith & Compar menu, select Formula (Figure 13).
Figure 13: Function for inputting formulas
This feature enables us to input mathematical formulas using basic mathematical operations. The input process is performed in a dialog box similar to the interface of an electronic calculator (Figure 14).
18
Figure 14: Inputting a formula
The controls and the indicator are connected to the respective terminals of the formula input function (Figure 15).
Figure 15: Connecting the objects
The development of LabVIEW Virtual Instruments usually involves the use of the so-called while loop. It is placed in the block diagram and encapsulates functions that are performed repeatedly over time. The while loop can be inserted from the express functions Menu - Express >> Exec Control >> While Loop with Button. We need to drag with our mouse the code that should be executed inside the while loop (Fig. 16).
Figure 16: Using a while loop
19
The while loop can be exited through a stop button that is placed on the front panel (Fig. 17).
Figure 17: The final appearance of the front panel
We run the app through the button and it will calculate the cost of the trip based on the inputs.
Exercise 3
Data acquisition with a DAQ device
One of the great advantages of LabVIEW is the possibility to easily create apps for data acquisition and processing. Data acquisition is most often performed through the so-called DAQ hardware. DAQ (Data Acquisition) is the process of measuring electrical or physical values such as voltage, current, temperature, pressure, etc. Specially designed devices are used and the resulting measurements are processed and stored on a personal computer. DAQ devices typically include analogue-to-digital and digital-to-analogue converters, timers, digital inputs and outputs, as well as a communication interface for connecting to a personal computer.
National Instruments – the LabVIEW manufacturer - offers a wide range of DAQ devices featuring different capabilities and falling within different price ranges. For this exercise, we will use the DAQ USB-6008 device. It has the following features: eight analogue inputs with a 12-bit resolution of an analogue-to-digital converter, two analogue outputs, 12 digital inputs / outputs, and a USB interface for connecting to a computer.
We will develop an application that collects data from a temperature sensor connected to an analogue input of a DAQ device, converts the voltage readings into temperature, and stores the data in an Excel file.
The front panel shown in the image makes it possible to monitor the current temperature values, to define the number of temperature values to be measured over time, and to set the time between two successive measurements. Figure 18 shows the front panel of the Virtual Instrument.
20
Figure18: Front panel
Inside the block diagram, we will first insert the so-called for loop, which can be accessed through Programming >> Structures >> For Loop. We will use the for loop to enclose an area of the block diagram, as shown in Fig. 19.
Figure 19: Using the for loop
We will then right-click the Measurement Control icon and select Representation >> I32. We will connect the control to the input terminal N of the for loop. In this way, we will set the number of iterations per cycle.
The LabVIEW data acquisition tools include the express function Express>>Input>>DAQ Assist. It is used to configure the measurement hardware and the measurement type. Figure 20 shows the user interface of the DAQ Assist function.
21
Figure 20: User interface of the DAQ Assist function We will select Acquire Signals >> Analog Input >> Voltage (Fig. 21).
Figure 21: Selecting measurement type
Then we will also select the device that will be used, which in this case is the USB-6008, as well as the analogue channel to which the temperature sensor will be connected (Fig. 22).
22
Figure 22: Selecting the measurement device and channel
The window that will appear should contain the parameters of the measurement channel. In this window we will select: input signal range from 0 to 10V, input configuration - RSE, number of measurements – 100, with measurement speed 1 kHz. Figure 23 shows the settings made.
Figure 23: Settings for the measurement channel
The measurement data can be read from the output of the DAQ Assist function (Figure 24).
Figure 24: Configured data acquisition function from USB-6008 device
23
The resulting data will be an array of 100 consecutive measurements. If we calculate the average value from these measurements, we can eliminate any noise effect on the signal. Calculation of the average can be performed if we use the Express >> Signal Analysis >> Statistics function. It is enough to select the Arithmetic mean checkbox from the options for statistical calculation (Fig. 25).
Figure 25: Calculating the average of the values
Since the arithmetic mean value is the value of the voltage coming from the temperature sensor connected to the input terminal of the DAQ device, it is necessary to convert this voltage into temperature using the appropriate formula. The temperature sensor used in this example is the LM335 sensor, which has the following characteristics: operating range from -40 to 100C, sensitivity from 10mV to 1C, linear output signal. The formula for converting the sensor’s output voltage readings into temperature values is the following:
𝑇 = 100 ∗ 𝑈𝑠𝑒𝑛𝑠𝑜𝑟− 273.15 (3)
To run the formula, we use Express >> Arith & Compar >> Formula. We need to enter the above formula in the express function field (Fig. 26) and to connect the result to the temperature indicator.
24
Figure 26: Calculating temperature At this stage, the block diagram looks as shown below (Fig. 27):
Figure 27: Block diagram
On the front panel, let us set the number of measurements at 60. If we run the Virtual Instrument, we will see that in a few seconds the execution will be completed. In practice, 60 iterations of the for loop will be performed, and the temperature will be measured in each of them.
If we want the measurements to be made with a definite time difference between two successive measurements, a time delay (timer) must be added at each iteration of the for loop. The time delay can be added as follows - we select Programming >> Timing >> Wait (ms) and connect this function to the control object "Time between two measurements, sec" as shown below (Fig. 28).
Figure 28: Setting a timer
If we input 1 second in the control, the timer function will be set to 1000 ms and the Virtual Instrument will be executed for about 60 seconds. In order to write the data into a file, we can
25
use the Write Delimited Spreadsheet function in the Programming >> File I / O library. This function allows arrays to be stored in Excel files and looks as shown in Fig. 29.
Figure 29: Function for writing to Excel files
Before the temperature measurements are recorded, they must be converted and grouped into an array. The purpose of the conversion is to change the data type and to convert them from Dynamic Data type to a floating point number. The conversion is done using the function Express >> Signal Manipulation >> From DDT. The configuration of the function is shown in Fig. 30.
Figure 30: Conversion from Dynamic Data Type to Scalar type (Double type)
An array from the measured values can be created by connecting the data to the for loop frame.
The array connects to the Excel file write function to the 1D Data terminal. If we want the data to be written in a column, then we must connect a true constant to the transpose? (No: F) terminal. Figure 31 presents the final block diagram of the application.
26
Figure 31: Block diagram of the application
We will run the app from the button and it will start measuring temperature. When the measurements are completed, a dialog box opens, prompting us to save the measurement data to a file. The file we are saving must have the extension "xls". If we open the saved Excel file, we will find the arrays with measurements in our application. Figure 32 shows the saved file and the array with measured temperature data, recorded as a column in the table.
Figure 32: Data saved in an Excel file
The developed Virtual Instrument can easily be supplemented with additional options for data processing or for incorporating new sensors to control additional environmental parameters.
Questions for assessment and self-assessment
1. What are the elements of the LabVIEW software environment?
27
2. Which elements are located on the front panel?
3. What are the express Virtual Instruments used for?
4. What major loops are supported in LabVIEW?
5. What is the process of so-called data acquisition?
6. Which function can be used to achieve the fastest connection between the measurement hardware and LabVIEW?
Tasks for independent learning
1. Develop a Virtual Instrument that calculates the area and perimeter of a circle with a given radius.
2. Develop a Virtual Instrument that calculates resistance in an electrical circuit with given values of current and voltage (based on Ohm's law).
3. Develop a Virtual Instrument that measures data across four channels of DAQ hardware and writes the data to a file.
4. Explore the main features of LabVIEW in the programming library.
5. Explore sample applications developed in LabVIEW, as available in the Help >> Find Examples menu.
28
University Students Selection
The following university students can be involved in the design and delivery of the activity:
- Students of Computer Science or Engineering, in any year of studies, as long as they are knowledgeable in Graphical Programming and have practical experience with LabVIEW.
- Students should be selected by the faculty member responsible for the activity and should have worked with this faculty member before (in class or in educational outreach activities).
The selected students should stand out for their science communication skills rather than their excellence and academic achievement per se.
Role (in order of relevance) Guidance Pedagogical co-designers of learning, teaching
and assessment; facilitators in hands-on and lab experiments
The selected university students:
- should work together with high school students during the practical activity in order to help them manage work with LabVIEW - should participate in the assessment of student performance during the activity and in the evaluation of the effectiveness of the training
- should also be actively engaged in the self- reflection phase, staying with the student team in which they worked.
Mentors of SE VET students The selected university students can be asked to share their contacts with bright or motivated high school students who may want to learn more about Graphical Programming or visit the university. The possibility of involving high school students in teams working on university projects or contests should be explored.
Consultants in planning and designing the
learning and teaching process The selected university students should be fully engaged in the design of the hands-on activity in order to ensure that the tasks would be manageable for younger students without academic background.
Students can be given the task to prepare the Power Point presentation for the activity, as well as any handouts and supporting materials.
They should, however, do this on the basis of clear instructions from the faculty member who will lead the course.
Co-researchers contributing to subject-based The engaged university students can be asked Annex III: Co-Creation
29
research to design interesting tasks for implementation in LabVIEW. They should be instructed to choose topics that would resonate with younger people.
High School Teachers (supporting role is suitable for teachers in Computer Science) Consultants in planning and designing the
learning and teaching process
The accompanying teachers should have the leading role in selecting trainees from among the students.
They should be approached in advance and be consulted about the relevance of the presented examples and a suitable level of difficulty of the theoretical presentation (in view of the intended group of trainees). Special attention should be paid to the selection of manageable practical tasks.
Teachers should be consulted about the best way to draw parallels and to link the content of the course to the compulsory study programs.
Pedagogical co-designers of learning, teaching and assessment; facilitators in hands-on and lab experiments
The accompanying teachers should work together with high school students during the practical activity in order to help them master the use of LabVIEW and help those that have failed to understand the presented material or apply it in practice.
Most teachers would be in position in which they themselves will work with LabVIEW for the first time. They should be given the chance to learn themselves.
They should be the primary source of feedback about the effectiveness of the training. They will also be in the best position to assess the performance of their students.
Teachers should play a central role in maintaining discipline during the activity.
University-high school partnerships
This course in particular would be a suitable addition to the study programs in schools with a profile in Computer Science, mathematics, or the Natural Sciences. It can be the beginning of a series of extra-curricular courses on Programming. If there is such an interest, contact between the accompanying teachers and the university should be made well in advance and the course should be planned as part of a larger set of topics. The course can be combined with open Lab sessions at the university. One particular high school teacher or administrator and one particular university faculty member should be tasked with the organization and should act as contact
30
persons and “boundary spanners”. For further collaboration to be planned, it is advisable that an educational manager from the school attend (part of) the course in order to witness the effectiveness of the training. If this is not possible, then a report of the achieved results and the satisfaction of students should be presented to the school management together with a proposal for further collaboration.