Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

I am using NI-CAN with Visual Basic 5.0. Opening and using the can bus works without any errors

. When I use ncCloseObject with the same object handle that I use with the other functions, I get an error. The error I get is 80010004. This is a bad parameter error. The only parameter that is used is the Object Handle. How do I eliminate the error?I am using it on a Windows 95 machine and a PCICan card. I cannot close my program and restart it again. It will not reopen the CAN port.
0 Kudos
Message 1 of 3
(5,105 Views)
. When I use ncCloseObject with the same object handle that I use with the other functions, I get an error. The error I get is 80010004. This is a bad parameter error. The only parameter that is used is the Object Handle. How do I eliminate the error?This may not answer your question, but I think you need to close each object individually. such as...

Status = ncCloseObject(TxHandle)
Status = ncCloseObject(RxHandle)

for objects opened with

Status = ncOpenObject("CAN0::STD0", TxHandle)
Status = ncOpenObject("CAN0::STD9", RxHandle)

Hopefully this helps.

Marty
0 Kudos
Message 2 of 3
(5,105 Views)
. When I use ncCloseObject with the same object handle that I use with the other functions, I get an error. The error I get is 80010004. This is a bad parameter error. The only parameter that is used is the Object Handle. How do I eliminate the error?Hello Vernon,
I've attached an example in VB for CAN below. This example ( Object to Object) transmits data from one port and reads from the other port. If you have a Two port CAN card, then you can connect the cable between the two ports and run this example.
In any case, you can verify whether you are closing the object handle in the same sequence as the example.
Let me know if the error still shows up with the example too.
0 Kudos
Message 3 of 3
(5,105 Views)