>>Message imported from previous forum - Category:Scripts and Tips<< User: ROVSCADAENGINEER, originally posted: 2019-05-07 02:23:21 Id:425 I am trying to pass a pulse to a pulse point and am not sure how to do this in VBA. the script is attached here. !((see attachments below) qa/iitgj87l9sye.png "")
I understand that with points you just write a vale to the CurrentValue as either 0 or 1. but I have not been able to figure this out for pulse points.
Reply User: JesseChamberlain, posted: 2019-05-07 04:02:52 You need to use the relevant control method, look it up in the schema.
As far as I know of the top of my head, it's only internal points that you can use CurrentValue, since the control method happens to have the same name as the method.
Reply User: ROVSCADAENGINEER, posted: 2019-05-07 04:22:17 Cheers jesse! I ended up figuring it out. the solution code is below.
If Not(SQL.Error) Then '
If ToggleCount 1 Then iResponse = MsgBox ("You are about to reset the pump when there has already been " _ & ToggleCount & " resets this week! Actuating consecutive resets may cause damage to the pump motor. Please request a work order for the site to inspect pump",_ vbExclamation + vbOKCancel + vbDefaultButton1, "Warning")
If iResponse2 = vbOK Then objPoint.interface.control Active MsgBox "Pump Reset" Else MsgBox "Reset Canceled" End If
Else objPoint.interface.control Active MsgBox "Pump Reset" End If
If SQL.Error Then MsgBox SQL.ErrorMessage, vbCritical + vbOKOnly, "Error in SQL Command" End If End If
Reply User: geoffpatton, posted: 2019-05-07 14:05:59 Should still be able to write a number to it, Outputs states are Base 0. At least when I control DNP Pulse Null points I write a 0 to objPoint.interface.control and Trip Close points are 0 and 1.