database communication using labview video · old fashion database (data-storage) systems not too...
TRANSCRIPT
![Page 1: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/1.jpg)
DatabaseCommunicationusingLabVIEW
Hans-PetterHalvorsen,M.Sc.
![Page 2: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/2.jpg)
Software Software
MicrosoftSQLServerExpresscanbedownloadedforfreefromInternet
AllLabVIEWSoftwarecanbedownloadedfrom:www.ni.com/download
![Page 3: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/3.jpg)
MicrosoftSQLServerDatabase
Overview
CreateTables
DatabaseManagement
Write/ReadData
ODBC
LabVIEWApplicationwithGUIthatCommunicatewiththeSQLServer
![Page 4: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/4.jpg)
DatabaseSystems
Hans-PetterHalvorsen,M.Sc.
![Page 5: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/5.jpg)
OldfashionDatabase(Data-storage)Systems
Nottoolongago,thiswastheonlydata-storagedevicemostcompaniesneeded.Thosedaysareover.
![Page 6: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/6.jpg)
DatabaseSystems• ADatabaseisastructuredwaytostorelotsofinformation.
Theinformationisstoredindifferenttables.• - “Everything”todayisstoredindatabases!
Examples:• Bank/Accountsystems• InformationinWebpagessuchasFacebook,Wikipedia,YouTube,etc.
• …lotsofotherexamples!(Giveme5examples)
![Page 7: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/7.jpg)
DatabaseManagementSystems(DBMS)• Oracle• MySQL• MariaDB• Sybase• MicrosoftAccess• MicrosoftSQLServer• ... (wehavehundredsdifferentDBMS)
![Page 8: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/8.jpg)
Hans-PetterHalvorsen,M.Sc.
SQLServer
![Page 9: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/9.jpg)
MicrosoftSQLServer Software
![Page 10: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/10.jpg)
CreatingTables
SchoolIdNameDescription
SCHOOLTableName
TableColumns
PrimaryKey
![Page 11: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/11.jpg)
LetsCreatetheExamplefromScratch
![Page 12: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/12.jpg)
StructuredQueryLanguageSQL
Hans-PetterHalvorsen,M.Sc.
![Page 13: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/13.jpg)
WhatisSQL?• SQL– StructuredQueryLanguage• SQLisastandardlanguageforaccessingdatabases– andmanipulatedata
• SQLisnotcasesensitive
select SchoolId, Name from SCHOOL
ColumnsTable
Example:
Weusethe“SELECT”commandinordertogetdatafromtheDatabase
Theory
![Page 14: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/14.jpg)
SQL– StructuredQueryLanguage
• insert into STUDENT (Name , Number, SchoolId)values ('John Smith', '100005', 1)
• select SchoolId, Name from SCHOOL
• select * from SCHOOL where SchoolId > 100
• update STUDENT set Name='John Wayne' where StudentId=2
• delete from STUDENT where SchoolId=3
QueryExamples:
Wehave4differentQueryTypes:INSERT,SELECT,UPDATEand DELETE
Theory
![Page 15: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/15.jpg)
LetsCreatesomeExamplesfromScratch
![Page 16: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/16.jpg)
Hans-PetterHalvorsen,M.Sc.
OpenDatabaseConnectivity(ODBC)
![Page 17: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/17.jpg)
ODBCODBC(OpenDatabaseConnectivity)isastandardizedinterface(API)foraccessingthedatabasefromaclient.Youcanusethisstandardtocommunicatewithdatabasesfromdifferentvendors,suchasOracle,SQLServer,etc.ThedesignersofODBCaimedtomakeitindependentofprogramminglanguages,databasesystems,andoperatingsystems.ControlPanel→AdministrativeTools→DataSources(ODBC)
WewillusethisODBCConnectionlaterinLabVIEWinordertoopentheDatabaseConnectionfromLabVIEW
Theory
Note!Makesuretousethe32bit versionoftheODBCTool!
![Page 18: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/18.jpg)
ODBC– StepbyStepInstructions
18
TheNameofyourSQLServer
TheNameofyourODBCConnection
UseeitherWindowsorSQLServerauthentication(Windowsissimplesttouse!)
SelecttheDatabaseyouareusing
Testyourconnectiontoseeifitsworks
![Page 19: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/19.jpg)
LetsCreatetheExamplefromScratch
![Page 20: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/20.jpg)
DatabaseCommunicationinLabVIEWLabVIEW
Hans-PetterHalvorsen,M.Sc.
![Page 21: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/21.jpg)
Hans-PetterHalvorsen,M.Sc.
LabVIEWSQLToolkitForEasyDatabaseCommunicationusingLabVIEW
![Page 22: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/22.jpg)
LabVIEWSQLToolkit
http://home.hit.no/~hansha/documents/labview/code/SQLToolkit.zip
ForEasyDatabaseCommunicationusingLabVIEW
©Hans-PetterHalvorsenDownloadforfreehere:
SoftwareSoftware
![Page 23: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/23.jpg)
LabVIEWSQLToolkit
23
Example1:GetDatafromDatabaseintoLabVIEW:
Example2:WriteDatatoDatabasefromLabVIEW:
EasyAccesstoDatabaseSystemsfromLabVIEW
YourODBCConnection
2DTablewithData
1
Query
Query
2 3
1 2 3
Students:TrytheseExamples
![Page 24: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/24.jpg)
Example1:GetDatafromDatabaseintoLabVIEW
![Page 25: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/25.jpg)
LetsCreatetheExamplefromScratch
![Page 26: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/26.jpg)
Example2:WriteDatatoDatabasefromLabVIEW
![Page 27: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/27.jpg)
LetsCreatetheExamplefromScratch
![Page 28: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/28.jpg)
AlternativeSolution:TypeintheConnectionStringforyourDatabase
Note!Whenusingthismethod,youdontneedtocreateanODBCConnectionfirst!
YourPasswordforthesauser
YourSQLServerInstance
TypeyourDatabasehere
YourSQLQuery
![Page 29: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/29.jpg)
Hans-PetterHalvorsen,M.Sc.
LabVIEWExampleLoggingMeasurementsDatatoSQLServer
![Page 30: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/30.jpg)
LoggingMeasurementDataintoSQLServerDatabase
30
TemperatureMeasurements(TC-01Thermocouple)
Note!YouwillneedtheNIDAQmxDriver
![Page 31: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/31.jpg)
LoggingMeasurementDataintoSQLServerDatabase
![Page 32: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/32.jpg)
LetsCreatetheExamplefromScratch
![Page 33: Database Communication using LabVIEW Video · Old fashion Database (Data-storage) Systems Not too long ago, this was the only data-storage device most companies needed. Those days](https://reader036.vdocument.in/reader036/viewer/2022062414/5f0312317e708231d40763fb/html5/thumbnails/33.jpg)
Hans-PetterHalvorsen,M.Sc.
UniversityCollegeofSoutheastNorwaywww.usn.no
E-mail:[email protected]:http://home.hit.no/~hansha/