Transmit payload NI-XNET CAN

Hi guys, Im using a NI-XNET can PCI device. How to transmit a payload on the bus?
Solved!
Go to Solution.

Hello JoVMo,
You can use the XNET Write (Frame CAN).vi
More information concerning the VI you find on the following link: http://www.ni.com/pdf/manuals/372840a.pdf (see page 216/848 or Chapter 4: 173)
Extra information concerning the  NI-XNET API, you can find here: http://zone.ni.com/devzone/cda/tut/p/id/12375
Kind regards,
Nico

Similar Messages

  • Change payload NI-XNET CAN

    HI,
    I am trying to perform some CAN communication with NI-XNET at the frame level.  I have started with the CAN Frame Input Single Point.vi and CAN Frame Output Single Point.vi examples that came with NI-XNET.  I would like to be able to change the payload of the frame to be written in the output vi  (i.e. have it not be controled by a human on the front screen) but have been unable to find a way to write the payload attribute in the XNET Frame CAN typedef.  I have tried to recreate this cluster on my own to no avail.  If anyone could point me in the correct general direction it would be much appreciated.  
    Thanks in advance,
    Kevin

    Hey Kevin,
    Are you sending a frame from a frame list that you created in a database?  Are you using a temporary database in memory?  If you have a framelist in a database that has the payload predefined, I'm not sure that you can change the cluster definition programmatically.  If you were to open up the XNET Database Editor, you should be able to manually specify the format of the cluster being passed, including the payload lenght.  In addition, if you set the database as the :memory: including the colons, you can configure the cluster to be whatever you would like from the front panel.
    Does this answer your question?  Are you just trying to change the payload length of a frame, or is there more to it than just that?
    Ben N.
    Applications Engineering
    Certified LabVIEW Developer

  • How to transmit multiple messages over CAN

    Hi All,
    How to transmit multiple messages over CAN ? With all three messages i want to send the system time & date also.
    How can i get the timestamp in DBL format (Since the timestamp in the input of ncWriteNetMult.vi is a DBL). If possible kindly share the code in Labview 7.1 also.
    Thanks in advance.
    J

    The NI-CAN driver brings examples for nearly every use case. Driver version 2.4 or later has the Write multiple function to write multiple frames at ones.
    There is an example available for LabVIEW, CVI and VC/VBasic called CAN Transmit multiple.
    Also check the attached VI and the Can manual: http://www.ni.com/pdf/manuals/370289m.pdf
    What do you mean by converting Timestamp to DBL? Timestamp contains all date and time information. You can convert it into string format as shown below and then use the relevant data from it by string operations.
    Hope this solves your problem.
    Shreyas Hebbare
    Shreyas Technologies
    India
    Attachments:
    Transmit Multipe Objects at Different Rates_LV80.vi ‏36 KB

  • Trouble with Simple XNET CAN Example...

    I am trying to get a simple XNET CAN write frame going. Here is the VI I created...
    I keep getting this:
    I looks like I have a frame set up, so what else could be the issue?

    Hey,
    I am "trying" to create a session and send data on the fly. I changed my vi back to the simple one I had earlier in the day:
    Attachments:
    XNET_CAN_Write.vi ‏12 KB

  • I am using XNET CAN on a PXI system. When I modify the can database I get the error "the interface has already been opened.."

    I have tried both building the XNET session from project explorer and by building a signal list in the VI.
    Any suggestions? Thanks in Advance.

    Thanks for the reply. I don't think I have any interface open. But to be sure, I rebooted everything - same result.
    Is there some step in the project config that I am failing to do? In the PXI systems I had before XNET, I had to setup some CAN configuration stuff in MAX to get it to work, but I don't see that option anymore with XNET.... 
    I have been sucessful in running XNET CAN VIs reading and writing the data from my database, but I stumble every time I add a signal or rename the database. 
    I made a simplified VI to illustrate, using a previously working database I now get the empty name message.(screen capture attached)
    This is connected to a working CAN link, and I can see these signals in MAX properly.  
    Thanks in advance for your assistance!
    Attachments:
    vi_issue1.jpg ‏136 KB

  • XNET CAN filtering based on payload information of different frames

    Dear all,
    The CAN frames I recieve per cycle are with the following identifiers: 
    [1 frame] 513 (Radar status- range, elevation, target type)
    [1 frame]1536 (Target status - No of targets near field from byte 1 and No of targets far field from byte 2)
    Followed by 96 message pairs of which 1-32 pairs are for near field and 33-96 are for far field.
    1793 (Target Info 1)
    1794 (Target Info 2)
    For the filter, I need to to identify the 1536 frame first and read byte 1 and byte 2 which gives me information about the number near and far targets respectively. 
    Then I need to pick (equal to byte1) number of message pairs from the first 32 pairs and retrieve sigals from that; and then pick (equal to byte2) number of message pairs from then next 64 message pairs and retrive signals. 
    As this plots only the targets that are valuable. I am also looking to create more efficient projects that can be scaled to multiple radars. Any tips for efficient documentation would be much appreciated.
    Kind Regards,
    Red
    Attachments:
    MainRadar.vi ‏129 KB
    radar-.dbc files.zip ‏5 KB

    Hello Red,
    I saw your code. you need do some modifications.
    1. your using STOP vi in ForLoop. when it's true then it will stop your main VI completely. It's like abort button. Instead of that right click on forloop and select Stop terminal.
    2. your passing two index arrays to Forloop (CAN Frames & Search ID Array). if your giving like this, it will always executes based on least array index. So suppose you have 100 frames then it will runs up to 7 times (because your array have 7 elements)
    3. why are taking index from foorloop and again using other loop with Shift registers?  you can take last value directly from your 1st FoorLoop. Right click on the Tunnel and Select Last element.
    4. In your VI, your always clearing your XNET reference. Suppose CAN Frame is not present in next iteration then it wont take previous value. it will give you default value (max- 0)
    Munna

  • LABVIEW NI-XNET CAN WRITE DELAY

    Hi,
    I am really happy that I can read this article because it seems like it is the similar problem that I am facing right now. I also has a really bad CAN update delay when I want to write Data on CAN bus.  I was trying to following your solusion here, use frame in single point, frame out single point. But I am not so sure that I can continue. In our labview, we use frame in/out stream(sorry the screenshot cut is wrong). But if I want to change it to frame in/out single point, it will show an error saying: mising wiring on NI-XNET block.
    In our labview, we use a big sequence loop. So what in saw in the 1st pic I attached is the first sequence, then in the 2nd sequence we had a Frame Can write frame. Then in the 3rd one, which is in the 2nd pic, it shows the CAN write frame that contain a lot of message that I would like to write on CAN bus.
    The problem here is sometimes the CAN loop takes 0.3s(I use a shift register in the 3rd sequence showing CAN loop time) to update which is too low for me to use Vector Canalyzer to record data. For example, I did a 10 sec test of recording using Canalyzer, it only has 59 values from Labview. 
    In your article it said I need to 'Frame in single point' for my reads, and 'Frame out single point' for my writes. I do know i can use database editor to build a session and define every frame and signal it it. However, I do not know where to put it then? is that connect to NI-XNET write frame? It is the only thing I can think of to do now? But is that meanning all the blocks in the second pic would be deleted.
    Because our grogram is really very very big and it including so many info, I do not think I can post VI. I thought there might be possibility that because of the ''BIG'' thing has something inside that culprit for CAN transmission delay. But I have tried to move  everything except CAN in this loop to another newly built loop. The problem is still there. 
    Thank you so much. 

    You actually always have an XNET database. It's just a matter of whether you use an external database or whether you create objects on the fly.
    From your screenshot, it looks like you are creating objects on the fly using the in memory database.
    Looking at your frame configuration, I was surprised to see Remote frames being configured. Most devices that I've encountered don't use them.
    So what sort of session are you trying to create? Frame Out Stream does not allow for cyclic transmission. You can repeat transmissions using a software loop. If you really have cyclic frames, Frame Out Single Point or Frame Out Queued would work. The post you referred to earlier was using the Frame Out Single Point.
    The XNET help is actually pretty good about breaking down the session modes. From that help, "...  this mode does not repeat its transmit. Unlike the Frame Output Queued mode, the Frame Output
    Stream mode does not use CAN frame properties from the database."
    So if you're using this mode and getting unexpected delays, it's likely due to your sequencing.

  • XNET CAN stops upon errors. (PXI-8512 using RT VeriStand)

    Hello, I am using the PXI-8512/2 in an electrically noisy environment so I often get errors on the CAN bus. I notice that often the 8512 stops communicating as a result. In my dual port 8512/2, LED #4 which normally blinks ends up turning off. However, I do have other devices listening on the same bus; they report errors but continue to stay alive. Is there anyway I can have the 8512 continue working in the presence of errors? I'm using the XNET custom device for VeriStand 2009 and don't see any error handling options. In fact, I don't get any notification of errors at all. I just notice that my incoming CAN signals stop and my outgoing ones have no effect. Thanks.

    Howdy All,
    This is a duplicat post. Since the question has to do with the NI XNET Custom Device for VeriStand we will answer on the other thread, please do not reply to this thread.
    Joshua B.
    National Instruments
    NI Services
    NI Support Resources
    NI Training Resources

  • XNET CAN (frame in)single point issue

    Hi guys,
    I have a problem reading a frame in a single point session. I have this issue now in two different (labview)vi's. In the first a device sends a single frame and I catch it in labview. In the second I send a single point frame from the same vi through another CAN tranceiver and catch this frame in the same vi.
    Sometimes the payload get catched and sometimes(like 5 executions) it's like nothing is received? How can I check raw frame data to know my payload is received?

    You are actually not doing single-point, instead, you are doing Stream Input. This will read into a queue of frames.
    In your while loop, you are doing a Frame CAN read w/o a timeout and a quantity of -1. This means, "return all frames that are currently available". Note, if there are no frames available, this will return an empty array.
    Here is where it gets tricky and you may need to know more about LabVIEW. You have an empty array, and you are then passing that into "index array". If you index an ampty array, you will get get a valid element (since an element cannot be empty) that contains the values of all zeros. This means that the timestamp will have a value of 0 and the payload will be an empty array.
    In the next frame, you are just checking for new timestamp to be different from the old timestamp. If the old timestamp was Feb 8th, 2011 @ 07:03 and the new timestamp is '0', that is indeed different and you will capture that as a frame detection.
    The simple fix would probably be to make frame detection only trigger on "(old != new) && (new != 0)". Note you need to also skip "old = new" in the last frame if you did NOT detect a frame.
    Other possible fixes:
    1. Read for 1 frame with a timeout. This will pause the VI until a frame is actually read.
    2. Since this is a queue (and not single-point), you can read and "frame detect" would just be if the array is not empty. With queues, old data is not repeated, so there would be no frames in this case. This dramatically simplifies your VI.

  • 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

  • NI-xNET CAN interface Queued/Single Point/Stream

    Hi
    guys, I want to write a known frame on the Bus 1 time an directly after
    want to read a frame with a known Identifier. But only that frame, so
    no other received frames in that time.
    What is the best way or only way?
    Solved!
    Go to Solution.

    Example: Single Point In Session with Termination Set ON
    Attachments:
    CAN Signal Input Single Point with Termination.vi ‏93 KB

  • NI-xNET CAN interface Queued/Sin​gle Point/Stre​am

    Hi guys, I want to write a known frame on the Bus 1 time an directly after want to read a frame with a known Identifier. But only that frame, so no other received frames in that time.
    What is the best way or only way?

    You should post your question to this board.

  • How can I read mail attachment for making it to the payload?

    Hi everybody,
    in the following my scenario:
    I have an incoming message with attachment by the mail sender adapter using PayloadSwapBean (because of other messages I have to use the bean). I want to send this attachment by using the mail receiver adapter to fix E-mail-address keeping the FromMailAddress, the MailSubject and the FileName
    without the metadata as additional attachment.
    I have found a thread where it is explained how to handle "payload as mail attachment and dynamic filename" by java-mapping. So far so good. My question is: How can I make my attachment to be the payload? How can I read the attachment by java-mapping?
    Thanks for help.
    Reagrds,
    Sebastian Linke

    USe payloadSwapBean for this to swap your payload and attachment
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    Rajesh
    Edited by: Rajesh on Feb 5, 2009 5:29 PM

  • NI XNET

    Hi,
    I am pretty new to both CAN and Labview. I would appritiate it if you can help me to get around this problem:
    I have a NI PCI 8512/2 CAN card on my PC from which I am trying to send signals to a laptop with Vector CANcard XL interface.
    CANanalyzer is in running mode on the laptop side.
    When I "Transmit Single Frame on CAN" (in a cyclic manner) from "NI XNET Bus Monitor" (with termination checked), I can see the correct frames received in CANalyzer trace window and no error frames. But when I send the same frame with a Labview VI (the very simple VI I attached), CANalyzer receives Error frames instead. Consider that the waiting time in the while loop is quite long and so the CAN Comm State begins with Error Active and changes into Error Passive state after a short time (in less than 2 seconds). Then the last error is Stuff and receive error counter is 128.
    But What does MAX do that my VI does not?
    Attachments:
    Wakeup4.vi ‏18 KB

    Well, the problem is solved!
    The default value for termination in Hi speed CAN is off. I changed it into on and it worked.

  • 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

Maybe you are looking for

  • Ipod Nano Video - Charging or not? Who knows?

    Okay, since Apple can't wrap their heads around the idea that some of us don't want video (and don't want to PAY for it) but would still like an MP3 player with a decent storage capacity, I finally broke down and bought a Nano video. Got it home, plu

  • BAPI_BUPR_RELATIONSHIP_CREATE ??

    Hello experts , I need to upload the data to BP transaction using bapi BAPI_BUPR_RELATIONSHIP_CREATE. I have some fields like department telephone extension fax email which also needs to be uploaded . But these feilds are not there in IMPORT PARAMETE

  • Bluetooth permission issues

    Hi, I'm unable to use my bluetooth device, I'm trying to send files with blueman-sendto, file send dialog never appears, i looked to the output and saw: do_cache (/usr/lib/python2.6/site-packages/blueman/gui/DeviceList.py:543) Caching new device 00:1

  • SAP note validity

    Hi experts, I've read that SAP notes are changes to standard code which are to be included in the next release. I was approached by a team to implement a SAP note; upon checking the validity the note is only applicable to previous SAP versions. Our s

  • Newbie question on "refresh itab"

    Dear forumers, What does the sequence of these codes mean? More specifically, what does REFRESH do to lt_tmp_mchb and why is it needed here? REFRESH lt_tmp_mchb. lt_tmp_mchb[] = tt_mchb[]. DELETE ADJACENT DUPLICATES FROM lt_tmp_mchb COMPARING matnr w