USB Logic Analyzer Shom Bandopadhaya Advisor: Dr. James H. Irwin

Size: px
Start display at page:

Download "USB Logic Analyzer Shom Bandopadhaya Advisor: Dr. James H. Irwin"

Transcription

1

2 Shom Bandopadhaya: USB Logic Analyzer October 13, 2005 USB Logic Analyzer Shom Bandopadhaya Advisor: Dr. James H. Irwin Introduction: The goal of this project is to continue design for a USB logic analyzer to be used in the junior laboratory. The design uses an Opal Kelly XEM3001 FPGA board which communicates over USB 2.0 to a GUI written in C#. The project was initially started by Jason Nielsen and Jeff Earleson in Previous work on this project has been recorded on their project website. Jeff Earleson will be working on the hardware part of the project again as an external consultant/designer. Shom and Jeff will both post updates on the their respective part of the project. Shom will be responsible for all deliverables pertaining to the Capstone Senior Project. Functional Description: The functional description was developed after talking to Dr. Irwin and Jeff Earleson. The functional description can be found on the project website. The project website is temporarily located at but the permanent project home will be at Electronic Laboratory Notebook: This project will use an Electronic Laboratory Notebook for record keeping instead of a traditional paper notebook. Lot of research was done to find a suitable and reliable solution. The key factor was to find a solution where in the information entered could not be digitally altered, which requires a strong encryption. The information also needed to be globally accessible, so it has to be stored in an open format and finally the information needs to be timestamped. The first two concerns were remedied by using OpenOffice.org 2.0 from Sun Microsystems Inc. as the data entry and storage format. Using a portable document format [PDF] add-on the notebook installments will be published in PDF format with 128bit encryption. Several more hours of researching online provided the solution to the time stamp problem. The PDF document will then be timestamped using an open source time-stamping software from The time-stamping service using a security certificate on a remote server to digitally sign the document and encloses it in a timestamped format (*.timestamp). The validator program, that is part of the package, opens the timestamped document and shows the time that was stamped by the trusted Time Stamp Authority [TSA] and allows for the document to be opened or saved in the original format. Further the lab notebook will be maintained as individual documents for each day that the progress is recorded for. At the end of each session that the notebook is worked on, the session's document will be converted to encrypted PDF format and then timestamped. The format of the document will include a header and footer. The header will contain Shom Bandopadhaya: USB Logic Analyzer on the left and the current date on the right. The footer will contain the page number of the current document (document valid for that session). All figures and 1

