K8090 memory fail


#1

With vb.net the communication did work fine, until I started a test program that showed that the port still was occupied by the first program (although that was properly closed). Tried a hot disconnect and reconnect and the problem was solved, until I tried to switch all relais off (at the start of the testprogram): that did give a memory error:

System.AccessViolationException occurred
HResult=0x80004003
Message=Poging tot
het lezen of schrijven van beveiligd geheugen. Dit duidt er vaak op dat ander
geheugen is beschadigd.
Source=Velleman.Kits
StackTrace:
at
Velleman.Kits.K8090Native.SendCommand(IntPtr hDevice, Byte cmd, Byte mask, Byte
hparam, Byte lparam)
at Velleman.Kits.K8090Board.SwitchRelayOff(Byte
mask)

It looks like that part of the memory is damaged by the “hot disconnect” and reconnect. Is it possible to exchange the firmware chip for an undamaged one?


#2

Problem solved: it was not a problem with the firmware, but in the new program: in the old program direct commands were used via the COM port and the new test program was to test the possibilities of commands via the kits.dll
Worked good with the “K8090,port” and the first “if not K8090 .connect” commands.

The next commands all were first checked for an open connection with the K8090, but that disconnects the K8090??? Anyway when using any further commands that was seen as an attempt to write to unattached memory. Now solved by setting a flag in the first connection check.