Sie sind auf Seite 1von 1

11/20/2017 How to write time values using VBA Script to a PLC From iFix ka21A000000D4PhQAK | GE Customer Center

How to write time values using VBA Script to a PLC From iFix
Id:
000019685
Average User Rating:

Your Rating:
Last Updated: 04/14/2017
Date Created: 03/16/2017
Products: iFIX
Categories: Q&A

Task
How to write time values using VBA Script to a PLC From iFix

Environment
Primary Product Module : DB Manager
Primary Product Version : iFix 5.x
Secondary Product Line : Drivers

Answer:
VBA Scripting Example of and iFix Database

To test the code

1. Set up 4 AI SIM Tags with output enabled in the iFix Database Named Hour, Minute, Day and Month.
2. Make sure the IO Addresses for the SIM Tags do not overlap and make sure they are not already being used. Example IO addresses 200, 202, 204 & 206.
3. Setup a Timed based Schedule set to trigger every minute continuously.
4. In the Schedule select the Edit Script and Enter the following Script.

Private Sub FixTimer4_OnTimeOut(ByVal lTimerId As Long)


WriteValue System.CurrentTimeHour, "FIXA.HOUR.A_CV", 1, False
WriteValue System.CurrentTimeMinute, "FIXA.MINUTE.A_CV", 1, False
WriteValue System.CurrentDateDay, "FIXA.DAY.A_CV", 1, False
WriteValue System.CurrentDateMonth, "FIXA.MONTH.A_CV", 1, False
End Sub


Examples are in the attached les.
Once the testing is completed, Change the driver from SIM to your OPC driver Finally, ensure the tags in the PLC accept writes as well.

Select Language:
English

Attached Files

DATE_TIME.csv 3 KB
Posted: 4/14/2017
4 SIM Tags for Date and Time

time_Test.evs 24 KB
Posted: 4/14/2017
Schedule example to update 4 AI tags using SIM driver.

Did this content solve your problem?


Yes No

https://digitalsupport.ge.com/en_US/Article/How-to-write-time-values-using-VBA-Script-to-a-PLC-From-iFix 1/1

Das könnte Ihnen auch gefallen