3 Shom Bandopadhaya: USB Logic Analyzer October 13, 2005 tables will be referenced based on the current document's page number. For instance, the the first figure on the second page of a document will be referenced as Figure 2.1 and the second figure on that page will be referenced as Figure 2.2. Any references to work completed during a previous session will be referenced by the document's name which has the following format: usblamm.dd.yy.pdf. For instance, Figure 2.1 in the document created on October 13, 2005 will be referenced as Figure 2.2 in usbla pdf. The pdf files will be maintained on the project website and a final lab notebook will be created by combining all the individual sessions. This is the current setup for the electronic laboratory notebook, any further changes will be noted later on. Project Website: One of the main considerations for the project website was user-friendliness and ease of updates. After having looked at several project websites it was realized that the weekly updates of the projects were important but not paid attention to. Since Jeff Earleson is working on the project externally, there needs to be an easy way for him to post updates without having to maintain the project website. After considering these factors a web log or blog approach was adopted for the project website. Another open source solution was implemented, Greymatter ( weblog/journal software built on cgi/perl. Greymatter instead of a PHP based solution because the cegt201 web server supports cgi/perl but not php. The website development will not be discussed in any more detail since it is not pertinent to the project. However, a lot of time was devoted in planning the website and adding extra features to it, such as provisions for custom pages and really simple syndication [RSS] 2.0 feed, etc. Lab Research : The morning was spent talking to Jeff Earleson about the setup of the project. We looked at the final paper from the previous year and Jeff provided an overview of the hardware. We also discussed what were the major problems that the team faced last year and where would be a good place to start researching. After talking to Jeff, Opal Kelly Documentation seems like a good place to start researching. First, the project paper from last read will be read to gain a better understanding of the project. The Opal Kelly website [ newly released a 3-D model of the XEM3001 FPGA board. A screen shot of the model is shown in Figure 2.1 Figure D model of XEM3001 2

4 Shom Bandopadhaya: USB Logic Analyzer October 13, 2005 The block diagram of the system as can be seen in Figure 3.1 was also provided on the product website [ along with other important documents that can be seen in Table 2.1. XEM Product Brief PDF XEM3001v2 - User's Manual PDF FrontPanel - Product Brief PDF FrontPanel - Product Brief (for educational users) PDF FrontPanel - User's Manual PDF FrontPanel - Applications Programming Interface Guide HTML New! - XEM3001-3D Model (Download free edrawings viewer here) EASM Table 2.1 Documents related to XEM3001 provided by Opal Kelly Figure 3.1 Block diagram of XEM3001 FPGA board After reading the Opal Kelly website I learned that in order to get their interface software and to get the DLL to interface with C# you need to be a registered member of the their community forum. I need to talk to Dr. Irwin and figure out what software is available and where. After I am more familiar with the Opal Kelly documentation, I will look into last year's code and then try some C# tutorials and get my feet wet. Software needs to be installed on the lab computers. Hopefully that will happen soon so Jeff can start testing with last year's software. I am figure out how and where to post these lab notebook sessions. 3

5 Shom Bandopadhaya: USB Logic Analyzer October 18, 2005 Microsoft Visual C#.NET: I started looking into C# and learning how to use the compiler and just the basic constructs of the language. I decided to use MSDN as a starting point and started with the tutorials provided at Hello World: I ran the Hello World programs and realized that C# is completely object oriented, it does have a main function, but for each class there is a main, there is no overall int main(). Also it seems like that one solution may contain many projects. I will need to find a good place to get a general overview of the compiler and C#. The hello world program is shown below, it also does not include any libraries or state any dependencies. public class Hello1 { public static void Main() { System.Console.WriteLine("Hello, World!"); } } Code 1.1 Simple Hello World program in C# A second Hello World program was also provided with the tutorial and it stated a dependency, system, which lets the code to directly call a function without referring to the dependencies first. using System; public class Hello2 { public static void Main() { Console.WriteLine("Hello, World!"); } } Code 1.2 Hello World with dependency I will continue with more tutorials to get comfortable before looking into last year's code. Documentation: In order to keep good documentation on the project all the classes and functions will have a description attached to them. Last year I found this software called Doxygen [ that looks through code and creates documentation based on its dependencies and comments. The software worked great in creating html (other formats are also available) documentation on some of my previous projects. I will be using the commenting convention recommended by the software so a comprehensive documentation can be automatically generated from it. A //! denotes a brief description of the function or class. While a /*! denotes the start of an extended 1

6 Shom Bandopadhaya: USB Logic Analyzer October 18, 2005 description. The following page explains the details of the convention, However, only basics of it will be used to create documentation that looks like 2

7 Shom Bandopadhaya: USB Logic Analyzer October 20, 2005 Opal Kelly Software: I was able to get in touch with Jason Nielsen (pcbla 2005) to get log-in information for the Opal Kelly community, which is restricted based on hardware purchase. We were able to switch over the account, the login and password will be recorded here, if future access is required to the site (by another team). Login: BUpcbla Password: usbla06 I downloaded the FrontPanel software from the Opal Kelly website so Jeff could start communicating with the board. Nick Schmidt (Asst. Lab Director) will have to install the software on the lab computer, due to permission restrictions. We spent some time getting the right software packages and then hunting down Nick. We also downloaded the Xilinx ISE WebPACK 7.1i. Jeff will be able to work on the physical board once these applications are installed on the lab computer. Website: After talking to Dr. Malinowski, he was able to able to give me permission to post on the project web space. The website was moved to the project web space at and a HTTP 301 redirect was placed at the old site. The website is now ready to be graded after a lot of file transfer issues were resolved. Functional Description Revisited: The DRT reviewed the functional description and made the following suggestions: The POD needs to be explained in more detail. What are the additional user features that may be implemented? Reason for using C# instead of more traditional C, C++, etc.? Organize goals section into primary and secondary headings. The functional description will be revised again and these suggestions will be incorporated into it. C#: I spent most of the day learning more about C# from the MSDN C# Language Specifications website. I am going to certain information here that I think will be good reminders for later. C# supports two kinds of types: value types and reference types. Console.WriteLine: The first argument is a string, which may contain numbered placeholders like {0} and {1}. Each placeholder refers to a trailing argument with {0} referring to the second argument, {1} referring to the third argument, and so on. C# has predefined types as can be seen in Table 2.1: C# predefined types. Explicit type cast conversion shown in Code 1.1: Typecasting long longvalue = Int64.MaxValue; int intvalue = (int) longvalue; Code 1.1 Typecasting 1

8 Shom Bandopadhaya: USB Logic Analyzer October 20, 2005 Type Description Example object The ultimate base type of all other types object o = null; string String type; a string is a sequence of Unicode characters string s = "hello"; sbyte 8-bit signed integral type sbyte val = 12; short 16-bit signed integral type short val = 12; int 32-bit signed integral type int val = 12; long 64-bit signed integral type long val1 = 12; long val2 = 34L; byte 8-bit unsigned integral type byte val1 = 12; ushort 16-bit unsigned integral type ushort val1 = 12; uint 32-bit unsigned integral type uint val1 = 12; uint val2 = 34U; ulong 64-bit unsigned integral type ulong val1 = 12; ulong val2 = 34U; ulong val3 = 56L; ulong val4 = 78UL; float Single-precision floating point type float val = 1.23F; double Double-precision floating point type double val1 = 1.23; double val2 = 4.56D; bool Boolean type; a bool value is either true or false bool val1 = true; bool val2 = false; char Character type; a char value is a Unicode character char val = 'h'; decimal Precise decimal type with 28 significant digits decimal val = 1.23M; Table 2.1 C# Predefined Types 2

9 Shom Bandopadhaya: USB Logic Analyzer October 20, 2005 Arrays are handled slightly differently in C# as shown in Code 3.1: Array Declarations. class Test { static void Main() { int[] a1; int[,] a2; int[,,] a3; int[][] j2; int[][][] j3; } } // single-dimensional array of int // 2-dimensional array of int // 3-dimensional array of int // "jagged" array: array of (array of int) // array of (array of (array of int)) Code 3.1 Array Declarations in C# Boxing and Unboxing to convert between value types and object types. Code 3.2: Boxing and Unboxing. This behavior is helpful when value types need to behave like object types, the example provided was a stack implementation shown in Code 3.3: Stack class. The stack can be used with elements of any type including value types like int and int literals. class Test { static void Main() { int i = 123; object o = i; int j = (int) o; } } // boxing // unboxing Code 3.2 Boxing and Unboxing public class Stack { public object Pop() {...} public void Push(object o) {...} } Code 3.3 Stack class More C#: I will have to finish going through the following topics before I can dive into reviewing/writing code for the project: Classes Interface Namespaces Member functions Member access Application Handling Automatic Memory Management After I get through understanding these elements then the detail and more parts of C# will be learned on a need to know basis and continual exploration of the language. 3

10 Shom Bandopadhaya: USB Logic Analyzer October 22, 2005 More C#: Automatic Memory Management C# cleans up memory used by the program once it can not be accessed by any code anymore. This means that when a variable is terminated by setting it to null, or the scope of the variable expires and no piece of code can access the data the memory used by that variable is reclaimed to be free memory. There is a provision to write non-managed code, it needs to be declared as unsafe code. Statements Most of the statements used in C# are derived from C and C++. Here are some of the differences: foreach statements static void Main(string[] args) { foreach (string s in args) Console.WriteLine(s); } throw statements and try statements static int F(int a, int b) { if (b == 0) throw new Exception("Divide by zero"); return a / b; } static void Main() { try { Console.WriteLine(F(5, 0)); } catch(exception e) { Console.WriteLine("Error"); } } checked and unchecked statements static void Main() { int x = Int32.MaxValue; Console.WriteLine(x + 1); // Overflow checked { Console.WriteLine(x + 1); // Exception } } unchecked { Console.WriteLine(x + 1); // Overflow } lock statements static void Main() { 1

11 Shom Bandopadhaya: USB Logic Analyzer October 22, 2005 } A a =...; lock(a) { a.p = a.p + 1; } using statements static void Main() { using (Resource r = new Resource()) { r.f(); } } Classes C# classes have Constants, Fields, Methods, Properties, Events, Operators, Indexers, Instance Constructors, Destructors, Static Contructors, and Inheritance. Some notes: A field is a member that represents a variable associated with an object or class. Static methods are accessed through the class. Non-static methods, which are also called instance methods, are accessed through instances of the class. Methods can be overloaded. Properties provide access to characteristics of a class. They contain a declaration and get and/or set accessor. Operators are unary, binary and conversion. Operators need to be declared as public and static. An indexer allows an object to be indexed and accessed as an array. Code 2.1: Indexer example shows an abbreviated example of an indexed stack class. using System; public class Stack {... public object this[int index] { get { return GetNode(index).Value; } set { GetNode(index).Value = value; } }... } class Test { static void Main() { Stack s = new Stack(); s.push(2); s.push(3); s[0] = 33; // Changes the top item from 3 to 33 s[1] = 22; // Changes the next item from 2 to 22 } } Code 2.1 Indexer example 2

12 Shom Bandopadhaya: USB Logic Analyzer October 22, 2005 If a class constructor is not provided a blank default with no parameter is created. A destructor can not be called from code, it is invoked automatically during garbage collection. C# supports single inheritance. The rules for inheritance are slightly more complicated, a detailed explanation should be read from MSDN. Structs They are similar to C++, careful use of structs can optimize programs. Further C#: These topics remain to be covered: Interface Namespaces Delegates 3

13 Shom Bandopadhaya: USB Logic Analyzer October 27, 2005 Hardware: Jeff and I discussed making the hardware function for 8 lines and work at slower speeds of either 1MHz or 12MHz. The reason for these specs is the intended use of the product in Junior Lab. The fastest device that the logic analyzer will be interfacing with will be an 8051 microcontroller which runs at 1MHz and has a clock speed of 12MHz. We are going to get a hardware that works for a slower system laid on a board so we can get it printed on a printed circuit. This will allow us to have a working prototype. I can test code with this prototype while Jeff can troubleshoot and develop designs a more sophisticated circuit which will handle high frequency signals. Jeff and I took a look at the hardware from last year. It took sometime to get the hardware together and make sure all the connections were intact. The main design problem from last year was the cross talk. Jeff setup the circuit to show me that problem. He connected a TTL square wave signal to the input of the comparator, the schematic can be seen in Figure 1.1: Compare circuitry. Figure 1.1 Compare circuitry He introduced the TTL square wave signal on the from probe line. Figure 2.1: TTL input (ch2) and output to FPGA (ch1) shows the TTL input signal and the output to the FPGA. Channel 1 which is the input to the FPGA shows that it is within acceptable levels of the XEM 3001 board which needs inputs to be under 3.3v. Figure 2.2: TTL input (ch2) and output to FPGA (ch1) transition shows there are issues with rise time and distortion. But for a slower system which they should not be too much of a problem. Jeff will deal with cross talk soon, but most of that problem could simply be resolved when the circuit is printed so they stray capacitance from the wire wrap will be eliminated. 1

14 Shom Bandopadhaya: USB Logic Analyzer October 27, 2005 Figure 2.1 TTL input (ch2) and output to FPGA (ch1) Figure 2.2 TTL input (ch2) and output to FPGA (ch1) transition 2

15 Shom Bandopadhaya: USB Logic Analyzer October 27, 2005 Figure 3.1 TTL input (ch2) and crosstalk on next output pin (ch1) Figure 3.1 shows the issue of cross talk that still exists. Channel 1 shows the crosstalk that exists on a pin next to the output pin. Software: I started looking at the previous year's software along with looking at the language specifications for C#. I was hoping to transfer some data from the XEM3001 to the PC using last year's C++ program. But the USB cable I needed was not found in the box. I researched how to use DLLs from C# and I included the tutorial I found, I will need to refer back to this when using the Opal Kelly DLL. This sample shows how to create and use a DLL in C#. This sample contains the source code for the Libraries Tutorial. Building and Running the Sample Within Visual Studio To build and run the Libraries sample 1. Open the solution (Libraries.sln). 2. In Solution Explorer, right-click the FunctionTest project and click Set as StartUp Project. 3. In Solution Explorer, right-click the FunctionTest project and click Properties. 4. Open the Configuration Properties folder and click Debugging. 5. In the Command Line Arguments property, enter Click OK. 7. From the Debug menu, click Start Without Debugging. This will automatically build the 3

16 Shom Bandopadhaya: USB Logic Analyzer October 27, 2005 library in Functions and execute the program. Building and Running the Sample from the Command Line To build and run the Libraries sample 1. Use the Change Directory command to change to the Functions directory. 2. Type the following: csc /target:library /out:functions.dll Factorial.cs DigitCounter.cs 3. Use the Change Directory command to change to the FunctionTest directory. 4. Type the following: copy..\functions\functions.dll. csc /out:functiontest.exe /R:..\Functions.DLL FunctionClient.cs FunctionTest

17 Shom Bandopadhaya: USB Logic Analyzer November 3, 2005 Logic Analyzers: Dr. Irwin wanted me to research Logic Analyzers. I looked for the manual for the logic analyzer that is in the junior lab, but was unable to locate it. I looked at actual logic analyzers on line and found a lot of hardware and hardware/software implementations. Most of the logic analyzers that I looked at provided high speed as one of their greatest features with specifications like 500 ps timing (2 GHz). Most of my day was spent looking at logic analyzers and the conventions they use. Hardware: Jeff and I looked at routing the board. It was interesting to observe all the caveats of the hardware portion of the project. After messing with the board layout program a lot Jeff and I were able to reduce to number of layers of the board to two. It almost seems impossible to implement the design on a single layer board. Figure 1.1: Board Layout shows the single layer board layout. Figure 1.1 Board Layout 1

18 Shom Bandopadhaya: USB Logic Analyzer November 3, 2005 NPlot Graphics Library: I dove into the NPlot graphics library and tried to start off with a simple window with a grid. After downloading the new DLL and looking at the setup parameters I wrote Code 3.1: Basic Windows Application. I will need to debug the code and keep adding features. using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Reflection; using NPlot; namespace initialtest { /// <summary> /// Summary description for Form1. /// </summary> public class Form1 : System.Windows.Forms.Form { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.Container components = null; public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); } // // TODO: Add any constructor code after InitializeComponent call // /// <summary> /// Clean up any resources being used. /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if (components!= null) { components.dispose(); } } base.dispose( disposing ); 2

19 Shom Bandopadhaya: USB Logic Analyzer November 3, 2005 } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { // // Form1 // this.autoscalebasesize = new System.Drawing.Size(5, 13); this.backcolor = System.Drawing.SystemColors.ActiveCaptionText; this.clientsize = new System.Drawing.Size(292, 273); this.name = "Form1"; this.text = "InitialTest"; this.load += new System.EventHandler(this.Form1_Load); } #endregion /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.Run(new Form1()); } private NPlot.Windows.PlotSurface2D plotsurface; private void Form1_Load(object sender, System.EventArgs e) { // --- Plotting --- plotsurface.clear(); // --- Grid Code --- Grid mygrid = new Grid(); } } } plotsurface.add(mygrid); Code 3.1 Basic Windows Application The window created by the code can be seen in Figure 4.1 Windows Application. There seems to be a problem with the way I refer to the NPlot object. I am not sure what the problem really is. I am still looking for a good API. 3

20 Shom Bandopadhaya: USB Logic Analyzer November 3, 2005 Figure 4.1 Windows Application 4

21 Shom Bandopadhaya: USB Logic Analyzer November 10, 2005 NPlot Problems: Over the weekend I spent a lot of time trying to generate a simple step plot. As mentioned in the previous notebook entry it was not quite working. Declaring the variable for the plot surface without the new command private NPlot.Windows.PlotSurface2D plot; was not working, as C# needs the variable to be initialized by their class constructor so the command needed was: private NPlot.Windows.PlotSurface2D plot = new Nplot.Windows.PlotSurface2D(); However, every example code from the NPlot declared it the first way, I looked at last year's code and it was done like the first method. After looking at all possibilities, I decided to write the code the second way and it compiled correctly, but the plotting surface wasn't added to the window. I tried looking for NPlot documentation. NPlot Documentation: There seems to be a steep learning curve, trying to use the DLL and the functions as intended. I am still trying to figure out what sort of initializations are mandatory, and what provide added features. Documentation available for it is rather sketchy, the examples packaged with the library are too robust so it is hard to glean basic information from it. I noticed that the in-code documentation was prepared in a way that Doxygen could extract most of the functional information. I generated the documentation using Doxygen, and after some tweaking it is finally useful. After all that, I did find an online documentation for the NPlot API. Soliciting outside help: Even after looking at the documentation which provided function calls and such, but provided no instructions on how to use them, I still wasn't able to plot anything. I called Jason Nielsen (worked on code last year). After looking at everything he said, it all looked fine and he had no idea why it was not plotting anything. He vaguely remembered dragging and dropping the plot surface instead of writing code to include it. He could not remember how that was achieved. He said I should look into design toolbox. Design Toolbox: Visual Studio.NET 2003 provides for a graphical IDE in building windows applications. The design toolbox has objects that can be dragged and dropped onto the application window, instead of having to generate code for all objects the code is automatically created to reduce the programming burden and allowing the programmer to place the objects precisely where they need to be graphically. I searched high and low through the toolbox to find where the NPlot plot surface was, but apparently it was no where. I checked again to make sure that the NPlot DLL was referenced correctly, and it appeared under references. Finally, I figured out that the DLL needed to be separately added to the Toolbox so the toolbox could then display the plot surface as an object. There is a lot of hidden code initializations that occur and that is why my previous attempt at writing all the code wasn't very successful, since I was not initializing everything, only what was stated by the API. 1

22 Shom Bandopadhaya: USB Logic Analyzer November 10, 2005 Victory at last: After adding the DLL to the toolbox and dragging the plot surface onto the application window, all the code I had written worked correctly to produce Figure 2.1: Simple Step Plot. Figure 2.1 Simple Step Plot The code will be included here since this is the simplest form using the NPlot library, and this will be a good reference for a bare bone basics. Code 5.1: Bare bone basic code for Step Plot will probably be the last time all the code is included for any part of the testing process. Code excerpts will assume full code for the program to function as shown below. using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Reflection; using NPlot; namespace initialtest { //! Test Class just creates an application window and attaches a //! plot surface area to the window and draws a step plot. public class test : System.Windows.Forms.Form { private System.ComponentModel.Container components = null; private NPlot.Windows.PlotSurface2D plot; 2

23 Shom Bandopadhaya: USB Logic Analyzer November 10, 2005 //! Constructor initializes components and calls function plotline() //! on this instance of the of object. public test() { InitializeComponent(); this.plotline(); } //! Creates one stepplot of six values that have been hard coded. public void plotline() { // --- Plotting --- plot.clear(); // --- Grid Code --- Grid mygrid = new Grid(); mygrid.horizontalgridtype = Grid.GridType.None; mygrid.verticalgridtype = Grid.GridType.Fine; plot.add(mygrid); plot.title = "Test"; StepPlot line = new StepPlot(); line.pen = new Pen (Color.Red, 1); line.ordinatedata = new int [] {0, 1, 0, 1, 1, 0}; line.hideverticalsegments = false; plot.add(line); plot.refresh(); } return; /// <summary> /// Clean up any resources being used. /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if (components!= null) { components.dispose(); } } base.dispose( disposing ); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> 3

24 Shom Bandopadhaya: USB Logic Analyzer November 10, 2005 private void InitializeComponent() { this.plot = new NPlot.Windows.PlotSurface2D(); this.suspendlayout(); // // plot // this.plot.autoscaleautogeneratedaxes = false; this.plot.autoscaletitle = false; this.plot.backcolor = System.Drawing.SystemColors.ControlLightLight; this.plot.datetimetooltip = false; this.plot.legend = null; this.plot.legendzorder = -1; this.plot.location = new System.Drawing.Point(16, 16); this.plot.name = "plot"; this.plot.padding = 10; this.plot.rightmenu = null; this.plot.showcoordinates = true; this.plot.size = new System.Drawing.Size(432, 288); this.plot.smoothingmode = System.Drawing.Drawing2D.SmoothingMode.None; this.plot.tabindex = 0; this.plot.text = "plot"; this.plot.title = ""; this.plot.titlefont = new System.Drawing.Font("Arial", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.plot.xaxis1 = null; this.plot.xaxis2 = null; this.plot.yaxis1 = null; this.plot.yaxis2 = null; // // test // this.autoscalebasesize = new System.Drawing.Size(5, 13); this.backcolor = System.Drawing.SystemColors.AppWorkspace; this.clientsize = new System.Drawing.Size(464, 317); this.controls.add(this.plot); this.name = "test"; this.text = "Testing Attention Please!"; this.resumelayout(false); } #endregion /// <summary> /// The application creates an instance of the class test. /// </summary> [STAThread] static void Main() 4

25 Shom Bandopadhaya: USB Logic Analyzer November 10, 2005 { } Application.Run(new test()); } } Code 5.1 Bare bone basic code for Step Plot Documentation I decided to start documenting the code the way I would like to document for the entire project, so that it is extractable by Doxygen. I ran Doxygen and it extracted the documentation correctly, that was encouragement enough to document more, and do a better job of documentation. Multiple Lines At this point I started expanding the code to handle an arbitrary number of lines specified by a variable called numlines. I am creating an array of plot step lines and plotting them one by one. 5

26 Shom Bandopadhaya: USB Logic Analyzer November 17, 2005 Multiple Lines: Over the weekend I spent several hours working on displaying multiple lines on the same plot. I designed the code so that the number of lines being displayed can be changed by changing a single variable called numlines. As of right now there are three variables that need to be set, numlines, points (the number of data points that need to be plotted), and linedata(array of array containing data points that are to be plotted, should correspond to numlines and points). I am carefully considering the way that the code is being developed. I am writing code so that everything is relative to variables that can be easily updated (eventually automatically, based on user interaction). This is adding overhead right now, but it is also making it easy to build on what I already have. The biggest problem that I encountered was to shift the lines up and down, so that they are not all plotted on top of each other. The solution proved to be simple after I tried to offset drawing each line (which I was not able to figure out how to do, that's something I will still need to find out for the future). I scaled the values based on what line they are a part of. Code 1.1: Scaling values shows that the values are offset by one and then multiplied by twice its index. This makes the lines be separated by a space, so the high of one line does not overlap with the low of the line above. for(int j=0; j<points; j++) { array[j]=linedata[i,j]+(2*i+1); } //assign value and scale based on //line number Code 1.1 Scaling values Legend: I decided to add a legend to the the plot, so it was clear to see what color line corresponds to what probe line. This proved to be a bigger challenge than I thought it should be. The way the legend is added seems to be different for each type of plot. I am still hurting from not having enough examples to base my attempts on. Figure 2.1 Multiline Test shows the plot with multiple lines. Resizing and Scaling: I looked at making the plot resize based on the user resizing the window. I learned of various ways to do it. I will have to get the size of the window and then use those values to calculate the size of the plot and then redraw the plot with the new values. This is a little complicated, I am going to try to work on that a little later. 1

27 Shom Bandopadhaya: USB Logic Analyzer November 17, 2005 Figure 2.1 Multiline Test Grand Visions: Like I mentioned previously, the idea will be have the user be able to combine lines into buses. One implementation would be to have a data field on the left that would display the user defined name of the line (for convenience or keeping signals distinct). The user then can select the lines and choose if they wanted to combine them into buses. The idea is demonstrated in Figure 2.2: Grand visions. -CLK +DATA BUS [0 7] -RD -WR Figure 2.2 Grand Visions Data Structure: The CirQlar data structure from previous year's project will not be used. The reason it was being used 2

28 Shom Bandopadhaya: USB Logic Analyzer November 17, 2005 is so that triggering would be easier if you can move around in a circular queue in memory. Since the triggering is being moved to hardware since the CirQlar had to be converted into an array for plotting anyway it does not make sense to use it. The new data structure will either be a class or struct, probably a class so there could be defined member functions and properties. It will have the following information (initially): Data to be plotted User defined signal name Grouping information Adding column to plot: I tried to add a column to the plot which would display information about the signals as shown in Figure 2.2: Grand Visions. I was trying to use a list, but could not bind data to the list to be shown. I will have to do some research to figure out how to make this graphical element interact with the private and public variables. Code Archive: I have started archiving the code on the project website, so that I can track changes if need be. 3

29 Shom Bandopadhaya: USB Logic Analyzer January 19, 2006 The following is a summary of the work done over winter break. Due to not having all the digital lab notebook tools available during the time of recording the work progress the following material will be timestamped for today's date, and will be referred to work done as of today. I will attempt to come up with a way to easily draw busses. I will first look into using bar graphs and plotting them horizontally. After looking at the NPlot examples they achieve this by a histogram, I will look in the code to see if I can just extract the drawing aspect of it. After experimenting a bit it looks like ordinate [y] and abscissa [x] may be flipped. Scratch that, it still seems to act unexpected at times. I was able to achieve figure 1.1 after some tinkering. Figure 1.1 Bar plot from NPlot The goal is to get horizontal graphs, so that they look like busses. As of right now, it does not seem possible to manipulate bar graphs into horizontal bars. After looking at the NPlot library s [ver 0.9.9] BarPlot.cs code I realized that I might have to write my own class for horizontal bars, although this seems rather strange. Since bar graphs are generally interpreted as horizontal lines and column graphs as vertical lines. I will now need to figure out how to add another class to the NPlot namespace without having to recompile the whole library. I am going to try to make a new namespace within my test file as part of NPlot and see if that works. This seems like a good time to get a book on C#. 1

30 Shom Bandopadhaya: USB Logic Analyzer January 19, 2006 That was rather painless, I just had to define a new class in the project and be it part of the NPlot namespace and inherent (or implement?) from other NPlot classes and it compiles fine. Now I will have to modify my new class Bus to plot horizontal bars and eventually into a full fledge bus class. I am going to do some in code documentation to explain the purpose and the functionality of the Bus class, so that it becomes part of the final documentation generated by Doxygen. First, a clarification: The bus class development right now is independent of the group data structure I had previously described. The bus class is just a developmental stage where by I just want to plot horizontal bars of length dependent on data. After further studying the barplot class I don t think it is a good way to implement a bus. I will need to look into further basic structures such as a rectangle and figure out a way to mesh that well with preexisting x and y axis drawn as a result of the step plots (individual data lines). My biggest concern at this point is making the axes play well together. I will be employing the techniques used in the BarPlot.cs file to stay within the conventions of the graphing library, so that everything plays nicely. I am having severe difficulties in coming with a coherent way to implement a bus structure. I am trying to come up with something which will compute the length of each block simply based on when the block s value changes, instead of having a complicated mechanism. Then I am trying to achieve the typical shape of a bus as shown in figure 2.1. Figure 2.1 Typical shape of logic bus As of right now I am still vertical and not horizontal. I can plot multiple blocks adjacent to each other, but there is no characteristic pointed edges, which makes the changes in blocks hard to detect. Figure 3.1 shows the current state of affairs, after a failed attempt of modifying the BarPlot class to a horizontal one. 2

31 Shom Bandopadhaya: USB Logic Analyzer January 19, 2006 Figure 3.1 Current state of affairs with the bus test The axis bounds were troublesome to fix due to null exception. Code 3.1 shows the method used to fix the problem. LinearAxis ly1 = new LinearAxis(0.0,(double)dataystop.GetUpperBound(0)+1.0); plot.yaxis1 = ly1; Code 3.1 Axis bounds set by first declaring a new axis then equating it to the plot Note that the WorldMin and WorldMax parameters are doubles, there s an explicit typecast to make it obvious. I added a width property to the bus class so that the thickness of the bus can be controlled by writing something simple like Code 2.2. bar.width = 20; Code 3.2 Accessing the width property 3

32 Shom Bandopadhaya: USB Logic Analyzer January 19, 2006 New Directions: I spent the morning recording the progress over winter break. I got a chance a to dive into the NPlot library itself. My approach was to use the bar plot class and modify it into a bus class. The problem was the robustness of the class when it came to data type management, the data is sequenced by custom sequencers so that no matter what kind of data is provided the class adapts it and plots appropriate bar graphs. The complexity of the class made it difficult to modify it. Since I know exactly what kind of data I will be receiving and the Bus class will be a very specific purpose class the data handling does not need to be robust. I am going to get down to even more basic blocks than bar graphs. I will be using rectangles to draw buses. It looks very difficult/impossible to get the edges of a rectangle to taper to give it the distinct look of a bus (refer to a figure 2.1). After talking to Dr. Irwin, I decided to draw a rectangle and then draw triangles on the edges to produce to tapering effect by making the triangle the same color as the background. Figure 1.1 demonstrates the idea, the four triangles provide the tapered edges and will be the same color as the background so they will be invisible. The blocks will be repeated as a bus unit. The width of the unit will depend on when the data changes on that bus. Figure 1.1 Bus unit created by tapering off the edges of the rectangle using four triangles Now I am going to re-research the NPlot library to find an effective way of doing the concept illustrated by Figure 1.1. NPlot does not have a triangle class like it has a rectangle class. However, it has a legend marker class that has a triangle marker. I won't be able to use the marker directly, because I need a right hand triangle and the legend marker draws an equilateral triangle. So, I looked at exactly how the triangle is drawn: it is drawn by creating three points and then connecting those points with lines and then filling in the enclosed area with the defined fill color. Code 1.1 demonstrates how NPlot draws the marker. case MarkerType.FilledTriangle: { Point p1 = new Point( x-h_, y-h_ ); Point p2 = new Point( x, y+h_ ); Point p3 = new Point( x+h_, y-h_ ); Point [] pts = new Point [3] { p1, p2, p3 }; GraphicsPath gp = new GraphicsPath(); gp.addpolygon( pts ); g.drawpath( pen_, gp ); g.fillpath( brush_, gp ); break; } Code 1.1 NPlot code to draw a triangle marker 1

33 Shom Bandopadhaya: USB Logic Analyzer January 19, 2006 In Code 1.1 'g' is the Graphics surface on which to draw on, and '_h' is an integer, a constant private attribute. Code 1.1 was extracted from Code 2.1 in Marker.cs in the NPlot library. /// <summary> /// Draws the marker at the given position /// </summary> /// <param name="g">the graphics surface on which to draw.</param> /// <param name="x">the [physical] x position to draw the marker.</param> /// <param name="y">the [physical] y position to draw the marker.</param> public void Draw( Graphics g, int x, int y ) { switch (markertype_) {... } } Code 2.1 Draw Command that encloses the triangle marker The constructor for the marker is shown in Code 2.2. But the constructor does not call the Draw function, I am assuming that the Add function used to add the marker to the plotsurface calls the Draw function like it does for other objects, barplots for instance. Which would mean that the drawing surface 'g' is provided by plotsurface. /// <summary> /// Constructor /// </summary> /// <param name="markertype">the marker type.</param> /// <param name="size">the marker size.</param> public Marker( MarkerType markertype, int size ) { markertype_ = markertype; Size = size; filled_ = false; } Code 2.2 Constructor for the marker sets up attributes I will have to decide if I want to make a right angle triangle class first and then spawn four of those objects to taper the edges or if I should just do the whole bus unit as one object. I am not sure if there are rendering or object handling advantages to either approach. 2

34 Shom Bandopadhaya: USB Logic Analyzer February 2, 2006 Changing Directions: After talking to Dr. Irwin, I am currently giving up on making a data bus to look like standard logic data bus with tapered edges. I am going to try to make it work first with just rectangles and then see if I can modify those. Same old problems: There seems to be NO good way to add a rectangle to a plot! Only things that can be added to a plot are part of IDrawable class, so classes like StepPlot, BarPlot etc. Although there is a convenient way to draw a rectangle, there seems to be no way to add it to the PlotSurface2D! Code 1.1 shows the code to generate a rectangle and also shows the constructor for a rectangle. RectangleD rec = new RectangleD(10,10,40,50); RectangleD (double x, double y, double width, double height) Code 1.1 Rectangle Constructor and example code After looking through more of NPlot documentation, which is not explanatory but just states functions that are poorly described, it seems like I have to make a class that inherits from IDrawable. IDrawable provides the void Draw function as can be seen in Code 1.2, I might also need to inherit from the IPlot class which provides several functions as can be seen in Code 1.3. void Draw( Graphics g, PhysicalAxis xaxis, PhysicalAxis yaxis ) Draws this object against x and y PhysicalAxis Code 1.2 Draw function from IDrawable void DrawInLegend (Graphics g, Rectangle startend) Method used to draw a representation of the plot in a legend. Axis SuggestXAxis () The method used to set the default abscissa axis. Axis SuggestYAxis () The method used to set the default ordinate axis. void WriteData (System.Text.StringBuilder sb, RectangleD region, bool onlyinregion) Write data associated with the plot as text. Code 1.3 Functions provided by IPlot I am re-writing the bus class after inheriting from the afore mentioned classes. I am going to temporary remove my triangle drawing code, and save it as Code 2.1. I will be using this as test code as well to check if the implementation is correct. h_ = 8; int x = new int(); int y = new int(); x=10; y=10; Point p1 = new Point( x-h_, y-h_ ); Point p2 = new Point( x, y+h_ ); Point p3 = new Point( x+h_, y-h_ ); 1

35 Shom Bandopadhaya: USB Logic Analyzer February 2, 2006 Point [] pts = new Point [3] { p1, p2, p3 }; GraphicsPath gp = new GraphicsPath(); gp.addpolygon( pts ); g.drawpath( pen_, gp ); g.fillpath( brush_, gp ); Code 2.1 Triangle drawing code Visual C# automatically fills in the constructs of the functions that are inherited, I will have to populate the appropriate code. I really need to figure out how the DataSequencer Class works, and what it exactly it does so I can use it to sequence the bus drawing data. I think I will use the StepPlot class as a reference for my Bus class. I understand the StepPlot class the best, so it would be a good class to mirror. The SequenceAdapter constructor can be seen in Code 2.2. Of the four arguments, it seems only a pair is required at a time, so either DataSource and DataMember or OrdinateData and AbsicassaData. public SequenceAdapter( object datasource, string datamember, object ordinatedata, object abscissadata ) Code 2.2 SequenceAdapter Constructor The NPlot documentation further explains the parameters: Parameters: datasource The source containing a list of values to plot. datamember The specific data member in a multimember data source to get data from. ordinatedata The source containing a list of values to plot on the ordinate axis, or a the name of the column to use for this data. abscissadata The source containing a list of values to plot on the abscissa axis, or a the name of the column to use for this data. I think it would be useful to use the datasource and datamember parameters. In my Bus class I could store the bus data as bus value and also as size of the rectangles that make up the bus unit and I could just pass that data structure to be plotted and specify which data member needs to be plotted. 2

36 Shom Bandopadhaya: USB Logic Analyzer February 23, 2006 To NPlot or not to NPlot: Dr. Irwin suggested that I look into other graphing libraries. On vacation, I spent about six hours researching graphing libraries online that played nice with C#. Using C# was a limiting factor here because not a lot of graphing libraries were ported to C# yet. All the graphing libraries that I ended up finding were more charting libraries than graphing libraries. A lot of these libraries cost a significant amount of money to license as well. Two of the most promising ones were: However, both were charting libraries. ZedGraph is open source so it can be modified. SoftwareFX libraries did not look like they could be modified. Even if these two libraries could be used they are still charting libraries and drawing basic shapes would be difficult. So basically, back to square one! All about the Sequence: I am going to take a deeper look at the SequenceAdapter class. I think once I am able to get my data to be manipulated by this class charting it (in at least some fashion) will become a lot easier. I am using the StepPlot class a reference to figure out how the SequenceAdapter class is used, since I am most familiar with StepPlot. I had to change the Draw function that is implemented by inheriting from IDrawable to be virtual public so that it wasn't a part of just IDrawable. I wrote Code 1.1 to draw a line from the first data point to the second data point, using the data constructs used in StepPlot. virtual public void Draw(Graphics g, PhysicalAxis xaxis, PhysicalAxis yaxis) { SequenceAdapter data = new SequenceAdapter(this.DataSource, this.datamember, this.ordinatedata, this.abscissadata); PointD p1=data[0]; PointD p2=data[1]; PointF p1x = xaxis.worldtophysical(p1.x,false); PointF p2x = xaxis.worldtophysical(p2.x,false); g.drawline(pen_,p1x,p2x); } Code 1.1 Draw Function should draw a line between first and second data point Code 1.1 did not compile because this object did not contain DataSource, DataMember, OrdinateData, and AbscissaData. I don't know where to define those variables, I can not find where StepPlot gets them. I am referencing it exactly how it is referenced in other places within the NPlot library. After a lot more looking around I found that DataSource and DataMember are a part of BasePlot class. They are declared as objects with get and set functions associated with them. Instead of inheriting from that class again, I am going to make DataMember and DataSource a part of the bus class, using the following code in Code 2.1: /// <summary> 1

37 Shom Bandopadhaya: USB Logic Analyzer February 23, 2006 /// Gets or sets the source containing a list of values /// used to populate the plot object. /// </summary> public object DataSource { get { return this.datasource_; } set { this.datasource_ = value; } } private object datasource_ = null; /// <summary> /// Gets or sets the specific data member in a multimember /// data source to get data from. /// </summary> public string DataMember { get { return this.datamember_; } set { this.datamember_ = value; } } private string datamember_ = null; Code 2.1 Code to implement DataMember and DataSource I will have to do the same for the ordinate and abscissa data. /// Gets or sets the data, or column name for the abscissa [x] axis. /// </summary> public object AbscissaData { get { return this.abscissadata_; } set { this.abscissadata_ = value; } } private object abscissadata_ = null; 2

38 Shom Bandopadhaya: USB Logic Analyzer February 23, 2006 /// <summary> /// Gets or sets the data, or column name for the ordinate [y] axis. /// </summary> public string OrdinateData { get { return this.ordinatedata_; } set { this.ordinatedata_ = value; } } private string ordinatedata_ = null; Code 3.1 Code to implement AbscissaData and OrdinateData I will have to implement the suggest x and y axis code before I can test to see if it works the way intended. 3

39 Shom Bandopadhaya: USB Logic Analyzer March 2, 2006 Switching Gears I switched gears and decided to work on GUI before I continued more with NPlot and the bus class. I mostly started experimenting with user controls and the way they behave. Essentially, after adding and modifying and figuring out properties and such I arrived at Figure 1.1. Figure 1.1: First true GUI The data being diplayed in the text boxes does not correspond to the data that is plotted, its just to show functionality. The small s buttons next to the text boxes save the data in those boxes to a file in the working directory. The opacity slider changes the opacity of the window so that a user can use that feature to compare waveforms or other data. The check boxes control which set of data is displayed. 1

40 Shom Bandopadhaya: USB Logic Analyzer March 2, 2006 Data Binding I was not able to bind data that I read from a file to the graph. I am not sure what the problem is. The code shown in Code 2.1 is supposed to read a text file and then convert that into a matrix of doubles. StreamReader s = File.OpenText("./data.txt"); string myline; string[] mysplitline; double mydouble; //!Converting text file into double values algorithm used from previous year for (int i=0; i<numlines; i++) { myline = s.readline(); while (myline!= null) { mysplitline = myline.split(' '); for (int j=0; j<mysplitline.length; j++) { mydouble = Convert.ToDouble(mysplitline[i]); linedata[i,j] = mydouble; } } } Code 2.1 Read text file and parse into doubles for plotting After being stuck at this for a long time I realized the simple coding errors, such as using while instead of if (since I am using two for loops, I didn't the while); using the wrong index (i instead of j). I was able to read the data file and use that data to plot. I need to figure out how to highlight the pertinent data that is being either highlighted or being currently viewed. Figure 3.1 shows the transparency feature along with a zoomed in selection of data that was read in from a text file. 2

41 Shom Bandopadhaya: USB Logic Analyzer March 2, 2006 Figure 3.1 Translucent window with four lines I am going to be working more on the GUI and create options menu that will open other forms so that options of lines can be set. Options such as what lines to display, what to call the lines, etc. 3

42 Shom Bandopadhaya: USB Logic Analyzer March 2, 2006 Figure 4.1 Full window showing all 16 lines 4

43 Shom Bandopadhaya: USB Logic Analyzer March 9, 2006 Progress and Changes on the GUI front Data Binding Resolved issue with binding data read from text file Still need to convert to '0', '1', '2' logic where: '0' : Logic low '1' : Logic indeterminate '2' : Logic high Display Took off data display Corresponding data can not be displayed yet Took off data saving as text file Will be added as a full feature soon New Select Line form Naming lines and other attributes will be added Lines to be plotted dynamically change Charting zoom level changes dynamically Changes made to Select Line form globally reciprocate Obstacles Graphing the correct data lines Dynamic data line selection passing wrong parameters Need to re-evaluate algorithm Still in testing phases Adding series name on to plotting area in a user friendly manner Scaling The biggest problem right now is the fact that the lines are not added and removed correctly. I think its because of how I am offsetting the lines from the bottom. Right now I am using a variable to keep track of how many lines are checked and multiplicatively offsetting the line. Code 1.1 demonstrates the mechanism. selectedlines = 0; for (int i=0; i<numlines; i++) { if (SelectForm.Lines[i].Checked == true) { plotline(i); selectedlines++; } else { selectedlines--; //!If line is not selected then the //!index is decremeneted to //eliminate gaps in the series } } Code 1.1 selectedlines keeps track of how many lines are checked and displays accordingly 1

44 Shom Bandopadhaya: USB Logic Analyzer March 9, 2006 I worked on switching the system to a additive offset and also switching the logic system to: '-1' : Logic low '0' : Logic indeterminate '1' : Logic high I am going to data the as integers. I am investigating how to convert the data stored in the linedata[] variable into something that will be plotted correctly, since now there are negative numbers involved. I think I will have to do some conversion on the fly. This will raise the issue of saving on memory vs. saving on processing time. 2

45 Shom Bandopadhaya: USB Logic Analyzer March 23, 2006 Data Line Plotting The way that data lines are plotted need to be changed to accommodate for selecting specific lines to select. Additionally, the logic level representation needs to be switched to: '-1' : Logic low '0' : Logic indeterminate '1' : Logic high I switched the logic levels and the way the lines are scaled to their respective positions on the plot from being a multiplicative process (based on their index) to an additive process. However, I am stuck on Error 1.1, I have no idea why the compiler is giving me this error. The second if statement in Code 1.1 causes the error, the declaration of SelectForm can be seen in Code 1.2. An unhandled exception of type 'System.NullReferenceException' occurred in GUI2.exe Additional information: Object reference not set to an instance of an object. Error 1.1: Object reference not set to instance of object for (int i=0; i<numlines; i++) { if (SelectForm.Lines[i].Checked == true) { NumberSelected++; plotline(i); } } Code 1.1: Only Checked lines are selected to be plotted private LineSelect SelectForm = new LineSelect(); private int NumberSelected = 0; Code 1.2 Instance of LineSelect form is declared, along with number of checked lines I talked to Dr. Malinowski to get insight into the error. He suggested that perhaps the SelectForm was declared as a global and a local variable and the code was referring to the local instance. I searched through the code and didn't find this to be a problem. The autos window in the debug mode shows the object and its properties, so I am really perplexed as to why I am getting this error! Figure 2.1 shows the autos window and shows that the object instance and the initializations are present and correct. 1

46 Shom Bandopadhaya: USB Logic Analyzer March 23, 2006 Figure 2.1 Autos window shows that the object instance and properties are correct Error Resolved Dr. Irwin looked at the error and I was explaining to him how the rest of the code fit in. At this time, I took look over at the LineSelect class and then I found the error that Dr. Malinowski had suggested was the problem. I had declared the array Lines[] as a public variable and then as a local variable. Dynamic Canvas Resizing I was able to dynamically resize the plotting canvas depending on the number of lines being plotted. Therefore, with fewer lines there is more visual resolution. I was having an issue with the high level of one line being visually equivalent to the low level of the next line. I resolved this by counting each line selected as a unit value of two and then using that to scale the lines to their corresponding locations. I changed the variable NumberSelected to ScaleFactor to accurately describe its function. NOTE: All data storage variables have been switched over to Closing Forms Every time you close the main form while forgetting to close the SelectLine form the threads are messed up and it takes while to close the SelectLine form. Although this is more of a user ease feature, I will be implementing it now by closing all forms and threads when the main application exits. I had to disable the windows standard toolbar with the minimize, maximize, and close buttons in order 2

47 Shom Bandopadhaya: USB Logic Analyzer March 23, 2006 to prevent the user from clicking the close button (which would only close that form, not the whole application). I added a custom close button on both the forms. The close button on the main form exits the application and all forms. The close button for the SelectForm closes just that form. I also ensured that if the SelectLine form is open and the user wants to select lines again it: a. does not spawn another instance of the form b. brings the open form to the front I made some improvements to the user interaction handling working with multiple forms. I added a maximize/restore button. I had to do this by accessing a C# class called screen that gets information on the current screen size, working areas, dock areas, etc. This is a very helpful class! I am having trouble with enabling the user to move the LineSelect form. I am using the same code for the main form, but that is working fine. Code 3.1 is a snippet is from which allows the user to move the form by clicking anywhere on it. //! API functions to move the form ( public const int WM_NCLBUTTONDOWN = 0xA1; public const int HTCAPTION = 0x2; [DllImport("user32.dll")] public static extern bool ReleaseCapture(); [DllImport("user32.dll")] public static extern int SendMessage(IntPtr hwnd, int Msg, int wparam, int lparam); public void LineSelect_MouseDown(object sender, MouseEventArgs e) { //If the left mouse is pressed, release form for movement if (e.button == MouseButtons.Left) { ReleaseCapture(); SendMessage(Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0); } } Code 3.1 Code snippet allows to move borderless forms After trying unsuccessfully I have not been able to resolve this issue. For now I am giving up on making the window movable. I eliminated the control box, so it is still visible similarly themed as the main form. I decided to clean up how the plot was configured and added some more functionality. I added a grid toggle function. This will allow the user to superimpose a vertical grid on the rising edge of the fastest changing signal, presumably the clock. This was a lot more complicated than anticipated. I made the grid fully scalable and its not affected by the number of lines being displayed or the current plot size. The grid lines show tearing add odd places, I am not sure why this is. This is something to do with how NPlot is drawing the vertical lines. It makes sense that it will not function perfectly since I am essentially tricking NPlot by exploiting the ticks it draws on the x-axis and making their length 3

48 Shom Bandopadhaya: USB Logic Analyzer March 23, 2006 equivalent to half the height of the plot (since it draws both from top and bottom). I am currently researching menus and menu handling and such. I didn't realize its 7pm now, so I am going home! 4

49 Shom Bandopadhaya: USB Logic Analyzer March 30, 2006 I had previously modified the LineSelect form to include text boxes for all the lines so that an user can specify custom names. NOTE: LineSelect is a class. SelectForm is an object of that class used in the main form. The morning was spent on me futilely trying to make the labels appear on the form and reflect the names defined by the user. I had to take a whole new approach to this. I added all the label using the form designer and then manipulated their text, and position using code to reflect: what lines were selected what names they were given what line plot corresponds to that signal Positioning was a difficult task especially with keeping resizing in mind. I wrote and spent about 2 times more time trouble shooting three functions, their code comment headers can be seen in Code Header 1.1. //!void initializelabels() assigns the line labels to an array to help in itteration //!void addlinelabels() reads the user defined line names from the SelectForm form //!and places them as lables on the main form. The labels are shown/hidden based //!on what lines are currently selected and their position is manipulated to match //!the position of the line that is plotted. //!int numselected() function counts the number of lines that are selected //in the SelectForm form and returns the count as an integer. Code Header 1.1 Description of the label placing functions Next, I tackled the problem of the application crashing when no lines were selected to be plotted. I found that this scenario was problematic for everything... plotting, resizing, refreshing, any form movement at all. I tried fruitlessly to tackle the problem by disabling the main form, suspending the main thread (which crashes the whole application), and some other equally unproductive approaches. Finally I developed the checknullerror function as described in Code Header 1.2. //!bool checknullerror() function checks if no lines are selected. //!If no lines are selected then it hides user interaction features which would //!cause the application to crash. Code Header 1.2 Description of no line selected error handling function Code 2.1 is included to demonstrate that a lot of features (moving, maximizing, minimizing) had to be disabled in order to achieve proper error handling. private bool checknullerror() { //!Error Handling required if no lines are selected if (numselected() == 0) 1

50 Shom Bandopadhaya: USB Logic Analyzer March 30, 2006 { } else { } SelectForm.ErrorLabel.Visible = true; SelectForm.BringToFront(); //Hiding these elements will prevent user interaction //that can lead to the application crashing this.plot.hide(); this.maximize.hide(); this.minimize.hide(); return true; SelectForm.ErrorLabel.Visible = false; this.plot.show(); this.maximize.show(); this.minimize.show(); return false; } Code 2.1 Features are disabled when no lines are selected to prevent application crash I am including two screenshots to better document the normal and error situations. 2

51 Shom Bandopadhaya: USB Logic Analyzer March 30, 2006 Figure 3.1 GUI under normal operating conditions 3

52 Shom Bandopadhaya: USB Logic Analyzer March 30, 2006 Figure 4.1 GUI under error conditions 4

53 Shom Bandopadhaya: USB Logic Analyzer April 06, 2006 Desktop Eulogy My desktop PC (my primary machine that I use to work on the project) has died. It was a good machine and hopefully with some magic it will be resurrected. For now I have lost code that worked on combining lines into buses. I backed up code last week on the H drive on the department server. I will be able to use that. Equipment Galore I decided to use a touch screen LCD monitor that the BU EE Department bought for a project last year (guidebot). I feel that using a touch screen to manipulate the software is going to make the experience equitable to using an instrument that you can touch. I will probably need to modify the GUI to suit touching to select as opposed to using mouse to select. In order for me to use the touch screen monitor I had to install the drivers and connect the mouse interface over USB. I am out of USB ports on my laptop so I borrowed an USB hub from Mr. Mattus. The USB hub made it impossible for me to plug in the VGA monitor, so I also had to get a USB cable extender. Parts List I am using my personal laptop and in addition to that, currently I have the following equipment on loan for the project: Touch Screen LCD Monitor (monitor, power supply, VGA cable, USB cable) 4 port USB hub (hub, power supply, cable extender) Opal Kelly XEM3001 (FPGA board, USB cable) Hardware I talked to Dr. Irwin and decided that instead of getting back on working on the bus, I am going to try to get the Opal Kelly board to generate test data. I will then use grab the data directly from the Opal Kelly board instead of reading a text file. This will make the project a little more closer to completed than just reading a text file. This will also allow me to press buttons on the Opal Kelly board and get it to send out different sets of test data, demonstrating that dynamic data is being collected and plotted by the GUI. I will be spending the rest of the day getting the Opal Kelly board to run sample programs and then writing some of my own VHDL. I will have to figure out how to compile the VHDL to a bit stream. Dr. Irwin did not have Jeff Earlson's notebook from last year, so I will have to research it online or try to get a hold of Jeff later. I will be using Xilinx Project Navigator ver 7.1 to synthesize the VHDL and create a bit stream that can be loaded onto the FPGA using the FrontPanel software supplied by Opal Kelly. Steps to Xilinx Nirvana 1. Create new project with following properties: 1.1. Device Family: Spartan Device: XC3S Package: PQ Speed Grade: Add source: 1

54 Shom Bandopadhaya: USB Logic Analyzer April 06, Counter.vhd 2.2. oklibrary.vhd 2.3. XEM3001v1.ucf 3. Synthesize (double click on side panel) 4. Implement Design (double click on side panel) 5. Generate Programming File (double click on side panel) Paradise Lost Xilinx hates the world! Even the Opal Kelly sample code isn't compiling. I take that back, its synthesizing but its it fails during Implement Design. Error 2.1 shows the errors created. ERROR:NgdBuild:604 - logical block 'ep61' with type 'oktriggerout' could not be ERROR:NgdBuild:604 - logical block 'ep00' with type 'okwirein' could not be ERROR:NgdBuild:604 - logical block 'ep20' with type 'okwireout' could not be ERROR:NgdBuild:604 - logical block 'ep21' with type 'okwireout' could not be ERROR:NgdBuild:604 - logical block 'ep22' with type 'okwireout' could not be ERROR:NgdBuild:604 - logical block 'ep40' with type 'oktriggerin' could not be ERROR:NgdBuild:604 - logical block 'ep60' with type 'oktriggerout' could not be ERROR:NgdBuild:604 - logical block 'okhi/hicore' with type 'okhostinterfacecore' ERROR:NgdBuild:455 - logical net 'ti_data<3>' has multiple driver(s): ERROR:NgdBuild:456 - logical net 'ti_data<3>' has both active and tristate ERROR:NgdBuild:455 - logical net 'ti_data<4>' has multiple driver(s): ERROR:NgdBuild:456 - logical net 'ti_data<4>' has both active and tristate ERROR:NgdBuild:455 - logical net 'ti_data<0>' has multiple driver(s): ERROR:NgdBuild:456 - logical net 'ti_data<0>' has both active and tristate ERROR:NgdBuild:455 - logical net 'ti_data<5>' has multiple driver(s): ERROR:NgdBuild:456 - logical net 'ti_data<5>' has both active and tristate ERROR:NgdBuild:455 - logical net 'ti_data<1>' has multiple driver(s): ERROR:NgdBuild:456 - logical net 'ti_data<1>' has both active and tristate ERROR:NgdBuild:455 - logical net 'ti_data<6>' has multiple driver(s): ERROR:NgdBuild:456 - logical net 'ti_data<6>' has both active and tristate ERROR:NgdBuild:455 - logical net 'ti_data<2>' has multiple driver(s): ERROR:NgdBuild:456 - logical net 'ti_data<2>' has both active and tristate ERROR:NgdBuild:455 - logical net 'ti_data<7>' has multiple driver(s): ERROR:NgdBuild:456 - logical net 'ti_data<7>' has both active and tristate ERROR:NgdBuild:455 - logical net 'ti_data<8>' has multiple driver(s): ERROR:NgdBuild:456 - logical net 'ti_data<8>' has both active and tristate ERROR:NgdBuild:455 - logical net 'ti_data<10>' has multiple driver(s): ERROR:NgdBuild:456 - logical net 'ti_data<10>' has both active and tristate ERROR:NgdBuild:455 - logical net 'ti_data<15>' has multiple driver(s): ERROR:NgdBuild:456 - logical net 'ti_data<15>' has both active and tristate ERROR:NgdBuild:455 - logical net 'ti_data<9>' has multiple driver(s): ERROR:NgdBuild:456 - logical net 'ti_data<9>' has both active and tristate ERROR:NgdBuild:455 - logical net 'ti_data<14>' has multiple driver(s): ERROR:NgdBuild:456 - logical net 'ti_data<14>' has both active and tristate ERROR:NgdBuild:455 - logical net 'ti_data<13>' has multiple driver(s): ERROR:NgdBuild:456 - logical net 'ti_data<13>' has both active and tristate ERROR:NgdBuild:455 - logical net 'ti_data<12>' has multiple driver(s): ERROR:NgdBuild:456 - logical net 'ti_data<12>' has both active and tristate ERROR:NgdBuild:455 - logical net 'ti_data<11>' has multiple driver(s): ERROR:NgdBuild:456 - logical net 'ti_data<11>' has both active and tristate ERROR: NGDBUILD failed Error 2.1 Xilinx error report for Opal Kelly Counter code Small Success I followed the tutorial on the Opal Kelly website and got that to compile all the way and run like it was supposed to. It is very straight forward, but doesn't contain any of the Opal Kelly constructs. I will have to see if i can write straight forward VHDL and then run it on the board and then use the DLL 2

55 Shom Bandopadhaya: USB Logic Analyzer April 06, 2006 interface to do all the USB transfer stuff, or if it needs some VHDL component. Code 3.1 shows the VHDL code that displays binary counting on the 8 inboard leds, and Code 3.1 shows the ucf file which contains the pinouts. library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity tutorial is Port ( clk : in std_logic; button : in std_logic_vector(3 downto 0); led : out std_logic_vector(7 downto 0) ); end tutorial; architecture Behavioral of tutorial is signal clkdiv : std_logic_vector(19 downto 0); signal counter : std_logic_vector(7 downto 0); signal reset : std_logic; begin led <= not counter; reset <= (not button(0)) or (not button(1)) or (not button(2)) or (not button(3)); process (clk) begin if rising_edge(clk) then if (reset = '1') then clkdiv <= x"00000"; counter <= x"00"; else clkdiv <= clkdiv - "1"; if (clkdiv = x"00000") then counter <= counter + "1"; end if; end if; end if; end process; end Behavioral; Code 3.1 VHDL Code for a 8bit counter displayed on LEDs NET "clk" LOC = "P80"; NET "led<0>" LOC = "P205"; NET "led<1>" LOC = "P204"; NET "led<2>" LOC = "P203"; NET "led<3>" LOC = "P200"; NET "led<4>" LOC = "P199"; NET "led<5>" LOC = "P198"; NET "led<6>" LOC = "P197"; NET "led<7>" LOC = "P196"; NET "button<0>" LOC = "P194"; NET "button<1>" LOC = "P191"; NET "button<2>" LOC = "P190"; NET "button<3>" LOC = "P189"; Code 3.2 Pin outs for the Opal Kelly board 3

56 Project Website Index Log Archives April 2006 March 2006 February 2006 January 2006 December 2005 November 2005 October 2005 Entries Project Completion and Final Presentation Live the Bradley Student Expo Gooeyer GUI Gooey GUI Gra Graph Graphics Graphics Library Expansion End of semester Scheming Plots Hardware Layout NPlot Graphing Library Sharpening C# and more Electronic Lab Notebook Pre-work on project USB Logic Analyzer Development Blog 1

57 Thursday, October 13th Electronic Lab Notebook This project will use an Electronic Laboratory Notebook for record keeping instead of a traditional paper notebook. Lot of research was done to find a suitable and reliable solution. After setting up the lab notebook, I researched the XEM3001 FPGA board and familiarized myself with the documentation available. After I am more familiar with the Opal Kelly documentation, I will look into last year's code and then try some C# tutorials and get my feet wet. Software needs to be installed on the lab computers. Hopefully that will happen soon so Jeff can start testing with last year's software.more on the Electronic Lab Notebook: The key factor was to find a solution where in the information entered could not be digitally altered, which requires a strong encryption. The information also needed to be globally accessible, so it has to be stored in an open format and finally the information needs to be timestamped. The first two concerns were remedied by using OpenOffice.org 2.0 from Sun Microsystems Inc. as the data entry and storage format. Using a portable document format [PDF] add-on the notebook installments will be published in PDF format with 128bit encryption. Several more hours of researching online provided the solution to the time stamp problem. The PDF document will then be timestamped using an open source time-stamping software from The time-stamping service using a security certificate on a remote server to digitally sign the document and encloses it in a timestamped format (*.timestamp). The validator program, that is part of the package, opens the timestamped document and shows the time that was stamped by the trusted Time Stamp Authority [TSA] and allows for the document to be opened or saved in the original format. Further the lab notebook will be maintained as individual documents for each day that the progress is recorded for. At the end of each session that the notebook is worked on, the session's document will be converted to encrypted PDF format and then timestamped. shom on 04:49 PM CST [permalink] 2

58 Thursday, October 20th Sharpening C# and more Most of my efforts have been focused on gathering applications, documentation, previous work and learning C#. The project website was moved from my personal webspace into the project webspace after Dr. Malinowski gave me permissions to upload to the project directory. Jeff and I talked to Nick Schmidt (Asst. Lab Director) to install FrontPanel software from the Opal Kelly website and Xilinx ISE WebPACK 7.1i, so Jeff could start communicating with the XEM3001 board.i have been learning C# from MSDN C# Language Specification. I realized that there are a lot of things that are done differently in C# as compared to C++ and Java, both of which I am pretty familiar with. The way that variables and objects are declared is diffrerent, but dynamic so that is beneficial. I expect to run into some syntax errors to begin with. I covered some basics on using the compiler and ran a few tutorials before starting on the Language Specifications. So far I have covered types and typecasting and the general mode of data handling. I will have to finish going through the following topics before I can dive into reviewing/writing code for the project: * Classes - a more indepth look * Interface * Namespaces * Member functions * Member access * Application Handling * Automatic Memory Management shom on 06:15 PM CST [permalink] 3

59 Saturday, November 5th NPlot Graphing Library Among other things I have started looking into the NPlot graphing library. There seems to be a steep learning curve, trying to use the DLL and the functions as intended. I am still trying to figure out what sort of initializations are mandatory, and what provide added features. Documentation available for it is rather sketchy, the examples packaged with the library are too robust so it is hard to glean basic information from it. I noticed that the incode documentation was prepared in a way that Doxygen could extract most of the functional information. I generated the documentation using Doxygen, and after some tweaking it is finally useful. I am busy learning the quirks of C# and getting the NPlot library to work (or do anything!). EDIT: I found online documentation for the NPlot API. shom on 01:26 AM CST [permalink] 4

60 Thursday, November 10th Scheming Plots After facing difficulties using the NPlot library to create any plots at all, I was able to figure out the problem. Although the DLL was added to the project it needed to be added to the design toolbox as well and the main plot surface had to be dragged onto the windows application for C# to perform the correct initializations. More detail can be found in the lab notebook entry. The image below shows the plot created: I am going to be working on puttling multiple lines on the same plot and adding user interaction to the plot. shom on 11:20 PM CST [permalink] 5

61 Thursday, January 19th Graphics Library Expansion Over winter break I looked at the NPlot graphing library in-depth to find a way to render buses with some existing construct. Bar plots were a natural choice and after a lot of work and learning I was able to produce bar graphs stacked on each other to look like a data bus. This screen shot illustrates the idea: However, there was no way to taper the edges to give it a data bus look and the robust data handling of the bar plot library almost made it impossible to modify it to suit my purposes. So, my new approach is to draw a rectangle and draw four triangles on the edges to mask off the edges of the rectangle and produce a tapering effect. Since NPlot does not have an inbuilt construct for triangles, I will have to develop a data bus unit from a rectangle and triangles that I write code for. The concept is illustrated in the following image: shom on 04:51 PM CST [permalink] 6

62 Thursday, February 23rd Gra Graph Graphics The focus of the project has changed slightly due to the fact that Jeff Earlson is no longer working on the hardware. There is a possibility that there will be no board to test the USB data acquisition with. In light of these events I have decided to focus more detailed attention on to the graphics. The NPlot graphing library is very complicated because of its robustness, so adding a bus class has been a difficult task.the NPlot library expands on existing classes by making new classes by inheriting other classes. I have had to learn more about classes in C# and all the rules about inheriting classes and implementing member functions. I think I have finally set up the framework that can be used to build the bus class. I am writing code to draw a bus unit (see picture in previous entry) of arbitary lengths, which will depend on how long the constituent signals don't change. shom on 04:58 PM CST [permalink] 7

63 Sunday, March 26th Gooey GUI I have mostly been working on and testing the GUI. Although, there is a separate time alloted for testing, the nature of GUI development leads to on spot testing. I will say that about 50% of the time I spend on the project is for development and the other 50% is testing. I have also changed how the data is stored internally form a double format to an integer format, this means less memory usage and faster processing. The logic level representation also had to be changed from the double representation: '0.00' - Low '0.50' - Indeterminate '1.00' - High to the integer representation: '-1' - Low '0' - Indeterminate '1' - High I have made a lot of progress on the GUI. The user now can: *Select and plot only specific lines *Lines can be selected in arbitary order *Closing the main application closes all related windows *Super impose a vertical grid, corresponding to the rising edge of the fastest signal *Toggle the grid on and off *Change the opacity of the application window *Maximize/Minimize window *Identify application by custom icon (in Windows ALT+TAB window) I am working on adding more features to the GUI and representing buses. If anyone is interested in helping me test the application, you can download and run the compiled binary (for Windows XP) and provide me with any feedback via . shom on 07:04 PM CST [permalink] 8

64 Thursday, March 30th Gooeyer GUI I have been adding a lot of GUI features. I modified the LineSelect form to include text boxes for all the lines so that an user can specify custom names. I added all the labels using the form designer and then manipulated their text, and position using code to reflect: *what lines were selected *what names they were given *what line plot corresponds to that signal Positioning was a difficult task especially with keeping resizing in mind. I also improved error handling, especially focusing on application crashing when no lines were selected to be plotted. I found that this scenario was problematic for everything... plotting, resizing, refreshing, any form movement at all. Currently the GUI is fairly stable and mostly idiot proof. My next challenge is to add the bus and use the mouse cursor to read the bus value and display it. Here's a snapshot of the current GUI: Again, if anyone is interested in helping me test the application, you can download and run the compiled binary (for Windows XP) and provide me with any feedback via . shom on 07:28 PM CST [permalink] 9

65 Thursday, April 13th Live the Bradley Student Expo The project works! The Opal Kelly XEM3001 sends an eight bit data stream over USB to the C# core program via some C++ executables (soon to converted to pure C#). The C# GUI plots the acquired data and still allows for all the functionality mentioned in previous entries! Expo visitors will be able to play with the product using a 17" touch screen monitor (the GUI was modified for easier touch navigation). The project is successful! shom on 03:56 AM CST [permalink] 1

66 Wednesday, April 26th Project Completion and Final Presentation The USB Logic Analyzer is a fully functional standalone software application now. It is interfaced with the XEM3001 FPGA board and it reads simulated data (8-bit binary counter) from the FPGA over USB correctly. I was able to figure out how to communicate with the FPGA board and read the buffer and then use part of Jason's C++ program from last year to parse the data correctly. Since there is no external PC board (hardware part of the project was terminated when Jeff left the project) to sample signals the FPGA puts an 8-bit binary count value in the buffer, which is a great way to demonstrate functionality. On the software side there have been tons of additions. I added in a data bus, I was able to read the logic lines and combine them into a hex value that is displayed on the plot surface. The user has the ability to select the lines added to the bus independent of the lines being plotted. The user can also save the plot in image format (png, jpeg, bmp, and gif) or in numeric format (csv). The saved CSV data file can be loaded back into the application in the future and all the software features can be used for analysis. The screen shot of the application visually explains a lot of these features. The project will be presented to faculty and students at the Senior Capstone Presentations on April 27th (tomorrow) at 8:30am. The presentation will be made available as part of the deliverables at later date. The final demonstration of the project will take place in Senior Lab on Friday, April 28th between 12 and 1 pm. The final post to this website will be made once the final report has been approved for submission, at which point the project will be completed and all deliverables will be available here. shom on 01:52 PM CST [permalink] 1

67 Project Proposal Shom Bandopadhaya Bradley University Department of Electrical and Computer Engineering EE 452 Senior Capstone Project Advisor: Dr. James Irwin 2 1

68 Outline Functional Description System Block Diagram Goals Schedule Cost Justification Progress Questions 3 2

69 Functional Description!" 4 3

70 System Block Diagram 5 4

71 USB Interface ' #$ #% ) #! % ' &! )!#" ' #$ ( 6 5

72 C# Core Program ' #$% ) *# #$% ' & *# ) + " (,# ## ( 7 6

73 GUI ' % ) #! % ' & ) * ' #% - ( # 8 7

74 Goals New display engine for NPlot Combine lines into busses DLL interface for USB Data processing through memory instead of hard drive Print/Save data capture Continuous Update (Pseudo Real Time) 9 8

75 Fall Schedule! " #$. *## /.00; 1 # / ; / =# : 1003.<2.00; 4 '6 & /.00; / /.00; 2 +9#7.. / ; 5 "'+9# ; & 6 :!#9# / ; 10 9

76 Spring Schedule 11 10

77 Cost Justification FPGA development platform Multiple applications Platform costs $ FPGA only $23.00 Software source available No licensing issues Software tweaks easy 12 11

78 Progress 13 12

79 Data Structure Needs to accommodate all this information Two classes will be implemented Line and Group Custom User Objects devised as containers -CLK +DATA BUS [0 11] -RD -WR 14 13

80 Data Structure Line Class Data to be plotted Internal Signal Name User defined Signal Name Line color Visible/Invisible Part of Group 15 14

81 Data Structure Group Class Internal Group Name User defined Group Name #of total lines Lines part of this Group Number Base (bin, dec, hex) To start with just hex will be implemented Provision for improvement 16 15

82 Website 17 16

83 Questions? 18 17

84 Project Progress Presentation Shom Bandopadhaya Bradley University Department of Electrical and Computer Engineering EE 452 Senior Capstone Project Advisor: Dr. James Irwin 1

85 ! " 2

86 $%&'()* +', (-./( 0* & - # 3

87 !" 1 4

88 # % 5

89 , #$% + &# #$%, ' &# + ( " )*# ## ) 2 6

90 , % + #! %, ' + &, #% - ) # 3 7

91 ! " #$. &## /.00; 1 # / ; / =# : 1003.<2.00; 4,6 ' /.00; / /.00; 2 (9#7.. / ; 5 ",(9# ; ' 6 :!#9#( / ; 4 8

92 !" # $5 9

93 $$ 10

94 ! ID Task Name Start Finish Duration % Complete 1 GUI 1/19/2006 3/15/2006 8w 60% 60% Jan 2006 Feb 2006 Mar 2006 Apr /22 1/29 2/5 2/12 2/19 2/26 3/5 3/12 3/19 3/26 4/2 4/9 4/16 2 Data Saving and Retrieval 3/16/2006 3/29/2006 2w 25% 25% 3 Testing 3/30/2006 4/5/2006 1w 0% 0% 4/23 4/30 May /7 4 Preparation for Expo 4/6/2006 4/19/2006 2w 0% 0% 5 Final Paper 4/20/2006 5/3/2006 2w 0% 0% $ 11

95 " $! # % & ' " ( $ 12

96 " $! # ) ( ' " $# 13

97 #$! 67/' 89/ 8* :; / /*67 8 <:/ 8 $1 14

98 Data/Instructions POD USB Cable USB Interface Data/Instructions C# Core Program Data Memory Mouse / Keyboad Instructions GUI $% 15

99 $2 16

100 /&= (: * # :* * 6 * :: (: (! * > $3 17

101 <! *:? &: : * &: * * 0 $4 18

102 %& 5 19

103 1

104 !" #" " $" % 2

105 !" #" " $" % 3

106 & '" )*+ '", ('" -*## "" 4

107 ! "! " # $%&'! ()# * " 5

108 !" #" " $" % 6

109 %!"+, ), )*- %. ()#/0 1 / 2 +) /4$!2.%89 %9 71/'4$!2 8: ;<'4$! 88, <5 7

110 %!"+, ), )*- %. Software runs on PC Logic Analyzer displays 16 channels ()#/0 1 / 2 +) /4$!2.%89 %9 71/'4$!2 8: ;<'4$! 88, <5 8

111 %!"+, ), )*- %. ()#/0 1 / 2 +) /4$!2.%89 %9 71/'4$!2 8: ;<'4$! 88,<5 Logic Analyzer samples over 100MHz Max Data Width = 16 bits 9

112 !" #" " $" % 10

113 %"""="= 8& %.-, ).4:(( : "4$! *(3 >"?34@%9 A$8"%9 %. 11

114 8 % % *. 3"" %B: 12

115 !" #" " $" % 13

116 14

117 15

118 Simulates Real Data in Absence of POD 16

119 !" #" " $" % 17

120 ! 18

121 19

122 " # 9%9 %. C:7 :7. 20

123 " # >7. 4) > ""%. 21

124 $ " 22

125 $ " # 9%. %9 C:7 : %9 > "" 23

126 $ " # ; %9 " >"" % " " 24

127 % & % 25

128 % & % # ("! 8 (" 9C> 26

129 % & % #. C:7>" * "%9 27

130 % & % # %* 9C> 28

131 % & % # :) # 29

132 30

133 # :* " "" "" " %9 +%39 74% 9> 31

134 # :.:AD. :A E". " 32

135 # $ " 19C>2 33

136 $ # :" 8 34

137 $ # 9" ) :.F. 35

138 !" #" " $" % 36

139 ' 37

140 # $ " 38

141 $ 39

142 # 8 % % *. 3"" %B: 40

143 # & % ""C:7 * %* * 41

144 ( ) 42

145 USB Logic Analyzer Functional Description Shom Bandopadhaya Advisor: Dr. James H. Irwin October 26, 2005 Senior Capstone Project Bradley University Department of Electrical and Computer Engineering

146 Introduction A logic analyzer displays logic level of digital signals. A logic analyzer differs from an oscilloscope which is a more powerful instrument but typically only has a few channels. This project seeks to continue work on a digital logic analyzer which has sixteen channels. The logic analyzer will display four logic levels: low, high, tri-state and indeterminate. The sixteen channels are sampled by an external conditioning hardware called a POD. The POD consists of an Opal Kelly XEM 3001 FPGA board and some external hardware. The POD interfaces to the computer using Universal Serial Bus [USB] protocol. The graphical user interface [GUI] on the computer will display one of the four possible logic levels sampled by the POD. The overall system block diagram can be seen in Figure 1: Overall system block diagram for USB Logic Analyzer. Analog Inputs Analog Inputs Analog Inputs Analog Inputs POD USB Display Monitor Keyboard C# software on Computer Data Storage / Retrieval User Inputs Mouse Printer Figure 1: Overall system block diagram for USB Logic Analyzer Inputs Analog inputs: User inputs: Outputs Display Monitor: Data Storage/Retrieval: Printer: These are the analog voltages on the probes of the POD. The POD handles CMOS or TTL levels. The user interacts with the software GUI using the keyboard and mouse, and is able to select options, change display parameters, and access additional features like zoom, scroll and save. Displays the GUI. The user can see the current logic levels, triggering points and also observe the effects of their interactions with the GUI. Saves the captured data frame to disk. The GUI can also open and display previously saved captures. Prints the current screen. 2

147 Operation Modes Option selection: Single Capture: Continuous Capture: Allows the user to select from the available options, such as logic type (TTL or CMOS), display window range, etc. Captures and displays information from the time the capture was started till the time software buffer was filled. Continuously captures information into the buffer and displays the current buffer, so the logic levels are shown at pseudo real-time. Goals Primary o o o o o New display engine DLL interface for USB Efficient data processing Print/Save data capture Continuous Update (Pseudo Real Time) Secondary o o Remote Viewing Reverse Assembly code decoding 3

148 USB Logic Analyzer System Block Diagram Shom Bandopadhaya Advisor: Dr. James H. Irwin November 22, 2005 Senior Capstone Project Bradley University Department of Electrical and Computer Engineering

149 Introduction A logic analyzer displays logic level of digital signals. A logic analyzer differs from an oscilloscope which is a more powerful instrument but typically only has a few channels. This project seeks to continue work on a digital logic analyzer which has sixteen channels. The logic analyzer will display four logic levels: low, high, tri-state and indeterminate. The sixteen channels are sampled by an external conditioning hardware called a POD. The POD consists of an Opal Kelly XEM 3001 FPGA board and some external hardware. The POD interfaces to the computer using Universal Serial Bus [USB] protocol. The graphical user interface [GUI] on the computer will display one of the four possible logic levels sampled by the POD. The overall system block diagram can be seen in Figure 1. Figure 1: Overall system block diagram for USB Logic Analyzer Inputs Analog inputs: User inputs: Outputs Display Monitor: Data Storage/Retrieval: Printer: These are the analog voltages on the probes of the POD. The POD handles CMOS or TTL levels. The user interacts with the software GUI using the keyboard and mouse, and is able to select options, change display parameters, and access additional features like zoom, scroll and save. Displays the GUI. The user can see the current logic levels, triggering points and also observe the effects of their interactions with the GUI. Saves the captured data frame to disk. The GUI can also open and display previously saved captures. Prints the current screen. 2

150 Operation Modes Option selection: Single Capture: Continuous Capture: Allows the user to select from the available options, such as logic type (TTL or CMOS), display window range, etc. Captures and displays information from the time the capture was started till the time software buffer was filled. Continuously captures information into the buffer and displays the current buffer, so the logic levels are shown at pseudo real-time. Goals Primary Secondary o New display engine o DLL interface for USB o Efficient data processing o Print/Save data capture o Continuous Update (Pseudo Real Time) o Remote Viewing o Reverse Assembly code decoding 3

151 Software Conditioned Signals: Keyboard/Mouse: Signals sent from the POD to the PC with all sampled data in packet form USB interface. Commands entered using keyboard and mouse to setup trigger conditions, change display format, save the waveform, setup, and hardcopies. Figure 4.1 Software Subsystem Block Diagram There are three major sub-blocks, the USB Interface, the C# Core Program, and the GUI as can be seen in Figure

152 USB Interface The USB interface uses the Opal Kelly provided library to connect to the FPGA using a USB 2.0 connection. It acquires data when requested by the C# core program and transmits the data back to the C# core program through the USB buffer. Figure 5.1 shows the process through which it is accomplished. C# Core Program The C# Core Program receives the instructions via the GUI, contacts the USB interface to start Data Acquisition, collects the data and then saves it to memory and sends it to the GUI to be displayed. Figure 5.2 describes the process. Start Start No No Acquire Data Instruction? User input to start Data Acquisition? Yes Yes Send Instruction to Opal Kelly Board Call USB Functions Opal Kelly Ready to send? No Wait for Response Data Acquired? No Wait for USB Functions Yes Yes Receive Data to Buffer Display Data on GUI Save Data to Memory Notify Core Program of Data Acquistion Execute User Specified Instructions End End Figure 5.1 USB Interface Tasks Figure 5.2 C# Core Program Tasks 5

153 GUI The GUI interfaces the user to the C# core program. It receives instructions via the keyboard and mouse and displays the information on the screen. Once it receives any instructions it contacts the Core C# Program to perform those tasks. It idles till it receives the next set of instructions. If the user decides to terminate the GUI it terminates the whole software. Figure 6.1 shows this process. Start No User Input? Yes Send Instruction to C# Core Program Data Ready to Display? No Wait for Data Yes Format Data Display Data No User Instructions? Terminate End Send Instruction to C# Core Program Figure 6.1 GUI Tasks 6

154 USB Logic Analyzer Project Proposal Shom Bandopadhaya Advisor: Dr. James H. Irwin December 10, 2005 Senior Capstone Project Bradley University Department of Electrical and Computer Engineering

155 Introduction A logic analyzer displays logic level of digital signals. A logic analyzer differs from an oscilloscope which is a more powerful instrument but typically only has a few channels. This project seeks to continue work on a digital logic analyzer which has sixteen channels. The logic analyzer will display four logic levels: low, high and indeterminate. The sixteen channels are sampled by external conditioning hardware called a POD. The POD consists of an Opal Kelly XEM 3001 FPGA board and some additional hardware. The POD interfaces to the computer using the Universal Serial Bus [USB] protocol. The graphical user interface [GUI] on the computer will display one of the four possible logic levels sampled by the POD. The overall system block diagram can be seen in Figure 1. Figure 1: Overall system block diagram for USB Logic Analyzer Inputs Analog inputs: User inputs: Outputs Display Monitor: Data Storage/Retrieval: Printer: These are the analog voltages on the probes of the POD. The POD can properly CMOS or TTL levels. The user interacts with the software GUI using the keyboard and mouse, and is able to select options, change display parameters, and gain access additional features like zoom, scroll and save. Displays the GUI. The user can see the current logic levels, triggering points and also observe the effects of their interactions with the GUI. Saves the captured data frame to disk. The GUI can also open and display previously saved captures. Prints the current screen. 2

156 Operation Modes Option selection: Single Capture: Continuous Capture: Allows the user to select from the available options, such as logic type (TTL or CMOS), display window range, etc. Captures and displays information from the time the capture was started till the time software buffer was filled. Continuously captures information into the buffer and displays the current buffer, so the logic levels are shown at pseudo real-time. Goals Primary Software o New display engine o DLL interface for USB o Efficient data processing o Print/Save data capture o Continuous Update (Pseudo Real Time) Conditioned Signals: Keyboard/Mouse: Signals sent from the POD to the PC with all sampled data in packet form USB interface. Commands entered using keyboard and mouse to setup trigger conditions, change display format, save the waveform, setup, and hardcopies. Figure 3.1 Software Subsystem Block Diagram 3

157 The USB Interface, the C# Core Program, and the GUI can be seen in Figure 3.1. USB Interface The USB interface uses the Opal Kelly provided library to connect to the FPGA using a USB 2.0 connection. It acquires data when requested by the C# core program and transmits the data back to the C# core program through the USB buffer. Figure 4.1 shows the process through which it is accomplished. C# Core Program The C# Core Program receives the instructions via the GUI, contacts the USB interface to start Data Acquisition, collects the data and then saves it to memory and sends it to the GUI to be displayed. Figure 4.2 describes the process. Start Start No No Acquire Data Instruction? User input to start Data Acquisition? Yes Yes Send Instruction to Opal Kelly Board Call USB Functions Opal Kelly Ready to send? No Wait for Response Data Acquired? No Wait for USB Functions Yes Yes Receive Data to Buffer Display Data on GUI Save Data to Memory Notify Core Program of Data Acquistion Execute User Specified Instructions End End Figure 4.1 USB Interface Tasks Figure 4.2 C# Core Program Tasks 4

158 GUI The GUI permits the user to gain access to the functionality provided by the C# core program. It receives instructions via the keyboard and mouse and displays the information on the screen. Once it receives any instructions it contacts the Core C# Program to perform those tasks. It idles till it receives the next set of instructions. If the user decides to terminate the GUI it terminates the whole application. Figure 5.1 shows these processes. Start No User Input? Yes Send Instruction to C# Core Program Data Ready to Display? No Wait for Data Yes Format Data Display Data No User Instructions? Terminate End Send Instruction to C# Core Program Figure 5.1 GUI Tasks 5

159 Integrating the goals into the schedule The following are the primary goals of the project are detailed in the schedule: New display engine for NPlot Combine lines into busses DLL interface for USB Data processing through memory instead of hard drive Print/Save data capture Continuous Update (Pseudo Real Time) These goals and their dependencies are reflected in the timeline in the next section. Schedule The GANTT charts show the schedule for the project. The start and stop dates, the duration of each task, the percentage of completion of each task, and the interdependencies of the tasks can be seen in the GANTT charts. The Fall semester schedule can be seen in Figure 6.1. As can be seen all the tasks scheduled for this semester have been completed, except for Develop New Graphics Library which will be completed over Winter Break as denoted by the schedule slip block. Oct 2005 Nov 2005 Dec 2005 % ID Task Name Start Finish Duration Complete 10/2 10/9 10/16 10/23 10/30 11/6 11/13 11/20 11/27 12/4 12/11 1 Functional Description 10/6/ /26/2005 3w 100% 100% 2 System Block Diagram 10/27/ /23/2005 4w 100% 100% 3 Project Proposal 11/29/ /8/ w 100% 100% 4 Notebook/Website 10/6/ /26/2005 3w 100% 100% 5 Learn C# 10/13/ /2/2005 3w 100% 100% 6 Using Graphics Library 11/3/ /9/2005 1w 100% 100% 7 Develop New Graphics Library 11/10/ /7/2005 4w 50% 50% Winter Break 8 Research Data Structures for Graphing 11/10/ /23/2005 2w 100% 100% Figure 6.1 Fall Semester Schedule Not a lot of time was initially delegated to the deliverables task of the project, which caused some delay in other tasks. In addition to that there were some tasks were attempted in parallel, which also caused some schedule slip. These factors were considered in developing the Spring semester schedule which can be seen in figure

160 " # $!!!!! % & ) )!" # ) $ %!&' $ ) %!&'(' $ $ ) *'+,' $ $ ) -.#*' $- ) Figure 7.1 Spring semester schedule Cost Justification The Opal Kelly XEM 3001 FPGA board is a development platform with a Xilinx Spartan 3 FPGA onboard. The development platform was used to speed up the development time since it implements USB protocol natively, and the hardware part of the project can just be concerned with the external circuitry and VHDL development. The cost of the development platform was $200.00, whereas the Spartan 3 FPGA single unit costs $ If the development board was not used there would be additional costs associated with the fabrication of the external circuitry along with the cost of the signal conditioning circuitry. The development board however can be used in Lab as a test board for other projects as well. If this project was ever to go to production, then the cost of the product is going to be significantly cheaper than equitable commercial solutions that sell for $ Progress As the schedule demonstrates a lot of tasks were accomplished this semester. The deliverables have culminated in this project proposal and the research done will be briefly described. After researching and learning C#, which was a significant time investment, the NPlot graphics library was tackled. Test values were then plotted and some user interaction was added to the plot, specifically, the ability to select a region and zoom in on it. After understanding the fundamentals of the design a better GUI can be developed during the Spring semester. Figure 8.1 shows four lines of data being plotted together. 7

161 Figure 8.1 Multiple Lines being plotted on one surface Eventually, the GUI will be modified to hold more information, to resemble Figure 8.2. Figure 8.2 Possible future look of the GUI In order to hold all the required information, two different data structures will be required. Table 9.1 lists the parameters of each of the data structures. 8

162 Line Class Group Class Data to be plotted Internal Group Name Internal Signal Name User Defined Group Name User Defined Signal Name Number of total lines Line Color Lines part of this Group Part of Group Number Base (bin, dec, hex)* Visible/Invisible *defaults to hex Table 9.1 Data structures and their contents Finally, the project website tracks the project s progress. The website is located under Bradley University Electrical Engineering project pages at the following location: Figure 9.1 shows a snapshot of the website for reference. Figure 9.1 Project website snapshot 9

Classes in C# namespace classtest { public class myclass { public myclass() { } } }

Classes in C# namespace classtest { public class myclass { public myclass() { } } } Classes in C# A class is of similar function to our previously used Active X components. The difference between the two is the components are registered with windows and can be shared by different applications,

More information

Chapter 1 Getting Started

Chapter 1 Getting Started Chapter 1 Getting Started The C# class Just like all object oriented programming languages, C# supports the concept of a class. A class is a little like a data structure in that it aggregates different

More information

Tutorial 6 Enhancing the Inventory Application Introducing Variables, Memory Concepts and Arithmetic

Tutorial 6 Enhancing the Inventory Application Introducing Variables, Memory Concepts and Arithmetic Tutorial 6 Enhancing the Inventory Application Introducing Variables, Memory Concepts and Arithmetic Outline 6.1 Test-Driving the Enhanced Inventory Application 6.2 Variables 6.3 Handling the TextChanged

More information

Introduce C# as Object Oriented programming language. Explain, tokens,

Introduce C# as Object Oriented programming language. Explain, tokens, Module 2 98 Assignment 1 Introduce C# as Object Oriented programming language. Explain, tokens, lexicals and control flow constructs. 99 The C# Family Tree C Platform Independence C++ Object Orientation

More information

User-Defined Controls

User-Defined Controls C# cont d (C-sharp) (many of these slides are extracted and adapted from Deitel s book and slides, How to Program in C#. They are provided for CSE3403 students only. Not to be published or publicly distributed

More information

Hierarchical inheritance: Contains one base class and multiple derived classes of the same base class.

Hierarchical inheritance: Contains one base class and multiple derived classes of the same base class. 1. What is C#? C# (pronounced "C sharp") is a simple, modern, object oriented, and type safe programming language. It will immediately be familiar to C and C++ programmers. C# combines the high productivity

More information

USB Logic Analyzer. Project Proposal. Shom Bandopadhaya Advisor: Dr. James H. Irwin. December 8, 2005

USB Logic Analyzer. Project Proposal. Shom Bandopadhaya Advisor: Dr. James H. Irwin. December 8, 2005 USB Logic Analyzer Project Proposal Shom Bandopadhaya Advisor: Dr. James H. Irwin December 8, 2005 Senior Capstone Project Bradley University Department of Electrical and Computer Engineering Introduction

More information

Instructions for Crossword Assignment CS130

Instructions for Crossword Assignment CS130 Instructions for Crossword Assignment CS130 Purposes: Implement a keyboard interface. 1. The program you will build is meant to assist a person in preparing a crossword puzzle for publication. You have

More information

Tutorial 5 Completing the Inventory Application Introducing Programming

Tutorial 5 Completing the Inventory Application Introducing Programming 1 Tutorial 5 Completing the Inventory Application Introducing Programming Outline 5.1 Test-Driving the Inventory Application 5.2 Introduction to C# Code 5.3 Inserting an Event Handler 5.4 Performing a

More information

PC Based Logic Analyzer. Project Proposal

PC Based Logic Analyzer. Project Proposal PC Based Logic Analyzer Project Proposal Advisors: Dr. James H. Irwin, Mr. José Sánchez Team Members: Jeffery Earleson, Jason Nielsen November 30, 2004 EE 451 Bradley University Electrical and Computer

More information

RIS shading Series #2 Meet The Plugins

RIS shading Series #2 Meet The Plugins RIS shading Series #2 Meet The Plugins In this tutorial I will be going over what each type of plugin is, what their uses are, and the basic layout of each. By the end you should understand the three basic

More information

ECSE-323 Digital System Design. Lab #1 Using the Altera Quartus II Software Fall 2008

ECSE-323 Digital System Design. Lab #1 Using the Altera Quartus II Software Fall 2008 1 ECSE-323 Digital System Design Lab #1 Using the Altera Quartus II Software Fall 2008 2 Introduction. In this lab you will learn the basics of the Altera Quartus II FPGA design software through following

More information

Direct Variations DIRECT AND INVERSE VARIATIONS 19. Name

Direct Variations DIRECT AND INVERSE VARIATIONS 19. Name DIRECT AND INVERSE VARIATIONS 19 Direct Variations Name Of the many relationships that two variables can have, one category is called a direct variation. Use the description and example of direct variation

More information

DAD Lab. 1 Introduc7on to C#

DAD Lab. 1 Introduc7on to C# DAD 2017-18 Lab. 1 Introduc7on to C# Summary 1..NET Framework Architecture 2. C# Language Syntax C# vs. Java vs C++ 3. IDE: MS Visual Studio Tools Console and WinForm Applica7ons 1..NET Framework Introduc7on

More information

C#: framework overview and in-the-small features

C#: framework overview and in-the-small features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer C#: framework overview and in-the-small features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer

More information

IT 374 C# and Applications/ IT695 C# Data Structures

IT 374 C# and Applications/ IT695 C# Data Structures IT 374 C# and Applications/ IT695 C# Data Structures Module 2.5: Methods A Deeper Look Xianrong (Shawn) Zheng Spring 2017 1 Outline static Methods, static Variables, and Class Math Methods with Multiple

More information

Visual Studio.NET.NET Framework. Web Services Web Forms Windows Forms. Data and XML classes. Framework Base Classes. Common Language Runtime

Visual Studio.NET.NET Framework. Web Services Web Forms Windows Forms. Data and XML classes. Framework Base Classes. Common Language Runtime Intro C# Intro C# 1 Microsoft's.NET platform and Framework.NET Enterprise Servers Visual Studio.NET.NET Framework.NET Building Block Services Operating system on servers, desktop, and devices Web Services

More information

Objectives. Introduce the core C# language features class Main types variables basic input and output operators arrays control constructs comments

Objectives. Introduce the core C# language features class Main types variables basic input and output operators arrays control constructs comments Basics Objectives Introduce the core C# language features class Main types variables basic input and output operators arrays control constructs comments 2 Class Keyword class used to define new type specify

More information

.Net Technologies. Components of.net Framework

.Net Technologies. Components of.net Framework .Net Technologies Components of.net Framework There are many articles are available in the web on this topic; I just want to add one more article over the web by explaining Components of.net Framework.

More information

Cpt S 122 Data Structures. Introduction to C++ Part II

Cpt S 122 Data Structures. Introduction to C++ Part II Cpt S 122 Data Structures Introduction to C++ Part II Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Topics Objectives Defining class with a member function

More information

Learning to Provide Modern Solutions

Learning to Provide Modern Solutions 1 Learning to Provide Modern Solutions Over the course of this book, you will learn to enhance your existing applications to modernize the output of the system. To do this, we ll take advantage of the

More information

Variables and Data Representation

Variables and Data Representation You will recall that a computer program is a set of instructions that tell a computer how to transform a given set of input into a specific output. Any program, procedural, event driven or object oriented

More information

4. Write sets of directions for how to check for direct variation. How to check for direct variation by analyzing the graph :

4. Write sets of directions for how to check for direct variation. How to check for direct variation by analyzing the graph : Name Direct Variations There are many relationships that two variables can have. One of these relationships is called a direct variation. Use the description and example of direct variation to help you

More information

QUIZ. What is wrong with this code that uses default arguments?

QUIZ. What is wrong with this code that uses default arguments? QUIZ What is wrong with this code that uses default arguments? Solution The value of the default argument should be placed in either declaration or definition, not both! QUIZ What is wrong with this code

More information

This is the start of the server code

This is the start of the server code This is the start of the server code using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Net; using System.Net.Sockets;

More information

Get JAVA. I will just tell you what I did (on January 10, 2017). I went to:

Get JAVA. I will just tell you what I did (on January 10, 2017). I went to: Get JAVA To compile programs you need the JDK (Java Development Kit). To RUN programs you need the JRE (Java Runtime Environment). This download will get BOTH of them, so that you will be able to both

More information

Absolute C++ Walter Savitch

Absolute C++ Walter Savitch Absolute C++ sixth edition Walter Savitch Global edition This page intentionally left blank Absolute C++, Global Edition Cover Title Page Copyright Page Preface Acknowledgments Brief Contents Contents

More information

************ THIS PROGRAM IS NOT ELIGIBLE FOR LATE SUBMISSION. ALL SUBMISSIONS MUST BE RECEIVED BY THE DUE DATE/TIME INDICATED ABOVE HERE

************ THIS PROGRAM IS NOT ELIGIBLE FOR LATE SUBMISSION. ALL SUBMISSIONS MUST BE RECEIVED BY THE DUE DATE/TIME INDICATED ABOVE HERE Program 10: 40 points: Due Tuesday, May 12, 2015 : 11:59 p.m. ************ THIS PROGRAM IS NOT ELIGIBLE FOR LATE SUBMISSION. ALL SUBMISSIONS MUST BE RECEIVED BY THE DUE DATE/TIME INDICATED ABOVE HERE *************

More information

Introduction to C# Applications

Introduction to C# Applications 1 2 3 Introduction to C# Applications OBJECTIVES To write simple C# applications To write statements that input and output data to the screen. To declare and use data of various types. To write decision-making

More information

Fast Introduction to Object Oriented Programming and C++

Fast Introduction to Object Oriented Programming and C++ Fast Introduction to Object Oriented Programming and C++ Daniel G. Aliaga Note: a compilation of slides from Jacques de Wet, Ohio State University, Chad Willwerth, and Daniel Aliaga. Outline Programming

More information

1. Introduction EE108A. Lab 1: Combinational Logic: Extension of the Tic Tac Toe Game

1. Introduction EE108A. Lab 1: Combinational Logic: Extension of the Tic Tac Toe Game EE108A Lab 1: Combinational Logic: Extension of the Tic Tac Toe Game 1. Introduction Objective This lab is designed to familiarize you with the process of designing, verifying, and implementing a combinational

More information

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Weiss Chapter 1 terminology (parenthesized numbers are page numbers) Weiss Chapter 1 terminology (parenthesized numbers are page numbers) assignment operators In Java, used to alter the value of a variable. These operators include =, +=, -=, *=, and /=. (9) autoincrement

More information

Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson

Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson Introduction History, Characteristics of Java language Java Language Basics Data types, Variables, Operators and Expressions Anatomy of a Java Program

More information

Menus. You ll find MenuStrip listed in the Toolbox. Drag one to your form. Where it says Type Here, type Weather. Then you ll see this:

Menus. You ll find MenuStrip listed in the Toolbox. Drag one to your form. Where it says Type Here, type Weather. Then you ll see this: Menus In.NET, a menu is just another object that you can add to your form. You can add objects to your form by drop-and-drag from the Toolbox. If you don t see the toolbox, choose View Toolbox in the main

More information

Week - 01 Lecture - 04 Downloading and installing Python

Week - 01 Lecture - 04 Downloading and installing Python Programming, Data Structures and Algorithms in Python Prof. Madhavan Mukund Department of Computer Science and Engineering Indian Institute of Technology, Madras Week - 01 Lecture - 04 Downloading and

More information

Agenda CS121/IS223. Reminder. Object Declaration, Creation, Assignment. What is Going On? Variables in Java

Agenda CS121/IS223. Reminder. Object Declaration, Creation, Assignment. What is Going On? Variables in Java CS121/IS223 Object Reference Variables Dr Olly Gotel ogotel@pace.edu http://csis.pace.edu/~ogotel Having problems? -- Come see me or call me in my office hours -- Use the CSIS programming tutors Agenda

More information

Macros in sbt: Problem solved!

Macros in sbt: Problem solved! Macros in sbt: Problem solved! Martin Duhem, Eugene Burmako Technical Report January 2015 Contents 1 Introduction 2 1.1 What problems do macros bring?................ 2 1.1.1 The problems we addressed

More information

C#.Net. Course Contents. Course contents VT BizTalk. No exam, but laborations

C#.Net. Course Contents. Course contents VT BizTalk. No exam, but laborations , 1 C#.Net VT 2009 Course Contents C# 6 hp approx. BizTalk 1,5 hp approx. No exam, but laborations Course contents Architecture Visual Studio Syntax Classes Forms Class Libraries Inheritance Other C# essentials

More information

CSE Theory of Computing Fall 2017 Project 1-SAT Solving

CSE Theory of Computing Fall 2017 Project 1-SAT Solving CSE 30151 Theory of Computing Fall 2017 Project 1-SAT Solving Version 3: Sept. 21, 2017 The purpose of this project is to gain an understanding of one of the most central problems of computing: Boolean

More information

MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #2 Examination 12:30 noon, Thursday, March 15, 2012

MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #2 Examination 12:30 noon, Thursday, March 15, 2012 MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #2 Examination 12:30 noon, Thursday, March 15, 2012 Instructor: K. S. Booth Time: 70 minutes (one hour ten minutes)

More information

CS 231 Data Structures and Algorithms, Fall 2016

CS 231 Data Structures and Algorithms, Fall 2016 CS 231 Data Structures and Algorithms, Fall 2016 Dr. Bruce A. Maxwell Department of Computer Science Colby College Course Description Focuses on the common structures used to store data and the standard

More information

Flag Quiz Application

Flag Quiz Application T U T O R I A L 17 Objectives In this tutorial, you will learn to: Create and initialize arrays. Store information in an array. Refer to individual elements of an array. Sort arrays. Use ComboBoxes to

More information

In order to create your proxy classes, we have provided a WSDL file. This can be located at the following URL:

In order to create your proxy classes, we have provided a WSDL file. This can be located at the following URL: Send SMS via SOAP API Introduction You can seamlessly integrate your applications with aql's outbound SMS messaging service via SOAP using our SOAP API. Sending messages via the SOAP gateway WSDL file

More information

CS121/IS223. Object Reference Variables. Dr Olly Gotel

CS121/IS223. Object Reference Variables. Dr Olly Gotel CS121/IS223 Object Reference Variables Dr Olly Gotel ogotel@pace.edu http://csis.pace.edu/~ogotel Having problems? -- Come see me or call me in my office hours -- Use the CSIS programming tutors CS121/IS223

More information

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture 04 Programs with IO and Loop We will now discuss the module 2,

More information

Classes, interfaces, & documentation. Review of basic building blocks

Classes, interfaces, & documentation. Review of basic building blocks Classes, interfaces, & documentation Review of basic building blocks Objects Data structures literally, storage containers for data constitute object knowledge or state Operations an object can perform

More information

JAVA An overview for C++ programmers

JAVA An overview for C++ programmers JAVA An overview for C++ programmers Wagner Truppel wagner@cs.ucr.edu edu March 1st, 2004 The early history James Gosling, Sun Microsystems Not the usual start for a prog.. language Consumer electronics,

More information

If Statements, For Loops, Functions

If Statements, For Loops, Functions Fundamentals of Programming If Statements, For Loops, Functions Table of Contents Hello World Types of Variables Integers and Floats String Boolean Relational Operators Lists Conditionals If and Else Statements

More information

Math Modeling in Java: An S-I Compartment Model

Math Modeling in Java: An S-I Compartment Model 1 Math Modeling in Java: An S-I Compartment Model Basic Concepts What is a compartment model? A compartment model is one in which a population is modeled by treating its members as if they are separated

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

Tips from the experts: How to waste a lot of time on this assignment

Tips from the experts: How to waste a lot of time on this assignment Com S 227 Spring 2018 Assignment 1 100 points Due Date: Friday, September 14, 11:59 pm (midnight) Late deadline (25% penalty): Monday, September 17, 11:59 pm General information This assignment is to be

More information

Pace University. Fundamental Concepts of CS121 1

Pace University. Fundamental Concepts of CS121 1 Pace University Fundamental Concepts of CS121 1 Dr. Lixin Tao http://csis.pace.edu/~lixin Computer Science Department Pace University October 12, 2005 This document complements my tutorial Introduction

More information

ENGR 3410: MP #1 MIPS 32-bit Register File

ENGR 3410: MP #1 MIPS 32-bit Register File ENGR 3410: MP #1 MIPS 32-bit Register File Due: Before class, September 23rd, 2008 1 Introduction The purpose of this machine problem is to create the first large component of our MIPS-style microprocessor

More information

(Refer Slide Time 6:48)

(Refer Slide Time 6:48) Digital Circuits and Systems Prof. S. Srinivasan Department of Electrical Engineering Indian Institute of Technology Madras Lecture - 8 Karnaugh Map Minimization using Maxterms We have been taking about

More information

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture - 43 Dynamic Binding (Polymorphism): Part III Welcome to Module

More information

Hi everyone. I hope everyone had a good Fourth of July. Today we're going to be covering graph search. Now, whenever we bring up graph algorithms, we

Hi everyone. I hope everyone had a good Fourth of July. Today we're going to be covering graph search. Now, whenever we bring up graph algorithms, we Hi everyone. I hope everyone had a good Fourth of July. Today we're going to be covering graph search. Now, whenever we bring up graph algorithms, we have to talk about the way in which we represent the

More information

1 Getting started with Processing

1 Getting started with Processing cis3.5, spring 2009, lab II.1 / prof sklar. 1 Getting started with Processing Processing is a sketch programming tool designed for use by non-technical people (e.g., artists, designers, musicians). For

More information

COP 3330 Final Exam Review

COP 3330 Final Exam Review COP 3330 Final Exam Review I. The Basics (Chapters 2, 5, 6) a. comments b. identifiers, reserved words c. white space d. compilers vs. interpreters e. syntax, semantics f. errors i. syntax ii. run-time

More information

Chapter 10 Recursion

Chapter 10 Recursion Chapter 10 Recursion Written by Dr. Mark Snyder [minor edits for this semester by Dr. Kinga Dobolyi] Recursion implies that something is defined in terms of itself. We will see in detail how code can be

More information

COPYRIGHTED MATERIAL. Starting Strong with Visual C# 2005 Express Edition

COPYRIGHTED MATERIAL. Starting Strong with Visual C# 2005 Express Edition 1 Starting Strong with Visual C# 2005 Express Edition Okay, so the title of this chapter may be a little over the top. But to be honest, the Visual C# 2005 Express Edition, from now on referred to as C#

More information

CHAPTER 7 OBJECTS AND CLASSES

CHAPTER 7 OBJECTS AND CLASSES CHAPTER 7 OBJECTS AND CLASSES OBJECTIVES After completing Objects and Classes, you will be able to: Explain the use of classes in Java for representing structured data. Distinguish between objects and

More information

MITOCW watch?v=w_-sx4vr53m

MITOCW watch?v=w_-sx4vr53m MITOCW watch?v=w_-sx4vr53m The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high-quality educational resources for free. To

More information

Visual Studio Windows Form Application #1 Basic Form Properties

Visual Studio Windows Form Application #1 Basic Form Properties Visual Studio Windows Form Application #1 Basic Form Properties Dr. Thomas E. Hicks Computer Science Department Trinity University Purpose 1] The purpose of this tutorial is to show how to create, and

More information

School of Computer Science CPS109 Course Notes 5 Alexander Ferworn Updated Fall 15

School of Computer Science CPS109 Course Notes 5 Alexander Ferworn Updated Fall 15 Table of Contents 1 INTRODUCTION... 1 2 IF... 1 2.1 BOOLEAN EXPRESSIONS... 3 2.2 BLOCKS... 3 2.3 IF-ELSE... 4 2.4 NESTING... 5 3 SWITCH (SOMETIMES KNOWN AS CASE )... 6 3.1 A BIT ABOUT BREAK... 7 4 CONDITIONAL

More information

Professional ASP.NET Web Services : Asynchronous Programming

Professional ASP.NET Web Services : Asynchronous Programming Professional ASP.NET Web Services : Asynchronous Programming To wait or not to wait; that is the question! Whether or not to implement asynchronous processing is one of the fundamental issues that a developer

More information

CHAPTER 7 OBJECTS AND CLASSES

CHAPTER 7 OBJECTS AND CLASSES CHAPTER 7 OBJECTS AND CLASSES OBJECTIVES After completing Objects and Classes, you will be able to: Explain the use of classes in Java for representing structured data. Distinguish between objects and

More information

377 Student Guide to C++

377 Student Guide to C++ 377 Student Guide to C++ c Mark Corner January 21, 2004 1 Introduction In this course you will be using the C++ language to complete several programming assignments. Up to this point we have only provided

More information

Working with Charts Stratum.Viewer 6

Working with Charts Stratum.Viewer 6 Working with Charts Stratum.Viewer 6 Getting Started Tasks Additional Information Access to Charts Introduction to Charts Overview of Chart Types Quick Start - Adding a Chart to a View Create a Chart with

More information

Language Specification

Language Specification # Language Specification File: C# Language Specification.doc Last saved: 5/7/2001 Version 0.28 Copyright? Microsoft Corporation 1999-2000. All Rights Reserved. Please send corrections, comments, and other

More information

(Refer Slide Time: 1:43)

(Refer Slide Time: 1:43) (Refer Slide Time: 1:43) Digital Circuits and Systems Prof. S. Srinivasan Department of Electrical Engineering Indian Institute of Technology, Madras Lecture - 27 Pattern Detector So, we talked about Moore

More information

CS201 Some Important Definitions

CS201 Some Important Definitions CS201 Some Important Definitions For Viva Preparation 1. What is a program? A program is a precise sequence of steps to solve a particular problem. 2. What is a class? We write a C++ program using data

More information

Computer Science E-119 Fall Problem Set 3. Due before lecture on Wednesday, October 31

Computer Science E-119 Fall Problem Set 3. Due before lecture on Wednesday, October 31 Due before lecture on Wednesday, October 31 Getting Started To get the files that you will need for this problem set, log into nice.harvard.edu and enter the following command: gethw 3 This will create

More information

Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p.

Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p. Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p. 9 Self-Test Exercises p. 11 History Note p. 12 Programming and

More information

Tips from the experts: How to waste a lot of time on this assignment

Tips from the experts: How to waste a lot of time on this assignment Com S 227 Spring 2018 Assignment 1 80 points Due Date: Friday, February 2, 11:59 pm (midnight) Late deadline (25% penalty): Monday, February 5, 11:59 pm General information This assignment is to be done

More information

CS112 Lecture: Working with Numbers

CS112 Lecture: Working with Numbers CS112 Lecture: Working with Numbers Last revised January 30, 2008 Objectives: 1. To introduce arithmetic operators and expressions 2. To expand on accessor methods 3. To expand on variables, declarations

More information

(Refer Slide Time: 01:25)

(Refer Slide Time: 01:25) Computer Architecture Prof. Anshul Kumar Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture - 32 Memory Hierarchy: Virtual Memory (contd.) We have discussed virtual

More information

Topics. Java arrays. Definition. Data Structures and Information Systems Part 1: Data Structures. Lecture 3: Arrays (1)

Topics. Java arrays. Definition. Data Structures and Information Systems Part 1: Data Structures. Lecture 3: Arrays (1) Topics Data Structures and Information Systems Part 1: Data Structures Michele Zito Lecture 3: Arrays (1) Data structure definition: arrays. Java arrays creation access Primitive types and reference types

More information

ENGR 3410: MP #1 MIPS 32-bit Register File

ENGR 3410: MP #1 MIPS 32-bit Register File ENGR 3410: MP #1 MIPS 32-bit Register File Due: October 12, 2007, 5pm 1 Introduction The purpose of this machine problem is to create the first large component of our MIPS-style microprocessor the register

More information

Chapter 4 Determining Cell Size

Chapter 4 Determining Cell Size Chapter 4 Determining Cell Size Chapter 4 Determining Cell Size The third tutorial is designed to give you a demonstration in using the Cell Size Calculator to obtain the optimal cell size for your circuit

More information

Developing for Mobile Devices Lab (Part 1 of 2)

Developing for Mobile Devices Lab (Part 1 of 2) Developing for Mobile Devices Lab (Part 1 of 2) Overview Through these two lab sessions you will learn how to create mobile applications for Windows Mobile phones and PDAs. As developing for Windows Mobile

More information

Problem Solving with C++

Problem Solving with C++ GLOBAL EDITION Problem Solving with C++ NINTH EDITION Walter Savitch Kendrick Mock Ninth Edition PROBLEM SOLVING with C++ Problem Solving with C++, Global Edition Cover Title Copyright Contents Chapter

More information

Understand Computer Storage and Data Types

Understand Computer Storage and Data Types Understand Computer Storage and Data Types Lesson Overview Students will understand computer storage and data types. In this lesson, you will learn: How a computer stores programs and instructions in computer

More information

CHIPS Newsletter Vol 5 - Yahoo! Mail. Official Newsletter of

CHIPS Newsletter Vol 5 - Yahoo! Mail. Official Newsletter of CHIPS Newsletter Vol 5 From: "chips@elproducts.net" To: "Chuck Hellebuyck" Thursday, April 29, 2010 12:07 AM CHIPs Vol 5 / April 28, 2010 Official Newsletter

More information

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture - 08 Constants and Inline Functions Welcome to module 6 of Programming

More information

CS Programming Exercise:

CS Programming Exercise: CS Programming Exercise: An Introduction to Java and the ObjectDraw Library Objective: To demonstrate the use of objectdraw graphics primitives and Java programming tools This lab will introduce you to

More information

Create your own Meme Maker in C#

Create your own Meme Maker in C# Create your own Meme Maker in C# This tutorial will show how to create a meme maker in visual studio 2010 using C#. Now we are using Visual Studio 2010 version you can use any and still get the same result.

More information

CS 376b Computer Vision

CS 376b Computer Vision CS 376b Computer Vision 09 / 25 / 2014 Instructor: Michael Eckmann Today s Topics Questions? / Comments? Enhancing images / masks Cross correlation Convolution C++ Cross-correlation Cross-correlation involves

More information

Reverse Engineering Swift Apps. Michael Gianarakis Rootcon X 2016

Reverse Engineering Swift Apps. Michael Gianarakis Rootcon X 2016 Reverse Engineering Swift Apps Michael Gianarakis Rootcon X 2016 # whoami @mgianarakis Director of SpiderLabs APAC at Trustwave SecTalks Organiser (@SecTalks_BNE) Flat Duck Justice Warrior #ducksec Motivation

More information

Object Oriented Programming: In this course we began an introduction to programming from an object-oriented approach.

Object Oriented Programming: In this course we began an introduction to programming from an object-oriented approach. CMSC 131: Chapter 28 Final Review: What you learned this semester The Big Picture Object Oriented Programming: In this course we began an introduction to programming from an object-oriented approach. Java

More information

C# Fundamentals. Hans-Wolfgang Loidl School of Mathematical and Computer Sciences, Heriot-Watt University, Edinburgh

C# Fundamentals. Hans-Wolfgang Loidl School of Mathematical and Computer Sciences, Heriot-Watt University, Edinburgh C# Fundamentals Hans-Wolfgang Loidl School of Mathematical and Computer Sciences, Heriot-Watt University, Edinburgh Semester 1 2018/19 H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC 2018/19

More information

Numbers Basics Website:

Numbers Basics Website: Website: http://etc.usf.edu/te/ Numbers is Apple's new spreadsheet application. It is installed as part of the iwork suite, which also includes the word processing program Pages and the presentation program

More information

Cpt S 122 Data Structures. Course Review Midterm Exam # 2

Cpt S 122 Data Structures. Course Review Midterm Exam # 2 Cpt S 122 Data Structures Course Review Midterm Exam # 2 Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Midterm Exam 2 When: Monday (11/05) 12:10 pm -1pm

More information

Lesson 3: Accepting User Input and Using Different Methods for Output

Lesson 3: Accepting User Input and Using Different Methods for Output Lesson 3: Accepting User Input and Using Different Methods for Output Introduction So far, you have had an overview of the basics in Java. This document will discuss how to put some power in your program

More information

Expressions and Casting

Expressions and Casting Expressions and Casting C# Programming Rob Miles Data Manipulation We know that programs use data storage (variables) to hold values and statements to process the data The statements are obeyed in sequence

More information

CS321 Languages and Compiler Design I. Winter 2012 Lecture 2

CS321 Languages and Compiler Design I. Winter 2012 Lecture 2 CS321 Languages and Compiler Design I Winter 2012 Lecture 2 1 A (RE-)INTRODUCTION TO JAVA FOR C++/C PROGRAMMERS Why Java? Developed by Sun Microsystems (now Oracle) beginning in 1995. Conceived as a better,

More information

EDITING AN EXISTING REPORT

EDITING AN EXISTING REPORT Report Writing in NMU Cognos Administrative Reporting 1 This guide assumes that you have had basic report writing training for Cognos. It is simple guide for the new upgrade. Basic usage of report running

More information

PC Based Logic Analyzer. Complete System Level Block Diagram

PC Based Logic Analyzer. Complete System Level Block Diagram PC Based Logic Analyzer Complete System Level Block Diagram Advisors: Dr. James H. Irwin, Mr. José Sánchez Team Members: Jeffery Earleson, Jason Nielsen vember 23, 2004 EE 451 Bradley University Electrical

More information

Getting help with Edline 2. Edline basics 3. Displaying a class picture and description 6. Using the News box 7. Using the Calendar box 9

Getting help with Edline 2. Edline basics 3. Displaying a class picture and description 6. Using the News box 7. Using the Calendar box 9 Teacher Guide 1 Henry County Middle School EDLINE March 3, 2003 This guide gives you quick instructions for the most common class-related activities in Edline. Please refer to the online Help for additional

More information

Mach4 CNC Controller Screen Editing Guide Version 1.0

Mach4 CNC Controller Screen Editing Guide Version 1.0 Mach4 CNC Controller Screen Editing Guide Version 1.0 1 Copyright 2014 Newfangled Solutions, Artsoft USA, All Rights Reserved The following are registered trademarks of Microsoft Corporation: Microsoft,

More information

VSIPL Fundamentals. Naming Data Types Blocks & Views. Randall Judd SSC-SD VSIPL Forum 1

VSIPL Fundamentals. Naming Data Types Blocks & Views. Randall Judd SSC-SD VSIPL Forum 1 VSIPL Fundamentals Naming Data Types Blocks & Views Randall Judd SSC-SD 619 553 3086 judd@spawar.navy.mil 1 VSIPL Names VSIPL is an ANSI C API for signal processing. ANSI C does not support function overloading.

More information