Using a Laptop Computer with a USB or Serial Port Adapter

Using a Laptop Computer with a USB or Serial Port Adapter to Communicate with the Eagle System 20-060_A.DOC Page 3 of 18 9/15/2009 Table of Contents...

21 downloads 536 Views 743KB Size
Using a Laptop Computer with a USB or Serial Port Adapter to Communicate With the Eagle System

ECU

DB9

USB

20-060_A.DOC

Page 1 of 18

9/15/2009

Using a Laptop Computer with a USB or Serial Port Adapter to Communicate with the Eagle System

© 2009 Precision Airmotive LLC This publication may not be copied or reproduced without express written permission from Precision Airmotive LLC.

20-060_A.DOC

Page 2 of 18

9/15/2009

Using a Laptop Computer with a USB or Serial Port Adapter to Communicate with the Eagle System

Table of Contents 1. Purpose 2. User Knowledge 3. Basic Steps 4. Eagle System Prerequisites 5. Laptop Computer Specification 6. Electronic Port Adapter 7. Terminal Program Download and Setup 8. Viewing Eagle Data in Window’s Notepad or Mac’s TextEdit Program 9. Viewing Eagle Data in Window’s Excel or Mac’s Numbers Program 10. Communicating with a Mac Computer Appendix

A. Hardware Layout When Using a Serial Adapter B. Hardware Layout When Using a USB Adapter C. Scripting With Tera Term Pro

20-060_A.DOC

Page 3 of 18

9/15/2009

Using a Laptop Computer with a USB or Serial Port Adapter to Communicate with the Eagle System

1. Purpose The purpose of this document is to define the necessary hardware, software, and user steps for a laptop computer to communicate with the Eagle System’s Electronic Control Unit (ECU). The user can then verify system status, troubleshoot, change calibration values, and perform data acquisition functions all of which are explained in the Eagle Calibration manual.

2. User Knowledge 2.1. The user must have read and be familiar with the following Eagle manuals: Owners, Installation, Post Installation Troubleshooting, and Theory of Operation. All of which can be found on Precision Airmotive’s Web Site. http://precisionairmotive.com 2.2. Read this entire document before buying products to minimize unnecessary purchases.

3. Basic Steps These are the basic steps on how to get a laptop computer to communicate with the Eagle System’s ECU. Most steps have an accompanying section (see titles in bold below) which go into further details on how to actually perform the action. Be aware, there are instructions for both MS Windows and Macintosh type laptops and for both serial and USB type ports. 3.1. Ensure that the Eagle System Prerequisites are met. 3.2. Determine the Specifications of Laptop Computer. 3.3. Electronic Port Adapter and Hardware. Acquire the appropriate port adapter and extension cables (the appendixes show how the adapters are installed). 3.3.1. If using a USB port adapter, download and install the device driver. 3.3.2. If using a USB port adapter and running Windows, the port configuration will be adjusted using the device manager found in the control panel of Windows. 3.4. Terminal Program Download and Setup 3.4.1. MAC computer has a Terminal program built in. See the Apple setup in this document. 3.4.2. Windows computer uses the freeware program Tera Term Pro. 3.5. Review the sections labeled: Viewing Eagle Data in Window’s Notepad or Mac’s TextEdit Program AND Viewing Eagle Data in Window’s Excel or Mac’s Numbers Program. 3.6. Hook everything up. Attach the port adapter to the laptop computer and then to either the Left or Right ECU communication port. 3.7. Turn the Aircraft Main Buss on; then turn the key switch to either the left or right ECU position. 3.8. Turn on the laptop computer and start the following programs: 3.8.1. Notepad (Windows) or TextEdit (Mac). 3.8.2. Tera Term Pro (Windows) or Mac’s Terminal program.

20-060_A.DOC

Page 4 of 18

9/15/2009

Using a Laptop Computer with a USB or Serial Port Adapter to Communicate with the Eagle System

