> For the complete documentation index, see [llms.txt](https://docs.videc.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.videc.de/june5-3.7/en/datenquellenunterstuetzung-und-einbindung/honeywell-experion-batch-heb/zusaetze.md).

# Add-ons

In case of errors, a simple diagnosis can be performed on the Honeywell database using PowerShell. PowerShell is part of the Windows operating system.

PowerShell Quick Introduction

1. To use PowerShell, launch the IDE. (Run as Administrator)

C:\Windows\system32\WindowsPowerShell\v1.0\PowerShell\_ISE.exe

{% hint style="info" %}
There are 32-bit and 64-bit variants!
{% endhint %}

2. The following command must be executed to allow PowerScript execution:

Set-ExecutionPolicy Unrestricted

Confirm the message with "Yes". Windows now allows the execution of PowerScripts.

To test the scripts below, copy the code into a file with the .ps1 extension

This file can then be executed in the PowerShell application (ISE).

|   |   |
| - | - |

\| <p># PowerShell Script</p><p># A simple query on a Honeywell Procedure Analyst SQL Server</p><p>Function Main{</p><p># Define SQL Server</p><p>$SQLServer = "ServerHWE"</p><p>$SQLDBName = "ProcedureAnalyst"</p><p>$uid ="Admin"</p><p>$pwd = "#june5"</p><p># Step 1: Query all databases</p><p>$sql1 = @"</p><p>SELECT \* FROM sys.databases</p><p>"@</p><p># Step 2: Query all events</p><p>$sql2 = @"</p><p>SELECT TOP 50</p><p>\[PROCEDURAL\_ELEMENT\_EXECUTION].\[STARTTIME] AS \[StartTime],</p><p>\[PROCEDURAL\_ELEMENT\_EXECUTION].\[ENDTIME] AS \[EndTime],</p><p>\[PROCEDURAL\_ELEMENT\_EXECUTION].\[USERPROCEDUREID] AS \[LotNumber],</p><p>\[EQUIPMENT].\[FULLNAME] AS \[Namespace],</p><p>\[EQUIPMENT].\[NAME] AS \[ItemName],</p><p>\[EQUIPMENT].\[EQUIPMENTLEVELNAME] AS \[EquipmentName],</p><p>\[PROCEDURAL\_ELEMENT].\[FULLNAME] AS \[ProceduralPath],</p><p>\[PROCEDURAL\_ELEMENT].\[PROCEDURELEVELNAME] AS \[ProceduralLevelName],</p><p>\[PROCEDURAL\_ELEMENT].\[PHASENAME] AS \[ProceduralPhaseName],</p><p>\[PROCEDURAL\_ELEMENT].\[NAME] AS \[ProceduralName],</p><p>\[PE\_EVENTS].\[CATEGORYNAME] AS \[EventCategoryName],</p><p>\[PE\_EVENTS].\[CONDITIONNAME] AS \[EventConditionName],</p><p>\[PE\_EVENTS].\[SUBCONDITIONNAME] AS \[EventSubcondition],</p><p>\[PE\_EVENTS].\[SOURCE] AS \[EventSource],</p><p>\[PE\_EVENTS].\[PRIORITY] AS \[EventPriority],</p><p>\[PE\_EVENTS].\[VALUE] AS \[EventValue],</p><p>\[PE\_EVENTS].\[TIMESTAMP] AS \[EventTime],</p><p>\[EQ\_PE\_XREF].\[AREANAME] AS \[EventAreaName],</p><p>\[PE\_EVENTS].\[DESCRIPTION] AS \[EventDescription],</p><p>\[PROCEDURAL\_ELEMENT\_EXECUTION].\[PROCEDUREEXECUTIONID] AS \[ProcExecutionID],</p><p>\[PROCEDURAL\_ELEMENT\_EXECUTION].\[PARENTID] AS \[ProcElExecID]</p><p>FROM</p><p>\[ProcedureAnalyst].\[pa].\[TPB\_VW\_PROC\_EXEC] \[PROCEDURAL\_ELEMENT\_EXECUTION],</p><p>\[ProcedureAnalyst].\[pa].\[TPB\_VW\_PROC] \[PROCEDURAL\_ELEMENT],</p><p>\[ProcedureAnalyst].\[pa].\[TPB\_VW\_EQ] \[EQUIPMENT],</p><p>\[ProcedureAnalyst].\[pa].\[TPB\_VW\_EQ\_PE\_XREF] \[EQ\_PE\_XREF],</p><p>\[ProcedureAnalyst].\[pa].\[TPB\_VW\_PE\_EVENTS] \[PE\_EVENTS]</p><p>WHERE</p><p>\[EQ\_PE\_XREF].\[EQUIPMENTID]=\[PROCEDURAL\_ELEMENT\_EXECUTION].\[EQUIPMENTID] AND</p><p>\[PE\_EVENTS].\[AREANAME]=\[EQ\_PE\_XREF].\[AREANAME] AND</p><p>\[PE\_EVENTS].\[TIMESTAMP]>=\[PROCEDURAL\_ELEMENT\_EXECUTION].\[STARTTIME] AND</p><p>\[PE\_EVENTS].\[TIMESTAMP]<=\[PROCEDURAL\_ELEMENT\_EXECUTION].\[ENDTIME] AND</p><p>\[PROCEDURAL\_ELEMENT\_EXECUTION].\[PROCEDUREID]=\[PROCEDURAL\_ELEMENT].\[PROCEDUREID] AND</p><p>\[PROCEDURAL\_ELEMENT\_EXECUTION].\[EQUIPMENTID]=\[EQUIPMENT].\[EQUIPMENTID]</p><p>"@</p><p># Step 3: Query all batches</p><p>$sql3 = @"</p><p>SELECT TOP 10</p><p>\[TPB\_VW\_PROC\_EXEC].\[USERPROCEDUREID] AS \[LotNumber]</p><p>,\[TPB\_VW\_PROC\_EXEC].\[STARTTIME] AS \[Start]</p><p>,\[TPB\_VW\_PROC\_EXEC].\[ENDTIME] AS \[End]</p><p>,\[TPB\_VW\_EQ].\[NAME] AS \[BatchID]</p><p>,\[TPB\_VW\_EQ].\[FULLNAME] AS \[Namespace]</p><p>,\[TPB\_VW\_PROC\_EXEC].\[DURATION] AS \[Duration]</p><p>,\[TPB\_VW\_PROC\_EXEC].\[PROCEDUREEXECUTIONID] AS \[ProductID]</p><p>,\[TPB\_VW\_EQ].\[EQUIPMENTLEVELNAME] AS \[UnitBatchID]</p><p>FROM</p><p>\[ProcedureAnalyst].\[pa].\[TPB\_VW\_PROC\_EXEC],</p><p>\[ProcedureAnalyst].\[pa].\[TPB\_VW\_PROC],</p><p>\[ProcedureAnalyst].\[pa].\[TPB\_VW\_EQ]</p><p>WHERE</p><p>\[ProcedureAnalyst].\[pa].\[TPB\_VW\_PROC\_EXEC].\[PROCEDUREID]=\[ProcedureAnalyst].\[pa].\[TPB\_VW\_PROC].\[PROCEDUREID] AND</p><p>\[ProcedureAnalyst].\[pa].\[TPB\_VW\_PROC\_EXEC].\[EQUIPMENTID]=\[ProcedureAnalyst].\[pa].\[TPB\_VW\_EQ].\[EQUIPMENTID] AND</p><p>\[ProcedureAnalyst].\[pa].\[TPB\_VW\_EQ].\[EQUIPMENTLEVELNAME]= 'Unit' AND</p><p>\[ProcedureAnalyst].\[pa].\[TPB\_VW\_PROC].\[PROCEDURELEVELNAME] = 'Unit Procedure'</p><p>"@</p><p># Step 4: Query a database</p><p>$sql4 = @"</p><p>SELECT \* FROM sys.databases WHERE Name = 'ProcedureAnalyst'</p><p>"@</p><p># Execute the individual steps.</p><p>MySQLData($sql1)| ft</p><p>MySQLData($sql2)| ft</p><p>MySQLData($sql3)| ft</p><p>MySQLData($sql4)| ft</p><p>}</p><p>Main</p><p>Function MySQLData($sql)</p><p># Function to query SQL data via SQL Client connection</p><p># Integrated Security = SSPI (Windows Authentication)</p><p># Integrated Security = false (SQL Server Authentication)</p><p>{</p><p>$conn = New-Object System.Data.SqlClient.SqlConnection</p><p>$conn.Connectionstring= "Server =$SQLServer; Database =$SQLDBName; Integrated Security = false; User ID =$uid; Password =$pwd;"</p><p>$conn.Open()</p><p>$cmd = New-Object System.Data.SqlClient.SqlCommand($sql,$conn)</p><p>$da = New-Object System.Data.SqlClient.SqlDataAdapter($cmd)</p><p>$ds = New-Object System.Data.DataSet</p><p>$da.Fill($ds)</p><p>return $ds.Tables</p><p>$conn.Close()</p><p>}</p> |
\| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

|   |   |
| - | - |

\| <p># PowerShell Script</p><p># A simple query on a Honeywell Procedure Analyst SQL Server via MSOLEDBSQL Provider</p><p>Function Main{</p><p># Lists all tables</p><p>$sql1 = "SELECT \* FROM sys.tables ORDER BY Name ASC"</p><p># Lists all columns of a table</p><p>$sql2 = "SELECT column\_name FROM INFORMATION\_SCHEMA.Columns where TABLE\_NAME = 'TPB\_APPL\_VERSION'"</p><p># Lists all rows of a table</p><p>$sql3 = "SELECT \* FROM pa.TPB\_APPL\_VERSION"</p><p>MySQLData($sql1)| ft # All tables</p><p>MySQLData($sql2)| ft # All columns of a table</p><p>MySQLData($sql3)| ft # All rows of a table</p><p>}</p><p>Main</p><p>Function MySQLData($sql)</p><p># Function to query SQL data via MSOLEDDBSQL Provider</p><p>{</p><p>$conn = New-Object System.Data.OleDb.OleDbConnection</p><p>$conn.ConnectionString= "Provider=MSOLEDBSQL;Data Source=ServerHWE;User ID = Admin;Password = #june5;Initial Catalog=ProcedureAnalyst"</p><p>$cmd = New-Object System.Data.OleDb.OleDbCommand $sql,$conn</p><p>$conn.Open()</p><p>$adapter = New-Object System.Data.OleDb.OleDbDataAdapter $cmd</p><p>$dataset = New-Object System.Data.DataSet</p><p>$adapter.Fill($dataset)</p><p>return $dataset.Tables</p><p>$conn.Close()</p><p>}</p> |
\| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.videc.de/june5-3.7/en/datenquellenunterstuetzung-und-einbindung/honeywell-experion-batch-heb/zusaetze.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
