CAN Periodics using Channel APIs

Hi All,
I need your suggestions on the application i have attached here with in the post.
The sample Application attached is used to send periodic messages on the CAN interface, by acquiring the message from a dbc. I need to send periodic message for every one second. The application requires to do few initializations and then enable the periodics to be sent. After performing few tests it has to disable the periodic messages.
I would like to know if the attached application does serve my purpose. Any suggestions would help me in learning and improve myself.
Thanks and Regards,
Pradeep
Attachments:
main_app.vi ‏26 KB
Send_Periodics.vi ‏32 KB
stop_periodics.vi ‏5 KB

Hi Rima,
Thank you for your suggestions, however I would like to clarify some of the points you have suggested.
1. In the case structure, cases 2..5, would be having a different functionality implemented.
2. The critical part of the application is the placement of the loops. I tried experimenting with the code in all possible combinations. If I combine the two loops into one the CAN periodic VI would be called only once before the enable periodic message is enabled. This would not allow the CAN periodic function to run.
3. I have also noticed that if the enable periodic message set to true before the loop gets executed the application loops in the CAN periodic VI and the control does not go to the next state in the case structure.
Due to above reasons I had to use two loops, so that he CAN periodics VI will be executed when the enable periodic message variable is enabled and using a global variable to stop sending of the CAN periodics.
Regards,
Pradeep

Similar Messages

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

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

  • 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

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

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

  • 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

  • Does the NI-CAN 2.5 Channel API support multiple periodic tasks?

    I have different channels that need to be output at seven different periods.  Can I create multiple periodic tasks with different periods or am I going to have to either use software timing or the Frame API?
    Robert C. Mortensen
    Certified LabVIEW Architect
    Certified LabVIEW Embedded Systems Developer
    Endigit

    Hi,
    yes you can initialize multiple task with different sample rates, but you have to initialize all sequentialy and then to start thee tasks sequentialy.
    Attached you can find an example for LabVIEW which shows how to do it.
    DirkW
    Attachments:
    CAN_Multi-Chans_Diff-Period.vi ‏26 KB

  • 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

  • How to use KM APIs, Can we use them in Standalone J2ee Application

    Hi Experts,
    I got KM APIs.
    I need to use them to access the KM Repository Content.
    I m a newbie in SAP KM.
    Can anyone help me to use KM APIs.
    For Eg:
    com.sapportals.portal.security.usermanagement.IUser user = …
    IResourceContext resourceContext = new ResourceContext(user);
    RID rid = RID.getRID("/etc");
    try {
      IResource resource = ResourceFactory.getInstance()
                           .getResource(rid, resourceContext);
      if( resource != null ) {
        // resource found
        System.out.println("resource " + resource.getRID() + " found");
      } else {
        // resource not found
        System.out.println("resource " + resource.getRID() + " does not exist");
    catch( ResourceException e ) {
      // problem while retrieving the resource
      System.out.println(
                        "exception while trying to get resource " + e.getRID()
                        + ": " + e.getMessage()
    How will i get the IUser populated?
    Can i use KM APIs from a standalone J2EE application?
    Can i Populate IUser in standalone J2EE application's Servlet?
    Please help me out.
    Waiting for reply
    -pankaj

    Hi Prem,
    Can u tell me how to deploy a war file on to the SAP J2EE server?
    I know how to deploy on Tomcat Server, but dont have any experience abt SAP J2EE server.
    Does SAP J2EE server also have some Webapp directory like TOMCAT where we have to put our WAR File?
    Or to Deploy a WAR File in SAP J2EE server is different, if yes then wats the procedure to do that?
    And can i access the KM APIs in SAP J2EE Server?

Maybe you are looking for

  • I am using laptop hitting and slow system not working

    i am using laptop hitting and slow system not working and very late opan file browser every think . plez help me

  • Home sharing problem with music between iTunes and Apple TV

    iTunes 10.5.2.11 Apple TV2 running 4.4.4 (3330) Windows 7 pc WI FI connection Apple TV is losing its connection to iTunes on my windows 7 pc after streaming EXACTLY TWO SONGS.   I've never had this problem until the last update of iTunes to 10.5.2.11

  • Turn off ?xml version = '1.0'?

    I am using OracleXMLQuery to get a XML document. When I review the DOM object, the first child has the value "<?xml version = '1.0'?>" and the second child has the <rowset> tag. I need a DOM object that does not have the <?xml version = '1.0'?> line

  • Producing message to temporary JMS destination

    Hi, Has anyone managed to produce a message to a temporary JMS destination using the JMS Adapter? I'm trying to get this request/reply-pattern working: -Java client connects to a Connection Factory and creates a temporary reply queue (works, CF retur

  • Subscribing to ICS file on my own (the same) Mac

    I have a task management program that outputs an updated ICS iCal file periodically. In iCal, I want to be able to "Subscribe" to that ICS file which, obviously, is located on the same Mac I'm using to subscribe. Is there a way to subscribe to that I