Channel API

We are using Channel API and we want to be able to see which message that is read. How to do this? We don´t want to use MAX.

First of all, make sure what type of CAN hardware you are using. If you have 'Series 2' NI CAN hardware, you should leave the fields in the configuration cluster empty and use the Series 2 Filter attributes instead:
ncConfigCanNet (StartOnOpen = False)
ncOpen
ncSetAttr (Series 2 Filter Mode)
ncSetAttr (Series 2 Mask)
ncSetAttr (Series 2 Comparator)
ncAction (Start)
ncClose
Of course, the fields of the configuration cluster do work with the Series 2 NI CAN hardware, however they are processed in software on Series 2 NI CAN hardware, whereas the above mentioned attributes work in hardware directly on the CAN controller (more efficient).
Another good start would be the 'Series2 Filter Mode' example VI:
NI Example Finder » Hardware Input and Output » CAN » Frame API » General
Check out this knowledge base article:
http://digital.ni.com/public.nsf/websearch/E834440265FD497986256968005DF85F?OpenDocument
Regards,
-B2k

Similar Messages

  • How do I read and write at the same time using the NI-CAN channel API?

    Here's the situation.  I have one CAN bus, and I need to read and write channel data (using the channel API) at the same time both at an interval of 20 ms.  It's easy to do one or the other using the channel API, but you can't setup a channel task to do both.  It's either input or output, not both.  Is this even possible?

    Hi,
    yes , this is possible. But you have to create two tasks, one for input and one for output. see the attached example for LabVIEW.
    If you download and install NI-CAN 2.4 you will get this example and one for C and VB as well.
    DirkW
    Attachments:
    Single Sample Input Output same Port.vi ‏79 KB

  • Why do I get error -1074388985 at CAN Connect Terminals when the Channel API has been stopped?

    While trying to establish synchronized CAN and DAQ using the Channel API, I get the error -1074388985 while attempting to connect the RTSI Clock to the master timebase.  The error message occurs each time I try to run the example VIs shipped with LabVIEW 6.1.  I am using a Series 2 PCI CAN card with a 6034E DAQ card.  Any ideas?  Tech support did not have a solution.

    Hi AVR,
    This warning means you have tried to change an attribute on a running object. This causes the warning and should not take place.
    Use the "Initialize' function instead of the "initStart" Function, then change the Attribute and use the "Start" function to start the communication, or stop the communication using the "stop" Function before you change any Attribute and then start again.
    Hope that helps
    DirkW

  • Max number of Messages using Channel API?

    We have a 2-port CAN card (series 2) runing at 500kB. When we use channel API to setup 9 messages (about 20 signal-channels) at 100Hz update rate in a write task - the data is constant, set to repeat output last sample (therefore butffer size is not the problem).
    Task Init-start gives error of too many channels too high speed. when we set only 8 messages at 100Hz or 9 messages at 90Hz, it works fine.
    If we calculate based on 500kB and 8-byte messages (give enough overhead), CAN bus shall be able to transact at least 40 full-length (8-byte) messages at 100Hz.
    there are two Rx messages at 50Hz on the bus. (totally only these 10 or 11 messages are on the bus).
    so what is the problem, simple because the CAN channel API is not good enough? 

    The NI-CAN driver I used was 2.3.1f1(?), then updated to 2.4.0f0. the results are the same. the erroe code is: -1074388831.
    Dirk is right. I did some tests and find the max speed it can spit to the bus is 666Hz (frames/s). this is true for both channel API - sampled ouput and for frame API - CAN objects.
    this will not meet the requirement of my (and many) application. I want use the NI CAN card to simulate several controllers in a vihicle to talk to one controller to be test. there are usally more than ten messages, many of them at 10ms update rate.
    when using frame API network object, timestamped, the max throughput seen is 830Hz.  when use "immedaite", the max throughput is ~3.15kHz (76% bus load). this rate probably meets most application,
    what's Interesting is, when use channel API, signle write (sample rate 0) in a loop, use the loop to control the rate, it is able to reach same ~3.2kHz rate, although the timing is not very accuate (but the channle API is not well timed either at higher rate: 6 messages sample rate at 100Hz, ouput recent: varying from 96 to 104Hz).
    the driver needs some improvement.

  • How can i send a set of can messages through channel api

    Can anyone post an example code for sending a set(more than 3) of CAN signals using channel api.

    you checked for examples? 
    Please remember to accept any solutions and give kudos, Thanks
    LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7

  • Channel API error code

    Hi,
    I have been using the Frame API for CAN communication and now I am working on making a simpler application which will utilize a database file that I will specify in MAX.  The database file only consists of messages that my LabVIEW application will write to the device and does not contain the messages that the device will send to my LabVIEW application.  I tried to run a write command to see if data is actually being written and an error came up pointing me to the nicanErr.txt file and said that I should talk to someone at NI to work through this problem.  Attached is the vi, the .ncd file, and the text file.  Can someone tell me what I am doing wrong?
    Thanks,
    Gary
    Attachments:
    Channel API.zip ‏24 KB

    Hello,
    Sorry about that, I have attached the file as an 8.2 file.
    You can navigate to the NI-CAN 2.6 drivers page .  You will have to be logged in to your NI profile.
    In the readme you should find that your PCMCIA CAN device is supported by the driver version.
    Let me know how this goes.
    Thank you. 
    Christian A
    National Instruments
    Applications Engineer
    Attachments:
    main_modified.vi ‏36 KB

  • CAN error with Channel API

    Hello All,
    Right now i am facing a CAN error when run my script which was developed using channel APIs. I am not able to trace out the the reason of the error. Pls find attached code and Error description. I have uploaded the sample code here and I am writing several messages in the same VI as same like in the code. Pls guide me in this
    Thanks in advance
    Anoop
    Attachments:
    CAN Channel API error.JPG ‏22 KB
    Channel API test.vi ‏29 KB

    Hi Anoop,
    Is the code you posted the exact code you are using when you get the error?  The reason I ask is, usually this error is associated with using the Set Property VI after the interface has already been started, such as in a loop.
    Are you able to use any examples from the Example Finder successfully? (Help > Find Examples)  You can Browse to CAN examples by clicking Hardware Input and Output > CAN > Channel API.
    Hope this helps!
    Adam W
    Applications Engineering
    National Instruments

  • Frame API or channel API

    HI,
    I will use a CAN (NI-CAN 2.1.3 ) with labwindows CVI 5.5 on win2000, but still now i have no idea about the difference between Frame API und the channel API ?
    thank you

    Hi und thank you tecoGmbh
    I have already known the answer, i have took a look at the doc thank you again

  • CAN program using Channel API receives only 0

    Hello everyone,
    I'm get in stuck. I'm currently programming CAN interface for a transmission using PXI, Channel API and a .dbc file.
    CAN configuration based on .dbc file is downloaded to PXI by MAX. 
    The problem is that it receives 0 for all the values by Channel API based program (Attached file), though it seems receiving meaningful data when I check raw data by Frame API based program. 
    Baudrate, CAN port, and .dbc file are correct.
    thanks! 
    Attachments:
    All signals and values.vi ‏22 KB

    Hi Yuta
    What I am expecting is that the sample rate is being set to high. When using the multiple channel - single sample instance of the CAN read vi, it will return a single sample for every period. The number of samples to read input is actually ignored and it will return a single sample for every channel specified. Therefore, if no data has been received within the sample period specified with the sample rate, it will return the default value as specified in the database file.
    Due to the high sample rate, it might be that data is being received, but aren't visible on screen since they are quickly being overwritten by new (default) data. I suggest trying to use the Multiple Channels - Multiple Samples instance of the CAN Read vi to see if you receive values in this case. Or you could try lowering the sample speed (note that sample rate is not the same as CAN baud rate).
    Also, make sure you are properly reading the data already in MAX's test panel as this would indicate if the database file is loaded properly.
    Best Regards
    Michiel
    Applications Engineer
    NI Belgium
    http://www.ni.com/ask

  • CAN program using Channel API doesn't receive data

    Hello everyone,
    I'm get in stuck. I'm currently programming CAN interface for a transmission using PXI, Channel API and a .dbc file.
    CAN configuration based on .dbc file is downloaded to PXI by MAX. 
    The problem is that it receives 0 for all the values by Channel API based program (Attached file), though it seems receiving meaningful data when I check raw data by Frame API based program. 
    Baudrate, CAN port, and .dbc file are correct.
    thanks! 
    Attachments:
    All signals and values.vi ‏22 KB

    Hi Yuta
    What I am expecting is that the sample rate is being set to high. When using the multiple channel - single sample instance of the CAN read vi, it will return a single sample for every period. The number of samples to read input is actually ignored and it will return a single sample for every channel specified. Therefore, if no data has been received within the sample period specified with the sample rate, it will return the default value as specified in the database file.
    Due to the high sample rate, it might be that data is being received, but aren't visible on screen since they are quickly being overwritten by new (default) data. I suggest trying to use the Multiple Channels - Multiple Samples instance of the CAN Read vi to see if you receive values in this case. Or you could try lowering the sample speed (note that sample rate is not the same as CAN baud rate).
    Also, make sure you are properly reading the data already in MAX's test panel as this would indicate if the database file is loaded properly.
    Best Regards
    Michiel
    Applications Engineer
    NI Belgium
    http://www.ni.com/ask

  • Data frames in Channel API

    Hi, in my project we need to send messages(PGNs) of J1939 format onto the microcontroller device and receive the response from the same. I have tested the microcontroller with the NI CAN software using MAX and it is working fine. Now I have to develop a LabVIEW application to send and receive the commands. I have used the "CAN write.vi" (Channel API) to send the CAN message. By using the "CAN Create message.vi" I am able to configure the PORT, Arbitration ID, Data length (8 bytes in my case) etc. But I dont find the field where I can fill in my data (8 bytes) in hex format.  Presently I have put my data in the "Single-chan Signle-samp dbl" input field of the "CAN Write.vi". Please let me know where I need to fill in the data values.
    I have attached the vi I have developed.
    Regards,
    Krishna.   
    Attachments:
    CAN_Test.vi ‏92 KB

    Hi Kittamma,
    You wrote, that it worked with the Max and now you are using the create channel function. Is there a reason not to take the channel database? To have control about every databyte, the only solution is to create or have one channel for every databyte and to write all channels together in one task.  The data has to be wired allways to the write VI.
    But keep in mind, if you have allready a databasefile or configuration in MAX, you can take the Init or InitStart VI and this VI takes the configuration automatically from MAX or your file.
    DirkW

  • Using frame and channel API at the same time.

    One of our customers specified the channel-mode number except programming the serial. So I have to use the channel api and the frame api at the the time! Is it possible with a 2 port PXI card like PXI-8461/2 (Port1 for channel api and port 2 for frame api)?

    Yes, you can have one port for channel api and one port for frame api. But you cannot mix on one port.
    DirkW

  • Reading the mode channel start and no. of bits using the CAN channel API

    Currently I am using the CAN channel API to get information from a CANdb file.  I'm using it to get max, min, scaling information, etc.  However, I can not use it to get the start bit and the number of bits in the channel mode when using mode-dependant channels.  Is there an easier method to retrieve this information using one of the CAN API's instead of manually parsing the file myself for the information?

    I think that there has been some misunderstanding with regard to the
    original question. I believe Dillon is trying to find the start bit and
    number of bits in the multiplexer. The terminology of multiplexer and
    mode gets a little confusing. For clarification, my understanding is
    that a mode is a specific value of a multiplexer. In the case of Dirk's
    example code, he was able to retrieve the number
    of bits of the CHANNEL, but not the number of bits of the MULTIPLEXER. 
    I believe that I have run into a similar problem to
    Dillon's. I want to read a NI CAN Database (*.ncd) or a Vector CAN
    Database (*.dbc) programmitically. I have attached a zip containing a
    VI and some *.ncd file to allow others to see my progress thus far.
    This is a heavily modified version of Dirk's previously posted program.
    As you can see, it is easy to get a list of messages using the "CAN Get
    Names" VI. Using that list of messages, it is also easy to get a list
    of channels by reusing the "CAN Get Names" VI. The list of channels
    does not include any information as to whether or not they belong to a
    multiplexer, but fortunately we can use the "CAN Get Property" VI to
    find out which channels are mode dependent and the value of the mode
    that the channel corresponds to (if it is mode dependent).
    Unfortunately, this does not give us any information as to the location
    or length of the multiplexer which contains the mode. Thus, I know
    whether I should be looking for a multiplexer and I know what value to
    watch for in the multiplexer, but I have no idea where or how to look
    for that value in the CAN message.
    Interestingly, by
    playing around with Dirk's database that he had attached, I was able to
    determine that the list of channels does not always give out the same
    information. Typically, you will simply receive an 1D array strings
    containing only the channel names, but the output is different in the
    event that you have a database that meets the following criteria:
        1. Two channels (in different modes) have the same name
        2. The database contains at least two multiplexers
    In
    this case the output will be a 1D array of strings in which the
    repeated channels (regardless of whether they are in the same
    multiplexer) will be output in the format "<message
    name>.<multiplexer NAME>.<mode value>.<channel
    name>". The channels that have unique names are simply output as the
    channel name. Now this is helpful in that by default the multiplexer
    name contains the start bit of the multiplexer, but this cannot be
    relied upon. The creator of the database could easily change the name
    of the multiplexer and the format is only adhered to when the
    previously mentioned criteria are met. Also it still does not tell us
    anything about the number of bits expected in the multiplexer (remember
    Dirk had found the number of bits expected for the CHANNEL).
    I have found another alternative output format when the following criteria are met:
        1. Two channels (in different modes) have the same name
        2. Only one multiplexer is contained within the file
    In
    this case the output will be a 1D array of strings in which the
    repeated channels will be output in the format "<message
    name>.<mode value>.<channel
    name>".  Again, this special format is only used for the repeated
    channels. Uniquely named channels are simply output as channel names. While this is not particularly useful, but I thought I should mention it.
    It
    is also probably worth noting that I found the previously mentioned
    alternative formats by directly reading reading a *.ncd file. It
    appears that by reading the channels directly from MAX we get at least
    one additional format (<message name.channel name> ).  Considering
    that this is actually even less information and since my application
    specifically requires that I directly read a CAN database without the
    assistance of MAX, I have not significantly explored this avenue.
    Let
    me finish by reiterating the question that I am asking: How do you
    programmitically determine the start bit and number of bits of the
    multiplexers in a CAN database (*.ncd or *.dbc). I have attached a zip
    file containg my current "testing" VI and some databases to illustrate
    the results that I have described above.
    Message Edited by William Griffin on 01-06-2009 04:58 PM
    William Griffin
    NI Certified LabVIEW Architect
    NI Certified Professional Instructor
    DISTek Integration, Inc. - NI Certified Alliance Partner
    http://ww2.distek.com
    Attachments:
    test_mode_dep_msg_rev_B.zip ‏18 KB

  • Kann man mit channel API`s Daten aus der ECU lesen?

    Hallo zusammen,
    Bin ein Frischling und habe ein Problem mit der CAN Datenübermittlung von einer ECU und der PXI bzw LabView.
    die benötigten CAN Messages und Botschaften sind auf die PXI eingelesen. Die Baudrate ist auch richtig eingestellt.
     Reduced 16%
    286 x 476 (37.89K)
    <SCRIPT type=text/javascript> // </SCRIPT>
    wenn ich nun das VI "single sample Input VI" aus den Beispielen starte, dann gibt er mir den Default Wert aus, der auf der PXI gespeichert ist, aber leider nicht den Original Wert aus der ECU.
    Mit welchen VI kann ich die andauernd gesendeten Botschaften von der ECU zu LabVIEW senden bzw. mit welchen VI`s kann ich die aktuellen Werte aus der ECU lesen????
    geht das mit den channel API`s ???? Oder muss ich in der MAX eine andere Konfiguration wählen???
    Könnte mir bitte jemand helfen :-)
    hat jemand eine Idee, nen Tip für mich,
     Reduced 63%
    1069 x 827 (134.21K)
    <SCRIPT type=text/javascript> // </SCRIPT>
    Freu mich über jede Antwort
    und im Vorraus herzlichen Danke für Eure Antworten
    Grüssle

    Hallo alko,
    mit der folgenden Formel werden alle Werte kleiner als 3 zu NoValue-Werten gewandelt, während die restlichen, gültigen Werte erhalten bleiben.
    call Formulacalc("Ch('neu') := (ch('alt') < 3)* NV + (ch('alt') >= 3) * ch('alt')")
    Danach kannst du die NoValue's bearbeiten.
    Call CHNNOVHANDLE("Zeit","neu","Delete","XY",0,0)
    Es werden zwei neue Kanäle erstellt, die nur noch die gültigen Werte enthalten.
    Ich hoffe das hilft die weiter.
    Gruß
    Walter

  • CAN error while using Channel API

    Hi
    Please find attached error message and code. I am sending message "BS_200" to the CAN channel 0. I get reference of the message from the dbc file called A.dbc. Please let me know  why does it show such an error message.
    Thanks and Regards
    Anoop
    Attachments:
    CAN error.JPG ‏20 KB
    test_2_Chnl api.vi ‏24 KB

    Hello,
    The maximum number of tasks you can have is 128, and the maximum number of messages is 272-number of tasks.  It's weird that you are getting that error though, since you are only using one message in your VI.  If you create a message in Measurement and Automation Explorer (MAX) and try to use that in your program, do you still get the error? If you import the dbc file into MAX (Right-click on CAN Channels, and select "Import Import from CANdb file") and use the message from MAX in your program instead of from the the file, do you still get the errror? Do you get the error if you try to use a different message, or does it only occur with the "BS_200" message?
    Please let me know what the results are, and I'll see if I can figure out what's going on here. Also, if it's possible for you to send me the dbc file you have (if it's not top secret),  I could try to reproduce the error. Hope this helps! Thanks!
    Regards,
    Ebele O.
    National Instruments

Maybe you are looking for

  • How can I upgrade to KitKat if I don't have access to the network, but I do have WiFi?

    I puchased my Droid RAZR HD in July of '12, and I believe it's on version 4.1 or 4.2, I'm not sure. I've recently been deployed overseas so I do not have Verizon service. I've checked the "check for system updates" option in the Settings menu periodi

  • Is there a way to convert own cps via iTunes store

    Hi I read somewhere there was a plan to enable you to upload or convert your own cds and shop purchased music, mp3s etc into itunes for a set fee. Has this been put into action yet? cheers

  • Lightroom CC won't open on iMac

    I downloaded Lightroom CC to my 6 year old mac book and 2 year old iMac. Macbook works. On iMac lightroom wont open. When you click the icon for it the startup window appears then just disappears. Have uninstalled and reinstalled and same problem. Li

  • Aperture and shooting Raw+Jpeg

    In camera Jpeg processing becomes better and better with each generation of cameras. One example is the dynamic range optimizer in my Sony A700. You often have a hard time to get similar results from the Raw. So for quite a lot of shots - especially

  • HR Cube having employee wise monthly salary.

    Hello, I want to get monthly Employee wise Salary (i.e actual paid). So please suggest the proper Cube name. Regards Satya