Jump to content

Cant read memlong from PLC


Recommended Posts

I have a Visual Basic 2008 (and use UnCmDrv1.dll)

I can read and write O, I, MB, and MI.

but when i try to read T og ML it will not work, and i got this message:

SafeArrayTypeMismatchException was unhandled

here is a bit of code:

Dim iMI() As Short

Dim iMB() As Byte

Dim iML() As Long

Dim iOut() As Byte

ReDim iOut(14)

Call mComDriver.Read_Outputs(0, 14, iOut, 2) 'OK work

ReDim iMI(1)

Call mComDriver.Read_MemIntegers(601, 1, iMI, 1) 'OK Work

ReDim iMI(1)

Call mComDriver.Read_TimersCurrent(6, 1, iMI, 1) 'don't work

ReDim iML(1)

Call mComDriver.Read_MemLongs(6, 1, iML, 1) 'don.t work

Is there something wrong here or maybe something other?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...