Reading CAN frames from 10 sensors Simultaneously

Hello,
I have developed a code that reads CAN data frame from the CAN port (PCI CAN/2 series 2 board). The board have 2 CAN ports. I have connected a sensor to one of the ports and reading the CAN frames using my code. I want to use the same code to read CAN frames from 1o sensors simultaneously. Can anyone help me? I have tried creating SUB VI of my code but it reads only one port at a time.    
Thanks in advance
Solved!
Go to Solution.

Hi Gruenberg,
I have one question....in my code the while loop interates at 1000ms  i.e.  I want to read CAN data every second (1 value per sec). But when I log this data I see that it gives me 11 values per sec. Because of this my log file is getting very bigger unnnecessarily. I tried to figure it out but couldn't find any solution. Can you tell me why this is happening?
Please see attached docs.
Thanks in advance.
Attachments:
F2C.jpg ‏291 KB
CAN0.txt ‏1 KB

Similar Messages

  • Read a frame from a mpeg video

    I need to progammatically read a frame from a mpeg video.
    I have already tried to make use of ffmpeg and convert the video in a PNGs (or whatever) sequence but now I would develop a more performing solution.
    Did anyone try or need something similar?
    Thanks!
    Solved!
    Go to Solution.

    Hi simroc76,
    the mpeg video format is not native supported by LabVIEW.
    If you want to read a mpeg video, one possible solution is to convert the mpeg file to an .avi file. If you want to create solution with a higher performance, i can give you two possible solutions:
    1) Maybe the ffmpeg application provides a dll, which you can call from LabVIEW. With this approach, you would use the CIN-Node from LabVIEW to control the function of ffmpe. I don't know, if ffmpeg provides such a function. If not, you must search in the internet for a application, which offers you this function. If you never used a DLL with the CIN-Node, this links are really helpful:
    Writing Win32 Dynamic Link Libraries (DLLs) and Calling Them from LabVIEW - Developer Zone - National Instruments
    http://www.ni.com/white-paper/4877/en
    Integrating External Code with the Import Shared Library Wizard - Developer Zone - National Instruments
    http://www.ni.com/white-paper/2818/en
    2) Another approach is to use ActiveX to get an frame. With ActiveX, you can control another application and can excange Data between LabVIEW and another application. This solution would also not be very easy, but it is an opption to import a frame from an avi-file into LabVIEW. If you want to know what is possible with ActiveX, you can use this example:
    Community: Creating a Hyperlink to a cell in Excel via Active X
    https://decibel.ni.com/content/docs/DOC-5780

  • XNET CAN frame queue overrun kills Read VI

    Hello, I am trying to read CAN frames via XNET. My problem seems to be connected to the queue of my Input session: If the queue gets bombed with random CAN messages from somewhere, the session property "Number of Values Pending" increases rapidly. That's ok, because my program calls XNET Flush before it starts using the bus itself. Otherwise my program would read the old queue content first and the expected reply frames later. This behaviour is ok and expected.
    But after I bombed the bus a little bit more so that the queue gets filled to maximal queue size (seems to be predefined as 1000), the Input session read operation will always timeout (tested with 1 second and more) and return an empty frame array. In this case the error wire is s to -1074384886 (timeout). The session always reports tranceiver state "Normal". Even the XNET Flush operation does not help, although it seems to empty the queue properly.
    summary: hitting the queue size limit with incoming CAN frames results in dead read operations.

    Hello pgraebel,
    In the screenshot you posted, NI-XNET will wait 0.1seconds for 1 frame to be present in the queue.  If there is less than 1 fram available, the VI will timeout.  That being said, I would guess that the timeout happens if you ask for many frames (close to the buffer limit), but the timeout is too small.  If you are trying to read 1000 frames, you may need to wait longer than 1 second for the frames to go on the bus.  That really depends on your bus timing/frame timing/etc.
    I made a small example to show you a little more how the buffers can be used in XNET.  You can set the buffer size and look at the unused spaces in both the read and write queue.  Let me know if it helps.
    O. Proulx
    National Instruments
    www.ni.com/support
    Attachments:
    CAN Frame Input Queued.vi ‏37 KB

  • Can't read frame from file

    We use proxies in our work flow, pre-rendering certain comps before rendering out the final project. For the most part this works fine, but occasionally we'll get an error that reads: "Error (4) reading frame from file." It's always the same comp but it doesn't cause the problem in every project.
    We use the quicktime codec with Tiff compression. Could it be a memory issue? Any help would be greatly appreciated. The error always pops up at the most inconvenient time -- of course.
    Thanks,
    Julian

    Well, if it's always the same file, then most likely one of the source footages is really damaged. The error not occuring every time mustn't mean anything. If the element in question is not visible at the given frame or AE doesn't do anything with it because it isn't required, naturally the error would not occur. I'm afraid the only way to track this down is to selectively disable/ remove the sources from the comps in question and render some test clips. Perhaps it would also help to check all the files used in the project in a "neutral" app such as external image and video viewers (XnView, VLC, MediaPlayer Classic...)
    Mylenium

  • Why I can't export a single frame from my composition?

    I try to export a single frame from the cavas but motion just did nothing when I click on export. Is there something wrong with my motion setup? I have trashed the motion's plist couple times already but still having the same issue. I can't even save the project. When click on save, motion did nothing, just like export. HELP!

    I see that you are on an intel mac. Are you running the universal versions (Final Cut Studio 5.1 w/ Motion 2.1)?
    See this article for troubleshooting steps: http://docs.info.apple.com/article.html?artnum=302596.
    When I am having major issues like this, I just start over from scratch. Do a complete erase and install with the OS discs, reinstall all applications and update everything with software update. I keep a separate partition just for film and video work that I can blow away any time (I don't store any important files on it).

  • When use scan mode and FPGA simultaneously, why does the FIFO Read can not be used?

    Hello, I am using compactRIO-9025 to do a project and trying to use scan mode and FPGA simultaneously ( Hybrid mode). I have already build a project as the following tutorial.
    http://digital.ni.com/public.nsf/allkb/0DB7FEF37C26AF85862575C400531690 and I have NI 9205, NI 9023 in Scan mode and NI 9871 in FPGA mode in the same project.
    In the FPGA Target of the project,  I add a FIFO and tried to use it to log in data from NI 9871. I wired the module I/O node to FIFO Write in the target vi. However, when I  droped the invoke method to the block diagram of the host vi and right clicked it, there is no FIFO Read can be choose. Could you please help me to solve this problem?
    Thank you very much!!

    I am not aware that using the Scan Engine is blocking any access to a transfer FIFO. But please reread this from your quoted KB:
    Secondly, the number of DMA FIFO's that can be used in the FPGA code will be reduced, since the scan engine uses two DMA FIFO's. Most FPGAs have 3 DMA FIFO's, so there will only be one DMA channel left to use in the FPGA code.
    This means, you have only a single DMA FIFO left which is either Target to Host or Host to Target.
    Make sure that you configured the FIFO to be the correct direction for your needs...
    hope this helps,
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Sensor_read_temp: failure reading temperature from sensor 0

    I have a Temperature sensor driver error as follows:
    2011 Mar 17 19:53:28 GB2FCC202EA %MODULE-4-MOD_WARNING: Module 12 (serial: JAF1435BFPG) reported warning due to Temperature sensor driver error in device 49 (device error 0xc310020b)
    2011 Mar 18 03:09:15 GB2FCC202EA %PLATFORM-4-MOD_TEMPFAIL: Module-12 temperature sensor 1 failed
    exception information --- exception instance 2 ----
    Module Slot Number: 12
    Device Id         : 49
    Device Name       : Temperature-sensor
    Device Errorcode  : 0xc310020b
    Device ID         : 49 (0x31)
    Device Instance   : 00 (0x00)
    Dev Type (HW/SW)  : 02 (0x02)
    ErrNum (devInfo)  : 11 (0x0b)
    System Errorcode  : 0x00000046 Temperature sensor driver error
    Error Type        : Warning
    PhyPortLayer      : Fibre Channel
    Port(s) Affected  : none
    Error Description : sensor_read_temp: failure reading temperature from sensor 0
    DSAP              : 0 (0x0)
    UUID              : 0 (0x0)
    Time              : Thu Mar 17 19:53:28 2011
                        (Ticks: 4D8258A8 jiffies)
    Temperature:
    Module   Sensor        MajorThresh   MinorThres   CurTemp     Status
                           (Celsius)     (Celsius)    (Celsius)        
    12       Outlet1         n/a             n/a         n/a        Failure              
    It looks a match for CSCsw41181 - however we don't see the following condition against any interface:
    'Error disabled - SFP vendor not supported'
    We tried reseating an SFP on this module but still no SFP vendor not supported condition.
    Any other known bugs or do we have to treat it as a hardware issue?
    thanks

    Hi,
    If it is related to CSCsw41181, a reload of the module would clear the condition.
    If you can schedule a maintenance window to reload the module, that may be the least
    intrusive next step (keep in mind that reloading the module will be disruptive to all the ports
    on that module).
    Regards,
    Ken

  • How to take timestamp from Transmitted CAN frame ?

    Hello,
    Timestamp from Received CAN frame is simply get as...
    NCTYPE_CAN_STRUCT *RxFrame 
    ... RxFrame->Timestamp ...
    For Transmitted frame I use: 
    ncGetAttribute(hCan, NC_ATTR_ABS_TIME, 8, &TxTime);
    ncWrite(hCan, sizeof(Transmit), &Transmit);
    But sometimes timestamp of Rx frame is BEFORE Tx timestamp ?!?!?!
    Is there any other way to get real Tx frame timestamp  - not by ncGetAttribute(...) ?
    Thank you in advance
    Petko G.

    you would need to set the interface into the Self-reception mode.
    Self-reception specifies whether to echo successfully transmitted CAN frames as received frames. Each reception occurs just as if the frame were received from another CAN device. The self reception mode is not available on the Intel 82527 CAN controller
    used by Series 1 CAN hardware. 

  • Why can't I read or write from my external hard drive?

    Hey there, I recently borrowed my brother's laptop to use as a media station for listening to music from, and watching movies, in order to free up some space on my main macbook.  In trying to migrate some files over, I discovered that my hard drive, a 320 GB WD Elements drive, is having some problems which I've never encountered before.  It has always worked fine in the past, but now I can't transfer any files to or from it, from either computer.  In all of my troubleshooting, I've gotten various errors, (-36, -50), and various messages saying how the device can't be read or written from, or how some files contian unreadable data, etc.
    Disk Utility found an unused node when verifying the disk, and notified me that the disk needed to be repaired.  I then used Disk Utility, which said it was able to successfully repair it, but the same problem remains, and after verifying the disk, it still says it needs to be repaired.  I've tried to find any files that may be causing the problem, and was finally able to delete a seemingly troublesome file that was stuck in my trash bin from the external drive after trying various apps, (ie Trash It, Cocktail, What's Keeping Me?).  This didn't end up solving anything...I've used terminal to eliminate some other potentially problematic files, with no luck still, and I'm not too confident with Terminal so I don't want to be messing around too much without more guidance.
    Most recently, I've used Disk Warrior to try to solve the problem, but still with no success.  When I use the app to Check All Files and Folders, it does so for only a few seconds, then reports that "An unexpected error ocurred while attempting to perform file operations" for several files, and that several files' "Property list is damaged and cannot be repaired".  When using Disk Warrior to REBUILD the drive, the app pauses for about 15 seconds, then says that it can't be rebuilt because it is in use.  Again, I've used the What's Keeping Me? app to kill any activity with the drive, and the same error occurs.
    I've spent a lot of time trying to sort this out...It's very frustrating, and I have a lot of files that mean a lot to me on my drive, so any help would be greatly appreciated!
    Thanks a lot!
    Ryan

    I have this problem too with my Western Digital 1TB My Passport for Mac.
    Downloaded Card Data Recovery - did not work. The software self terminated itself when the problematic WD is connected. Starts up fine when the WD is not connected by USB.
    Then I downloaded Remo Recovery. Starts up fine, scans fine and appears to save the files but ALL the files 'saved' are unreadable.
    Finally, downloaded Stellar Phoenix in a last ditch attempt to recover my precious video files. Starts fine, saves fine BUT it cannot save files above 200MB because the WD stops working every 10 minutes.So, did not solve my problem totally because I have so many files above 200MB.
    And yes, I PAID for all the software above. And the first two software are reluctant to refund me my money until their development team can ascertain whether it's a software bug, over online web conference. And because of the time differences, I can never get online with them. So, all my money gone.
    Until one day I opened Activity Monitor and noticed this 'fsck_hfs' starting up everytime I connected the problematic WD My Passport for Mac.
    So, tried to Force Quit 'fsck_hfs' and VOILA!
    A dialogue box popped up and says that the Passport for Mac cannot be repaired and that I can move and copy files from it but not save to it.
    PHEW!!
    At least I can access the files and save them to my Seagate 1TB although now I am having a problem opening FCP X project files rescued from the WD.

  • I have an external hard drive, from Iomega. However, I cannot copy or save any file to it. On my PC it says that is possible to read and write in it, but in my Mac, it says I can only read. can somebody help me?

    I have an external hard drive, from Iomega. that I can open and see my files. However, I cannot copy or save any file to it. On my PC I have it says that is possible to read and write in it, but in my Mac, it says I can only read. can somebody help me?
    Also, Im a photographer, so I like to name a lot of files at the same time (used to do in on PC and it was very usefull.) cannot find out how to do it on my Mac. Really appretiate if some one can give me a solution! Thanx

    Your drive is formatted with the NTFS file system.  OS X can read but not write to the NTFS file system.  There are third party drivers available that claim to add the ability to OS X to write to an NTFS partition.  I have not tried them and don't know if they work.
    The only file system that OS X and Windows can both write to natively is the FAT32 file system.

  • How can I read pdf files from LabVIEW with different versions of Acrobat reader?

    How can I read pdf files from LabVIEW with different versions of Acrobat reader?
    I have made a LabVIEW program where I have possibility to read a PDF document.  When I made this LabVIEW program it was Acrobat Reader 5.0.5 that was installed on the PC. Lather when the Acrobat Reader was upgraded to version 6.0, there was an error when VI tries to launch the LabVIEW program. And Later again when we upgraded to Acrobat Reader 7.0.5 I must again do some changes and rebuild the EXE files again
    It isn't so very big job to do the changes in one single LabVIEW program, but we have built a lot of LabVIEW programs so this take time to due changes every time vi update Acrobat Reader. (We have build EXE files.)
    The job is to right click the ActiveX container and Click "Insert ActiveX Object", then I can brows the computer for the new version of acrobat Reader. After this I must rebuild all the "methods" in the Activex call to make the VI executable again.
    Is there a way to build LabVIEW program so I don't have to do this job every time we update Acrobat Reader?
    This LabVIEW program is written in LabVIEW 6.1, but I se the problem is the same in LabVIEW 8.2.
    Jan Inge Gustavsen
    Attachments:
    Show PDF-file - Adobe Reader 7-0-5 - LV61.vi ‏43 KB
    Read PDF file.jpg ‏201 KB
    Show PDF-file - Adobe Reader 5-0-5 - LV61.vi ‏42 KB

    hi there
    try the vi
    ..vi.lib\platform\browser.llb\Open Acrobat Document.vi
    it uses DDE or the command line to run an external application (e.g. Adobe Acrobat)
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"

  • Siri says she can't read my email from the iphone5s lock screen when I'm using the standard headphones, but I could do that on 4s. How can I get my 5s to do that?

    Siri says she can't read my email from the iphone5s lock screen when I'm using the standard headphones, but I could do that on 4s. How can I get my 5s to do that?

    Hi Liz,
    Sorry to hear you are having a similar problem.  Last night I went to the tool bar at the top of iphoto, clicked on "File",  then clicked "Browse Backups" in the drop down menu.    I have an external hard drive that is set up to Time Machine.   The Browse Backups  opened the iphoto pages in the Time Machine.  I selected a date one day ahead of the day I performed the now infamous update, and it showed my iphoto library as it had existed that day.   I then clicked  "Restore Library" at the bottom right corner of the Time Machine screen.   Roughly 2 hours later my iphoto was back to normal.   When I opened iphoto there was a message saying I need to upgrade my program to be compatible with the new version of iphoto(version 9.2.1).  I clicked "Upgrade" and within seconds it had done whatever upgrading it needed to do. 
    The only glitch in the restoration was that it restored the library as it appeared last week, so I no longer had photos I had imported this past weekend.   I simply went back to the Browse Backups in the drop down menu,  when Time Machine opened I selected the page showing my pictures from this weekend and again said to Restore Library.   Roughly 45 minutes later the library was restored including the most recent photos.  
    I am now a happy camper. 
    I don't know if any of this will be of help to you because your email says you are having trouble with photos imported after the upgrade was performed.   Have you had any pop up notices when you first open iphoto,  that tell you you need an upgrade to be compatible with the new iphoto?     If so have you clicked "upgrade"? 
    Good luck Liz,  if you have Time Machine running as a back up to your library, maybe you wil be able to get help there, by following my instructions above.   Otherwise,   good luck with your investigations.   I'd be interested in hearing how you make out.
    Karen

  • LR 5.6 on Mac desktop all of a sudden will not read any card from any reader but will work on my laptop. I can work on previous images but not import new ones. Even if I create a catalog on laptop and import to my desktop on a thumb drive, the images are

    LR 5.6 on Mac desktop all of a sudden will not read any card from any reader but will work on my laptop. I can work on previous images but not import new ones. Even if I create a catalog on laptop and import to my desktop on a thumb drive, the images are only accessible as long as the thumb drive is inserted.

    Sounds like you may need to repair the Disk Permissions on your drive where your images are stored.

  • How can I input read a line from a file and output it into the screen?

    How can I input read a line from a file and output it into the screen?
    If I have a file contains html code and I only want the URL, for example, www24.brinkster.com how can I read that into the buffer and write the output into the screen that using Java?
    Any help will be appreciate!
    ======START FILE default.html ========
    <html>
    <body>
    <br><br>
    <center>
    <font size=4 face=arial color=#336699>
    <b>Welcome to a DerekTran's Website!</b><br>
    Underconstructions.... <br>
    </font> </center>
    <font size=3 face=arial color=black> <br>
    Hello,<br>
    <br>
    I've been using the PWS to run the website on NT workstation 4.0. It was working
    fine. <br>
    The URL should be as below: <br>
    http://127.0.0.1/index.htm or http://localhost/index.htm
    <p>And suddently, it stops working, it can't find the connection. I tried to figure
    out what's going on, but still <font color="#FF0000">NO CLUES</font>. Does anyone
    know what's going on? Please see the link for more.... I believe that I setup
    everything correctly and the bugs still flying in the server.... <br>
    Thank you for your help.</P>
    </font>
    <p><font size=3 face=arial color=black>PeerWebServer.doc
    <br>
    <p><font size=3 face=arial color=black>CannotFindServer.doc
    <br>
    <p><font size=3 face=arial color=black>HOSTS file is not found
    <br>
    <p><font size=3 face=arial color=black>LMHOSTS file
    <br>
    <p><font size=3 face=arial color=black>How to Setup PWS on NT
    <BR>
    <p><font size=3 face=arial color=black>Issdmin doc</BR>
    Please be patient while the document is download....</font>
    <font size=3 face=arial color=black><br>If you have any ideas please drop me a
    few words at [email protected] </font><br>
    <br>
    <br>
    </p>
    <p><!--#include file="Hits.asp"--> </p>
    </body>
    </html>
    ========= END OF FILE ===============

    Hi!
    This is a possible solution to your problem.
    import java.io.*;
    class AddressExtractor {
         public static void main(String args[]) throws IOException{
              //retrieve the commandline parameters
              String fileName = "default.html";
              if (args.length != 0)      fileName =args[0];
               else {
                   System.out.println("Usage : java AddressExtractor <htmlfile>");
                   System.exit(0);
              BufferedReader in = new BufferedReader(new FileReader(new File(fileName)));
              StreamTokenizer st = new StreamTokenizer(in);
              st.lowerCaseMode(true);
              st.wordChars('/','/'); //include '/' chars as part of token
              st.wordChars(':',':'); //include ':' chars as part of token
              st.quoteChar('\"'); //set the " quote char
              int i;
              while (st.ttype != StreamTokenizer.TT_EOF) {
                   i = st.nextToken();
                   if (st.ttype == StreamTokenizer.TT_WORD) {          
                        if (st.sval.equals("href")) {               
                             i = st.nextToken(); //the next token (assumed) is the  '=' sign
                             i = st.nextToken(); //then after it is the href value.               
                             getURL(st.sval); //retrieve address
              in.close();
         static void getURL(String s) {     
              //Check string if it has http:// and truncate if it does
              if (s.indexOf("http://") >  -1) {
                   s = s.substring(s.indexOf("http://") + 7, s.length());
              //check if not mailto: do not print otherwise
              if (s.indexOf("mailto:") != -1) return;
              //printout anything after http:// and the next '/'
              //if no '/' then print all
                   if (s.indexOf('/') > -1) {
                        System.out.println(s.substring(0, s.indexOf('/')));
                   } else System.out.println(s);
    }Hope this helps. I used static methods instead of encapsulating everyting into a class.

  • Can't read or write from iPod when it syncs with a big library

    When I try to sync with my 50Gb size library in the iTunes installed on my iBook G4 (10.4.11), it appears "can't read or write from the ipod", in the middle of the synchronization. It starts to do the job very well, but when it has done only 6 or 8 Gb, the process got slower until it appears such message. I have iTunes 7.6 and ipod firmware 1.1. I have tried on Windows and Mac plattforms, trying all the combinations (Mac and/or Win formats) and the trouble persists. The device has only two weeks of use, and it was working perfectly until now. The problem it is the same if I do it manually (no automatic sync). I am not sure if the problem is defective hardware, does anybody have any idea or have similar problem? Thanks.

    Thanks a lot for your answer. The idea of an increasing autoplaylist it is pretty good. I did it, in 5 Gb steps, and in the thrid step (10 Gb done), when it only has copied almost one Gb, the error message pop up again. Before the message appears, iTunes become slower and slower copyng each song until it stops in one song, and after a while, message appears. After, the system come down, almost blocked, and it takes a long until I can mount the ipod again. Of course, ipod restarts automatically and the songs copied in the last step are not there. I was taking care in every moment of the process, avoiding to leave the system suspend alone (and also turning off all the saving energy options). I am now pretty sure that the problem is on the device. Anyway, thank you very much for your valuable ideas.

Maybe you are looking for