05-27-2024 02:26 AM
Hi pls,
@plssendhelp1506 wrote:
Hello everyone, I did some modification but I am still facing a little issue here. By right when the thermocouple 1 and 4 reaches 200 degree celsius it is supposed to be in red colour but over here it turn green instead. I am not sure what is wrong here....
You didn't follow Christians suggestions, but still keep you own buggy code.
@plssendhelp1506 wrote:
also is it workable to insert PID controller here ?
Yes, sure.
What do you want to achieve with a PID controller in your case?
05-27-2024 02:52 AM - edited 05-27-2024 02:53 AM
I did try to do what Christian suggested however when I changed the color of the LED....4 entire LED color changes instead of 1 and i am not sure why.....sorry
With regards,
E
05-27-2024 03:11 AM
Hi pls,
@plssendhelp1506 wrote:
I did try to do what Christian suggested however when I changed the color of the LED....4 entire LED color changes instead of 1 and i am not sure why.....sorry
Now you forgot to attach the block diagram!
When you followed Christians suggestion, but don't get the same result then you did something wrong…
05-27-2024 09:34 AM
@plssendhelp1506 wrote:
I did try to do what Christian suggested however when I changed the color of the LED....4 entire LED color changes instead of 1 and i am not sure why.....sorry
With regards,
E
They should be Color Boxes, not LEDs.
05-27-2024 09:51 AM - edited 05-27-2024 10:14 AM
@plssendhelp1506 wrote:
I did try to do what Christian suggested however when I changed the color of the LED....4 entire LED color changes instead of 1 and i am not sure why.....sorry
A LED has only two possible values, True or false. The color is a property and elements of an array can only differ in value, but share all properties.
For a colorbox, the color is the value and can thus differ for each array elements. It is a numeric!
Have a look at links in this old idea for details.
05-27-2024 10:09 AM
@plssendhelp1506 wrote:
While this is definitely not the way to do it, here are some general coding problems. Your code is extremely clumsy with way too many duplicate elements.
Of course you can add PID controls. What have you tried? I would recommend to focus on that first and deal with cosmetics (e.g. adding color LEDs) as a last step.
05-28-2024 01:24 AM
It managed to work out !!! Thanks for all the suggestions and patience guiding me 😅 Just one more question: Is it possible for me to keep the value constant but make the colorbox light up as blue in color instead of green when the temperature reaches -99.7,-190,-190 and -38 respectively or must I change the limit then the color will change...
05-28-2024 01:37 AM - edited 05-28-2024 01:38 AM
Hi pls,
@plssendhelp1506 wrote:
Just one more question: Is it possible for me to keep the value constant but make the colorbox light up as blue in color instead of green when the temperature reaches -99.7,-190,-190 and -38 respectively or must I change the limit then the color will change..
Part of many programming problems is to ask the right questions! Being able to ask the right question often helps to solve the problem correctly…
So I have to ask:
Please specify your requirements as exactly as possible!
05-28-2024 02:15 AM - edited 05-28-2024 02:16 AM
Gerd already raised the important points.
Also:
@plssendhelp1506 wrote:
Just one more question: Is it possible for me to keep the value constant but make the colorbox light up as blue in color instead of green when the temperature reaches -99.7,-190,-190 and -38 respectively or must I change the limit then the color will change...
A colorbox changes colors, it does not light up, whatever that means. Within noise and accuracy, your temperature never exactly reaches these values. You can add as many color ranges as you want by expanding my code by adding more thresholds in the array constant and more colors in the "range" color array. You could go through an entire rainbow of colors as a function of temperature! (ice cold (purple), cold (blue), coldish (bluegreen), nice (green), warmer (yellow), hot (orange), blazing hot (red), white hot (white) as well as a color for missing data or sensor offline (black). etc.).
05-28-2024 11:36 PM - edited 05-28-2024 11:36 PM
Thanks for the suggestions! I have did some modifications but it still didn't managed to turn out what i am aiming for. The attached picture below is what i did.
Requirements:
1) the color box will only be activated if it senses current into the system. So by default, it should all be black at their normal state.
2) The alarm will be activated if the thermocouple were to be operating at a temperature that exceeds the limit ( I did the connection but it doesn't seem to activate when i do simulation)
3) to answer the question you posted, from left to right the first thermocouple will be reaching the value from up as the temperature is meant to be decreasing while the last thermocouple will be reaching the value from down since it is meant to be increasing...and yes, being exactly the limit value
Best regards,
Emma