This year we are going to offer a slightly different spin on Pi Day.
Pi, often referenced as the Greek letter π, is the ratio of a circle’s circumference to its diameter. In 2009, the bill H.RES.224 was resolved and passed that supported the designation of March 14 (3/14 or 3.14) as “National Pi Day”. This bill recognized the continued importance of the National Science Foundation’s math and science education programs.
This year we are going to cover Pi in Industrial Automation, and to take a little liberty “Pie” also.
1. Did you know there is a built-in script function for IWS? Yep, the function “Pi()” returns a value of 3.1415926535897931 (an approximation of pi). This can be used for all kinds of calculations including position animations to follow curves or circles, volume calculations, areas, how a river meanders.
2. Here is a stretch – Raspberry Pi. While technically not related to the mathematical constant, a Raspberry Pi running Linux can be used to run the IoTview runtime. This can be as a demo or as a full-fledged product. See these webinars for examples:
3. Use Pi to rotate an object on screen. By combining the Pi() function with SIN and COS you can generate horizontal and vertical positions to move an object in a circle. Here is an example scheduler worksheet that will generate horizontal (XVal) and Vertical (YVal) tags to change the position of an object.
Every 100ms the tag “Count” increments until it gets to 60 and starts over at 0. Then Count is used along with Sin() and Cos() functions to generate numbers (XVal and YVal) that are essentially 90 degrees out of phase. By putting them in the position animation of an object, it will move in a circle on the screen.
And here is the resulting animation:
Have any good Pi stories that you’ve use within InduSoft Web Studio? Let us know.