Back

Topic

[KB664]VBA and SCADA BASIC function integration

Tags: Scada Basic, Scripting, VBA

11 years ago
By FC
Options
Print
Applies to:

PcVue version 8.20 onwards


Summary:

The Configure / Project / Settings / Run User Programs // Before initialization // After initialization properties – used to execute SCADA Basic code at startup doesn’t take into account the status of VBA.


Details:

If it’s required that some SCADA Basic programs interact with VBA code at startup, it’s advisable to start the SCADA Basic programs only after the loading of VBA is complete.

In order to do so:

  • Create a new PcVue CMD variable (Bit with Command option) called, for iexample, GENERAL.VBAStartupCompleted.
  • Open the VBA editor and select Main/WorksSpace/PcVue Objects/ThisProject in the treeview window.
  • In the dropdown menu located up/right, choose fvProject and StartupComplete.
  • Add – [NameOfTheSVVariable] = 1 ;
    In our example – [GENERAL.VBAStartupCompleted] = 1

vba1

It’s then possible to create a PcVue event (Configure/Action/Events menu), triggered by the GENERAL.VBAStartupCompleted variable, to initialize and launch the SCADA Basic code.

 


Created on: 09 Sep 2013 Last update: 13 May 2024