Professional OPC
Development Tools

logos

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.

QuickOPC with TestStand (National Instruments)

More
20 Feb 2024 17:38 #12558 by support
Examples for OPC client and subscriber development in Python are now on GitHub: github.com/OPCLabs/Examples-QuickOPC-Python .

Please Log in or Create an account to join the conversation.

More
21 Nov 2023 13:43 #12407 by support
Note: QuickOPC now supports Python in much better way, cleaner syntax, and public packages (pypi.org/project/opclabs-quickopc/) on Python Package Index . See What's new in QuickOPC 2023.2 for more information. And, over 270 examples are available in the User's Guide!

Please Log in or Create an account to join the conversation.

More
27 May 2015 16:11 #3170 by support
Well,

in your original post, you wrote "Is it possible to call several python scripts who works all at the same session?". I took it that this is the way you can and want to do it, and as a question whether on our side, we can support that, and explained that the answer is "yes".

When you now say "I don't know how can I pass the instance between the scripts.", I have no answer to it. It depends on the tool that you are using. If this is inside TestStand, then it is outside our expertise.

Best regards

Please Log in or Create an account to join the conversation.

More
27 May 2015 14:35 - 27 May 2015 14:35 #3169 by Icebaer
Hi Support-Team,
can you please give me an example with the option EasyUAClient.Isolated = True? I don't know how can I pass the instance between the scripts.

First Python-Script:
import win32com.client
 
# Instantiate the client object
client = win32com.client.Dispatch('OpcLabs.EasyOpc.UA.EasyUAClient')
client.Isolated = True
# client.IsolatedParameters.Session.LocaleId = "de"
client.IsolatedParameters.Session.LocaleId = "en"
client.IsolatedParameters.Session.EndpointSelectionPolicy.AllowedMessageSecurityModes = 1 # 1 = SecurityNone
client.IsolatedParameters.Session.UserIdentity.UserNameTokenInfo.UserName = "Anonymous"
client.IsolatedParameters.Session.UserIdentity.UserNameTokenInfo.Password = ""

Second Python-Script:
import win32com.client
 
# Define Node IDs
endpointurl = 'opc.tcp://192.168.1.213:4880/OpcUAServer/None'
nodeid = 'ns=2;s=anynodeid'
 
# SubscribeMonitoredItem
client.SubscribeMonitoredItem(endpointurl, nodeid, 500)

Third Python-Script:
import win32com.client
 
# Define Node IDs
endpointurl = 'opc.tcp://192.168.1.213:4880/OpcUAServer/None'
nodeid = 'ns=2;s=anynodeid'
 
# ReadValue
value = client.ReadValue(endpointurl, nodeid)
 
# Display results
print('ReadValue: ', value)

Last Python-Script:
import win32com.client
 
#UnsubscribeMonitoredItems
client.UnsubscribeAllMonitoredItems()

Thank you, Icebaer
Last edit: 27 May 2015 14:35 by Icebaer.

Please Log in or Create an account to join the conversation.

More
22 May 2015 08:41 #3159 by support
Follow-up to the previous answer:

Ad 1: Verified, both Basic256, Basic128Rsa15 are supported.

Ad 2: If you intend to e.g. set the LocaleId using one script, and then use that LocalId in a second script, then you need to consider the fact that LocaleID is part of session parameters. By default, all instances of EasyUAClient share the same, and they are accessible through *static* property EasyUAClient.AdaptableParameters.Session. I am not sure if you can make use of statiuc properties from your tool. The other options is to set EasyUAClient.Isolated to 'true', in which case the this instance of EasyUAClient will use its own session, and take its parameters from (non-static) EasyUAClient.IsolatedParameters.Session. So if you wanted the setting be re-used between scripts, you would have pass the instance of EasyUAClient around between the scripts. The last option goes back to the non-isolated, static property: It is possible to create an instance of EasyUAConfiguration object, which acts as a non-static proxy to otherwise static settings. Setting the session parameters on the EasyUAConfiguration would then have the same affect as setting the static EasyUAClient.AdaptableParameters (which is not directly accessible to OLE Automation clients, because COM only knows about non-static members).

Best regards

Please Log in or Create an account to join the conversation.

More
19 May 2015 06:13 #3154 by support
Dear Sir,
I ask you for some patience, I am currently out of office and will be back on Friday. Will send you more detailed answers then. Most likely the answers are Yes/Yes, but need some checking and qualification.

Please Log in or Create an account to join the conversation.

More
18 May 2015 08:12 - 18 May 2015 08:13 #3152 by Icebaer
Hi Support-Tean,
I have two additional questions.

1.) Security Policy (Basic256, Basic128Rsa15)

I have read the following topic. Supports QuickOPC Basic256 and Basic128Rsa15?
Link

2.) Python

Is it possible to call several python scripts who works all at the same session? For example I make a script who set the localeID, another one who subscribe the items and so on... Now I could call this single scripts with TestStand.

Thank you, Icebaer
Last edit: 18 May 2015 08:13 by Icebaer.

Please Log in or Create an account to join the conversation.

More
11 May 2015 15:10 #3117 by Icebaer
Hi Support-Team,
I have tried your example and it works with Phyton.

Tomorrow I will test how can I set the Security Policy (Basic256, Basic128Rsa15) and the Publishing Time.

Thank you, Icebaer

Please Log in or Create an account to join the conversation.

More
11 May 2015 04:29 #3107 by support
I have not actually tried it, but it should look like this:
import win32com.client
 
client = win32com.client.Dispatch('OpcLabs.EasyOpc.UA.EasyUAClient') 
 
client.Isolated = true
client.IsolatedParameters.Session.LocaleId = "de-DE"
client.IsolatedParameters.Session.EndpointSelectionPolicy.AllowedMessageSecurityModes = 1    #UAMessageSecurityModes.SecurityNone
 

Best regards
The following user(s) said Thank You: Icebaer

Please Log in or Create an account to join the conversation.

More
07 May 2015 15:05 #3100 by Icebaer
Hi Support-Team,
can you give me an example how I can set the "global" LocaleID and the Security Mode with Phyton.


Thank you, Icebaer

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.064 seconds