CAN Read using Frame API

I'm working with raw CAN data. The protocol sends out response as raw bytes(8 or upto 30)  on CAN Bus when data is requested by a CAN message.
Example:
Tx : Message ID with number of bytes you want to receive
Tx   12X   30 00 00 00 00 00 00 00
You'll receive the requested 30 bytes (only once) in this format
 22 00 00 00 00 00 00 00
 23 00 00 00 00 00 00 00
 24 00 00 00 00 00 00 00
I started working using the Transmit Receive same Port.vi in the examples modified it to suite my application.
I changed the Vi to identify the 24 as the last byte and stop the Vi or wait 1/2 sec if it does not find any data.
The Problem:
The Problem I'm facing is sometimes the Vi is missing reading the data and runs for 1/2 sec and shuts off. I am using other trace tools to make sure the desired data is on the bus.
If I run the Vi 10 times the Vi would miss reading the data atlest 4 times. Since the data is received only once after the request it is important to read immediately after the write.I'm posting the code and help to improve the read process would be appreciated.
Attachments:
Transmit_once_Receive_Multiple_Msgs.vi ‏99 KB

Hi Vamsi,
If your NI CAN card has 2 ports, you can use the bus monitor to check that the data on the bus is seen by the NI CAN card (you had mentioned that you have other trace tools, but this will make sure that the NI CAN card is reading the bus properly).  You can learn about the bus monitor:
How Can I Monitor the NI-CAN Bus?
Using the NI-CAN Bus Monitor Without Going Through MAX 
To troubleshoot your code, you can use indicators and probes on your String wires at various pointsto make sure that the frame data looks like you expect as you're parsing it.  
Mark E.
National Instruments
Schedule a Free 1-Hour online LabVIEW Tutorial with an NI Applications Engineer

