Dymosim OPC server: Items cannot ce acessed by MATLAB - simulink

I'm currently using Dymola 2015 and try to run my model on an embedded OPC server. It is a very simpel model, a sine wave with a real output interface.
So far, the following things are working:
I can run the embedded OPC no problem
The data can be accessed from MatrikonOPC Explorer
I can initialize and run the server with MATLABS OPC Toolbox
However, I still have these problems:
I can NOT read data from MATLABS OPC Toolbox. When I run the Toolbox inside Simulink and add tags to the OPCRead-Block, it gives the warning "No items defined for the group". When I try to access the data by command line inside MATLAB, it gives me the error message "Unexpected unkown exception from MEX file"
When I try to build a bridge to transfer the data from Dysmosim Server to another OPC server with Matrikon's Data Manager, I get the error "Could not create output tag xxxxx.xxx": The server could not be started.
Any help is appreciated.

Related

PREOP to SAFEOP failed error in ECAT state machine Twincat 3

I am trying to control a Staubli arm (CS9) using a C6930 BEckhoff PLC using uniValPLC. I have configured the robot as ECAT slave. When I want to stablish stablish comunication between two devices, I have the following 3 errors:
The problem occurs when I link PLC variables with robot variables. Twincat continues in run mode despite of the errors, but I can not read robot variables.
Please I need help.
Thanks.

Why do I get the error "Server Creation Failed: "Class not Registered"?

I am creating a COM server (using actxserver) for CSTStudio using MATLAB, but I'm getting the error
Class not regiestred in feval
which is working inside actxserver. Also when I tried to create COM server for other applications such as Word and PowerPoint it is working fine but showing an error for the invoke function.
Here is the MATLAB Code:
addpath(genpath('G:\MATLAB\CST-MATLAB-API-master'));
cst = actxserver('CSTStudio.application');
mws = cst.invoke('NewMWS');
This is the error:
MicrostripAntenna
Error using feval
Server Creation Failed: Class not registered
Error in actxserver (line 89)
h=feval(['COM.' convertedProgID], 'server', machinename, interface);
Error in MicrostripAntenna (line 32)
cst = actxserver('CSTStudio.application');
Not clear what you mean by saying it is "working for other applications." Do you mean you can create those objects or that from within those programs you can create CSTStudio.application? #1 is CSTStudio installed on that computer? Is there a registry entry for the ProgId on the computer? Is it an in-process (.dll) or local server (.exe)?
My first suggestion is that you use VB Script to try and diagnose whether it is a 32/64-bit mismatch and whether the server is even on the machine.
Take this VB Script and save it to a file called CSTStudioTest.vbs
dim app
set app = CreateObject("CSTStudio.application")
MsgBox TypeName(app)
Change directory to where the newly created file exists.
Then, execute the script in two different ways:
c:\windows\system32\wscript.exe CSTStudioTest.vbs
and also as
c:\windows\syswow64\wscript.exe CSTStudioTest.vbs
If both succeed, then that means CSTStudio is a local server (.exe)
If one succeeds, then that means CSTStudio is an in-process server (.dll) and that it means it will only work with programs of the same bitness. If only the first script succeeded, it means CSTStudio server is a 64-bit in process server. If only the second script succeeds, it means it is a 32-bit in process server. If it is an in process server, then you can only directly call it from a process that has the same bitness (64 bit from 64 bit, or 32 bit from 32 bit).
If both of those scripts fail, that means CSTStudio is not installed correctly on your computer (if at all).
If the bitness between MATLAB and CSTStudio is different, the easiest remedy is to get a version of MATLAB or CSTStudio that matches the bitness of the other.

Time out error after setting up HANA studio using landscape file import

