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)
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
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.
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
Please Log in or Create an account to join the conversation.
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.
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.
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
Please Log in or Create an account to join the conversation.
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.
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
Please Log in or Create an account to join the conversation.
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.