Read CAN Interface of USB-8473 by programmation

Hello,
I'm looking for an example to obtain the CAN interface name of my card usb-8473. I've developped an application for colleagues and I don't know the CAN interface name they use (CAN0, CAN1, ...). It will be great if I could read this name in my application, to correctly set the object name of the CAN communication I'm configuring and opening.
As joined, an example I've started but I cannot finish.
Data location in MAX:
I'm working with:
LabVIEW 2012 SP1 (12.0.1f3), 32 bits
MAX 5.4.0f0
NI-CAN 2.7.4
Thanks,
Francis M | Voir mon profil
Certified LabVIEW Developer
Solved!
Go to Solution.

Find the attached code.
I am not allergic to Kudos, in fact I love Kudos.
 Make your LabVIEW experience more CONVENIENT.
Attachments:
Device Identification Prototype.vi ‏15 KB

Similar Messages

  • Labview misses a read when using Ni USB 8473 can interface

    I was wondering if anybody here has had experience with this problem... I already talked to a Labview tech but i have not received an answer yet...
    This is my problem..
    I have a program that  when a button is pressed, it initializes a can interface to CAN0 for example, then it writes... then it waits about 100mills and then it reads... My computer is connected to a simulator through the USB 8473 interface (I have the problem when I connect it to the hardware I am going to use), and everytime I write, this simulator sends a response... The problem is that sometimes I don't see a response... I have made sure that the simulator responds so I know it is responding... I have changed the waiting time before the read from 1 mills to 100 mills to 1 second, and still with the same result... 
    The way I have fixed this problem is by reading multiple times (3 times)... so every time I send a request, i wait 100 mills... then I read once, wait 25 mills, then read again, wait, then read again....
    So, I wanted to know if anybody here has had to do this in order to get around this problem...???
    The reason why I was asking this is because I also have another application that has to monitor my hardware by sending requests every 100 milliseconds... so I have two loops, once that writes requests every 100 mills... and another that reads the responses every 20 mills... but sometimes it looks like eventhough i read this many times, I still miss some frames, which are caught later but still not good enough...
    I have posted a different thread about the above problem...
    If you have questions just ask please...
    Thanks

    Yes, by Labview tech i meant NI Support... sorry about that...
    I am still waiting for them on this subject...
    I'll attach a simplified version of my code (the only difference between this code and the original is that i parse all the data that i get...)
    I am attaching these if a couple replys... 
    Run the receive and respond (simulator) then run the CAN_PROBLEM vi... click on the OK button to write then read... you can tell it missed the message when the Frames to Read field is 0...
     how are you sure that you device is sending a response?
    Very sure... 100%... the original simulator lets me know when it sends the response...
    Can you run bus monitor on another port, ie another USB-CAN device?
    I did that, and the other USB-CAN gets it... the program I am running on the other computer is called CANyliser... I think that program waits until there is something in the queue (which I am not doing with mine)... I am just reading after I have wrote teh message (reading after about 100 mills I wrote)... So I am assuming that's plenty of time... i have increased this waiting time to 1 sec and still get the same behaviour...
    Attachments:
    CAN_PROBLEM.vi ‏16 KB
    ReceiveAndRespond.vi ‏17 KB
    CAN INIT.vi ‏23 KB

  • How to read CAN interface through nisyscfg.lvlib

    I need to read the CAN interface assigned to my NI-USB 8473 CAN-to-USB controller within NI's System Configuration (MAX). 
    The purpose is to programmatically identify the NI-USB hardware device attached to the PC, read the CAN interface assigned to it, and use that in LabVIEW instead of manually checking NI MAX after the controller is disconnected and reconnected or using it on a different PC etc.
    Using LabVIEW's VI's found through 
    Measurement I/O - System Configuration                    I
    Initialize, Get Experts, Find Hardware                         and get:
    Expert = nisyscfg
    VendorName=National Instruments
    ProdName=USB-8473 (High-Speed CAN)
    IsNI=true
    IsPresent=1
    Is there a property for the CAN Interface?  If so, where is it found?
    Is there a different way to accomplish the same thing?
    Thanks, Scott.Pierskalla

    This was the best I could do.
    http://forums.ni.com/t5/LabVIEW/Get-CAN-Bus-Ports/td-p/2174296
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Mixed message lengths on CAN Bus using USB-8473 Device

    I am attempting to use the Frame API functions for LabVIEW
    and send both 11-bit and 29-bit headers over a bus that uses both address lengths.  I am currently successfully sending 11-bit
    packets but the 29-bit packets are having their addressing truncated to the 11-bit
    length when put on the bus.   
    As far as I can see I should have to set the standard
    comparator to 0xCFFFFFFFF and then send messages.  I am using a NI USB-8473 CAN Device for doing
    this.  Is there anything else I need to
    change for extended addressing?

    You need to OR your Extended ID with the 0x20000000 before giving it to the NCwriteNet.vi.
    This is the way that the underlying CAN driver and hardware know that is it an extended ID you are trying to send.
    The ID on the CAN bus will NOT have the ORed ID but only your ID. The driver/hardware filter the 0x20000000 from the ID.
    This is the same for reading an extended ID on the CAN bus. 
    Before using the ArbitrationId, you need to AND the ArbitrationId with 0x1FFFFFFF to filter the extended flag out. 

  • NI-DNET or NI-CAN driver using USB-8473 to get a Devicenet communication

    Hi.
    I have a doubt regarding the proper driver to get a link between a Beckhoff BK5220 header and Labview, using USB-8473 interface.
    For this purpose, we are currently using a PCMCIA-CAN/2 card with NI-DNET1.41 driver and Labview 7.0, but our new laptops has been delivered without PCMCIA slot, so I have to find al alternative solution.
    I found the USB-8473 interface in NI Web. To operate with it We have to upgrade our Labview (it is not a problem) and upgrade at the same time the driver, but in the last version of NI-DNET driver, this hardware is still not supported.
    In the README of the last version of NI-CAN driver, it is supported, so, knowing that Devicenet protocol is actually a Can field bus protocol, and that we are currently using succesfully  a generic CAN PCMCIA card for this purpose,my question is:
    Could We use this hardware with this NI-CAN driver to get a link with a Beckhoff BK5220 using Devicenet protocol?
    Please let me know how I can solve it.
    Thanks in advance
    Best Regards
    Raul Gracia

    Hi Raul,
         You may find this KnowledgeBase interesting. Moreover, the following KB says "the user can implement DNET specifications using the NI-CAN Frame API". I encourage you to give a call to a National Instruments Internal Sales Engineer so that he can give you a hand with your hardware configuration .
         Regards,
    David Oña

  • NI USB-8473 사용중 ncConfig() 함수에서 오류(-1074388723)발생합니다

    안녕하세요.
    NI USB-8473 사용중 ncConfig() 함수에서 오류(-1074388723)발생합니다.
    NI PCI-CAN Series2 보드를 사용했을 때 적용한 프로그램인데
    NI USB-8473 로 교체했을 때 읽기는 되는데 쓰기가 안됩니다.
    첨부파일에 오류가 발생하는 곳의 위치를 표시했습니다.
    사용하는 프로그램은 VB6.0 입니다.
    원인을 알수 있을까요? 수정방법도 ... 부탁합니다.
    Attachments:
    00.JPG ‏160 KB

    The NI USB-8473 does not support NI-CAN Objects. It is limited ot Network Interface support only.
    http://digital.ni.com/public.nsf/allkb/7A7875C000F205DD862572640073B8CF

  • Synchronize Series 2 PCMCIA CAN/2 with USB-6229

    Hi,
    Just want to know if it's possible to synchronize series 2 PCMIA CAN/s or USB-8473s with USB-6229. If so how to connect the two setup together through RTSI connection? I assume I would follow the example VI "CAN Sync Start with NI-DAQmx". Thanks.
    Jason

    Hi Blayne,
    Thanks for your reply. I used the reference design and connected it as follow. However I can see that the CAN and DAQ start is still not synchronize, I suspect I need to configure the startTrigger. Basically I want to it to start capturing analog and CAN data simultaneously when I start running. Analog signal will always be there, I suppose to set the trigger source to an analog input (AI0), when it start capturing, generate a pulse on the startTrigger to start CAN capture. How would I go about doing this?
    From the USB-8473s to USB-6229
    CLK -> 10Mhz pulse AO to PFI12
    TRIG -> ai/StartTrigger to PFI0
    GND -> DGND
    I've attached a draft of my program.
    Thanks a lot.
    Jason
    Attachments:
    cansync_11Oct11.vi ‏61 KB

  • How can we interface external usb camera or usb device(storage, card reader) to Ipad 2.What all things are need(any development Kit apart from IOS sdk)

    Hi,
    Before going any further in my research, I want to know the views and opinions about the intent of my work I am about to start.
    AIM : I am trying to interface an external uvc camera with the ipad 2 and iphone .Just like in android there is a node(in unix and linux everythign is a file)which gets created in the /dev/ directory which can be accesses by the application using the native interfaces (JNI) and finally via the android code.I am trying to develop the similair application for the ipad 2 and iphone.
    Can some one plz point out :
    (1) How I can interface external hardware like ( external uvc camera) or any other USB device(a card reader, a storage device, a barometer etc)
    (2) I have googled about Apple's Authentication chip which can be used to interface the external h/w.Can some one point out how useful it is.Is this related to that somehow.
    (3)What are the things similair to JNI, node, /dev/ in the IOS for Ipad 2 and Iphone.
    I will be highly obliged ,if some one could provide me the top pointers on it.
    Thanks and Rgds,
    MangoApple

    1.) See
    External Accessory Programming Topics
    Connecting to an Accessory
    Monitoring Accessory-Related Events
    2.) See the MFi Program

  • How can I get a USB-8473 to work at 125kbps?

    All,
    I am using an NI USB-8473 high speed CAN card.  I've plugged in into a known-good CAN port in a network that works fine at 500kbps with other CAN devices.
    When I run the 8473 at 125Kbps, it works fine.  When I run it faster than that, it does not work.  It does not read CAN data, although the CAN LED does flash before an error (3FF6206B or other) is generated.  When I try to write to the bus at speeds above 125K, the device appears to attempt to write once, then stop functioning.
    Any help would be greatly appreciated.
    Thanks!
    Solved!
    Go to Solution.

    Although the network works with another interface at 500kbps, please check if your cabling meets the requirements for High-Speed CAN (page 4-4 of the NI-CAN Hardware and Software Manual).
    Do you use proper cable termination as mentionned at page 4-5 of above linked document ?
    Has the "know-good CAN port" an onboard 120 ohm termination resistor ?

  • CAN USB-8473

    hi,
    im using the NI-CAN 8473 to communicate with the CAN bus on my car through an OBDII connector.
    im using for this the Automotive Diagnostic Command Set. I tried a simple code to get the supported PIDs in the car, but there was no communication between the CAN-USB and the car ECU.

    My understanding is that the Automotive Diagnostic Command Set works with all vehicles. To my knowledge this is a standard interface which works with all vehicles 2008 and later utilizing CAN. You can reference the SAE J1979 spec document/spec by googling. It will show you the standard CAN pins for all vehicles which should be the same (CAN+, CAN-, and gnd). This standard provides for the legislative pids which are mandated by the government so the guy on the corner garage can diagnose your trouble codes. Like when you go to your local Auto parts and the guy brings out his tester to tell you your trouble code and reset your engine on light. He's accessing the trouble codes and also the legislative pids. The transmit ID is normally 7E0 and the receive ID is 7E8. That's also in the spec.
    Now for my problem, I can't get the Automotive Diagnostic Command Set to work with my USB 8473s. I'm using the engine example that comes with the kit trying to measure RPM, TPS, and ECT on a 2010 Ford Escape. Here's my question:
    Should the Automotive Diagnostic Command Set work with Windows7 64 bit and LabVIEW 2010 32 bit?
    I installed it on my machine and it installed in the LabVIEW 2010 directory. I can't get it to work on any of the vehicles I tried. I have checked the wiring and confirmed the pinouts of the OBDII connector. The USB led is a steady yellow and the OBD lights flash green on the USB 8473s but the sofware hangs in the OBD Open.vi. I've checked with our CAN communication OBDII engineering team and confirmed the transmit and rcv adrresses. I have the baud rate set to 500K. Any help would be most appreciated! I've been told the toolkit is Plug & Play. Mine Plugs, but won't play!

  • Is is possible to access channels from a CAN database in labview with NI USB 8473s

    Hello,
    I would like to know whether is possible to access a CAN database, which is uploaded through MAX, in labview.
    More specifically, I have uploaded my CAN database in MAX and I want to have access to each specific channel in labview.
    i.e according to picture, I would like to have access  to n_Motor_InsRpm channel of E1_L0_1 (motor speed) in Labview, so I can set and transmit a speed value through CAN. Could that be possible with NI USB 8473 s? If yes, is there any simple example in Labview ?
    Thanks for your Help
    Charis
    Solved!
    Go to Solution.
    Attachments:
    CANdb.jpg ‏11 KB

    There are several ways to get database information without needing hardware. Here is one I did a while ago.
    https://decibel.ni.com/content/docs/DOC-39793
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • How can I use USB interface in Labview?

    Hi.
    Does labview allow to USB interface?
    I have been seen allowing GPIB and RS232.
    I'm beginer at Labview and wanna use USB interface for my target system and pc.
    I wanna know how to labview interfaces from target system to pc.
    And if Labview doesn't provide USB interface module, how can I use USB?
    Is using a USB at Labview hard to beginer?
    Plz, answer to my quetion.
    sorry, my English is very poor.
    thx for reading my article.

    You can access devices connected to the USB port, but not in the same way as you would a GPIB or RS232 device. There are no USB drivers like there is VISA for GPIB or serial. Rather devices that plug into the USB appear to the systen as some sort of standard resource like a printer, disk drive or IO board. LabVIEW then interacts with these devices as it would any other device of the same type.Look at it this way, if you have a USB daq device you will access it through MAX the same as if it were a plugin card. Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Where can I download the A2901A adb interface window usb driver? Thank

    Where can I download the A2901A adb interface window usb driver? Thank
    Solved!
    Go to Solution.

    anika200,
    Thank you for your comment.
    Regards,

  • Does NI-CAN (USB-8473) support programming in C#

    Hi there, I am developing software in C#, which supposed to test electronic devices (production of electronic manufacturing company), to ensure quality and functionality.
    My system consist of many NI devices, mainly Digital and Analog I/O, of them belong to DAQmx-group, and support programming in C#.
    Recently I added to the system CAN device USB-8473, which belong to NI-CAN-group (using my own terminology).
    Question is: Does NI-CAN provide support (classes, libraries, dll's, etc) for programming in C#?
    Thank you in advance

    Hi Chris, thanks for fast reply,
    yes, sure, I read this section of manual, just was thinking, this manual is from mid-2010, and meanwhile updated version of NI-CAN might be available, compatible with last generation of .NET, but it seems it is not.
    One more question: your Nican.dll is C++, unmanaged code library. To use it in .NET, particularly in C#, there must be some code which describe functions and variables packaged in this dll, to  provide translation (conversion) of functions and variables types, from C++ types to C# types, which would be very helpful for .NET programmers in using this dll. Something like:
            [DllImport("Nican.dll" , CallingConvention = CallingConvention.Cdecl)]
            public static extern int ncGetHardwareInfo(uint CardIndex, uint PortIndex, uint AttrId, uint AttrSize, ref uint  Attr);
            //instead of NCTYPE_STATUS _NCFUNC_ ncGetHardwareInfo(NCTYPE_UINT32 CardIndex, NCTYPE_UINT32 PortIndex, NCTYPE_ATTRID AttrId, .......
            public const int NICAN_ERROR_BASE   =        (int)(0xBFF62000);    // instead of #define  NICAN_ERROR_BASE (NCTYPE_STATUS)(0xBFF62000)
            public const int CanErrFunctionTimeout = (NICAN_ERROR_BASE | 0x001); // instead of #define  CanErrFunctionTimeout (NICAN_ERROR_BASE | 0x001)
    If you have code with this kind of conversion, would be very nice to have a link to that.
    Thank you for your help.

  • USB-CAN USB-8473s で定期送信したい

    サービスリクエストNo.766130です
    OS:WindowsXP
    開発環境:Visual Basic 6.0
    USB-CAN USB-8473s
    NI USB-8473s を用いて
    相手ECUのID100hに対して10ms 周期で定期送信処理を
    行うためのプログラムを作成中です。
    プログラム起動時、下記のプロシージャを実行するのですが、
    Status = ncConfig("CAN0:TD0x100", 7, AttrIdList(0), AttrValueList(0)) の
    戻り値が 0 にならず、設定ができません。
    戻り値 BFF6210Dhになりました。
    この問題を回避する有効な手法はありますでしょうか?
    よろしくお願いいたします。 
    Private Sub Can_Open()
        Dim AttrIdList(10) As Long
        Dim AttrValueList(10) As Long
        Dim nret As Long
        nret = 0
        '// CANネットワークインターフェースの設定
        AttrIdList(0) = NC_ATTR_BAUD_RATE
        AttrValueList(0) = NC_BAUD_500K
        AttrIdList(1) = NC_ATTR_START_ON_OPEN
        AttrValueList(1) = NC_TRUE
        AttrIdList(2) = NC_ATTR_READ_Q_LEN
        AttrValueList(2) = 10
        AttrIdList(3) = NC_ATTR_WRITE_Q_LEN
        AttrValueList(3) = 10
        AttrIdList(4) = NC_ATTR_CAN_COMP_STD
        AttrValueList(4) = 0
        AttrIdList(5) = NC_ATTR_CAN_MASK_STD
        AttrValueList(5) = NC_CAN_MASK_STD_DONTCARE
        AttrIdList(6) = NC_ATTR_CAN_COMP_XTD
        AttrValueList(6) = 0
        AttrIdList(7) = NC_ATTR_CAN_MASK_XTD
        AttrValueList(7) = NC_CAN_MASK_XTD_DONTCARE
        AttrIdList(8) = NC_ATTR_LISTEN_ONLY
        AttrValueList(8) = 0
        AttrIdList(9) = NC_ATTR_HW_SERIES
        AttrValueList(9) = NC_HW_SERIES_847X_SYNC
        Status = ncConfig("CAN0", 10, AttrIdList(0), AttrValueList(0))
        If Status <> 0 Then 'NC_SUCCESS Then
            MsgBox "CANオープン前設定1エラー"
            nret = -1
        End If
        If nret = 0 Then
            '//ID100
            AttrIdList(0) = NC_ATTR_COMM_TYPE
            AttrValueList(0) = NC_CAN_COMM_TX_PERIODIC
            AttrIdList(1) = NC_ATTR_BKD_PERIOD
            AttrValueList(1) = 10
            AttrIdList(2) = NC_ATTR_CAN_DATA_LENGTH
            AttrValueList(2) = 8
            AttrIdList(3) = NC_ATTR_CAN_TX_RESPONSE
            AttrValueList(3) = NC_FALSE
            AttrIdList(4) = NC_ATTR_RX_CHANGES_ONLY
            AttrValueList(4) = NC_FALSE
            AttrIdList(5) = NC_ATTR_READ_Q_LEN
            AttrValueList(5) = 0
            AttrIdList(6) = NC_ATTR_WRITE_Q_LEN
            AttrValueList(6) = 10
            Status = ncConfig("CAN0:TD0x100", 7, AttrIdList(0), AttrValueList(0))  ← ここの箇所でエラーになります
            If Status <> 0 Then 'NC_SUCCESS Then
                MsgBox "CANオープン前設定2エラー"
                nret = -1
            End If
        End If
        If nret = 0 Then
            Status = ncOpenObject("CAN0:TD0x100", TxHandleW1)
            If Status <> 0 Then 'NC_SUCCESS Then
                MsgBox "CANオープン前設定3エラー"
                nret = -1
            End If
        End If
    End Sub

    N.Mo さん
     このエラーはハードウェアが対応していない旨のエラーですね。
     USB-8473(s)使用時のエラー-1074388723に関して
     エラー番号がLabVIEWと違いますが、ダイアログに出ているHEX値が同一であるのと、
    行いたい内容が一致しているので、結論としてはハードウェアが対応していない、ということになります。
     USB-847xシリーズで使用できるAPIは以下のリンク先に記してあります。
     Which NI-CAN Frame API Functions does the NI USB-847x Device Support?
     ハードウェアの機能が使用できないとなると、後はソフトウェアのタイミングで制御することに
    なります。(もしくは外部のカウンタボードからトリガを受けて同期させて。。。少々面倒になりますね。)
     ご検討ください。

Maybe you are looking for