COM Automation API
Overview
Start with the generated Overview page for the top-level API introduction and examples.
Start with the generated Overview page for the top-level API introduction and examples.
GWv4 supports automation via a COM interface.
There is a dual interface; GWv4 can be automated by both an IDispatch style interface which supports late-binding languages such as Javascript and additionally via direct v-table style interfaces.
Interfaces:
IGWv4Application
IGWv4FileOptions
IGWv4Job
IGWv4PCLogging
IGWv4PCLoggingExport
IGWv4Ports
IGWv4Script
IGWv4ScriptFunction
IGWv4EcuObject2
See the IGWv4Application documentation for code examples.
The following classes are available:
COM Application object. Supports the IGWv4Application and IDispatch interfaces.
Member GWv4::IGWv4PCLogging::AppendParameter ([in] BSTR name, [out, retval] BOOL *retval)use AppendChannel. Channels were called ‘parameters’ in versions prior to 4.03.20. Member GWv4::IGWv4PCLogging::ClearParameterList ()use ClearChannelList. Channels were called ‘parameters’ in versions prior to 4.03.20. Member GWv4::IGWv4PCLogging::GetParameter ([in] unsigned int index, [out, retval] BSTR *retval)use GetChannel. Channels were called ‘parameters’ in versions prior to 4.03.20. Member GWv4::IGWv4PCLogging::GetParameterUpdateRateCode ([in] unsigned int index, [out, retval] int *rate)use GetChannelUpdateRateCode. Channels were called ‘parameters’ in versions prior to 4.03.20. Member GWv4::IGWv4PCLogging::ParameterCountuse ChannelCount. Channels were called ‘parameters’ in versions prior to 4.03.20. Member GWv4::IGWv4PCLogging::RemoveParameter ([in] unsigned int index, [out, retval] BOOL *retval)use RemoveChannel. Channels were called ‘parameters’ in versions prior to 4.03.20. Member GWv4::IGWv4PCLogging::SetParameter ([in] unsigned int index, [in] BSTR name, [out, retval] BOOL *retval)use SetChannel. Channels were called ‘parameters’ in versions prior to 4.03.20. Member GWv4::IGWv4PCLogging::SetParameterUpdateRateCode ([in] unsigned int index, [in] int rate)use SetChannelUpdateRateCode. Channels were called ‘parameters’ in versions prior to 4.03.20. Member GWv4::IGWv4PCLoggingExport::ChannelCount- use ChannelCount Member GWv4::IGWv4PCLoggingExport::GetParameter ([in] unsigned int index, [out, retval] BSTR *retval)- use GetChannel. Channels were called ‘parameters’ in versions prior to 4.03.20. Member GWv4::IGWv4PCLoggingExport::GetParameterExportRate ([in] unsigned int index, [out, retval] GWv4StfChannelRate *rate)- use GetParameterExportRate. Channels were called ‘parameters’ in versions prior to 4.03.20. Member GWv4::IGWv4PCLoggingExport::ParameterCount- use ChannelCount. Channels were called ‘parameters’ in versions prior to 4.03.20. Member GWv4::IGWv4PCLoggingExport::SetParameterExportRate ([in] unsigned int index, [in] GWv4StfChannelRate rate)- use SetChannelExportRate. Channels were called ‘parameters’ in versions prior to 4.03.20.
The following files are available:
Browse the API reference by owner or alphabetically.
Total functions: 106
Total functions: 106
| Function | Description |
|---|---|
| Refresh([out, retval] IGWv4Job **job) | Start a one-shot read of the whole object from the ECU. |
| Function | Description |
|---|---|
| Cancel(void) | Cancels the Job. |
| Wait(void) | Wait for the Job to complete. |
| Function | Description |
|---|---|
| GetProperty([in] BSTR name, [out, retval] VARIANT *retval) | |
| SetProperty([in] BSTR name, [in] VARIANT value) | properties are made available by the IDispatch interface (late-binding). |
| Function | Description |
|---|---|
| AddMarker() | Add a marker to the log at the current point in time. |
| AppendChannel([in] BSTR name, [out, retval] BOOL *retval) | Set name of the channel at the specified index in the PC logging list. |
| AppendParameter([in] BSTR name, [out, retval] BOOL *retval) | Set name of the channel at the specified index in the PC logging list. |
| ClearChannelList() | Remove all channels from the PC logging list. |
| ClearParameterList() | Remove all channel from the PC logging list. |
| CloseTab() | Close the PC logging tab. |
| CreateExporter([in] BSTR filename, [out, retval] IGWv4PCLoggingExport **exporter) | Create a PC logging exporter. |
| CreateTab([in] BOOL focus_tab) | Adds the PC logging tab to the GWv4 UI. |
| GetChannel([in] unsigned int index, [out, retval] BSTR *retval) | Get name of the channel at the specified index in the PC logging list. |
| GetChannelUpdateRateCode([in] unsigned int index, [out, retval] int *rate) | Get the update rate of the channel at the specified index in the PC logging list. |
| GetParameter([in] unsigned int index, [out, retval] BSTR *retval) | Get name of the channel at the specified index in the PC logging list. |
| GetParameterUpdateRateCode([in] unsigned int index, [out, retval] int *rate) | Get the update rate of the channel at the specified index in the PC logging list. |
| RemoveChannel([in] unsigned int index, [out, retval] BOOL *retval) | Set name of the channel at the specified index in the PC logging list. |
| RemoveParameter([in] unsigned int index, [out, retval] BOOL *retval) | Set name of the channel at the specified index in the PC logging list. |
| SetChannel([in] unsigned int index, [in] BSTR name, [out, retval] BOOL *retval) | Set name of the channel at the specified index in the PC logging list. |
| SetChannelUpdateRateCode([in] unsigned int index, [in] int rate) | Set the update rate of the channel at the specified index in the PC logging list. |
| SetParameter([in] unsigned int index, [in] BSTR name, [out, retval] BOOL *retval) | Set name of the channel at the specified index in the PC logging list. |
| SetParameterUpdateRateCode([in] unsigned int index, [in] int rate) | Set the update rate of the channel at the specified index in the PC logging list. |
| Start([in] BSTR filename, [out, retval] BSTR *output_file) | Starts PC logging to the given output GLO file. |
| Stop([out, retval] BSTR *output_file) | Stops PC logging. |
| Function | Description |
|---|---|
| Export([in] BSTR filename, [in] IGWv4FileOptions *options, [out, retval] IGWv4Job **job) | Export the GLO file to STF format. |
| GetChannel([in] unsigned int index, [out, retval] BSTR *retval) | Get name of the channel at the specified index in the PC logging list. |
| GetChannelExportRate([in] unsigned int index, [out, retval] GWv4StfChannelRate *rate) | Get the update rate of the channel at the specified index in the PC logging list. |
| GetParameter([in] unsigned int index, [out, retval] BSTR *retval) | Get name of the channel at the specified index in the PC logging list. |
| GetParameterExportRate([in] unsigned int index, [out, retval] GWv4StfChannelRate *rate) | Get the update rate of the channel at the specified index in the PC logging list. |
| SetChannelExportRate([in] unsigned int index, [in] GWv4StfChannelRate rate) | Set the STF export rate of the channel at the specified index in the PC logging list. |
| SetParameterExportRate([in] unsigned int index, [in] GWv4StfChannelRate rate) | Set the STF export rate of the parameter at the specified index in the PC logging list. |
| Function | Description |
|---|---|
| GetPortDevice([in] unsigned int index, [out, retval] BSTR *retval) | Get device ID for the port at the specified index in the port list. |
| GetPortMemento([in] unsigned int index, [out, retval] BSTR *retval) | Get internal ‘memento’ for the port at the specified index in the port list. |
| GetPortName([in] unsigned int index, [out, retval] BSTR *retval) | Get friendly name of the port at the specified index in the port list. |
| GetPortType([in] unsigned int index, [out, retval] int *retval) | Get friendly name of the port at the specified index in the port list. |
| Refresh([in] BSTR typelist) | Refresh the ports list. Blocks execution until complete. |
| SelectPort([in] int type, [in] BSTR device, [out, retval] BOOL *retval) | Set the port for connecting with. The port must exist in the list. |
| Function | Description |
|---|---|
| Compile([in] BSTR script, [out, retval] BOOL *ok) | Compiles the given script. |
| CompileFile([in] BSTR script_file, [out, retval] BOOL *ok) | Compiles the given script file. |
| Execute([out, retval] VARIANT *ret) | Executes the given script. |
| GetFunction([in] BSTR name, [out, retval] IGWv4ScriptFunction **func) | Gets a handle to a function in the script, which can subsequently be called multiple times. |
| Function | Description |
|---|---|
| Bind([out, retval] int *ok) | Bind the function to the script if it was recompiled. |
| Call([in] SAFEARRAY(VARIANT) args, [out, retval] VARIANT *ret) | Calls the function (will automatically attempt to bind if not already done so or if the script was recompiled). If the function cannot be bound, this will result in an error E_INVALIDARG. |
IGWv4Application automation interface.
Instances supporting this interface may be created using the Application coclass.
e.g.
Javascript:
var obj = new ActiveXObject("GWv4.Application");VBScript:
Dim obj As Object
Set obj = CreateObject("GWv4.Application")C++, via C++ Interface:
::CoInitialize(NULL);
IGWv4Application* iface = 0;
HRESULT hr = ::CoCreateInstance(
CLSID_Application,
NULL,
CLSCTX_LOCAL_SERVER,
IID_IApplication,
(LPVOID*)&iface);
if (iface) {
iface->Show();
iface->Release();
}
::CoUninitialize();C++, via IDispatch:
::CoInitialize(NULL);
HRESULT hr;
CLSID clsid; // CLSID of ActiveX object.
LPUNKNOWN punk = NULL; // IUnknown of ActiveX object.
LPDISPATCH pdisp = NULL; // IDispatch of ActiveX object.
// Retrieve CLSID for GWv4.Application from the registry.
// This is {33AE968A-6D0E-4344-BB40-3A137209BA75} which could be
// used directly for better performance.
hr = CLSIDFromProgID(L"GWv4.Application", &clsid);
if (FAILED(hr)) {
return hr;
}
// Create an instance of the ActiveX object.
hr = CoCreateInstance(clsid, NULL, CLSCTX_SERVER,
IID_IUnknown, (void **)&punk);
if (FAILED(hr)) {
if (punk) punk->Release();
return hr;
}
hr = punk->QueryInterface(IID_IDispatch, (void **)&pdisp);
if (FAILED(hr)) {
punk->Release();
if (pdisp) pdisp->Release();
return hr;
}
punk->Release();
// << Use the dispatch interface..
pdisp->Release();
::CoUninitialize();| Property | Description |
|---|---|
| Visible | Displays/hides the Application UI. |
| FullScreen | Makes the window fullscreen (or not). |
| LastErrorString | Provides an error string describing the last method failure that occurred, if possible. |
| Session | Not yet implemented. |
| Tabs | Not yet implemented. |
| Ecu | Not yet implemented. |
| PCLogging | Gets an interface to PC logging features. |
| LogPlayback | Gets an interface to Log playback features. |
| Telemetry | Gets an interface for accessing/configuring CAN / Serial telemetry. Not implemented yet. |
| CalibrationNotes | Gets/Sets calibration notes. |
| IsEcuConnected | Determine if the ECU is connected (online). |
| TabCountTotal | Gets the number of tabs in the GWv4 UI. |
| CurrentBaudRate | Gets the number of tabs in the GWv4 UI. |
| HasActiveTransactions | Return number of active ECU Comms transations. |
| Function | Description |
|---|---|
| CreateFileOptions | Create an instance of IGWv4FileOptions that can be used to modify the behaviour of various functions that deal with files in one way or another. |
| CreateScript | Create an instance of IGWv4Script that can be used to compile and execute scripts within GWv4. |
| CreatePortList | Creates an interface for accessing/configuring the various ECU comms ports. |
| OpenCalibration | Opens the calibration file specified by ‘path’. |
| SaveCalibration | Saves the current calibration by its current file name. |
| SaveCalibrationAs | Saves the current calibration with a new file name. |
| CloseCalibration | Closes the currently open calibration. |
| InstallEcu | Installs the ECU definition file from the given path. |
| ConnectEcu | Connect to an ECU. |
| DisconnectEcu | Disconnect from the currently connected ECU (if any). |
| CreateOptionsMap | Create an instance of IDashOptionsMap that can be used to modify the behaviour of various functions that accept options. |
| InvokeAction | Invokes an action with the specified ID. |
| GenerateHelpInfo | Generate Help Information as JSON. |
| EnumerateWindows | Enumerate Windows in the application. |
| TakeScreenShot | Take a screenshot of a window or the whole application. |
| CloseWindow | Close a window (if possible). |
| FocusWindow | Focus & raise a window (if possible). |
| SetProperties | Set mutiple properties on a window / view. |
| GetProperties | Get all properties from a window / view. |
| SetProperty | Set a single property on a window / view. |
| GetProperty | Get a single property from a window / view. |
| LoadLayout | Load a layout (gxt) file. |
| SaveLayout | Save a layout (gxt) file. |
| ShowTab | Show the given tab. |
| CloseTab | Close the given tab. |
| SimulateEcu | Simulate an ECU. |
| SetSimulationProperty | Set a simulator property or Channel value. |
| Click | Simulate a mouse click. |
| Keyboard | Simulate a keyboard. |
| ClearEcuStatus | Clear ECU status messages. |
| AppendEcuStatus | Append to ECU status messages. |
| NewCalibration | Create a new calibration file using the given identity json string. |
| GetObject | Get an object of the specified type (e.g. Channel, Option, Map, Table). |
Displays/hides the Application UI.
BOOL VisibleThe UI will be hidden initially when creating an instance of GWv4.
Makes the window fullscreen (or not).
BOOL FullScreenSetting this value to TRUE causes the application window to take up the full screen without title bars etc.
When entering fullscreen mode via the COM Automation Interface, the popup ’toaster’ window giving users a way of exiting fullscreen mode is not displayed.
Provides an error string describing the last method failure that occurred, if possible.
BSTR LastErrorStringWhere appropriate, this string is also included in Error exception description strings as a result of IDispatch calls (e.g. when accessed via late binding as with JavaScript).
Not yet implemented.
IDispatch SessionIn future this will return an interface to the ‘Session’ object which will give access to data models etc.
Not yet implemented.
IDispatch TabsIn future this will return an interface that gives access/control of the list of tabs, tab groups, views within tabs etc.
Not yet implemented.
IDispatch EcuIn future this will return an interface that gives access/control of the ECU directly.
Gets an interface to PC logging features.
IGWv4PCLogging PCLoggingGets an interface to Log playback features.
IDispatch LogPlaybackGets an interface for accessing/configuring CAN / Serial telemetry. Not implemented yet.
IDispatch TelemetryGets/Sets calibration notes.
BSTR CalibrationNotesDetermine if the ECU is connected (online).
BOOL IsEcuConnectedThe GIN file should be loaded if this is ’true’. However, it is possible that the calibartion and/or tabs are not downloaded / loaded yet.
Gets the number of tabs in the GWv4 UI.
int TabCountTotalThis can be used as a basic check to see if the tabs have been loaded for the current session.
Gets the number of tabs in the GWv4 UI.
int CurrentBaudRateThis can be used as a basic check to see if the tabs have been loaded for the current session.
Return number of active ECU Comms transations.
BOOL HasActiveTransactionsWhen the connection is idle (but connected), this will be zero.
Create an instance of IGWv4FileOptions that can be used to modify the behaviour of various functions that deal with files in one way or another.
HRESULT CreateFileOptions([out, retval] IGWv4FileOptions **options)See Also: IGWv4FileOptions
Create an instance of IGWv4Script that can be used to compile and execute scripts within GWv4.
HRESULT CreateScript([out, retval] IGWv4Script **script)See Also: IGWv4Script
Creates an interface for accessing/configuring the various ECU comms ports.
HRESULT CreatePortList([out, retval] IGWv4Ports **retval)Opens the calibration file specified by ‘path’.
HRESULT OpenCalibration([in] BSTR path, [in] IGWv4FileOptions *options)Saves the current calibration by its current file name.
HRESULT SaveCalibration([in] IGWv4FileOptions *options)If the calibration does not have a file name then the behaviour of this function will depend upon the ‘options’ parameter and may not be saved as a result.
See IGWv4FileOptions::SaveModifiedDiscard and IGWv4FileOptions::SaveModifiedPrompt
Saves the current calibration with a new file name.
HRESULT SaveCalibrationAs([in] BSTR path, [in] IGWv4FileOptions *options)See IGWv4FileOptions::OverwriteAllow and IGWv4FileOptions::OverwriteSilent
Closes the currently open calibration.
HRESULT CloseCalibration([in] IGWv4FileOptions *options)In practice, currently the ‘options’ parameter has no effect on this function but has been added to support possible future changes to the application.
Installs the ECU definition file from the given path.
HRESULT InstallEcu([in] BSTR path)Connect to an ECU.
HRESULT ConnectEcu()Disconnect from the currently connected ECU (if any).
HRESULT DisconnectEcu()Create an instance of IDashOptionsMap that can be used to modify the behaviour of various functions that accept options.
HRESULT CreateOptionsMap([out, retval] IGWv4OptionsMap **options)It is also possible to use JavaScript objects for options instead of an options map.
See Also: IGWv4OptionsMap
Invokes an action with the specified ID.
HRESULT InvokeAction([in] BSTR action_id, [in, optional] VARIANT options)With the option “menuItem”, action_id instead chooses an item of the open popup menu: the labels of any sub menus and the item, separated by ‘|’, e.g. “Gauge Layout|Anchors/Positioning”.
Fails, with LastErrorString describing why, if the action is unknown.
Generate Help Information as JSON.
HRESULT GenerateHelpInfo([in, optional] VARIANT options, [out, retval] BSTR *result)The information as a JSON string. If outputFile is specified in options then the returned string will be blank.
If the ‘options’ parameter has a property ‘outputFile’ then the JSON will be written to that file instead of returned as a string.
Enumerate Windows in the application.
HRESULT EnumerateWindows([in, optional] VARIANT options, [out, retval] BSTR *result)The information as a JSON string.
The result is an object whose “windows” array lists the top level windows, or only the window chosen by the option “id”, “name”, “label” or “lastCreatedView”. Each window has “id”, “label”, “name”, “type”, “shown”, “visible” (shown along with all its parents), “helpId” and its position, with child windows in “windows”. Option “depth” limits the levels of child windows: 0 lists none, which is much faster. If the option “outputFile” is given, the JSON is written to that file instead.
Take a screenshot of a window or the whole application.
HRESULT TakeScreenShot([in, optional] VARIANT options, [out, retval] VARIANT *result)The information as a JSON string.
If the ‘options’ parameter has a property ‘outputFile’ then the screenshot will be output to that path instead of returned.
options can identify the window through one of the following keys:
Other options:
Screenshots of top-level windows include their drop shadow, with transparency. See the “captureMethod” property of SetProperty for screenshots of hidden windows.
Close a window (if possible).
HRESULT CloseWindow([in] VARIANT options, [out, retval] VARIANT *result)TRUE if OK, false otherwise. This is a variant for posssilbe future changes.
options:
Focus & raise a window (if possible).
HRESULT FocusWindow([in] VARIANT options)Additional options: movex: move window to x coordinate movey: move window to y coordinate
Set mutiple properties on a window / view.
HRESULT SetProperties([in] VARIANT options, [in] VARIANT props)Fails if any property is unknown or cannot be set.
Get all properties from a window / view.
HRESULT GetProperties([in] VARIANT options, [out, retval] VARIANT *result)a JSON string detailing the properties.
Set a single property on a window / view.
HRESULT SetProperty([in] VARIANT options, [in] BSTR name, [in] VARIANT value)If a window ID/name/label is not supplied, the main frame will be selected.
Special Properties:
Fails, with LastErrorString describing why, if the property is unknown or does not apply to the window.
Get a single property from a window / view.
HRESULT GetProperty([in] VARIANT options, [in] BSTR name, [out, retval] VARIANT *result)The property value.
Special properties
Load a layout (gxt) file.
HRESULT LoadLayout([in] BSTR path, [in, optional] VARIANT options)Save a layout (gxt) file.
HRESULT SaveLayout([in] BSTR path, [in, optional] VARIANT options)Show the given tab.
HRESULT ShowTab([in] VARIANT tab)Close the given tab.
HRESULT CloseTab([in] VARIANT tab)Simulate an ECU.
HRESULT SimulateEcu([in] VARIANT options)Set a simulator property or Channel value.
HRESULT SetSimulationProperty([in] VARIANT options)Simulator Properties:
Simulate a mouse click.
HRESULT Click([in] VARIANT options)Fails, without clicking, if the point is not in the visible part of the window or another window covers it. Otherwise the click could go to another application. Moves and releases are not checked, because a drag moves the mouse outside the window where it started.
Simulate a keyboard.
HRESULT Keyboard([in] VARIANT options)Clear ECU status messages.
HRESULT ClearEcuStatus([in, optional] VARIANT options)Append to ECU status messages.
HRESULT AppendEcuStatus([in] BSTR path, [in, optional] VARIANT options)Create a new calibration file using the given identity json string.
HRESULT NewCalibration([in] BSTR identity, [in, optional] VARIANT options)Get an object of the specified type (e.g. Channel, Option, Map, Table).
HRESULT GetObject([in] BSTR type, [in] BSTR name, [in, optional] VARIANT options, [out, retval] IGWv4EcuObject **ret)| Property | Description |
|---|---|
| Definition | Get interface to GIN file. |
| IsConnected | Determine if the ECU is connected (online). |
| Function | Description |
|---|---|
| Connect | Connect to an ECU. |
| Disconnect | Disconnect from the currently connected ECU (if any). |
| ReadCalibration | Read the calibration file from ECU and save to file specified by ‘path’. |
| WriteCalibration | Write a calibration file to ECU. |
| VerifyCalibration | Read the calibration file from ECU and check it matches the currently loaded calibration file. |
| ClearCalibrationToDefaults | Erase calibration file data from ECU and set values to defaults where defined. |
| ClearCalibrationToZero | Erase calibration file data from ECU and set values to zero. |
| ProgramFirmware | Program Firmware. |
| CheckNotRunningFlag | Check the ECU is not running. |
| StoreChanges | Programs the checksum in the ECU and causes calibration data to be stored in non-volatile memory (saved on ECU). |
| ReadEHL | Read the Engine History Log and write to file. |
| ReadEcuFile | Read file from ECU and write to disk. |
| WriteEcuFile | Load ECU file from disk and write to ECU. |
| EraseEcuFile | Erase file from ECU. |
| ReadLog | Read log from ECU. |
| EraseLog | Erase log from ECU. |
| ProgramGpsBeaconStartLine | Program GPS beacon start line. |
Get interface to GIN file.
IDispatch DefinitionDetermine if the ECU is connected (online).
BOOL IsConnectedThe GIN file should be loaded if this is ’true’. However, it is possible that the calibartion and/or tabs are not downloaded / loaded yet.
Connect to an ECU.
HRESULT Connect([in] IGWv4FileOptions *options)Disconnect from the currently connected ECU (if any).
HRESULT Disconnect([in] IGWv4FileOptions *options)Read the calibration file from ECU and save to file specified by ‘path’.
HRESULT ReadCalibration([in] BSTR path, [in] IGWv4FileOptions *options, [out, retval] IGWv4Job **job)see IGWv4FileOptions::overwriteallow and IGWv4FileOptions::overwritesilent
Write a calibration file to ECU.
HRESULT WriteCalibration([in] BSTR path, [in] IGWv4FileOptions *options, [out, retval] IGWv4Job **job)Read the calibration file from ECU and check it matches the currently loaded calibration file.
HRESULT VerifyCalibration([out, retval] IGWv4Job **job)Erase calibration file data from ECU and set values to defaults where defined.
HRESULT ClearCalibrationToDefaults([out, retval] IGWv4Job **job)Erase calibration file data from ECU and set values to zero.
HRESULT ClearCalibrationToZero([out, retval] IGWv4Job **job)Program Firmware.
HRESULT ProgramFirmware([in] BSTR path, [out, retval] IGWv4Job **job)Check the ECU is not running.
HRESULT CheckNotRunningFlag([out, retval] IGWv4Job **job)Programs the checksum in the ECU and causes calibration data to be stored in non-volatile memory (saved on ECU).
HRESULT StoreChanges([out, retval] IGWv4Job **job)Read the Engine History Log and write to file.
HRESULT ReadEHL([in] BSTR path, [out, retval] IGWv4Job **job)Read file from ECU and write to disk.
HRESULT ReadEcuFile([in] int type, [in] BSTR path, [out, retval] IGWv4Job **job)Load ECU file from disk and write to ECU.
HRESULT WriteEcuFile([in] int type, [in] BSTR path, [out, retval] IGWv4Job **job)Erase file from ECU.
HRESULT EraseEcuFile([in] int type, [out, retval] IGWv4Job **job)Read log from ECU.
HRESULT ReadLog([in] BSTR path, [out, retval] IGWv4Job **job)Erase log from ECU.
HRESULT EraseLog([out, retval] IGWv4Job **job)Program GPS beacon start line.
HRESULT ProgramGpsBeaconStartLine([in] double start_longitude, [in] double start_latitude, [in] double end_longitude, [in] double end_latitude, [in] double heading_radians, [out, retval] IGWv4Job **job)| Property | Description |
|---|---|
| AxisCount | Get number of axes. |
| SiteCount | Get total number of sites. |
| Index | Index, index of the object in the collection of similarly typed objects. |
| Name | Name of the object. |
| Description | Description, description of the object. |
| Units | Units of the object. |
| ElementSize | Element size, in bytes. |
| Address | Address, address of the object. |
| IsBit | IsBit, true if object is a single bit. |
| IsReadOnly | IsReadOnly, true if object is read only. |
| IsSigned | IsSigned, true if object is signed. |
| MaxRaw | MaxRaw, maximum raw value. |
| MinRaw | MinRaw, minimum raw value. |
| MaxReal | MaxReal, maximum real value. |
| MinReal | MinReal, minimum real value. |
| Function | Description |
|---|---|
| GetReal | Get the real value of the object. |
| SetReal | Set the real value of the object. |
| GetRaw | Get the raw value of the object. |
| SetRaw | Set the raw value of the object. |
| GetString | Get the string value of the object. |
| SetString | Set the string value of the object. |
| GetAxis | Get object representing the specified axis. |
| GetAttribute | Get attribute with given name. |
| HasAttribute | Determine if attribute exists. |
| RawFromReal | Convert real value to raw value. |
| RealFromRaw | Convert raw value to real value. |
| StringFromRaw | Convert raw value to string value. |
Get number of axes.
int AxisCountGet total number of sites.
int SiteCountIndex, index of the object in the collection of similarly typed objects.
int IndexName of the object.
BSTR NameDescription, description of the object.
BSTR DescriptionUnits of the object.
BSTR UnitsElement size, in bytes.
int ElementSizeAddress, address of the object.
long AddressFor A2L files, this includes the address extension in the upper 32 bits.
IsBit, true if object is a single bit.
VARIANT_BOOL IsBitIsReadOnly, true if object is read only.
VARIANT_BOOL IsReadOnlyIsSigned, true if object is signed.
VARIANT_BOOL IsSignedMaxRaw, maximum raw value.
VARIANT MaxRawMinRaw, minimum raw value.
VARIANT MinRawMaxReal, maximum real value.
VARIANT MaxRealMinReal, minimum real value.
VARIANT MinRealGet the real value of the object.
HRESULT GetReal([in, optional] VARIANT *axes, [out, retval] VARIANT *value)Set the real value of the object.
HRESULT SetReal([in] VARIANT value, [in, optional] VARIANT *axes)Get the raw value of the object.
HRESULT GetRaw([in, optional] VARIANT *axes, [out, retval] VARIANT *value)Set the raw value of the object.
HRESULT SetRaw([in] VARIANT value, [in, optional] VARIANT *axes)Get the string value of the object.
HRESULT GetString([in, optional] VARIANT *axes, [out, retval] BSTR *value)Set the string value of the object.
HRESULT SetString([in] VARIANT value, [in, optional] VARIANT *axes)Get object representing the specified axis.
HRESULT GetAxis([in] unsigned int axis, [out, retval] IGWv4EcuObject **value)Get attribute with given name.
HRESULT GetAttribute([in] VARIANT name, [out, retval] BSTR *result)Determine if attribute exists.
HRESULT HasAttribute([in] VARIANT name, [out, retval] BOOL *result)Convert real value to raw value.
HRESULT RawFromReal([in] VARIANT real, [in, optional] VARIANT *axes, [out, retval] VARIANT *raw)Convert raw value to real value.
HRESULT RealFromRaw([in] VARIANT raw, [in, optional] VARIANT *axes, [out, retval] VARIANT *real)Convert raw value to string value.
HRESULT StringFromRaw([in] VARIANT raw, [in, optional] VARIANT *axes, [out, retval] BSTR *result)ECU object access with a one-shot refresh from the connected ECU.
Extends IGWv4EcuObject without changing its published interface. GetObject and GetAxis return objects supporting both interfaces. GetReal, GetRaw and GetString read cached values and do not request ECU data.
JavaScript (Windows Script Host):
// The application must already have the required setup open and ECU connected.
var object = app.GetObject("String", "Your string name");
var job = object.Refresh();
job.Wait(); // Throws if the read failed. Alternatively, poll Completed and check Failed.
WScript.Echo(object.GetString());| Function | Description |
|---|---|
| Refresh | Start a one-shot read of the whole object from the ECU. |
Start a one-shot read of the whole object from the ECU.
HRESULT Refresh([out, retval] IGWv4Job **job)Check the job’s completion status before reading the cached value. This does not enable continuous polling or write values to the ECU.
Interface for configuring file control options for use with various file-based functions in the COM API.
| Property | Description |
|---|---|
| OverwriteAllow | Allow file overwrites. |
| OverwriteSilent | Silently ovewrite files. |
| SaveModifiedDiscard | Silently discard modified files. |
| SaveModifiedPrompt | Prompt to save modified files. |
| UpdateRecentFiles | Control whether or not file will be added to recent file lists (displayed in application file menu). |
Allow file overwrites.
BOOL OverwriteAllowIf FALSE, the attempting to overwrite existing files will silently fail.
The operation in question should return a failure code.
Default: FALSE.
Silently ovewrite files.
BOOL OverwriteSilentIf TRUE, files will be silently overwritten.
Otherwise a dialog box will be displayed.
Has no effect if (OverwriteAllow == FALSE).
Default: TRUE.
Silently discard modified files.
BOOL SaveModifiedDiscardIf TRUE, closing of modified files/projects will be sliently discared.
Default: TRUE.
Prompt to save modified files.
BOOL SaveModifiedPromptIf TRUE, closing of modified files/projects will be prompted for saving with a dialog box.
Has no effect if (SaveModifiedDiscard == TRUE).
Default: FALSE.
Control whether or not file will be added to recent file lists (displayed in application file menu).
BOOL UpdateRecentFilesIf TRUE, places opened/saved files on recent file lists.
Default: FALSE.
Interface for controlling and monitoring the progress of asynchronous Jobs/Tasks.
e.g. Javascript:
var gda = new ActiveXObject("GWv4.Application");
if (gda) {
var fileopt = gda.CreateFileOptions();
var job = gda.ImportLog(
"C:\\Folder\\text_data.csv",
"C:\\Folder\\text_data_import.stf",
"C:\\Folder\\import_template.gdasvtemp",
fileopt
);
while (!job.Completed) {
var prog = (job.Progress * 100) + "%";
WScript.StdOut.WriteLine(prog);
WScript.Sleep(500);
}
WScript.StdOut.WriteLine("Completed.");
if (job.Error && job.Error.length) {
WScript.StdOut.WriteLine("Error: " + job.Error);
}
}| Property | Description |
|---|---|
| Progress | Gets the progress of the Job as a value between 0.0 and 1.0 inclusive. |
| Completed | Indicates if the Job has completed. |
| Failed | Indicates if the Job failed. |
| Error | Gets the error status of the Job. |
| AllMessages | Gets a newline-separated string containing all messages generated by the Job. |
| Function | Description |
|---|---|
| Cancel | Cancels the Job. |
| Wait | Wait for the Job to complete. |
Gets the progress of the Job as a value between 0.0 and 1.0 inclusive.
double ProgressIndicates if the Job has completed.
BOOL CompletedCheck the Error property to determine if there was a failure.
Indicates if the Job failed.
BOOL FailedSee Also: Error
Gets the error status of the Job.
BSTR ErrorThis string will be empty of the Job completed without errors.
See Also: Failed
Gets a newline-separated string containing all messages generated by the Job.
BSTR AllMessagesCancels the Job.
HRESULT Cancel(void)Wait for the Job to complete.
HRESULT Wait(void)This will block until the job is completed. Note that this will run the main application event loop from within the wait subroutine - so if the user interface is displayed then the user may still be able to interact with the application.
Interface for configuring file control options for use with various file-based functions in the COM API.
| Function | Description |
|---|---|
| GetProperty | |
| SetProperty | properties are made available by the IDispatch interface (late-binding). |
HRESULT GetProperty([in] BSTR name, [out, retval] VARIANT *retval)properties are made available by the IDispatch interface (late-binding).
HRESULT SetProperty([in] BSTR name, [in] VARIANT value)Interface for access to PC logging features.
| Property | Description |
|---|---|
| Running | Get/Set running state. |
| LogFolder | Get/Set log folder. |
| FileNameFormat | Get/Set filename format. |
| ParameterCount | Get number of channels in the PC logging list. |
| ChannelCount | Get the number of items/channels in the logging list. |
| Function | Description |
|---|---|
| CreateTab | Adds the PC logging tab to the GWv4 UI. |
| CloseTab | Close the PC logging tab. |
| Start | Starts PC logging to the given output GLO file. |
| Stop | Stops PC logging. |
| AddMarker | Add a marker to the log at the current point in time. |
| GetParameter | Get name of the channel at the specified index in the PC logging list. |
| SetParameter | Set name of the channel at the specified index in the PC logging list. |
| AppendParameter | Set name of the channel at the specified index in the PC logging list. |
| RemoveParameter | Set name of the channel at the specified index in the PC logging list. |
| GetParameterUpdateRateCode | Get the update rate of the channel at the specified index in the PC logging list. |
| SetParameterUpdateRateCode | Set the update rate of the channel at the specified index in the PC logging list. |
| ClearParameterList | Remove all channel from the PC logging list. |
| CreateExporter | Create a PC logging exporter. |
| GetChannel | Get name of the channel at the specified index in the PC logging list. |
| SetChannel | Set name of the channel at the specified index in the PC logging list. |
| AppendChannel | Set name of the channel at the specified index in the PC logging list. |
| RemoveChannel | Set name of the channel at the specified index in the PC logging list. |
| GetChannelUpdateRateCode | Get the update rate of the channel at the specified index in the PC logging list. |
| SetChannelUpdateRateCode | Set the update rate of the channel at the specified index in the PC logging list. |
| ClearChannelList | Remove all channels from the PC logging list. |
Get/Set running state.
BOOL RunningGet/Set log folder.
BSTR LogFolderGet/Set filename format.
BSTR FileNameFormatGet number of channels in the PC logging list.
int ParameterCountDeprecateduse ChannelCount. Channels were called ‘parameters’ in versions prior to 4.03.20.
Get the number of items/channels in the logging list.
int ChannelCountAdds the PC logging tab to the GWv4 UI.
HRESULT CreateTab([in] BOOL focus_tab)Close the PC logging tab.
HRESULT CloseTab()Starts PC logging to the given output GLO file.
HRESULT Start([in] BSTR filename, [out, retval] BSTR *output_file)Stops PC logging.
HRESULT Stop([out, retval] BSTR *output_file)Add a marker to the log at the current point in time.
HRESULT AddMarker()Get name of the channel at the specified index in the PC logging list.
HRESULT GetParameter([in] unsigned int index, [out, retval] BSTR *retval)Deprecateduse GetChannel. Channels were called ‘parameters’ in versions prior to 4.03.20.
Set name of the channel at the specified index in the PC logging list.
HRESULT SetParameter([in] unsigned int index, [in] BSTR name, [out, retval] BOOL *retval)Deprecateduse SetChannel. Channels were called ‘parameters’ in versions prior to 4.03.20.
List is automatically extended and setting an empty name removes the item.
Set name of the channel at the specified index in the PC logging list.
HRESULT AppendParameter([in] BSTR name, [out, retval] BOOL *retval)Deprecateduse AppendChannel. Channels were called ‘parameters’ in versions prior to 4.03.20.
List is automatically extended and setting an empty name removes the item.
Set name of the channel at the specified index in the PC logging list.
HRESULT RemoveParameter([in] unsigned int index, [out, retval] BOOL *retval)Deprecateduse RemoveChannel. Channels were called ‘parameters’ in versions prior to 4.03.20.
List is automatically extended and setting an empty name removes the item.
Get the update rate of the channel at the specified index in the PC logging list.
HRESULT GetParameterUpdateRateCode([in] unsigned int index, [out, retval] int *rate)Deprecateduse GetChannelUpdateRateCode. Channels were called ‘parameters’ in versions prior to 4.03.20.
Set the update rate of the channel at the specified index in the PC logging list.
HRESULT SetParameterUpdateRateCode([in] unsigned int index, [in] int rate)Deprecateduse SetChannelUpdateRateCode. Channels were called ‘parameters’ in versions prior to 4.03.20.
Note that the update rate is dependent upon the overall channel update rate and is relative to the fastest channel being updated.
Remove all channel from the PC logging list.
HRESULT ClearParameterList()Deprecateduse ClearChannelList. Channels were called ‘parameters’ in versions prior to 4.03.20.
Create a PC logging exporter.
HRESULT CreateExporter([in] BSTR filename, [out, retval] IGWv4PCLoggingExport **exporter)Get name of the channel at the specified index in the PC logging list.
HRESULT GetChannel([in] unsigned int index, [out, retval] BSTR *retval)Set name of the channel at the specified index in the PC logging list.
HRESULT SetChannel([in] unsigned int index, [in] BSTR name, [out, retval] BOOL *retval)List is automatically extended and setting an empty name removes the item.
Set name of the channel at the specified index in the PC logging list.
HRESULT AppendChannel([in] BSTR name, [out, retval] BOOL *retval)List is automatically extended and setting an empty name removes the item.
Set name of the channel at the specified index in the PC logging list.
HRESULT RemoveChannel([in] unsigned int index, [out, retval] BOOL *retval)List is automatically extended and setting an empty name removes the item.
Get the update rate of the channel at the specified index in the PC logging list.
HRESULT GetChannelUpdateRateCode([in] unsigned int index, [out, retval] int *rate)Set the update rate of the channel at the specified index in the PC logging list.
HRESULT SetChannelUpdateRateCode([in] unsigned int index, [in] int rate)Note that the update rate is dependent upon the overall channel update rate and is relative to the fastest channel being updated.
Remove all channels from the PC logging list.
HRESULT ClearChannelList()Interface for access to PC logging features.
| Property | Description |
|---|---|
| FileName | Get/Set log folder. |
| ParameterCount | Get the number of channels in the logging list. |
| ChannelCount | Get the number of channels in the logging list. |
| Function | Description |
|---|---|
| GetParameter | Get name of the channel at the specified index in the PC logging list. |
| GetParameterExportRate | Get the update rate of the channel at the specified index in the PC logging list. |
| SetParameterExportRate | Set the STF export rate of the parameter at the specified index in the PC logging list. |
| Export | Export the GLO file to STF format. |
| GetChannel | Get name of the channel at the specified index in the PC logging list. |
| GetChannelExportRate | Get the update rate of the channel at the specified index in the PC logging list. |
| SetChannelExportRate | Set the STF export rate of the channel at the specified index in the PC logging list. |
Get/Set log folder.
BSTR FileNameGet the number of channels in the logging list.
int ParameterCountDeprecated
Get the number of channels in the logging list.
int ChannelCountDeprecated
Get name of the channel at the specified index in the PC logging list.
HRESULT GetParameter([in] unsigned int index, [out, retval] BSTR *retval)Deprecated
Get the update rate of the channel at the specified index in the PC logging list.
HRESULT GetParameterExportRate([in] unsigned int index, [out, retval] GWv4StfChannelRate *rate)Deprecated
Set the STF export rate of the parameter at the specified index in the PC logging list.
HRESULT SetParameterExportRate([in] unsigned int index, [in] GWv4StfChannelRate rate)Deprecated
Export the GLO file to STF format.
HRESULT Export([in] BSTR filename, [in] IGWv4FileOptions *options, [out, retval] IGWv4Job **job)Get name of the channel at the specified index in the PC logging list.
HRESULT GetChannel([in] unsigned int index, [out, retval] BSTR *retval)Get the update rate of the channel at the specified index in the PC logging list.
HRESULT GetChannelExportRate([in] unsigned int index, [out, retval] GWv4StfChannelRate *rate)Set the STF export rate of the channel at the specified index in the PC logging list.
HRESULT SetChannelExportRate([in] unsigned int index, [in] GWv4StfChannelRate rate)Interface for access to PC logging features.
{75585FDE-457A-41C7-A96F-C4A94F86381B}
| Property | Description |
|---|---|
| Length | Get/Set filename format. |
| SelectedPortMemento | Get/Set the selected port memento to select a port for connecting with. |
| Baudrate | Get/Set the baudrate for the selected port. |
| CanRXID | Get/Set the CAN RX ID for the selected port. |
| CanTXID | Get/Set the CAN TX ID for the selected port. |
| CanExtendedIDs | Get/Set the CAN Extended IDs option for the selected port. |
| EthernetTimeoutAdjust | Get/Set the Ethernet timeout ajustment. |
| Function | Description |
|---|---|
| Refresh | Refresh the ports list. Blocks execution until complete. |
| GetPortName | Get friendly name of the port at the specified index in the port list. |
| GetPortType | Get friendly name of the port at the specified index in the port list. |
| GetPortMemento | Get internal ‘memento’ for the port at the specified index in the port list. |
| GetPortDevice | Get device ID for the port at the specified index in the port list. |
| SelectPort | Set the port for connecting with. The port must exist in the list. |
Get/Set filename format.
int LengthGet/Set the selected port memento to select a port for connecting with.
BSTR SelectedPortMementoGet/Set the baudrate for the selected port.
int BaudrateGet/Set the CAN RX ID for the selected port.
int CanRXIDGet/Set the CAN TX ID for the selected port.
int CanTXIDGet/Set the CAN Extended IDs option for the selected port.
BOOL CanExtendedIDsGet/Set the Ethernet timeout ajustment.
int EthernetTimeoutAdjustRefresh the ports list. Blocks execution until complete.
HRESULT Refresh([in] BSTR typelist)COM GSB USB Simulator FTDI HID PCAN Ethernet ShiftecCAN
Get friendly name of the port at the specified index in the port list.
HRESULT GetPortName([in] unsigned int index, [out, retval] BSTR *retval)Get friendly name of the port at the specified index in the port list.
HRESULT GetPortType([in] unsigned int index, [out, retval] int *retval)Get internal ‘memento’ for the port at the specified index in the port list.
HRESULT GetPortMemento([in] unsigned int index, [out, retval] BSTR *retval)Get device ID for the port at the specified index in the port list.
HRESULT GetPortDevice([in] unsigned int index, [out, retval] BSTR *retval)Set the port for connecting with. The port must exist in the list.
HRESULT SelectPort([in] int type, [in] BSTR device, [out, retval] BOOL *retval)false if port was not found in the list.
port types: COM = 0, GSB = 1 USB = 2 SIM = 3 FTDI = 4 HID = 5 PCAN = 6 Ethernet = 7
Note that COM port device strings should be in the format:
\\.\COM1Interface for compiling and executing scripts within GWv4.
| Property | Description |
|---|---|
| LastError | Gets the last error that occurred as a string. |
| LastErrorCode | Gets the last error that occurred as a numerical code. |
| Function | Description |
|---|---|
| Compile | Compiles the given script. |
| Execute | Executes the given script. |
| GetFunction | Gets a handle to a function in the script, which can subsequently be called multiple times. |
| CompileFile | Compiles the given script file. |
Gets the last error that occurred as a string.
BSTR LastErrorGets the last error that occurred as a numerical code.
int LastErrorCodeCompiles the given script.
HRESULT Compile([in] BSTR script, [out, retval] BOOL *ok)Executes the given script.
HRESULT Execute([out, retval] VARIANT *ret)The script must be compiled first.
Gets a handle to a function in the script, which can subsequently be called multiple times.
HRESULT GetFunction([in] BSTR name, [out, retval] IGWv4ScriptFunction **func)The script must be compiled + executed first.
If the script is recompiled / executed then any exsiting function
Compiles the given script file.
HRESULT CompileFile([in] BSTR script_file, [out, retval] BOOL *ok)Interface for calling functions within scripts.
| Function | Description |
|---|---|
| Bind | Bind the function to the script if it was recompiled. |
| Call | Calls the function (will automatically attempt to bind if not already done so or if the script was recompiled). If the function cannot be bound, this will result in an error E_INVALIDARG. |
Bind the function to the script if it was recompiled.
HRESULT Bind([out, retval] int *ok)0 if the function name does not exist or the script is invalid.
Calls the function (will automatically attempt to bind if not already done so or if the script was recompiled). If the function cannot be bound, this will result in an error E_INVALIDARG.
HRESULT Call([in] SAFEARRAY(VARIANT) args, [out, retval] VARIANT *ret)The following namespaces are available:
brief GWv4 COM automation library.
| Enumeration | Description |
|---|---|
| GWv4StfChannelRate | Enumeration of plot modes (distance/time relative plotting). |
| Typedef | Description |
|---|---|
| IComApplication | |
| IComFileOptions | |
| IComJob | |
| IComPCLogging | |
| IComPCLoggingExport | |
| IComPorts | |
| IComScript | |
| IComScriptFunction | |
| IComOptionsMap | |
| IComEcu | |
| IComEcuObject | |
| IComEcuObject2 | |
| GWv4StfChannelRate | Enumeration of plot modes (distance/time relative plotting). |
| ComStfChannelRate |
Enumeration of plot modes (distance/time relative plotting).
Values:
typedef IGWv4Application GWv4::IComApplicationtypedef IGWv4FileOptions GWv4::IComFileOptionstypedef IGWv4Job GWv4::IComJobtypedef IGWv4PCLogging GWv4::IComPCLoggingtypedef IGWv4PCLoggingExport GWv4::IComPCLoggingExporttypedef IGWv4Ports GWv4::IComPortstypedef IGWv4Script GWv4::IComScripttypedef IGWv4ScriptFunction GWv4::IComScriptFunctiontypedef IGWv4OptionsMap GWv4::IComOptionsMaptypedef IGWv4Ecu GWv4::IComEcutypedef IGWv4EcuObject GWv4::IComEcuObjecttypedef IGWv4EcuObject2 GWv4::IComEcuObject2Enumeration of plot modes (distance/time relative plotting).
typedef enum GWv4::GWv4StfChannelRate GWv4::GWv4StfChannelRatetypedef GWv4StfChannelRate GWv4::ComStfChannelRateNo documented data types were found.