Hi,
I have a small problem with the configuration of one of the alarms coming from one of the machines linked to our data collection system.
The alarm is called "Machine in Standby" (internal variable: S0.M85.4), because we have 5programs that we run on the machine so we want to track downtime information with different program numbers.
I have written a program using Case statements that IF program number 2 is running send the value of S0.M85.4 to "varOut1" ELSE when program 4 is running send the value of S0.M85.4 to "varOut2".
For example currently we are running program 2. When we change the program to go from one product to another product, the machine is in standby mode, which means their is a recieved time for varOut1 in the alarm list. And as soon as we change the other program the machine shows recieved time for "varOut2".
The problem here is because the varOut1 is left without any cleared time information so it shows me NEGATIVE duration of time in IPA.
This can be resolved by adding few command lines in the VBA code saying , SET "Cleared_time" = "System time" for "varOut1" when program is changed from 2 to 4.
Could any one please help me in writing this statement which assigns the "Time_Cleared" field as "System_time" when a program is changed on the machine.
I Have also attached the VBA code that I wrote for this program, if you could please check and tell me what statement would I have to write to set the clear time as system time whenever the program number is changed on the machine.
Thanks.