07-23-2007 10:50 AM
07-24-2007 08:50 AM
07-24-2007 10:16 AM
Having delved into this for a few days, I now understand why NI has not yet produced an API for .NET. Microsoft broke much backward compatibility with Visual Studio 2005. It is extremely difficult to get even a few of the API functions working on an as-needed basis. This is not a simple job at all, and I suspect that is why NI has not yet done so.
But, I have little choice, as VB6 is not supported anymore. So, please NI:
"Please make a Visual Studio object that encapsulates the LIN and CAN interfaces. All of the functionality should be through regular properties and methods-- similar to, for example, the Visual Studio Serial Port object."
Best Regards,
Rein Teder
Opto-Electronics Engineer
07-24-2007 12:44 PM
07-24-2007 02:55 PM
If Status <> 0 Then GoTo RecError
'Public Structure NCTYPE_CAN_STRUCT
' Dim Timestamp As NCTYPE_UINT64 (Bytes 0 - 7) ' Dim ArbitrationId As Integer (4 Bytes, so Bytes 8, 9, 10, 11) ' Dim FrameType As Byte (Byte 12) ' Dim DataLength As Byte (Byte 13) ' <VBFixedArray(7)> Dim Data() As Byte (Bytes 14, 15, 16, 17, 18 19, 20, 21) 'End Structure Dim ReceiveStruct As NCTYPE_CAN_STRUCTReceiveStruct.Initialize()
ReceiveStruct.ArbitrationId = ByteBuffer(8) + ByteBuffer(9) * 256 _
+ ByteBuffer(10) * 65536 + ByteBuffer(11) * 256 * 65536
ReceiveStruct.FrameType = ByteBuffer(12)
ReceiveStruct.DataLength = ByteBuffer(13)
For i = 0 To 7ReceiveStruct.Data(i) = ByteBuffer(14 + i)
Next08-01-2007 09:39 AM
08-01-2007 04:02 PM
The above-referenced CAN to USB converter looks just great-- I'll check it out when I need to develop a CAN system. (A need which is likely to arrise soon.) But, there are relatively few tools out there for the LIN bus, my current need. (I tried a product called Baby LIN but found the documentation incomprehensible.)
Just confirming, I was able to get my project working using .NET and variations of the above snippet of code. Essentially, with .NET you can no longer use type "Any" pointers, and the only thing I found that worked with the NI API was to pass to/from arrays of bytes. The .NET upgrade wizard will NOT get you working code. It is apparent to me why NI has not yet released a .NET package; if it was easy they would have done it. I hope they do, as the NI product itself is very good.
Rein Teder
Opto-Electronics Engineer
12-11-2024 02:41 AM
Hi, i'm trying to use usb 8476 with vb.net and i can't find the appropriate API or dll for.net. which library did you use please?