27.7 ASSIGNMENT PROBLEMS
1. Describe an application of ASCII communications.
2. Write a ladder logic program to output an ASCII warning message on channel 1 when the value in 'temp' is less than 10, or greater than 20. The message should be "out of temp range".
3. Write a program that will send an ASCII message every minute. The message should begin with the word `count', followed by a number. The number will be 1 on the first scan of the PLC, and increment once each minute.
4. A PLC will be controlled by ASCII commands received through the RS-232C communications port. The commands will cause the PLC to move between the states shown in the state diagram. Implement the ladder logic.
5. A program is to be written to control a robot through an RS-232c interface. The robot has already been programmed to respond to two ASCII strings. When the robot receives the string `start' it will move a part from a feeder to a screw machine. When the robot receives an `idle' command it will become inactive (safe). The PLC has `start' and `end' inputs to control the process. The PLC also has two other inputs that indicate when the parts feeder has parts available (`part present') and when the screw machine is done (`machine idle'). The `start' button will start a cycle where the robot repeatedly loads parts into the screw machine whenever the `machine idle' input is true. If the `part present' sensor is off (i.e., no parts), or the `end' input is off (a stop requested), the screw machine will be allowed to finish, but then the process will stop and the robot will be sent the idle command. Use a structured design method (e.g., state diagrams) to develop a complete ladder logic program to perform the task.
6. A PLC is connected to a scale that measures weights and then sends an ASCII string. The string format is `XXXX.XX'. So a weight of 29.9 grams would result in a string of `0029.90'. The PLC is to read the string and then check to see if the weight is between 18.23 and 18.95 grams. If it is not then an error output light should be set until a reset button is pushed.
7. Write a program that will convert a numerical value stored in the 'REAL' value
float and write it out the RS-232 output with 3 decimal places.
8. A system for testing hydraulic reservoirs is to be designed and built using a PLC. Part of the test will be conducted using a computer based Data AQuisition (DAQ) system for high speed analog inputs. When the test begins a command of 'S' is sent to the DAQ system, and an output 'pump' will be turned on. The test is started with a 'start' input and stopped with a 'stop' input. The test will be shut down and an error light turned on if the flow sensor does not turn on within 0.1s, or if the pressure input rises above 4V. When the test is done the DAQ system will send a 'D' to the PLC. The PLC will retrieve the data by sending and 'R' to the DAQ system. The data is returned in the format 'xxxx.x<cr><lf>'. The last data line will be 'END'. The array of data should be analyzed and the results stored in the real variables 'maximum', 'average', 'standard_deviation', and 'median'. These variables will displayed on an HMI. Write a structured text program for the control system.