{"id":29257,"date":"2022-08-22T11:41:18","date_gmt":"2022-08-22T18:41:18","guid":{"rendered":"https:\/\/digilent.com\/blog\/?p=29257"},"modified":"2022-08-22T11:41:18","modified_gmt":"2022-08-22T18:41:18","slug":"reading-generated-data-in-a-real-time-distributed-system-part-1","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/reading-generated-data-in-a-real-time-distributed-system-part-1\/","title":{"rendered":"Reading Generated Data in a Real-Time Distributed System &#8211; Part 1"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.digilent.com\/blog\/wp-content\/uploads\/2022\/08\/2022-ReadingGeneratedData-part1-580.png\" alt=\"\" width=\"580\" height=\"290\" class=\"aligncenter size-full wp-image-29324\" data-wp-pid=\"29324\" \/><\/p>\n<p>In today\u2019s manufacturing world, companies are trying to do more with less staffing by maximizing throughput or looking for critical status of a production line without interrupting focus of production staffing.<\/p>\n<p>In the past, a manager would often need to walk the production floor to see how the various processes are performing. This took time away from other important tasks, and required these managers to generate reports and perhaps present the data to other managers. One way that the process has evolved to reduce or even eliminate the need for manager oversight is by sending the data collected from various systems to a centralized (physical or cloud-based) data base.<\/p>\n<p>Many manufacturing facilities utilize data acquisition and control products integrated directly into their production stands.\u00a0 These devices monitor and\/or control the manufacturing process of products from all aspects of life today.\u00a0 The sensor data used to make programmed decisions to any part of the production process can also be used to inform and notify managers, supervisors, directors, administrators, etc. either as a consolidated view or as a report in near real-time.<\/p>\n<p>The key to this is setting up a database as a repository or collection point for all the data being collected. Once the data base is created and setup, existing code used can be easily modified to send that telemetry to the data base where folks who needs to know, can run an app to see what is happening over in production.<\/p>\n<p>This series of articles demonstrates creating and setting up a database and suggestions for augmenting applications written in but not limited to Visual Basic.NET, LabVIEW, and DASYLab.<\/p>\n<p><a href=\"https:\/\/digilent.com\/blog\/reading-generated-data-in-a-real-time-distributed-system-part-2\/\">Part 2 &#8211; Creating an Application to Collect and Pass Data<\/a><\/p>\n<p><a href=\"https:\/\/digilent.com\/blog\/reading-generated-data-in-a-real-time-distributed-system-part-3\/\">Part 3 &#8211; Creating an Application to View Data<\/a><\/p>\n<p><a href=\"https:\/\/digilent.com\/blog\/reading-generated-data-in-a-real-time-distributed-system-part-4\/\">Part 4 &#8211; Distributing Applications<\/a><\/p>\n<p><a href=\"https:\/\/digilent.com\/blog\/reading-generated-data-in-a-real-time-distributed-system-part-5\/\">Part 5 &#8211; Using Additional Software Packages<\/a><\/p>\n<h2>Setting Up an MS Database<\/h2>\n<p style=\"font-weight: 400;\">There are a lot of &#8216;step by step&#8217; instructions on how to accomplish this on the internet, just Google \u201cHow to set up an ODBC connection.\u201d\u00a0 In lieu of that, here are my &#8216;step by step&#8217; instructions (as performed on Windows 7\/64 bit).<\/p>\n<p style=\"font-weight: 400;\">You will need to put an ODBC connection on the computer you&#8217;re working on. Click on Start&gt;&gt; Control Panel &gt;&gt; Administrative Tools, then double click on &#8220;Data Sources (ODBC)&#8221;. Click on the &#8220;System DSN&#8221; tab. User DSN means that only you will be able to access this data source, and System DSN means that anyone who is on the machine should be able to access the data source (though only if they provide the necessary credentials). Now click on<span>\u00a0<\/span><strong>Add\u2026<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2022\/08\/01.png\" alt=\"\" width=\"472\" height=\"392\" class=\"aligncenter size-full wp-image-29281\" data-wp-pid=\"29281\" \/><\/p>\n<p style=\"font-weight: 400;\">We will be using Microsoft Access, so select \u2018Microsoft Access Driver (*.mdb, *.accdb),\u2019 then click<span>\u00a0<\/span><strong>Finish<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2022\/08\/02-CreateNewDataSource.png\" alt=\"\" width=\"478\" height=\"360\" class=\"aligncenter size-full wp-image-29282\" data-wp-pid=\"29282\" \/><\/p>\n<p style=\"font-weight: 400;\">The ODBC Microsoft Access Setup dialog appears.\u00a0 Enter a Data Source Name, Description, and click on<span>\u00a0<\/span><strong>Create\u2026<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2022\/08\/03-ODBCMicrosoftAccessSetup.png\" alt=\"\" width=\"481\" height=\"321\" class=\"aligncenter size-full wp-image-29283\" data-wp-pid=\"29283\" \/><\/p>\n<p style=\"font-weight: 400;\">The new Database dialog appears.\u00a0 Enter the name of the database.\u00a0 Throughout this article, we will be working with the name<span>\u00a0<\/span>MccGenericOdbc, and it is placed in C:\\Users\\Public\\Documents.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2022\/08\/04-NewDatabase.png\" alt=\"\" width=\"552\" height=\"373\" class=\"aligncenter size-full wp-image-29284\" data-wp-pid=\"29284\" \/><\/p>\n<p style=\"font-weight: 400;\">Click on<span>\u00a0<\/span><strong>OK<\/strong>.\u00a0If all went correctly you should see this message:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2022\/08\/06-ODBCMicrosoftAccessSetup.png\" alt=\"\" width=\"497\" height=\"172\" class=\"aligncenter size-full wp-image-29285\" data-wp-pid=\"29285\" \/><\/p>\n<p style=\"font-weight: 400;\">Click on<span>\u00a0<\/span><strong>OK<\/strong>, and you will be back to the ODBC Microsoft Setup now with the database name inserted:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2022\/08\/05-ODBCMicrosoftAccessSetup.png\" alt=\"\" width=\"481\" height=\"321\" class=\"aligncenter size-full wp-image-29288\" data-wp-pid=\"29288\" \/><\/p>\n<p>&nbsp;<\/p>\n<p style=\"font-weight: 400;\">Click<span>\u00a0<\/span><strong>OK<\/strong>, and now your ODBC Data Source Administrator will look like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2022\/08\/06-ODBCDataSourceAdministator1.png\" alt=\"\" width=\"472\" height=\"392\" class=\"aligncenter size-full wp-image-29286\" data-wp-pid=\"29286\" \/><\/p>\n<p>&nbsp;<\/p>\n<p style=\"font-weight: 400;\">Open the Windows explorer and navigate to C:\\Users\\Public\\Documents to see your new database:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2022\/08\/07-WindowsExplorer1-1-600x350.png\" alt=\"\" width=\"600\" height=\"350\" class=\"aligncenter size-medium wp-image-29289\" data-wp-pid=\"29289\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2022\/08\/07-WindowsExplorer1-1-600x350.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2022\/08\/07-WindowsExplorer1-1.png 878w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p style=\"font-weight: 400;\">It is assumed you have a copy of Microsoft Access to complete the following steps.\u00a0 However, if you do not, attached to this article is a useable copy of the database for this project.<\/p>\n<p style=\"font-weight: 400;\">Double click on MCCGenericOdbc.mdb to launch Microsoft Access and open the empty database. Click \u201cCreate &gt; Table\u201d.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2022\/08\/08-EmptyDatabase-600x299.png\" alt=\"\" width=\"600\" height=\"299\" class=\"aligncenter size-medium wp-image-29290\" data-wp-pid=\"29290\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2022\/08\/08-EmptyDatabase-600x299.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2022\/08\/08-EmptyDatabase-1024x510.png 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2022\/08\/08-EmptyDatabase.png 1200w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p style=\"font-weight: 400;\">A new Table appears. The first column is already labeled \u201cID\u201d.\u00a0 We need 5 additional columns for our table. \u00a0Notice the column to the right of ID is highlighted, and labeled \u201c<em>Click to add<\/em>\u201d.\u00a0 Click on it, and a drop down menu appears with various options for the data type.\u00a0 We want this first column to be the time the data was collected so select \u201cDate &amp; Time\u201d. \u00a0The cursor moves to the field name location.\u00a0 By default it is named \u201cField1\u201d.\u00a0 Change that to \u201cTime\u201d.\u00a0 Repeat this process for the next 4 columns, making the data types all \u201cShort Text\u201d, and with the names changed to, \u201cTemperature\u201d, \u201cPressure\u201d, \u201cTachometer\u201d, and \u201cInterlock\u201d.<\/p>\n<p style=\"font-weight: 400;\">When completed, it will look like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2022\/08\/09-DatabaseWithTable1-600x299.png\" alt=\"\" width=\"600\" height=\"299\" class=\"aligncenter size-medium wp-image-29291\" data-wp-pid=\"29291\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2022\/08\/09-DatabaseWithTable1-600x299.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2022\/08\/09-DatabaseWithTable1-1024x510.png 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2022\/08\/09-DatabaseWithTable1.png 1200w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p style=\"font-weight: 400;\">Click on \u201cFile\u201d, \u201cSave\u201d, and a Save as dialog appears.\u00a0 Enter a name for the table.\u00a0 Enter \u201cTestData\u201d and click<span>\u00a0<\/span><strong>OK<\/strong>.\u00a0 Then close Access.\u00a0 We will be reading and writing to this data table in the next sections.<\/p>\n<p>&nbsp;<\/p>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-29257 jlk' data-task='like' data-post_id='29257' data-nonce='e18fa772db' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-29257 lc'>0<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-29257 jlk' data-task='unlike' data-post_id='29257' data-nonce='e18fa772db' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-29257 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-29257 status align-left'>Be the 1st to vote.<\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>In today\u2019s manufacturing world, companies are trying to do more with less staffing by maximizing throughput or looking for critical status of a production line without interrupting focus of production &hellip; <\/p>\n","protected":false},"author":59,"featured_media":29344,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4361,4267,1563],"tags":[],"ppma_author":[4507],"class_list":["post-29257","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-acquisition","category-featured","category-guide"],"jetpack_featured_media_url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2022\/08\/2022-ReadingGeneratedData2-part1-580.png","authors":[{"term_id":4507,"user_id":59,"is_guest":0,"slug":"jgreenberg","display_name":"Jeff Greenberg","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/7d7c29970e5c0f9f3acaf605ee106bd6?s=96&d=mm&r=g","author_category":"","user_url":"","last_name":"Greenberg","last_name_2":"","first_name":"Jeff","first_name_2":"","job_title":"","description":""}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/29257","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/users\/59"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=29257"}],"version-history":[{"count":0,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/29257\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/29344"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=29257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=29257"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=29257"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=29257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}