Simulate Property (AApp) |
Version 9 |
Returns or sets the current process simulation mode.
Object.Simulate [ = bSimulate]
The UutCount property syntax has the following parts:
Name |
Type |
Description |
Object |
AApp |
AApp object |
bSimulate |
Bool |
Simulation mode: True - simulation is turned on, False for simulation turned off. Default is False. |
When running from the IDE the Simulate property gets its initial value from the IDE Conditions, Simulate menu item. If the menu item is checked the Simulate property will be set to True.
Turning on simulation will cause ATEasy to not skip interface (such as COM, GPIB, etc) initialization. The interface is automatically initialize on demand when a function requesting to send or receive data using the interface is used. Simulated function that are redirected to OnSimulate event and not get called will not cause interface initialization. This will result is the user ability to run the application even though no interface is installed.
See the Simulation topic for more information about application simulation.
The following example check if simulation is ON and if not, it prompt the user to enable simulation. If the simulation is enabled, it will select the simulated procedures using SetSimulateProcedures procedure:
Procedure OnInit(): Void
--------------------------------------------------------------------------------
{
if App.Simulate=False
if MsgBox("This example shows how to use ATEasy 9 Simulation.\r\n" \
"The example program simulate Agilent 34401A DMM and the Language example.\r\n" \
"When running with Simulate flag turn ON, set from ATEasty conditions menu, \r\n" \
"It will call the OnSimulate() event instead of calling the actual instrument driver calls.\r\n" \
"Missing hardware interfaces/instruments will not generate any errors.\r\n\r\n" \
"Do you want to turn On the simulation?\r\n", aMsgYesNo)=aIdYes
! turn on simulations, same as selecting Simulate from the Conditions menu
TestExec Execution SetSimulation (True) ! similar to app.Simulate=True
endif
endif
! Select what to simulate
! code to handle these reside in OnSimulate of this driver! code to handle these reside in OnSimulate of this driver
if App.Simulate
! simulate all the DMM procedures and IO Tables
SetSimulateProcedures("DMM.IOTables") ! all DMM driver IO Tables
endif
}
Simulation, SetSimulateProcedures