motion Posted March 4, 2014 Report Posted March 4, 2014 Good day I just have I question regarding FSUIPCClient.DLL 2.4.0.0 calls. I am using the module for interfacing a self-made program based on VB.NET. In previous Versions of FSUIPC (VB6) there was a call like: ---------------------- If FSUIPC_Read(adr, 1, VarPtr(fs_data), dwResult) Then If FSUIPC_Process(dwResult) Then ...do something End if End if ----------------------- Now I Need for VB.NET FSUIPC4 the same read-Call... I tried it with following code, but it is not what I need for changing variables... ----------------------- Public Sub FSUIPCDATA_get() FSUIPCConnection.Process() Dim dataget As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(adrget) datagetv = dataget.Value End Sub ----------------------- "dataget" and "adrget" are changing variables. With Kind regards...
Paul Henty Posted March 4, 2014 Report Posted March 4, 2014 Hi, The problem is that you are calling Process() before you've created the offset. You need create the offset first so it can be processed. Also, if you declare Offsets for temporary use you must Disconnect() them from the DLL before they go out of scope. If you don't, the DLL will keep hold of them. You will eventually build up a large number of offsets and exceed the memory limits of FSUIPC requests. Public Sub FSUIPCDATA_get() Dim dataget As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(adrget) ' Create offset FSUIPCConnection.Process() ' process the offset datagetv = dataget.Value ' get value dataget.Disconnect() ' disconnect it from the DLL End Sub Paul
motion Posted March 5, 2014 Author Report Posted March 5, 2014 Thank you Paul. I will test it. Kind regards...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now