4. Eagle System Prerequisites 4.1. It is important that the user installs the Eagle system per the installation manual. The aircraft main buss battery and Eagle battery MUST BE fully charged. Ensure that the ground wire between the main battery and the engine/aircraft is adequate in size and is making good contact. 4.2. Locate the Left and Right communication port connectors that are part of the wiring harness that comes from the ECU.

Left and Right ECU Comm Ports. Notice each has 2 rows of Female sockets. These are Female DB9 Connectors. 4.3. Determine how far away the laptop computer is going to be from the Left and Right ECU communication ports. A communication extension cord maybe needed to position the computer in a comfortable user location, examples are found in Appendix A and B.

20-060_A.DOC

Page 5 of 18

9/15/2009

Using a Laptop Computer with a USB or Serial Port Adapter to Communicate with the Eagle System

5. Laptop Computer Specifications An inexpensive laptop computer can be used. The specific requirements for the laptop are: 5.1. Must have a decent internal battery or DC power adapter that plugs into the aircraft. This is to ensure the computer does NOT go dead while taking data in flight or on the ground. 5.2. MS Windows based laptop computers will automatically come with a program called “Notepad.” Macintosh computers have a program called “TextEdit.” These simple programs can open, view, save, and e-mail the data that was saved (logged) by the Terminal program. 5.3. Window’s Excel and Mac’s Numbers can do the same things as Notepad and TextEdit but they can also perform data manipulation like: graphing, sorting and averaging. Usually all that is needed is a program like Notepad for Eagle data review. 5.4. The computer must have either a serial port or USB port, see pictures below. 5.5. If the computer’s USB port is going to be used then the computer also needs a CD drive. The USB port adapter comes with a device driver load on a CD.

Computer Serial Port Notice the 2 rows of Male Pins. This is a Male DB9 connector.

20-060_A.DOC

Page 6 of 18

Computer USB Ports

9/15/2009

Using a Laptop Computer with a USB or Serial Port Adapter to Communicate with the Eagle System

6. Electronic Port Adapter 6.1. The electronic port adapter is a device that connects between the Eagle System’s ECU RS485 port and to either a laptop computer’s USB or RS232 serial port. 6.2. NOTE - The RS485 and the RS232 use the same physical connector. The connector used is known as a “DB9.” How the information is being transmitted determines what port it is. Side Note - When purchasing DB9 connectors it is important to know that there both male and female style connectors. 6.3. The adapter comes in two different physical styles, serial port and USB port. Both adapters are technically called “Serial Interface Adapters.” Both adapters will do the same job. The serial port adapter is the simplest to use. The USB port adapter requires two additional steps: installing a software driver that comes with the USB adapter and telling the computer what port the device is attached to. How to perform these steps is mentioned later. 6.4. Precision Airmotive has tried several different port adapters and found that the products from http://www.usconverters.com work well, are easy to acquire, and are reasonably priced. Listed below is information for a serial port adapter and a USB adapter. 6.5. If a USB port adapter is needed specifically ask for the CD software driver when ordering the port adapter. The CD is very easy to use, where as the driver off their web site is more labor intensive. Physical Style of Adapter Computer Serial RS232 to Eagle RS485 Computer USB to Eagle RS485

US Converter’s Product Name RS232 to RS485 converter USB to RS485 Cable (This comes with a built in 2 ft long USB Cable)

Model RS485 USB485CAB

NOTE. Precision has found that some inexpensive laptops may have a USB port, but they are missing some internal circuitry. The USB adapters that are mention here will work successfully because they have this missing UART circuitry (Universal Asynchronous Receiver Transmitter).

20-060_A.DOC

Page 7 of 18

9/15/2009

Using a Laptop Computer with a USB or Serial Port Adapter to Communicate with the Eagle System

6.6. Installation of the USB driver is performed by performing the following steps

Select this option, then select next.

Do NOT select any options. Just put the CD in the drive and wait. Everything happens automatically.

20-060_A.DOC

