Jump to content

Cant read memlong from PLC


Frode

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.