Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit


ASSIGNMENT 2

MTRN3500 Computing Applications in Mechatronic Systems - 2021


1 General Instructions

This assignment has been designed to facilitate online learning allowing you to have more lib-eral access to the experimental set up which we will call “the PLC System”. However, you can only access these equipment online through remote login. Please follow the document MTRN3500 Remote A ess Instru tions.pdf in Moodle, for instructions as to how to login. The com puter you will be logging in will have one of the PLC Systems physically attached to it. The PLC system will respond to the software you will write. You will also have access to a camera which will allow you to see what happens on the PLC System.


2 Assignment Problem

This assignment requires you to develop an object oriented software package for a Programmable Logic Controller (PLC - and hence PLC System) which in this case is used as a general purpose interface device. PLCs like this are commonly used to control various robotic systems in the industry as they have more functionalities such as process control loops (PID loops). They are equipped with various digital inputs and outputs (for controlling ON/OFF systems, sensing ON/OFF signals and for communicating with encoders) as well as analogue I/O (for dealing with amplifiers, actuators or other analogue equipment).

Twenty four of these units have been setup, along with peripheral equipment (encoders, volt meters, LEDs, motors etc.) in the Mechatronics labs at UNSW. You are required to write the necessary software for controlling the PLC. A header file Galil.h has been provided for you. It declares all the functions which you are required to implement. You must create a C++ file called Galil. pp (NOTE: The file must have this name EXACTLY) and it must contain all the function definitions you will write. You are allowed to add your own member functions or data, but you must not change the existing member functions and data. Having developed Galil.h and Galil. pp you must be completely prepared to demonstrate the functionality of your object class by using it in a main() function.

You will be coding the assignment in Visual Studio (one of the best C++ IDE’s) on the lab computers. This will require you to login remotely to the Mechatronics Lab computers. It is highly recommended that you write the code on your own personal computer and push it to the lab PCs from a repository such as Github, whenever you make changes. This is because you will be automatically logged out of the computers after one hour. We also recommend that you set up the project in your UNSW H-Drive, so that it will be there when you log in to a different lab machine (you will not be able to choose a machine; you will be assigned one when you attempt a login, however, all computers and the experimental set ups are identical).


3 Overview of the Supplied Code

You can find the following in the Moodle site under Assignment Two.

● Galil.h: This header file declares all the necessary functions that you must write in your Galil.cpp. Read all the instructions carefully.

● EmbeddedFun tions.h: This header file wraps the Galil commands in a class structure. Whenever you send a command to the board, send it through this class. Failure to do so will result in mark deduction.

Other Files: g lib.libg libo.libg lib.hg libo.hg lib_errors.hg lib_re ord.hg lib.dllg libo.dllGalilControl.lib: These files contain all the dependencies required to use the Galil library. You must extract the zipped folder on Moodle and place these files in your solution folder. Some instructions for setting up the project are found in the next sections.


4 Creating a Visual Studio Solution

To set up the project, please follow the steps below:

1. Open visual Studio and create a new project. File←New←Project

2. Select ‘CLR Empty Project .NET Framework’ allowing you to create a C++ Windows Console application.

3. Name your project, whatever you like, and choose a directory.

4. Hit Create.

5. In a file explorer, find the solution folder for your new project

6. Paste the contents of the zipped dependencies folder and unzip it.

7. Add “gclib.lib” and “gclibo.lib” as libraries.

8. You can now create your own main file and start coding. Compiling and linking in VS is called “building”, and you can run either with or without debug functionality.

9. IP address to be used to connect to hardware: 192.168.0.120. Port: Any > 25000.


5 How You Will be Assessed

Warning: You must attend your designated weekly lab class to progress with this assignment. We will be recording your weekly attendance. DO NOT WAIT TILL WEEK 10! If you did not attend the lab classes and come to us seeking help, we will not be able to help you. We simply cannot rerun past lab classes.

1. Your assessment will take place in week 11 in a Microsoft Teams meeting with your demonstrator. You need to make an appointment with your demonstrator before the end of Week 10.

2. This assignment is a take home assignment. Develop a complete package as described in this assignment and have it ready (with the main() function written and all objects instantiated) on the Uni computer you will use for the assessment on the day of the assessment.

3. On the day of the assessment you will be asked to incorporate into your already prepared main() function, statements to carry out some tasks. Only a maximum of 5 minutes will be available for you to complete your task. This is why it is really important to have all the class instantiation completed and be really prepared to call any of the member functions to complete the specified task. Only one attempt is allowed.

4. Marks will be awarded according to the following scheme:

(a) Making the program fully operational on the day of the assessment (5 marks) and answering questions posed to you by your demonstrator (3 marks).

(b) Style marking as per the following requirements.

i. Modularity:

Logical breakdown into separate files,

Well reasoned selection of data and function members of the classes and nonmember functions (if any).

ii. Structure:

Order of programming statements,

Indentation,

Use of braces and parenthesis,

Consistent and well reasoned choice of constant/variable/function names.

iii. Program constructs:

Well reasoned choice of data types,

Proper choice of iterative loops,

Orderly use of other constructs such as swit hbreakontinue, etc

Logical selection of constructors

Achieving best program logic with least amount of coding.

Total for all three items above (6 marks).

(c) Auto-marking checking of the submitted files for the correctness of the solutions to each of the functions (6 marks).

(d) Your mark out of 20, will directly contribute to forming the final mark for this course.


6 What to Submit

Without zipping the files, submit your galil.h and galil. pp files to Moodle by 11.59 pm of 26 November, 2021. The submitted code will be first checked for similarity scores and then by the style marker.


7 Penalties

1. If you are found to have plagiarised you will get zero marks for the assignment and you will be reported to School and University authorities.

2. If you have deleted or changed the existing code of the header files, or do not conform to the submission instructions (resulting in demonstrator intervention), 2 marks will be deducted.

3. Each day late past the online submission deadline will lose 20% of the total marks for the assignment as per School guidelines.

4. If you do not attend the assessment lab session you must apply for special considerations through myUNSW.