Page 8 of 18

9/15/2009

Using a Laptop Computer with a USB or Serial Port Adapter to Communicate with the Eagle System

6.7. Port Configuration steps if using MS Windows laptop and an USB adapter. 6.7.1. Go to the “Control Panel” of your computer. Then select “System,” then the tab called “Hardware,” followed by “Device Manager.” A screen will pop up that will look similar to the one shown below to the left. Then plug in the USB Port Adapter and the screen will acknowledge that the USB adapter is present.

USB device is UNplugged. Only COM1 is present.

USB device is Plugged in.

6.7.2. If the COM Port number for the assigned to the USB adapter is higher than 4, then this will need to be changed. Click on the USB port with the right mouse button, then select “Advanced Settings” and change the assignment to one that is less than 4 and is not being used by another device (example shown next.)

Change Here

6.7.3. The COMM number and the BAUD rate information from above will be entered into the Terminal program (Tera Term Pro.)

20-060_A.DOC

Page 9 of 18

9/15/2009

Using a Laptop Computer with a USB or Serial Port Adapter to Communicate with the Eagle System

7. Terminal Program Download and Setup The Terminal program is a user interface that translates information coming to and from the Eagle system via the Electronic Port Adapter and displays it on the user’s laptop computer screen. The data can also be logged to a file that MS Notepad or Apple TextEdit can open. 7.1. The MAC computer has a built in Terminal program. See the section called “Communicating with a MAC Computer.” 7.2. For MS-Windows PCs, Precision Airmotive is currently using a freeware program called, Tera Term Pro. The program has the ability to: 7.2.1. Send script files. A script file can be used to completely rewrite the calibration file, thus eliminating numerous user entries. These script files are created by Precision Airmotive for special situations. The special settings for this are explained in Appendix C. 7.2.2. Continuously log data to a file. If the computer looses power, the data that was recorded is not lost. 7.3. Tera Term Pro is down loaded from http://hp.vector.co.jp/authors/VA002416/teraterm.html. The download is a Zip file. Click on this file with the right mouse button and select the option “Extract All”. Run the Setup file. Keep track of where the program and files are being created and saved to minimize frustration. 7.4. The standard setup for Tera Term Pro and how to save (log) Eagle data is shown next.

20-060_A.DOC

Page 10 of 18

9/15/2009

Using a Laptop Computer with a USB or Serial Port Adapter to Communicate with the Eagle System

Settings for Tera Term Pro

COM1 for serial adapter or whatever you selected for the USB. Select Serial for both the Serial and USB adapters

Set to 1

Select Setup and then set the Terminal size to 120 characters wide and 40 deep. Click on Term size = win size. This will make the window the correct size when launched the next time. Be sure to save setup otherwise you do it all over.

20-060_A.DOC

Page 11 of 18

9/15/2009

Using a Laptop Computer with a USB or Serial Port Adapter to Communicate with the Eagle System

Logging to a File with Tera Term Pro Under the File Menu select Log. In the Log window create a new file name or open a previously created file. Upon opening, an additional small window will appear. This window allows you to pause or close the log file. These log files may be saved in a folder of your choice or on the Desktop (keep track of where this file is saved because you will want to use it later). Note: If the Append box in the Log window is checked the new data will be added to the existing data in the file. If it is not checked, the old data will be over written. Tera Term files do not have a file extension such as .txt. When opening this file in Notepad select all files in order to see it. Choose the File menu to connect, disconnect, and exit program.

Number of bytes added to file.

NOTE: The data that is saved in the logged file is viewed by opening it in Window’s Notepad or Mac’s TexEdit or imported as a text space delimited in Window’s Excel or Mac’s Numbers.

20-060_A.DOC

Page 12 of 18

9/15/2009

Using a Laptop Computer with a USB or Serial Port Adapter to Communicate with the Eagle System

8. Viewing Eagle Data in Window’s Notepad or Mac’s TextEdit Program Data that is displayed on the Terminal screen or was saved to a logged file can be viewed in Notepad and TextEdit. The data can then be saved, printed, and E-mailed from one of these text programs. It is important to setup Notepad or a TextEdit with the proper font and size. Failure to do so will result in a text wrap or the data running off the screen. Sometimes this condition cannot be undone after it is saved. The EMS data string is up to 114 characters wide. In order to fit the data into a text file the Font should be Courier New with a size of 8 points. To do this, select the Format menu and select Font. There are two ways of getting the Eagle data from Terminal program (Tera Term Pro or Mac’s version) into the Notepad or TextEdit. 1. The data that is being displayed live on the Terminal program screen can be highlighted, copied (Ctrl C) then pasted (Ctrl V) right into Notepad or TextEdit. 2. The data file that was created and saved (logged) in the Terminal program can be opened in Notepad or TextEdit. Use the pull down menu; File, Open, and use the option “Files of type” and choose “All Files”. This is necessary to see the file created by the Terminal program because it has no file extension. Note: Windows also has WordPad. The same is true for the font settings. There is one exception for this word processor. The saved file must be saved as a .txt file not an .rtf (rich text file). The default is .rtf so it always has to be changed to .txt. Failure to do so fills the data with formatting symbols making it un-useable. This can be undone by opening the .rtf file and doing a save as text file using WordPad itself. This may not be possible with another word processor. So Notepad is the preferred editor.

20-060_A.DOC

Page 13 of 18

9/15/2009

Using a Laptop Computer with a USB or Serial Port Adapter to Communicate with the Eagle System

9. Viewing Eagle Data in Window’s Excel or Mac’s Numbers Program Data that was saved (logged) to file by a Terminal program or in a Text program like Notepad can be imported into Excel or Numbers. The data can then be saved, printed, E-mailed, and manipulated. Data cannot be copied and pasted right off the Terminal program window. The exact steps for importing data will vary depending on specific software revision of Excel and Numbers that is being used. However, the general steps are listed below. 1. Open a new file. 2. From the main pull down menu select “Data” then from the options “Get External Data” pick “From Text”. 3. Browse for the previously saved Terminal file or Text file. Look for file types “All Types *.*” because the Terminal file has NO extension. 4. Select the file and then the command “Import”. 5. Select the import options “Delimited”, “Space”, and “Text”.

20-060_A.DOC

Page 14 of 18

9/15/2009

Using a Laptop Computer with a USB or Serial Port Adapter to Communicate with the Eagle System

10. Communicating with a Mac Computer The Mac has a built in Terminal program under Applications/Utilities. This is a Unix command window. With the USB to RS485 drivers in place launch Terminal. Type the following commands without brackets: 1. Type [ls /dev/tty.*]. This command will list the USB serial devices. 2. Find the one that is the serial device you added. Example: /dev/tty.serial-0001. 3. Copy the part in gray to paste later. This is the USB device name. 4. Type [screen /dev/tty.serial-0001 9600]. This selects the device and sets the Baud Rate. 5. A communication window will appear. Type OPS if not already scrolling data. 6. Adjust the window size so the data does not wrap and then hit the return key. The data should stop. You are now ready for a data command session. 7. To save the data select all from the Edit menu. Place in a text editor (TextEdit) and save. 8. To quit the serial window hold the control key and press A then \ keys. 9. To quit the Unix session type [exit] and you are now logged off then quit Terminal. Note that MAC files use just a carriage return after each line. Windows uses a carriage return and line feed after each line. At the Windows end this can be corrected by opening the file with WordPad and saving as a text file which adds the line feeds. There are Serial Terminal programs available but none tend to be free for the MAC. When the baud rate is changed in the EMS you must exit Terminal and re-launch Terminal. If you are changing the baud rate to19200 you would type [screen /dev/tty.serial-0001 19200]. Normally the baud rate is not changed and is defaulted at 9600. Note that all unix commands have a space after the command. There are probably ways to save data to a Log file so for the current time the copy/paste method will be used.

