Just a question. I've been working in a Vision project but right now I have some doubts.
Currently the project works fine when I have the vision client active in the window where it update a database with some information when the propertyChange in a calendar changes each second and runs a query for saving data.
Right now is it necessary another window but when that new window is active in the vision client and the other is close the database stops saving data because it doesn't detect the change of the calendar.
I think right now I have to change my scripts with some global variables but I don't know how to do that. I just need that when Vision Client starts all my global variables start functioning no matter in what window the client is.
It sounds as though you have not designed your application correctly. If you need something to record every second then you should set that up in the gateway, not in the application. That way it will run even if there is no client open.
Have the PLC count the pulses from the meter using a counter with a rollover of 1,000,000 or whatever you like.
Read the PLC integer value with an OPC tag and set the scale factor in the tag properties.
Use Ignition's built-in historian or a transaction group or gateway scheduled event to record the count. Note that this means that if you miss one or more readings that you will still be able to calculate the total flow and an average rate between any two timestamps.
Decide how often you need to take a reading and plan a sensible historian strategy.