Download LTU - EX - - 05/157 -

Transcript
E.5.5 The GUI interface
A simple interface has been created using Guide, see Figure E.4. It is called rocketclient and
its corresponding source files are rocketclient.m and rocketclient.fig. It comes with three event
handlers: DataRecvdHandler.m, ConnectionStatusHandler.m and KeepaliveHandler.m;
which handle each of the events in Table E-6. It has connect and disconnect buttons, which
are invoking the connect and disconnect methods in the proxy.
Commands are sent to the PC/104 server by adding buttons to the GUI which invokes
the SendCommand method. Text boxes can also be added to monitor variables of interest,
such as the autonomous vehicles position, velocity and acceleration.
E.6 Tutorial – Using the MATLAB client program
To better understand how the communication system works, we will demonstrate how to use
and expand the MATLAB program. First, make sure MATLAB 6.5 or later has been installed
onto a Windows 2000 or XP computer (A Windows NT machine should work as well). Also
make sure the following files are found in a single folder on the computer:
ConnectionStatusHandler.m
DataRecvdHandler.m
findGuiData.m
KeepaliveHandler.m
rocketclient.fig
rocketclient.m
RocketNetworkProxy.dll
E.6.1 Basic operation
If running the program for the first time, register the dll-file by first running cmd (Select run
from the start menu and type cmd).
Set the working directory where the files above have been placed, then type:
regsvr32 RocketNetworkProxy.dll
If successful, start MATLAB.
Make sure MATLAB’s current directory is the directory where the files above are located. In
MATLAB, type:
rocketclient
A window similar to the one in Figure E.4 should appear. Open the file rocketclient.m and
locate the line stating:
invoke(handles.COMh,'Connect','169.254.13.200');
This is found inside the function pushbutton1_Callback. The numbers inside the string is the
internet address of the PC/104 computer. During this project, it was set to 169.254.13.200.
Make sure that the address in rocketclient.m corresponds to the IP address of the PC/104
computer.
Start the PC/104 computer. If screen and keyboard is connected to it, login using
username root, and password root. When logged in, start the data acquisition driver by typing:
./pcm3718 –s &
75