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

Similar Messages

  • 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

  • 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

  • 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

  • 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

  • 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.

  • 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 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

  • Advanced CAN Frame to Channel Conversion: Error with LV 8.5.1

    Hello!
    I´ve tried to read in a DBC-file with the "Advanced CAN Frame to Channel Conversion Example" on a LabVIEW 8.5.0 system and it works fine.
    On a LabVIEW 8.5.1 System I get the error:
    Scan From String (arg 6) in CAN FtoC Parse Channels and Mode.vi->CAN FtoC Parse CANdb Messages and Channels.vi->CAN Channel Data Import.vi
    Does anybody know a solution for this error?
    Thank you for your help,
    demo66
    regards,
    demo66

    Hi!
    It is a problem of localized decimal point.
    In a german Windows, LabVIEW will use Komma as decimal point.
    So the Scan From String.vi will convert string 0,21 in a double but not 0.21. From the file dbc you receive the values with period "." that's why it create the error 85.
    You have 2 possibilities: change the localized decimal point in LabVIEW (Tools -> Options) or you say to the Scan From String.vi to use "." as a decimal point.
    Go to CAN FtoC Parse Channels and Mode.vi and search the 2 Scan From String.vi
    Add at the beginning of the Format String %.; so that the format String will use the "." as decimal point (see Attachement).
    After that the example will work.
    Best regards
    Ken
    Attachments:
    Scan From String.jpg ‏51 KB

  • 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

  • Deterministic CAN Frame to channel conversion

    Hi, I need to create a CAN logger which should record (in TDMS format) and show in real time (in a mixed signal graph) several channels in deterministic mode.
    Using an interface wich supports the Channel API (such as NI PXI-8464) it is all right and the software works properly.
    The problems appears when the aquisition is done through a NI USB 8473, doing the frame to channel conversion with the two virtual channels (CAN256 and  CAN257). The conversion is done in the way shown below:
    where in the CAN256 i transmit in "timestamped mode"
    While the time goes on, the logged signal is more and more delayed respect the real one until the buffer fills and an error is generated.
    What i need is a Frame to Channel conversion wich keeps deterministic, also with a small constant delay.
    Any solution?
    Thanks a lot
    Fabio

    Hello Fabio,
    Usign the virtual ports for frame to channel conversion is not very efficient.  I would suggest using the frame to channel conversion library.
    Let me know if you have any questions about it.  Have a great day.
    O. Proulx
    National Instruments
    www.ni.com/support

  • CAN Frame to channel conversion using CVI

    Hi,
    I am using USB-8473 can bus modules in a project.  I would like to display the channel data by using the Frame to Channel conversion library.  Is there a version that can be used with CVI?  I am using CVI 9.1
    Thanks
    John

    Hello John,
    I do see what you mean, the VIs actually just call into a C dll. I dowloaded to the Library after reading your post and opened up the VIs. It looks like each is just a small wrapper around Call library funciton node. It is definately silly that the VIs are so well documented but not the functions of the dll itself. Based on browsing a few of these VIs, it would be pretty easy to write the wrapping code in C and call all the same functions of frchconvlib.dll. 
    I will look into whether this library was written by a third party or NI, and if its NI property I would like to expose the dll itself to users like yourself. 
    I do apologize that this is the only current solution. I will let you know what I find out.
    This kind of feedback it important to receive, so thank you for voicing you concern.
    Best,
    Anna K.
    National Instruments

  • Who worked with ICS' Model 4896 GPIB? I can not count the data from the module. Can prompt as it to make. It is desirable with examples (data read-out from the module and data transmission between channels. It is in advance grateful.

    I can not count the data from the module. Can prompt as it to make. It is desirable with examples (data read-out from the module and data transmission between channels. It is in advance grateful.

    Hello. Most of the engineers in developer exchange are more familiar
    with NI products. Contacting ICS for technical support is a better
    course of action.

  • Custom fields not display in SRM5.5 Basic Data Frame

    Hello Everybody,
          I am working on SRM5.5 Server which i have to add two custom fields in Basic Data Frame..
         No field is display in basic data frame After I added those fields in INCL_EEW_PD_ITEM_CSF_SC and INCL_EEW_PD_ITEM_CSF.
        I added these fields by help of 672960 OSS notes..
       Add also when i execute the program BBP_DYNPROS_GENERATE where I entered the program name as SAPLBBP_PDH_CUF and execute but non of them is working fine..
      Is there anything else do i need to display custom fields in basic data frame??
    I have one more question..
      When you logon through SAPGUI and goto BBPSC01 t.code where you see lots of fields in basic data frame such as unloading point and all.. But those all fields does not display when you logon through WebURL..
      I checked is there any BAdi such CUF or Screenvarient or some Badi has been actived but non of the Badi has been implemented..
      To display all the fields which are display in GUI Mode also should display in URL..
      To bring this functionality , What do i need to do?
      I appreciate if you answer these questions..
    Thanks,
    John.

    Hi Disha,
    We are trying to add custom fields to the Shopping Cart Header. We are using SRM 5.0. We added the fields to the structures "INCL_EEW_PD_HEADER_CSF_SC" & "INCL_EEW_PD_HEADER_CSF".  We are able to see the custom fields. But the issue is , we are able to see the custom fields in the Shopping Cart one step shop scenario. Whereas when we run the wizard which is a 3 step scenario, we are not able to see the custom fields.
    Technically speaking, the custom fields are visible for the ITS BBPSC01 & BBPSC03 , where as these custom fields are not visible for the ITS BBPSC02.
    Please let me know, if we need to append the fields to some other structure to be able to see them in the Shopping cart wizard also.
    I will be gald to provide any kind of info.
    Thanks in advance...

  • 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

Maybe you are looking for

  • Oracle 8.0.5 on redhat linux 7.1

    Hi all, I have an old PII machine with only 64M of ram. I was told to install oracle 8.1.7 I need at least 128M of ram. My question is: can I install oracle 8.0.5 in this machine? if so, do i have to do something specail ? i.e glibc thanx mark

  • Copy paiste objects into the exact position!

    helllo forumers. i have 2 questions about the copy paiste command. 1st) question is i have multiple objects on one layer circles rectagnles and so on,im trying to copy paiste one of those objects onto a new layer.but it wont be paisted on the exact s

  • Mail won't open inbox after upgrade

    After upgrading my dads macbook from 10.4.11 to 10.5.6, mail would open but nothing would pop-up. and when he opened the inbox manually, the account doesnt show up even though it is set correctly in the preferences. also when he goes to quit the appl

  • Printing a small picture without 3rd party software

    Girlfriend bought a new mac (I convinced her), and wanted to test her new printer. I pressed appleshift4 to make a small picture clipping. Normally, I would drag the image into Microsoft Word for Mac, and reshape, position, and resize the image there

  • Unable to connect FR studio Datasource

    Hi all, I am facing an issue, when i logon to FR studio and wants to prepare new report -> clicking on 'Insert grid' -> it promts some error. *"DatasourceIDLogin.LoadDatasourceNames Error: -2147467259 Error Loading DatasourceList to Repository"*. aft