Online Forums
Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.
Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.
Do not use the Contact page for technical issues.
OPC UA using PHP
This is a bug on our side. It comes, however, from an OPC Foundation code. In some cases, it attempts to strip off last 4 characters of the command-line argument zero, without considering all the possible cases. We will fix it in the upcoming QuickOPC version (2017.2). For now, there are workarounds:
1a. Use PHP.EXE to start the program, and not just PHP (in this case you do not have to put in the full path)
1b. Use the full path to start the program.
2. Add following at the beginning of your program:
$ClientConfiguration = new COM("OpcLabs.EasyOpc.UA.EasyUAClientConfiguration");
$ClientConfiguration->SharedParameters->EngineParameters->ConfigurationSources = 2;
I apologize for the inconvenience - and thank you once again for your help in finding the root cause.
Best regards
Please Log in or Create an account to join the conversation.
2. Start from CMD directly using just PHP (not php.exe).
php "C:\Program Files (x86)\OPC Labs QuickOPC 2017.1\ExamplesCom\PHP\Console\UADocExamples\_EasyUAClient.Read.Main.php"
"C:\Program Files (x86)\PHP\v5.5\php.exe" "C:\Program Files (x86)\OPC Labs QuickOPC 2017.1\ExamplesCom\PHP\Console\UADocExamples\_EasyUAClient.Read.Main.php"
Is this normal behavior? Hard links to these commands are impractical.
Please Log in or Create an account to join the conversation.
1) Are you trying to make some configuration using the .config (XML) file?
2) how are you starting the PHP? From the CMD, or some other way? If from CMD, how precisely? - Specifically, do you have just PHP at the end, or PHP.EXE?
Thank you
Please Log in or Create an account to join the conversation.
> mscorlib.dll!string.Substring(int startIndex, int length) Unknown
Opc.Ua.Core!Opc.Ua.ApplicationConfiguration.GetFilePathFromAppConfig(string sectionName) Unknown
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.AppConfigSdkConfigurationProvider.GetConfiguration(Opc.Ua.Configuration.ApplicationInstance sdkApplicationInstance, out Opc.Ua.ApplicationConfiguration sdkApplicationConfiguration) Unknown
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.UAClientEngineBase.MakeSdkApplicationConfiguration(Opc.Ua.Configuration.ApplicationInstance sdkApplicationInstance, out Opc.Ua.ApplicationConfiguration sdkApplicationConfiguration) Unknown
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.UAClientEngineBase.CreateSdkApplicationConfiguration(Opc.Ua.Configuration.ApplicationInstance sdkApplicationInstance, out Opc.Ua.ApplicationConfiguration sdkApplicationConfiguration) Unknown
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.UAClientEngineBase.CreateSdkApplicationInstance(out Opc.Ua.Configuration.ApplicationInstance sdkApplicationInstance, out Opc.Ua.ApplicationConfiguration sdkApplicationConfiguration) Unknown
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.UAClientEngineBase.MakeSdkApplicationInstance(out Opc.Ua.Configuration.ApplicationInstance sdkApplicationInstance) Unknown
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.UAClientEngineBase.InternalConnect() Unknown
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.UAClientEngineBase.Connect() Unknown
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.UAClientEngineBase.ExternalConnect() Unknown
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.UAEngineBase.PerformGuardedOperation(string name, System.Action action) Unknown
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.UAClientEngineBase.StartGuardedOperation.AnonymousMethod__0() Unknown
[Native to Managed Transition]
[Managed to Native Transition]
mscorlib.dll!System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage msg, System.Runtime.Remoting.Messaging.IMessageSink replySink) Unknown
mscorlib.dll!System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.ThreadPoolCallBack(object o) Unknown
mscorlib.dll!System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(object state) Unknown
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() Unknown
mscorlib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch() Unknown
mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() Unknown
Please Log in or Create an account to join the conversation.
1) when the exception is thrown, you may get a little popup titled "Exception Thrown", and in it, there is a link that says "Copy Details". Click on it, and then send us the content of the clipboard.
2) In the Quick Watch window you have, select the "StackTrace" row, and then click the drop-down button at the right of it, and select "Text Visualizer". Then, send us the resulting text from the visualizer window.
3) When the exception occurs, Debug -> Windows -> Call Stack from the VS menu. Then, right-click inside the Call Stack window, select "Select All", and send us the content of the clipboard.
Thank you in advance, and best regards
Please Log in or Create an account to join the conversation.
We had selected 'System.ArgumentException' as instructed, but it is not breaking into a debugger (see this image link . I went ahead and added checkmarks next to the two exception types that we are seeing: 'System.ArgumentOutOfRangeException' and 'System.Reflection.TargetInvocationException'. With these checked, Visual Studio kicked into Break Mode with the following additional details:
- Imgur Link : System.ArgumentOutOfRangeException
System.ArgumentOutOfRangeException occurred
HResult=0x80131502
Message=Length cannot be less than zero.
Source=mscorlib
StackTrace:
at System.String.Substring(Int32 startIndex, Int32 length)
- Imgur Link : System.Reflection.TargetInvocationException
System.Reflection.TargetInvocationException occurred
HResult=0x80131604
Message=Exception has been thrown by the target of an invocation.
Source=<Cannot evaluate the exception source>
StackTrace:
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
Inner Exception 1:
ArgumentOutOfRangeException: Length cannot be less than zero.
Please Log in or Create an account to join the conversation.
The exception type seems to be slightly different from what I expected, although it is still a subtype of 'System.ArgumentAxception'. It is 'System.ArgumentOutOfRangeException' instead. Can you please make sure that this type is also explicitly checked in the Exception settings (Step 2 in the original instructions)?
Best regards
Please Log in or Create an account to join the conversation.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Cannot find or open the PDB file.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files (x86)\OPC Labs QuickOPC 2017.1\Assemblies\net452\OpcLabs.EasyOpcUA.dll'. Cannot find or open the PDB file.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files (x86)\OPC Labs QuickOPC 2017.1\Assemblies\net452\OpcLabs.BaseLib.dll'. Cannot find or open the PDB file.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'. Cannot find or open the PDB file.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'. Cannot find or open the PDB file.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'. Cannot find or open the PDB file.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll'. Cannot find or open the PDB file.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll'. Cannot find or open the PDB file.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Cannot find or open the PDB file.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'Opc.Ua.Client'. Cannot find or open the PDB file.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'Opc.Ua.Core'. Cannot find or open the PDB file.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'Opc.Ua.Configuration'. Cannot find or open the PDB file.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files (x86)\OPC Labs QuickOPC 2017.1\Assemblies\net452\OpcLabs.BaseLibForms.dll'. Cannot find or open the PDB file.
Exception thrown: 'System.ArgumentOutOfRangeException' in mscorlib.dll
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll'. Cannot find or open the PDB file.
Exception thrown: 'System.ArgumentOutOfRangeException' in mscorlib.dll
Exception thrown: 'System.Reflection.TargetInvocationException' in mscorlib.dll
The program '[236] php.exe' has exited with code 0 (0x0).
Please Log in or Create an account to join the conversation.
And, can you please disable "Just My Code": In Debug -> Options, General: uncheck the corresponding setting. It may also be worth enabling the "Use Manage Compatibility Mode"
Regards
Please Log in or Create an account to join the conversation.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files (x86)\OPC Labs QuickOPC 2017.1\Assemblies\net452\OpcLabs.EasyOpcUA.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files (x86)\OPC Labs QuickOPC 2017.1\Assemblies\net452\OpcLabs.BaseLib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'Opc.Ua.Client'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'Opc.Ua.Core'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'Opc.Ua.Configuration'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files (x86)\OPC Labs QuickOPC 2017.1\Assemblies\net452\OpcLabs.BaseLibForms.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'php.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The program '[17192] php.exe' has exited with code 0 (0x0).
Please Log in or Create an account to join the conversation.