Similar Messages

  • CAN periodic transmit message with different modes using Frame API's

    I want to transmit a CAN message periodically using Frame API's. I am able to send messages which dont have modes inside the message. For some messages having multiplexer in ".ncd " files and inside that multiplexer having different modes. Now in order to send all the modes of that message periodically by configuring them once by using Frame API's i did not  find a way. I am able to send messages but the last updated mode is only sent periodically. Is there any way that CAN message having different modes can be sent periodically, updating all modes periodically automatically using Frame API's.

    Hello Kpraveen,
    You could set the period for N*Period, N being the number of modes.  You just need to make sure your application changes the modes fast enough to update each periodic frame.
    For example, say you have 2 modes and the frame's period should be 10ms.  That means that you would like that frame to go out twice every 10ms, updating mode 1 and then mode 2.  So, that means that the frames period can be 5ms. 
    1.  It will start by updating mode1
    2.  5ms later, it will update mode2
    3.  5ms later it will update mode1 again
    mode 1 really has a  period of 10ms...
    You just have to make sure that you can update the frame fast enough, or switch between modes fast enough, or you will send the same mode twice.
    Let me know if this helps, or if I an not understanding this properly.  Have a great day.
    O. Proulx
    National Instruments
    www.ni.com/support

  • Is NI-CAN v2.3 & NI PCI-CAN/XS2 with Frame API Thread Safe?

    Hi, I'm downloading a file from the host computer to the modules. When I downloaded the data to the four module at the same time (with 4 threads), I'm getting communication failure ~ 20% of the time. When I synchronized the software, so it will download two modules at a time (using one port from each card at a time). The communication failure disappeared. I just wonder if the NI-CAN software & PCI-CAN/XS2 are thread-safe. I'd appreciate if anyone have any suggestion.
    Information of the software & hardware
    - Computer: Pentium4 2.8GHz, 512M Ram
    - OS: Windows 2000
    - Development Tool: Borland C++ Builder v5
    - NI-CAN v2.3 - The application is using Frame API
    - PCI-CAN/XS2 (SW-Selectable CAN, 2 Ports)
    - CAN bus: 500k High Speed
    Thanks
    Eric

    The NI-CAN software does support threads. What's the specific error
    you're getting that 20% of the time? It may be due to something besides
    the multi-threading.
    Regards,
    Matt S.
    LabVIEW Integration Engineer with experience in LabVIEW Real-Time, LabVIEW FPGA, DAQ, Machine Vision, as well as C/C++. CLAD, working on CLD and CLA.

  • Can i use 2D API with out using JRE.

    hi,
    can i use 2d API with out using JRE 1.3 .
    please reply
    ravi

    Yes, it was (still is?) supported in Java 1.2 - but no
    earlier.How is it done.can u please give some sample code.
    Thanks and regards,
    Ravikumar

  • Can you monitor signals using frame api on a PDA?

    Hi all
    I'm pretty new to LV all together, but I'm working on writing a program to monitor information off our CAN network, like oil pump speed, water temp, batt voltage, etc.  Is there a way to monitor these signals using the frame api, opposed to channel api, and display them continuously on a gauge/meter?  Since I'm using PDA module, I have to use the frame api, and not channel.  Frame api seems a little more vague to me than channel api.  Any advice or tips are welcome.
    Also on a side note, I copied/pasted a tab that i changed the background color to yellow from a windows targeted program to a PocketPC one.  The tabs stayed yellow when I built and transfered the .exe to the pda, but i don't have any control now on its color because PDA module doesn't have Property Nodes.  Every now and then, the tabs will go to default grey, and i have to undo the changes to get it back to yellow.  Is there some way to control the color?  I don't think the Change Control Color works in this case.
    Thanks ahead for any comments and advice.

    ....By the way, i'm using a PCMCIA-CAN/2 (HS) card on a PDA running WinCE5.0 and soon to be one running WinCE4.2...

  • 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

  • How can I use MapQuest API in Adobe Flash CC?

    Hi all,
    Since Google Maps API will be deprecated in 3 months I'm trying to use MapQuest instead. (MapQuest Developer Network: Map APIs, SDKs and Web Services - MapQuest Developer Network)
    But I can't import the component MQFlashMapsAPI_7.1.5_MQ_MOBILE.swc into my project.. Any idea why?
    I've read that I have to import the core.swc from the Flex SDK.. I've put the core.swc file in the components folder, but when I'm going into the components window in Adobe Flash, neither core.swc or MQFlashMapsAPI are visible.
    Do you what should I do in order to import MQFlashMapsAPI in my project ?
    I'm using Adobe Flash pro CC
    Thank you for your help,

    I would be really shocked if it requires ActionScript 2.0 but CC doesn't support that. Otherwise I honestly don't know why it would want a flex library in a place you can't utilize Flex.
    You say you've used this API before. Is this the same MapQuest SWC version you successfully used before or is it updated? What version of flash did you successfully use this in? Lastly did you get Flex from Adobe (4.6.0) or Apache?

  • CAN Channel to Frame API

    Hi All,
    In a bit of a jam...we're using CAN channel api to manage a few functions of a piece of hardware thats on a CAN bus.  Works great. Code is attached as a picture.
    We are duplicating the system and have loaded the entire PC up and had to resort to a USB based CAN card that doesn't support channel API.  Yeah bad.
    I found NI provides something called the " CAN Frame Channel Conversion Library 1.0.2" and have been trying to get it to work.  I'm not getting any results though...does anyone else have experience with this?  Is it possible to modify all our vi's that are CAN based like the one attached?
    Talk to me like a little kid on this one, CAN at frame level is completely new to me.
    I am able to watch all the data on the bus via MAX and the bus monitor, so I thought this would be more a labview board type question.
    Thanks!
    LV7.1, LV8.5
    Attachments:
    CANHelp.PNG ‏18 KB

    Hi 
    I didn't know there is a genuine conversion library  
    I've been recently doing some work as vacation replacement for a colleague that had a CAN interface for a data logger.
    Since the channel API is relatively slow the concept was to log everything in frame API and later convert it to channel by passing it through a virtual CAN bus. This is provided by NI at "ports" 255 and 254 or something like that. You should check the help docu which is not too bad.
    The only caveat was that the simulated CAN does by default also simulate delays and transmission time on the bus, you have to explicitly set this to no or zero or something. On TX and RX this works differently one is a property node the other a method. and you have to be precise with the sequence of doing what.
    But in the end it worked.
    Unfortunately the program is now on the customer's PC. So I cannot be any more precise on the how-to-dos.
    I hope it helped just a bit
    Gabi
    7.1 -- 2013
    CLA

  • Can I use external APIs to authenticate users?

    I have been asked to develop a lightswitch application either as desktop client or HTML client. Now I am confused about the authentication
    mechanism in LightSwitch, and it leads a question: Can I authenticate my users from an external website or application?  
    For the HTML client, I have been thinking that whether I could use external APIs like Facebook Login API to authenticate my users? If I could, the code should be JavaScript, then where should I put it, and how can I configure my LS application?
    For the desktop client, same question, if I could identify my users by pulling some user information from an external website, what kind of code/Programming Language shall I use? 

    Hey ConnorTx!
    This is not supported out of the box.
    For in-browser desktop applications, you can hack around this by setting up the social media credentials, then redirecting to your desktop application while passing the self-encrypted credentials.  I explained this workaround in
    this article.
    I don't have enough production experience with HTML apps yet.  However when you use Forms authentication, I suspect you can simply fill in the IPrincipal on the HttpContext.Current, then redirect to your HTML app, and the LightSwitch Forms Auth mechanism
    would pick up your principal as valid credentials.  I wish I had time to show you some code for this, would make a great blog post :/
    Keep rocking LS!
    Jan
    It's your story - time to switch on the innovation.||About me||LightSwitch blog

  • Can we use frames and jsps together..

    Is it good to use frames with jsps.performence wise..bcos when iam calling jsps in frames it taking more time..to laod..
    regards,

    Remember, 2 frames == 2 HTTP requests. 3 frames == 3 requests, etc.
    It will take longer of course. To think otherwise is crazy. However there are times when the benefits are there. I've used them, expecially if it's a situation where taking a little longer on the initial load makes all other accesses faster. This is particularly the case when I've got a fancy UI that uses lots of graphics. I don't need to load the graphics more than once so I put them in separate frames and only have one frame (which is mostly text) change content.

  • LDQ read using LDQ APIs returning junk characters in an xml string

    Hi Everyone,
    We are facing a strange problem while using LDQ APIs to read the stored data in LDQ.
    We use the following API
    l_content_tab = unit_reader->get_next_contents( q_count ).
    loop at l_content_tab  assigning <l_content_wa>.
    msg_contents = <l_content_wa>->get_cdata( )
    endloop.
    The message contents is a string in XML form.
    While reading from LDQ, though the string is well formed , it replaces the very last closing tag '>' with a junk character.
    It works perfect 99% of the time, but some systems we see this strange behavior and up-on re-reading it, it gives the right string.
    Has any one faced such an issue before?
    Regards,
    Liji

    Hi Everyone,
    We are facing a strange problem while using LDQ APIs to read the stored data in LDQ.
    We use the following API
    l_content_tab = unit_reader->get_next_contents( q_count ).
    loop at l_content_tab  assigning <l_content_wa>.
    msg_contents = <l_content_wa>->get_cdata( )
    endloop.
    The message contents is a string in XML form.
    While reading from LDQ, though the string is well formed , it replaces the very last closing tag '>' with a junk character.
    It works perfect 99% of the time, but some systems we see this strange behavior and up-on re-reading it, it gives the right string.
    Has any one faced such an issue before?
    Regards,
    Liji

  • Can not use XML API from Sun (JAXP)

    Some of my EJBs and Servlets uses XML API from Sun (JAXP) but after deployment the J2EE Container uses its own XML engine (Oracle XML Parser....) instead.
    I try to add JAXP library to my deployment file and test again but this problem still occurred.
    My question is how to add my libraries to J2EE Container and these libraries can be shared by any applications.
    Regards,
    Narong

    Please post this in the misc or xml newsgroup.
    vipuld shah wrote:
    i have an application which is running through javaWebStart
    if u start the application first time(through clicking on
    link of .jnlp file), it will download necessary .jar files
    & it will store those files in javaWebStart's cache.
    when u will visit second time, it will check files in cache
    with the files in server, if both are same, then it will not
    download but will use from its cache.
    it works fine for .jar files, but is it possible for some .xml
    files which are changing very rarely.--
    Rajesh Mirchandani
    Developer Relations Engineer
    BEA Support

  • Can I use UI-API connected company with DI-API business objects?

    Hi.
    I have to make some inventory transactions, by using DI-API business object Documents:
    SAPbobsCOM.Documents vInventoryGenEntry;
    vInventoryGenEntry = (SAPbobsCOM.Documents)
    oCompany.GetBusinessObject(BoObjectTypes.oInventoryGenEntry);
    But, the Company object available on UI-API doesn't give me GetBusinessObject, that is necessary to use a business object.
    Then, I think it's necessary to make at least 2 connections:
    - DI-API connection, using SAPbobsCOM.Company()
    - UI-API connection, using SboGuiApi.Connect(sConnectionString)
    Is it true?
    I'm looking for a solution that uses just one connection.
    Is there another way to do that?
    Thanks.

    Hi!
    There is a way to get a "real" company object from the ui application object, using a method called "Single sign-on". Look for it in the documentation, that is just what you need.
    Hope it helps!
                        Jon Arranz

  • Using Frame API for C, Need to change Data size for a TX Object

    I need to Transmit different messages to the same ArbitrationID address. The Transmited messages have variable lengths. Can I call ncConfig on an object to change the NC_ATTR_CAN_DATA_LENGTH even after the call to ncOpenObject. Or do I have to Close the object and reopen it after the call to ncConfig?
    Thanks!

    Hello Genesis,
    your second assumption is right. You do have to close, reconfigure and reopen the object in order to change the data length.
    As long as you're using the CAN Object in the 'Transmit Data by Call' mode only, you might want to consider using the Network Interface for transmitting. When you use the Network Interface, you can change the ArbitrationID for each write call.
    -B2k

