Avatar
Please consider registering
guest
sp_LogInOut Log Insp_Registration Register
Register | Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Feed Topic RSSsp_TopicIcon
Issue calling a method with no input arguments in Prosys OPC UA Simulation Server
June 20, 2025
16:52, EEST
Avatar
berina123
New Member
Members
Forum Posts: 1
Member Since:
June 20, 2025
sp_UserOfflineSmall Offline

Hi,
I have a question regarding the use of the Prosys OPC UA Simulation Server for testing method calls.

I created a method inside the Simulation folder. This method is designed not to have any input arguments, since I don’t want the function to accept any. As an output argument, I’ve defined a scalar String, similar to an example I found on the OPC UA website. For the SET action, I configured it to assign a constant value from the simulation folder to a specific variable (just for simple testing).

On the client side, my code for calling the method looks like this:

UA_Variant *output;
size_t outputSize;

UA_StatusCode retval = UA_Client_call(client,
UA_NODEID_STRING(3, “85/0:Simulation”), // Parent object
UA_NODEID_NUMERIC(3, 1011), // Method NodeId
0, NULL, // No input arguments
&outputSize,
&output);

if(retval == UA_STATUSCODE_GOOD) {
printf(“Method call succeeded. Output count: %lu
“, (unsigned long)outputSize);
// Handle output
UA_Array_delete(output, outputSize, &UA_TYPES[UA_TYPES_VARIANT]);
} else {
printf(“Method call failed. StatusCode: 0x%08x
“, retval);
}

However, this call fails with status code: 0x80020000 (BadInternalError).

Interestingly, when I define another method that does have one input argument (e.g., a Double), it works perfectly fine using the same approach.
The only difference between the two methods is that this one doesn’t take any input arguments.

Could someone help me understand what I might be missing in the configuration of the method with no inputs?
Do I still need to define an empty InputArguments property explicitly for methods without inputs?

Thanks in advance!

July 7, 2025
16:36, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1067
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Sorry for a late answer. Can you try the Method call with https://prosysopc.com/products…..a-browser/ (r-click the method node in the address space tree)? I could not reproduce the problem (using Browser). Can you verify via https://prosysopc.com/blog/opc…..wireshark/ (or the Req/Res Log tab in Simulation Server) that the Method Call request actually arrived in the server? Sometimes the statuscodes are also used to indicate client-side issues.

Forum Timezone: Europe/Helsinki
Most Users Ever Online: 1919
Currently Online:
Guest(s) 62
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 100
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 773
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1558
Posts: 6567
Newest Members:
willardmackellar, vnedrenie_koPi, shaylaholton205, PhilesiaGen, rosaurathiel524, Arthurobext, stefanmacneil3, ralni, illuminationscanada, PhillipGit
Moderators: Jouni Aro: 1039, Pyry: 1, Petri: 1, Bjarne Boström: 1054, Jimmy Ni: 26, Matti Siponen: 359, Lusetti: 0
Administrators: admin: 1