Hello everyone, I am relatively new to programming but I am faced with a challenge that I need to resolve. I am looking to incorporate 2 analog inputs ranging from 4 to 20mA into my program. The goal is for the program to calculate the average of these 2 inputs, set a sampling time, potentially multiply them by a constant, and display the updated information with each new sample. I am utilizing the micro 8202080-LC20-20QBB controller along with the 2711R-T4T4 Panelview 800 HMI for this project.
What level of accuracy is required for the sample time, such as±1ms, ±10ms, or ±100ms? Are you working on a school assignment? What data types are used for the samples, such as raw integer counts or floating-point values? What data type is used for the displayed value? Will the sample time vary during the process?
Hello Dr. Bitboy, I believe a sample time of 0.5 seconds should suffice for the data type of 0 to 5VDC. I have two inputs of this type and I need to calculate the average of the two inputs to display on the screen mentioned earlier. Would the "running average over n samples" instruction block be suitable for this task?
Russell Carey asked, "Hi Dr. Bitboy, I believe a sample time of 0.5 seconds should suffice. The data type is 0 to 5vdc. I have two inputs for this and I want to calculate the average of these inputs and showcase the results on the screen mentioned earlier. Would the "running average over n samples" instruction block be suitable for this task? This project is not a homework assignment, but rather for a grape harvester. The machine has both left and right sides that can be adjusted up and down, allowing it to remain level on uneven terrain. It is crucial to always know the overall height of the machine from the operator's cabin. The factory units on the machines have ceased to function over time. Instead of spending $8,000 per machine to replace the factory units (totaling 4 machines), I prefer to address the issue with a PLC. The existing units can input a setpoint for maximum and minimum height and display the data as a percentage. While this feature is convenient, it would complicate the program. Initially, I would like to display some data, then adjust it by a constant to provide a suitable range for reading on the screen."
Analog inputs typically range from 0 to 4095. To process these inputs linearly, a repeating timer (XIO tmr.QTON tmr T#1000ms...) can be used. On each scan cycle when the timer expires, mathematical calculations are performed (+ IO_EM_AI_00 IO_EM_AI_01 summed_inputs/ summed_inputs 2 average_input* average_input factor final_result) within a single rung. The XIO instruction represents a Normally Closed contact, while tmr refers to the timer object for the TON timer. The tmr.Q bit indicates the timer expiry for the TON timer. During most scan cycles, the value will be 0, leading to a True output from XIO and time accumulation in the timer. After accumulating time, the value becomes 1 for a scan cycle, triggering a False output from XIO on the next cycle. This resets the timer and tmr.Q bit to 0, restarting the process. TON is the Timer-ON delay timer instruction with a time literal value of T#1000ms (equivalent to 1000 milliseconds). The calculations involve adding IO_EM_AI_00 and IO_EM_AI_01, dividing the summed result, and calculating the average input value. The final result is obtained by scaling the raw input value (0-4095) to the desired engineering value, such as height.
Hello and welcome to the world of programming! The project you're undertaking sounds interesting. To proceed, you'll need to use Analog Input modules compatible with your Micro820 Controller and then program using Connected Components Workbench Software. The AI module will convert the 4-20mA signal into a digital value that you can calculate an average from, multiply by a constant, or use for other computations. For setting the sampling time, you could use a timer that triggers your calculation routine in a cyclic manner. Finally, to display the updated information on your Panelview HMI, you'll send the computation results to HMI via tags. Please, remember that the exact details you'll need to work out will depend on the specifics of your hardware set-up and the Connected Components Workbench Software version you're using. Good luck with your project!
Welcome to the world of programming! It sounds like you're on a great path integrating analog inputs into your program. Since you're using a micro 820 PLC, it's worth noting it supports structured text programming. You can use the programming software Connected Components Workbench (CCW) to set up your analog inputs, perform calculations, and control the sampling rate. To display real-time data on your PanelView, use the PanelView's HMI software to create tags that correspond to your PLC's registers. Make sure to start slow, break down each step, and test as you go. If you get stuck, don't hesitate to ask. We're here to help!
Welcome to the world of programming! Firstly, kudos on taking up this interesting project. While working with analog inputs, you have to ensure that your Micro 820 programmatically reads these inputs correctly. Since you're working with a 4-20mA range, you might also need a scaling function to convert this range into more suitable, understandable units for your application. Now, to average two inputs, you will need to sum these inputs and divide by 2 - relatively simple math operations. Setting a sampling rate would involve either setting a definitive delay between each read or utilizing the timer functions available in the controller. For multiplication by a constant, another simple math operation will suffice. As for displaying updated info, you'll need to make sure the HMI is correctly pulling this calculated data from your controller. The actual implementation of these will depend on the programming environment and language you're using. Good luck with your project!
Hey there! It sounds like an exciting project you’re working on! To start, you'll need to set up the analog input channels on your Micro 820 controller to read the 4-20 mA signals. Make sure to configure the scaling correctly, as this will convert your mA readings into a usable value (like volts or directly into engineering units). For calculating the average, just add the two readings and divide by two. Setting up a timer for sampling is straightforward, and you can easily implement a constant multiplier if needed. Once you have your results, you can use the Panelview 800 to display the average—I'm sure it will look great on the HMI! If you run into any specific code issues, feel free to ask!
Hey! That sounds like an exciting project you’ve got! To tackle your analog inputs, you'll first want to ensure that you're properly configuring the channels for the 4-20mA signal range in your controller. Once you have that set up, you can implement a simple loop to read both inputs at your defined sampling time. Calculating the average is straightforward—just sum the two readings and divide by two. Don’t forget to multiply by your constant right after calculating the average if that’s part of your logic. For displaying the values on your HMI, make sure to set up the data communication correctly, so your updated values show up in real-time. If you run into any specific issues while coding, feel free to reach out! Good luck!
Hey there! It sounds like an interesting project you’re embarking on! To handle your 4-20 mA inputs, make sure you utilize the right analog input modules for your Micro820 controller; you'll want to set up the input scaling properly to convert the mA values to a more usable format. For averaging the two inputs, simple calculations using the controller's programming environment will do the trick—just read both inputs, sum them, and divide by two. If you're looking to set a sampling time, consider using a periodic timer function in your program to ensure consistent updates. Don’t forget to display your calculated average on the PanelView HMI; building a user-friendly interface will help visualize your data effectively. Good luck, and feel free to ask if you run into specific hurdles!
âś… Work Order Management
âś… Asset Tracking
âś… Preventive Maintenance
âś… Inspection Report
We have received your information. We will share Schedule Demo details on your Mail Id.
Answer: - To incorporate 2 analog inputs into your program, you can use the analog input modules compatible with the micro 820 controller. These modules can convert the analog signals into digital values that can be processed by the controller.
Answer: - To calculate the average of the 2 analog inputs, you can sum the values of the two inputs and then divide the sum by 2 to get the average. This average can then be used for further processing or display.
Answer: - You can set a sampling time by configuring the scan time in your program. This scan time determines how often the controller reads the analog inputs and updates the values. By adjusting the scan time, you can control the frequency of sampling.
Answer: - Yes, you can multiply the analog inputs by a constant in your program. By incorporating the multiplication operation in your code, you can apply the desired constant factor to the analog input values before further processing or display.
Answer: - To display the updated information on the Panelview 800 HMI,
Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.