When I installed HANA in Eclipse and imported a Landscape file provided by my teammate, I am getting the error. I have attached the image to this post.
Please tell me what should I do to resolve it.
W1D sapw1ddb00.dir.slb.com 00 - System status cannot be determined
SAPControl request failed: Connection timed out: connect
java.lang.reflect.InvocationTargetException
The "Landscape export file" from HANA Studio contains the list of connections set up in HANA Studio incl. the folder structure.
It does not contain any login data.
When HANA Studio is set to refresh the instance status for all instances on startup, it will try to connect to the instances via the sapcontrol connection, which requires logon data.
Without this information, the call will fail.
The error message in the question does point to a different issue, though.
There seem to be logon data available (otherwise HANA studio would not have tried the connection), but the sapcontrol call timed out.
A common issue can be that the target system is not reachable from the workstation this HANA Studio is running on.
To analyse this issue, the usual network tools like PING, DIG, ARP, and SSH can come in handy.

Debugging Azure IoT Edge modules using Visual Studio Code

I can't get local debug of IoT Edge modules working on VS Code, but part of the problem could be that I don't understand what I'm doing in the steps.
I'm following the Microsoft guide here. Can anyone explain to me when I run the command "Azure IoT Edge: Start IoT Edge Hub Simulator for Single Module" in VS Code, why do I need to pass an "input name"? Why doesn the simulator need to know this. I've got multiple input commands on my edge module and the fact I need to pass it is making me question what the simulator actually does. I want to be able to debug multiple inputs.
Also on the same documentation, I can't see how it defines which module I want to run in the simulator. Am I missing something or is the process confusing?
When you Start the IoT Edge Hub Simulator for a Single Module, you spawn two Docker containers. One is the edgeHub and the other is a testing utility. The testing utility acts as a server that you can send HTTP requests to, the requests specify the input name and the data. You can use this to send messages to various inputs on your module. Just looking at that, I understand why it is confusing to supply the input name to the simulator. But when you inspect the edgeHub container, you'll see the following environment values being passed:
"routes__output=FROM /messages/modules/target/outputs/* INTO BrokeredEndpoint(\"/modules/input/inputs/print\")",
"routes__r1=FROM /messages/modules/input/outputs/input2 INTO BrokeredEndpoint(\"/modules/target/inputs/input2\")",
"routes__r2=FROM /messages/modules/input/outputs/foo INTO BrokeredEndpoint(\"/modules/target/inputs/foo\")",
"routes__r3=FROM /messages/modules/input/outputs/input1 INTO BrokeredEndpoint(\"/modules/target/inputs/input1\")"
Just like on a real device, you need routes to talk to your module. The edgeHub container registers these routes with the values you supplied during the starting of the simulator. That input can be a comma-separated list. So if you are using more inputs, feel free to supply them when you start the simulator. Under the covers, that command runs:
iotedgehubdev start -i "input1,input2,foo"
Note: when I was testing this with the latest VS Code Extension, the first time I ran it, the textbox contained: "input1,input2".

In nodejs using opcua.OPCUAClient how to connect to a Matrikon OPC Simulation server

I have used the code in https://github.com/node-opcua/node-opcua/blob/master/documentation/creating_a_client.md to create a opcclient to read from the sample_server. That worked OK. Now I want to connect to a Matrikon OPC simulation server. So in the node sample_client ,I changed the
var endpointUrl = "opc.tcp://" + require("os").hostname() + ":8080/Matrikon.OPC.Simulation.1";
In the MatrikonOPC Explorer, on the left tab I see
Localhost '\\compname'
Matrikon.OPC.Simulation.1
Group0
on clicking Group0 in the right pane, I have a tag Random.Int1 and the value is continuously changing. In the server Info pane,it says server stare as running.
When I run the node sample_client, it gives no output..it doesn't even give the
"cannot connect to endpoint"
error. It seems like it is stuck in the foll line
client.connect(endpointUrl,function (err) {
Would anybody know why and how I hve to construct the endpoint url.
It seems that the server your trying to connect to is an old OPC classic server (using the DCOM from Microsoft as a communication layer) and not an OPC.UA server (using the new unified architecture standard on TCP).
This is why Matrikon.OPC.Explorer can connect to it.
There is no easy way to connect OPC <=> OPC.UA directly as the two technologies are different unless you use a special bridging software.
see also Difference Between OPC UA and OPC DA? for more info about Classic OPC vs OPC.UA