Maybe you are looking for

  • How to control the goods receive in Cross-Company Stock Transfer process?

    Hi, we use the standard Cross-Company Stock Transfer process to transfer goods between company, we have a issue, for  example transfer order quantity(po) is 10 pc, devlivery order quantity is also 10 pc,but only issue 5pc.and then we use mb01 to rece

  • JTable pls help!

    Hi guys, i basically need to retrieve some data into a table from the database(mySql). but the data just cant be out. i need help from you all :). basically i have a form package, entity package, controller package, sqlAction package(where it calls t

  • RV042 Failover

    Hello! Need some help with this situation. Have one RV042 configured like ahead: 2 WAN links in Smart Link backup mode (WAN1 Primary) WAN1 - Cable modem WAN2 - DSL router Network service Detection Remote host: 8.8.8.8 Dns Lookup host: www.google.com

  • Cmsadm same password?

    Hi Everyone,    we installed and configured NWDI and are sucessfully able to transport EP and XI content across all the target systems defined in the track.   I would call this a limitation with NWDI, i.e. according to config steps, the "CMSadm" user

  • Peachtree Classic 12 Issues printing from PDQ

    This is a long-shot but I am looking to see if anyone has any knowledge of Peachtree Classic 12. We have a user that does accounting through Peachtree Classic 12 which resides on a Windows 2000 VM running on VMWare Workstation 11. Every so often she