![]() ![]() I cant query the database directly without knowing what tables to look at, and the dates might span a month (last day of one month to the first day of the next) and that means is will be in two different tables. In the database, its quite simple using a query but from ignition there do not seem to be any tools that allow this. From this they want to query the history to see how many times they fell below 2psi between the dates. ![]() For example, the want a screen that has a start date and an end date entered on the screen, they also have a pressure value, say 2psi. They are logging a pressure on a vessel, and they have an alarm at 0.5 psi, but the would like to have a page that allows them to look at some other low points for the day. ![]() I’m hoping that there is a simple solution that I’m overlooking. For example, the following code will access the value of a Tag.I have a customer who asked for what I first thought would be a simple query, and after attempting to do it, turns out seems quite hard. Ignition comes with a group of system functions, called the System Library. Using a system function is simple. For example, if a component on a window is running a script, its values are isolated to the client, and the output will be displayed on the Designer/Client output console. "Client Scope" scripts, however, execute on the running client (and also in Designer when testing, but only in Preview Mode). Additionally, some of the system functions like only work in the "Client Scope," so you will not be able to use them in the script on the Tag. This means that the script will not be able to access any client level resources such as windows or components that you may have open in the Client. For example, running a script on a Tag is run in the Gateway Scope and the output is sent to the Gateway console (i.e., wrapper.log file) because Tags are stored in the Gateway. This is important because it determines what system functions can be run, what resources the script can interact with, and where the output will be written to. Where a script is run from determines what scope it is running in. Within Ignition, there are different scopes: the Gateway Scope, the Perspective Session scope, and the Client Scope. ![]() One important thing to keep in mind before scripting in Ignition, is to understand the concept of scope. Each location has its own events that trigger your scripts to run, and add functionality to your projects in different ways. The most apparent place is in event handlers on components and other objects in Vision Clients and Perspective Sessions. Python is used in many places in Ignition. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |