Write analogue channel to CAN bus

I have a cDAQ with a number of analogue and digital I/O modules installed. What I would like to do is take some of the analogue inputs and transmit them onto a CAN bus using the NI 9862 module. I know the basics of how to read the analogue data but I'm not sure how to get this onto the CAN bus, does anyone have a sugested starting point?
Thanks,
Richard

Hi Richard,
as you use the 9862 on a cDAQ you should have XNET driver installed. This driver comes with a lot of example VIs. Start by studying them!
You need to define a CAN message containing your "analog" signal. Then you send that message using XNET write message function…
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome

Similar Messages

  • Acquire with DAQ and write DATA on can bus

    I acquire data with a 6040E card and I would to send some of these data on CAN bus (card CAN DS) at 100ms but my industrial PC crash (1.2GHz 512Mo win2000 LV6.1).
    The frequency of the acquisition is 1KHz and i aquire 4 data, my while loop run at 4ms, all seem to be normal.
    In the same loop i try to send data on CAN bus all the 100ms but after sending 3 or 4 data my computer crash.
    In two differents loops it's the same problem.
    When I communicate with RS232 instruments during this acquisition i have no problem.
    Can I do it? what is the problem? ...
    Thank you for your response.
    XAVIER

    I'm using NI CAN 2.0, NI DAQ 6.9.2, and NI VISA 2.6.1.
    In fact I would like to acquire data with a 6040E and 6602 counter at the same frequency (250Hz). I have a continuous acquisition of 16 DAQ channels with a sampling rate of 1KHz. I read 4 data in my buffer (1000) but only the first element of the buffer interresting me. The time of my while loop is 250Hz and all this 250Hz I read the value of my counter (simple read). A buffered read with the counter is not good because of the low frequency of my input signal. That increases the time of my acquisition loop.
    I use the RTSI bus to synhronise the starting of the counter with the ai scan start of my DAQ card.
    All the 100ms (in the same while loop) I write 1 CAN frame (1 2 3 4 5 6 7 8 at this time) w
    ith ncwritenet.vi of the frame API.
    But after few second (5 to 60) the image of my computer freezes, my mouse doesn't move, I can only shutdown my computer to restart it.
    I have find only this solution to synchronize my DAQ and counter acquisition but it takes many CPU time and it would be the reason of the crash.
    Thank you for your futur response.
    XAVIER

  • What is the best way to write 10 channels of data each sampled at 4kHz to file?

    Hi everyone,
    I have developed a vi with about 8 AI channels and 2 AO channels... The vi uses a number of parallel while loops to acquire, process, and display continous data.. All data are read at 400 points per loop interation and all synchronously sampled at 4kHz...
    My questions is: Which is the best way of writing the data to file? The "Write Measurement To File.vi" or low-level "open/create file" and "close file" functions? From my understanding there are limitations with both approaches, which I have outlines below..
    The "Write Measurement To File.vi" is simple to use and closes the file after each interation so if the program crashes not all data would necessary be lost; however, the fact it closes and opens the file after each iteration consumes the processor and takes time... This may cause lags or data to be lost, which I absolutely do not want..
    The low-level "open/create file" and "close file" functions involves a bit more coding, but does not require the file to be closed/opened after each iteration; so processor consumption is reduced and associated lag due to continuous open/close operations will not occur.. However, if the program crashes while data is being acquired ALL data in the buffer yet to be written will be lost... This is risky to me...
    Does anyone have any comments or suggestions about which way I should go?... At the end of the day, I want to be able to start/stop the write to file process within a running while loop... To do this can the opn/create file and close file functions even be used (as they will need to be inside a while loop)?
    I think I am ok with the coding... Just the some help to clarify which direction I should go and the pros and cons for each...
    Regards,
    Jack
    Attachments:
    TMS [PXI] FINAL DONE.vi ‏338 KB

    One thing you have not mentioned is how you are consuming the data after you save it.  Your solution should be compatible with whatever software you are using at both ends.
    Your data rate (40kS/s) is relatively slow.  You can achieve it using just about any format from ASCII, to raw binary and TDMS, provided you keep your file open and close operations out of the write loop.  I would recommend a producer/consumer architecture to decouple the data collection from the data writing.  This may not be necessary at the low rates you are using, but it is good practice and would enable you to scale to hardware limited speeds.
    TDMS was designed for logging and is a safe format (<fullDisclosure> I am a National Instruments employee </fullDisclosure> ).  If you are worried about power failures, you should flush it after every write operation, since TDMS can buffer data and write it in larger chunks to give better performance and smaller file sizes.  This will make it slower, but should not be an issue at your write speeds.  Make sure you read up on the use of TDMS and how and when it buffers data so you can make sure your implementation does what you would like it to do.
    If you have further questions, let us know.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • Digital TV doesn't detect analogue channels

    new digital tv (26AV700A) doesn't pick up all available channels, in particular analogue channels. our previous analogue tv picked up all analogue channels when connected to the same aerial.
    done the setup (wizard) and auto scan which found some of the analogues, but not all.
    the setup menu, submenu channels, lacks two menu items specified in the tv's handbook - both refer to analogue channels, ie <analogue manual scan> and <analogue fine tune>
    it seems some key analogue capability is missing - is there some setting that turns the whole analogue thing on/off ?

    Hi
    I dont think you will get proper answer here because this is forum for Toshiba computers/notebooks and all stuff that has something to do with it.
    If you have problem with TV I recommend you to contact your local dealer in TV shop. They are specialized for such issues and I hope they can help you with this.
    By the way, friend of mine has Toshiba TV and in settings there is option where you can enable channel scanning for analogue channels, digital channels or both of them. There is also option for quick scan. Everything is described in users manuals.

  • Getting "Name0" should be "Name" from Write Data Channel vi

    Can someone please explain this behavior? For some reason I'm getting "0's" apended to the Name string of my Write Data Channel vi.
    Small write vi sample is attached.
    thanks for any help
    Attachments:
    write[1].vi ‏316 KB

    Mudda,
    Thanks for the feed back. It looks like this behavior is tied to using the "Simulated Signal" express vi's. When the Simulated Signal vi is wired the Name field becomes the "Name/Channel Number" field. When you merge multiple Simulated Signal vi's and feed this into the Write Data Channel input you get "Name(n), Name(n+1)" etc. That is fine for merged inputs but for what it's worth I think we should be able to disable this "feature" when just using 1 Simulated Signal input. Sample of this is attached.
    Attachments:
    write_001.vi ‏382 KB

  • Resetting CAN bus without knowing task reference

    Good morning everyone,
    I am using the CAN Channel API to read data coming in from a CAN bus while simultaneously taking measurements using other DAQ hardware. When my VI throws an error after the CAN bus has been initialized and started, attempting to run my VI again will cause the CAN init-start VI to throw an error because the channel was never cleared.
    Is there a way to clear a CAN channel without having a task reference to wire? How else could I solve this issue?
    Thanks!
    Erik
    Solved!
    Go to Solution.

    Hi Erik,
    Is the error that you're experiencing coming from the same function on a regular basis?  If so, what can be done prior to adding error handling to the entire application, you can add a case structure, use the error cluster from that function to act as the selector for the case structure, and add a Clear Channel command to the true case of the structure followed by an error handler.  
    Now, that said, I still recommend employing error handling throughout the application, especially if this will be distributed as an executable.  But for development purposes, that may be the quickest way to implement a Clear function on failure in the VI so that it will restart correctly on the next iteration.
    Regards,
    -Dave C
    Applications Engineer
    National Instruments

  • Read CAN bus object

    Hi there,
    I´m a new comer in the field CAN bus diagnose, and have problem with CAN object diagnose.
    As I write my program just like the attachment, I received an error message.
    I wanna poll a specified ID without reading the CAN net in whole.
    How can I use the CAN object VIs correctly?
    Thx!

    JB is right, objects are not supported since the USB-CAN does not have an internal processor like the Series 2 CAN cards.
    You could either use hardware filters to filter out all unwanted frames and keep CPU load down or receive all frames and filter them in LabVIEW.
    Regards,
    Andreas S
    Systems Engineer

  • Basic CAN BUS question

    I'm using a CAN BUS for the very first time and would like to have some explanations on something that seems to be a normal behavior. I used the CAN Transmit - event based.vi with NI-Spy to monitor the outputted CAN frame.
    I've set the baudrate to 1MB, the Arbitration Id to 0x8, the data length to 4 (see attached Front Panel Settings.jpg). When I look at the captured input and buffer I can see that the input data size is 14 and that the buffer contains the arbitration Id 08 followed by four 00 bytes, the data lenght value 04, the four data bytes 01 02 03 04 and then four 00 bytes.
    These results doesn't seems to be compliant with the CAN frame specification (see attachment CAN FRAME Bosch.png). Can somebody explain this to me?
    Thanks,
    Ben
    Attachments:
    CAN Transmit - event based.png ‏48 KB
    Front Panel Settings.jpg ‏44 KB
    CAN Spec Bosch.png ‏162 KB

    Hi Ben,
    What's the exact hardware you are using with this? Have you checked with the Bus Monitor instead of NI Spy to see if the frames are read correctly. It's generally a lot more difficult to make sense of the frames in NI Spy. You can launch Bus Monitor from MAX by right clicking the specific CAN interface. If you have a 2 port CAN device or have 2 CAN ports that you can access, then you can write out of one and read from the other using the Bus Monitor to make sense of what's being written on the bus.
    Raj
    National Instruments
    Applications Engineer

  • Can bus activity

    Hi all,
    I'm using all ports of a PCI series 2 CAN card and I would like to monitor the bus activity using without opening bus monitor.
    Does anyone know how to detect if the CAN bus is still sending messages or not using channel-API?
    Sometimes the bus seems to freeze after a while and not showing any changes at all. I have to stop the vi and run again to see the change value.
    I am trying to read lots of messages (each contain maximum 64 channels). I use Multi-Chan Single-Samp 1D Dbl type to read.
    Thank you
    -bm-
    Attachments:
    Single Sample Input.vi ‏57 KB

    Please direct all replies to the following post:
    http://forums.ni.com/ni/board/message?board.id=30&​message.id=1457
    Logan S.

  • Pb of transmitio​n of a message on CAN bus with MAX using a CANdb file (.dbc)

    Hello,
    I tried to transmit a message on the CAN bus with MAX, I used a database.
    I have tried to transmitsome datas with the "NI CAN channel test pannel" (right click on a channel of a message), I put my value i click on "start", then "send" and when I look at the "Bus Monitor" (right click on CAN0) I see messaged that are received but I don't see my message transmit...
    Why my message are not transmitted?
    Bye.

    Duplicat post: http://forums.ni.com/ni/board/message?board.id=170&message.id=247678&jump=true
    LabVIEW Champion . Do more with less code and in less time .

  • 16 analogue channels

    Hello
    This is just a quick question. I've got a mac mini 1.4.2Ghz and i've been running Logic pro on it for a while now and its been running fine, no problems. I've now started using a MOTU 828 mkII audio interface with it so i could have 8 channels of sound going to and from a mixing desk, and this also works fine. I'm using an external mixing desk because i have a lot of vintage rack gear which i like to use.
    But i've noticed that i can add an extra 8 analogue channels of audio by adding an ADAT bridge to the MOTU audio interface, but would my mac mini cope with all these extra audio signals, or would it start to struggle and loose performance?
    Any advice would be greatful

    Tom, I would like to think it would cope as long as you keep the clock rate down at 44.1 or 48Khz. Where you may have problems is if you expect to be able to run plug-ins on all those channels as well.
    I'm hoping to do a similar thing with a Fireface 800 and add a further 8 ADAT channels - all through one Firewire 400 connection. Admittedly I have a G5 DP 2Ghz Mac but if you have one of the new Intel Mac Minis then I have heard they are pretty fast.
    Rik

  • Nmea 2000 over pxi - can bus (NI PXI-8460/2​)

    Hi,
    I gonna purchase an Automatic Test Equipment (ATE) based on NI PXI.
    (LabWindows/CVI, Win7)
    One of the features of my ATE is to test a NMEA2000 network (read and write masseges).
    Can I use the NI PXI-8460/2 module to test the NMEA2000 network?
    If yes, what else do I need except of that module (software, hardware)
    If not, what can I use instead of a CAN-BUS module?

    Hello easo,
    All of our CAN cards will work with a network as long as it is CAN compliant. In order to program our CAN cards all you will need is our CAN driver. Please let me know if you have any other questions. Have a great day!
    Best Regards,
    Adam G 
    National Instruments
    Applications Engineer

  • I have an external hard drive that was formatted by a PC and has files and directories etc. I want to format it and use it on my IMAC for backup but I can't seem to write to it nor can I delete current content. How do I initialize it for use with the MAC?

    I have an external hard drive that was formatted by a PC and has files and directories copied to it etc. I want to use it on my IMAC for backup. I see it on my my IMAC . I can open files etc.  But I can't seem to write to it nor can I delete current content. I don't care if I lose current content. How do I initialize it for use with the MAC?

    You can't write to it because it's formatted as NTFS which OS X will read but not write to. If you want to continue using the drive with both a PC and OS X you will need to download and install NTFS-3G so you can then write to it from your Mac. You can get NTFS-3G at:
    http://www.macupdate.com/app/mac/24481/ntfs-3g
    If you want to use the drive exclusively with your Mac then move the data off it and reformat it in Disk Utility (Applications - Utilities - Disk Utilities) as Mac OS Extended (Journaled.)

  • Can LabView simulate multiple nodes on a single CAN bus?

    We currently are developing a system where a single control panel controls a number of drive motors over a CAN bus.  Each of those drive motors has electronics and software in them which tracks the status of the motor, and this information is sent over the CAN bus to the control panel.
    We have previously used Vector CANoe to simulate the activity of the drive motor nodes on the CAN bus during development of the control panel.  We want to move to LabView in order to run this kind of simulation.
    Is it possible for LabView to be used to run this kind of simulation?  Each node would have its own CAN ID on the bus.  It would need to send out appropriate periodic status messages on that CAN bus that would be based on user inputs.  It would also need to display certain information based on commands sent to it via the control panel over CAN.
    Thanks for the assistance.

    Hi,
    I believe that what you need is to simulate several CAN ports. There is a similar discussion form that I believe will answer you question. I hope this helps.
    Regards
    Krista S.
    Applications Engineering
    National Instruments

  • Is there a limit on Channel that can be added to selector

    I have read in an old document on javaworld that there is a limit of 63 channels that can be registered with a Selector. I assume I can create multiple Selecors, if I have to manage more than 63 channels and try to select on each one after the other.
    However, I still want to know whether this limit is there as I did NOT see it in any NIO documentaion.
    I quote from the below article -
    "Fourth, a selector can have only 63 channels registered, which is probably not a big deal. "
    http://www.javaworld.com/javaworld/jw-09-2001/jw-0907-merlin_p.html
    Raj

    This was a Windows-only limit in JDK 1.4.0. If you are not on Windows, or are in 1.4.1 or later, there is no limitation.

Maybe you are looking for

  • How to parse thus XML data?

    Hi,experts: In below thread: Receiving .Net dataset with deployed proxies i asked how to create a external definition in IR base on above XML data. Now,i have created a XSD file base on the XML data.And importing it into IR successfully. <?xml versio

  • Ghost email in CDT client

    hi, we have a problem with SAP BCM because in CDT one of our emails hanged up and it is shown that it's waiting 2000 hours for reaction. off course i searched in CTM many times and i cannot find this task (to be handled again) do you know maybe what

  • Memory full error on Crystal 11

    We are facing "Memory full" error on some of our reports when we run on our server. Server: windows 2003 Application used for input parameters: vb6 Crystal product: Crystal 11 What might be wrong with the application?

  • Wanting to create a new Apple ID but says the email is unavailable/ maybe used already

    I Am trying to create a new Apple ID but the email I am trying to use is unavailable or used already.  How is that possible?  Is it because I have that email in my phone as well as my email I use for my Apple ID?

  • Does FW CS5 Mac crap out w large file sizes?

    Does FW CS5 Mac crap out with large file sizes like CS4 did? It seems like files over a 4-5MB tend to be flaky... Is there an optimum file size? I'm running a Mac Tower 2.93 GHz Quad Core, w 8 GB RAM