node-activex icon indicating copy to clipboard operation
node-activex copied to clipboard

Type Mismatch Error

Open SerafinTech opened this issue 2 years ago • 1 comments

I am getting this error:

let errors = opc_items.Validate(tagList.length, tagList)
                       ^

Error: DispInvoke: Validate Type mismatch.
 on last line of following code:

From this code:

let winax = require('winax');

let con = new winax.Object('Graybox.OPC.DAWrapper');

con.Connect('Matrikon.OPC.Simulation.1', 'localhost')
con.ClientName = 'OpenOPC';

let groups = con.OPCGroups
groups.DefaultGroupUpdateRate = -1
let opc_group = groups.Add()
opc_group.IsSubscribed = 1
opc_group.IsActive = 1
let opc_items = opc_group.OPCItems
let tagList = ['Random.Real8']
let errors = opc_items.Validate(tagList.length, tagList)

Specification for the function:

Validate (Count As Long, ItemIDs() As String, ByRef Errors() As Long, Optional RequestedDataTypes As Variant, Optional AccessPaths As Variant)

other object methods work with no problem. AddItem method of OPCItems object cause nodejs to exit with no error.

Attached is the library docs OPC DA Auto 2.02 Specification.pdf

SerafinTech avatar Dec 10 '22 18:12 SerafinTech

Hello, could it be like this:

let v_errors = new winax.Variant([], 'long');

opc_items.Validate(tagList.length, tagList, new winax.Variant(v_errors, 'byref'))

"ByRef Errors() As Long" not Optional and not RetVal

сб, 10 дек. 2022 г. в 21:24, Jason Serafin @.***>:

I am getting this error:

let errors = opc_items.Validate(tagList.length, tagList) ^

Error: DispInvoke: Validate Type mismatch. on last line of following code:

From this code:

let winax = require('winax'); let con = new winax.Object('Graybox.OPC.DAWrapper'); con.Connect('Matrikon.OPC.Simulation.1', 'localhost')con.ClientName = 'OpenOPC'; let groups = con.OPCGroupsgroups.DefaultGroupUpdateRate = -1let opc_group = groups.Add()opc_group.IsSubscribed = 1opc_group.IsActive = 1let opc_items = opc_group.OPCItemslet tagList = ['Random.Real8']let errors = opc_items.Validate(tagList.length, tagList)

Specification for the function:

Validate (Count As Long, ItemIDs() As String, ByRef Errors() As Long, Optional RequestedDataTypes As Variant, Optional AccessPaths As Variant)

other object methods work with no problem. AddItem method of OPCItems object cause nodejs to exit with no error.

Attached is the library docs OPC DA Auto 2.02 Specification.pdf https://github.com/durs/node-activex/files/10200656/OPC.DA.Auto.2.02.Specification.pdf

— Reply to this email directly, view it on GitHub https://github.com/durs/node-activex/issues/117, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEMMNILPRCCNYPCY4QMV6LWMTDHFANCNFSM6AAAAAAS2NIBLY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

durs avatar Dec 13 '22 13:12 durs