Single-Board-Heater-System/C2/Accessing-SBHS-through-Scilab-on-Windows/English-timed
From Script | Spoken-Tutorial
00:01 | Welcome to this Spoken tutorial on “Accessing SBHS through Scilab on Windows”. |
00:07 | SBHS stands for Single Board Heater System. |
00:10 | In this spoken tutorial, we will learn: to set up serial communication between Scilab and SBHS |
00:17 | to perform a Step Test experiment. |
00:20 | For this tutorial, I am using Windows-7 Operating System and Scilab 5.3.3. |
00:28 | You may download Scilab from www.scilab.org. |
00:34 | To install Scilab, watch the "Scilab" spoken tutorial series on: |
00:44 | Before proceeding with this tutorial, you should watch- Introduction to Xcos, Connecting SBHS to computer. |
00:52 | The relevant tutorials for these are available in this series, on the spoken tutorial website. |
00:59 | To begin, we have to download the Scilab Step Test code. So, let us open a web browser. |
01:06 | In the address bar, type: os-hardware.in. Click on the project SBHS and then on the Downloads link. |
01:19 | Download the file available under the section SBHS Local Code and save this file on the Desktop. |
01:29 | Notice that the downloaded file will be in zip format. |
01:34 | Right-click on this file and choose Extract here. |
01:38 | A folder named scilab codes local will be created. |
01:43 | We are now ready to begin our experiment. |
01:47 | Make sure the SBHS is connected to your computer and it is powered ON. |
01:53 | First, we will check the communication port number assigned to the SBHS. |
01:58 | To do this, right-click on My Computer and then click on Properties. |
02:05 | A window will open up. In this window, click on Device Manager. |
02:11 | Please note that the look and feel of Windows 7 is completely different from other Windows versions. |
02:19 | You may also need to vary the steps that I demonstrate here to suit your Windows version. |
02:28 | The device manager will show you a list of hardware devices on your computer. |
02:33 | Locate the Ports (COM & LPT) option. |
02:38 | Here it is! Double-click on this option to open it. |
02:42 | If you have connected RS232 cable, then look for communications Port COM1 . Else, look for USB Serial Port. |
02:52 | For RS232 connection, the port number mostly remains COM1. |
02:59 | For a USB connection, it may change to some other number. |
03:03 | Note down the appropriate COM number; in my case it is COM14. |
03:09 | Now, sometimes the COM port number you get after connecting a USB cable is a two-digit number. |
03:17 | The serial tool box which connects your board and computer can handle only single-digit port number. |
03:24 | Hence, it is necessary to change your COM port number. |
03:28 | Let me show you the procedure to change the COM port number. |
03:31 | Double-click on that particular COM port. |
03:34 | Click on the Port Settings tab and then click on Advanced. |
03:40 | In the COM port number drop-down menu, choose the port number to any other single-digit number. |
03:46 | Windows may show you that all ports are currently in use but in reality, this is only the old status. |
03:55 | Hence you can forcibly use a particular COM port number, if there is no other USB device connected. |
04:03 | Click on OK to apply these settings. |
04:07 | Click on OK to close the Properties window. |
04:11 | Close the Device Manager and the remaining windows. |
04:14 | Now, let us learn how to configure Scilab, to perform a Step Test experiment using SBHS. |
04:23 | Open the Scilab local codes folder that we have saved on the Desktop. |
04:28 | Open the folder Step test. |
04:31 | Locate and double-click on the file ser underscore init dot sce. |
04:37 | This will launch Scilab automatically and will also open the file in Scilab editor. |
04:43 | If it doesn't open the file, click on the File menu, then on Open a file. |
04:50 | Choose the file ser underscore init and click on Open. |
04:57 | Switch to the scilab workspace and execute the following commands. |
05:03 | Type: get d space dot dot slash common underscore files and press the Enter key. |
05:10 | Then type: exec space dot dot slash common underscore files slash loader dot sce and press Enter. |
05:21 | You can see that it gives a message that it has loaded the serial port toolbox. |
05:26 | Switch to the Scilab editor. |
05:28 | In the ser underscore init dot sce file, locate the line which asks for value of variable port2. |
05:36 | Value of port2 variable needs to be replaced with the identified COM port number. |
05:44 | Change the port number to the one you identified or which you have set just a few minutes back. |
05:52 | Make sure this is in single quotes. |
05:55 | Do not make any other changes to the content of this file. |
05:59 | Now, save the file. |
06:01 | On the menu bar, click on the Execute button to execute this file. |
06:06 | On the Scilab workspace you will get a message "COM Port Opened". |
06:12 | However, it is also possible that you get an error message. |
06:16 | Let me explain using slides, how do you handle a typical error. |
06:21 | Let me switch to the slides. |
06:23 | In case a TCL/TK related error is displayed, reconnect the USB cable connected to the SBHS and execute this file again. |
06:33 | Check once if the COM port number has changed. |
06:37 | If it still doesn't work, restart Scilab and repeat the process. |
06:42 | In the Scilab workspace, execute the following commands. |
06:46 | Type: exec space step underscore test dot sci and press Enter. |
06:54 | Then type: xcos space step underscore test dot xcos and press Enter. |
07:03 | This will launch the xcos interface made for step test experiment. |
07:09 | You can change the block parameters by double-clicking on the blocks. |
07:13 | It is recommended that you keep the parameters unchanged for the first time. |
07:18 | In the menubar of the Xcos window, click on the Simulation option, now select the Start option. |
07:27 | After we have executed the Xcos file successfully, a plot window with three graphs will be displayed. |
07:35 | The first graph is of Heater in percentage, |
07:40 | the second graph is of Fan in percentage and |
07:44 | the third graph is of Temperature in degree Celsius. |
07:49 | There are some things to be noted. Let me switch to the slides. |
07:54 | The Fan, Heater and Temperature are displayed on the SBHS display as shown in the image. |
08:01 | Please note that the values shown in the graph should be the same as displayed on the SBHS display. |
08:08 | If this is not the case then it means that Scilab is not communicating with SBHS. |
08:14 | You can also check if the communication LEDs are flashing periodically. |
08:19 | You will find these LEDs next to the USB connector on the SBHS as shown in this image. |
08:26 | Now, this is a real experiment and will take some time to produce results. |
08:30 | I will now pause the recording for some time. |
08:35 | After running the experiment for sufficient time, the final graphs will be as shown here. |
08:41 | We can see that the temperature has responded to the step change in the heat value. |
08:47 | Now most of the process that we went through, can be completed by just executing one file. |
08:53 | Let me show you this file. Switch to the step test folder. |
08:58 | The steps after launching of scilab, till opening xcos, can be executed using thr start.sce file. |
09:07 | Let me switch to slides. |
09:10 | Usage of start dot sce file is recommended only after you get a firm understanding of the process. |
09:17 | This file assumes that the port number provided in the ser underscore init dot sce file is correct. |
09:26 | Now, to stop the experiment, click on the Stop option available in the menu bar of the Xcos window. |
09:35 | After completing the experiment, let us reset the SBHS. |
09:40 | Let me switch to the slides again to illustrate this. |
09:44 | A Reset push button is provided on the SBHS, as shown in the picture. |
09:49 | To reset, press the Reset button for 1 or 2 seconds and then release it. |
09:55 | The reset operation makes Heat 0% and Fan 100%. |
10:00 | However 0 is displayed for both on the LCD. |
10:05 | The data file for this experiment is saved in the Step test folder. |
10:10 | Let me show you this file. |
10:13 | The name of the data file is in the format of a time stamp. |
10:17 | Read the data file name as Year Month Date Hours Minutes Seconds dot txt. |
10:27 | Let me open and show you the content of the data file. |
10:31 | It has values of heat, fan and temperature for every sample. |
10:36 | Hence, this file can be used for analysis purpose. |
10:40 | Now, let us summarise. |
10:42 | In this tutorial, we learnt to set up serial communication between the Scilab and SBHS. |
10:48 | Perform a Step Test experiment. |
10:52 | The video available at the following link summarises the Spoken Tutorial project. Please download and watch it. |
10:58 | The Spoken Tutorial project team conducts workshops and gives certificates to those who pass online tests. |
11:04 | For more details, write to us. |
11:08 | Spoken Tutorial project is funded by NMEICT, MHRD, Government of India. |
11:13 | More information on this mission is available at the link shown here. |
11:17 | Thanks for joining. This is Rupak Rokade from IIT Bombay, signing off. |