20-060_A.DOC

Page 15 of 18

9/15/2009

Using a Laptop Computer with a USB or Serial Port Adapter to Communicate with the Eagle System

Appendix A Hardware Layout When Using a Serial Adapter US Converter’s Product Name: RS232 to RS485 converter Model Number: RS485 Benefits: Device does not require downloading a software driver or setting up the Device Manager for ports when using MS Windows computers. Connection: The adapter can be plugged right in between the ECU (Left or Right Side) and the laptop computer with no additional wires. However, for convenience an extension cable can be used. An extension cable can be purchased or it can be made by purchasing the piece parts which include the correct gender DB9 connector and wires.

To laptop. You can also add on a serial extension cable. This is a Female socket DB9

To Eagle. You can also add on a serial extension cable. This is a Male pinned DB9

Terminal strip only needed if you want to make a custom harness.

For Reference: The computer has a male pinned DB9 Connector.

Extension Serial Cable

The Eagle system has a female socket DB9 Connector.

Extension serial cables can be acquired in different lengths and are available at stores like Office Depot, Radio Shack, and Staples.

Additional Reference Information (not needed to use adapter) Adaptor pin outs RS232 side 1 DCD 2 RXD 3 TXD 4 DTR 5 GND 6 DSR 7 RTS 8 CTS 9 RI

20-060_A.DOC

RS485 side 1 D-/B 2 D+/A 3 --4 --5 GND 6 5 ~ 12V 7 --8 --9

Page 16 of 18

Terminal strip 1 D+/A 2 D-/B 3 GND 4 +5V ~ +12V

DB-9 (ECU) 2 (A) 1 (B) 5

9/15/2009

Using a Laptop Computer with a USB or Serial Port Adapter to Communicate with the Eagle System

Appendix B Hardware Layout When Using a USB Adapter US Converter’s Product Name: USB to RS485 Cable Model Number: USB485CAB Benefits: The device will work with a computer that does not have a serial port. The device also comes with a built in 2 foot long USB extension cable. Additional Requirements: These devices require downloading software from the manufacture and managing the port requirements when using MS Windows. Connection: The adapter can be plugged right in between the ECU (Left or Right Side) and the laptop computer with no additional wires. If an additional extension cord is needed, either a USB or serial cable can be purchased.

To laptop. You can also add on an additional USB extension cable.

Terminal strip only needed if you want to make a custom harness

For Reference The computer has a male pinned DB9 connector.

To Eagle. You can also add on a serial extension cable. This is a male pinned DP9.

USB Extension Cable

Serial Extension Cable

The Eagle system has a female socket DB9 connector. US Converters sells separate 2 foot long USB extension cables. Office Depot, Radio Shack, and Staples also carry USB and serial extension cables. 20-060_A.DOC

Page 17 of 18

9/15/2009

Using a Laptop Computer with a USB or Serial Port Adapter to Communicate with the Eagle System

Appendix C Scripting With Tera Term Pro Purpose This appendix defines the special Tera Term Program settings required to run a script file. Script files are provided by Precision Airmotive for special situations.

Set to 5000 when scripting

Hit the ENTER button 1 time gives 5 sec delay

Hit the ENTER button 2 times gives a 10 sec delay

20-060_A.DOC

When scripting do not save setup with the 5000 as this will have to be undone on next launch. Do only during scripts then back to 0 or 1.

To the left is a script file. With the msec/Line delay set at 5000. Every new line generates a 5 second delay to the next command. For long string outputs like vete+2 we add an extra line to make a 10 second delay. This script does a SW version, prints the original VE table, configures for a 320 CU inch engine, raises the VE table by 2% and displays the new VE table. Other schemes may be used such as a baud rate 19,200 and thus cutting the time in half. The msec/Line could be 1000 and 5 (CR) which would be the same delay.

Page 18 of 18

9/15/2009