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.

Similar Messages

  • 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

  • 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

  • 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

  • Error -1074384751 in XNET Create Session (Signal Output Single-point)

    Hello all,
    I have a selected number of signals from a database, and I am trying to create XNET Signal Output session from these signals of database.
    However, I get this error when I run this on my RT pc:
    Error -1074384751 occurred at XNET Create Session (Signal Output Single-point).vi:4
    Possible reason(s):
    NI-XNET:  (Hex 0xBFF63091) For Signal Output sessions, the multiplexer signals used in the session must be specified explicitly in the signal list.
    Can anyone please explain why this error can be coming?
    Thanks
    FraggerFox
    -FraggerFox!
    Certified LabVIEW Architect, Certified TestStand Developer
    "What you think today is what you live tomorrow"

    It seems the Diag frames must be sent from a Frame Output Queued session. Therefore i replaced the function "XNET Create Session (Frame Output Single-Point)" with "XNET Create Session (Frame Output Queued)" and it seems to work...

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

  • NI XNET Remote Frame request in Labwindows

    Hello,
    Can someone plz share me the sample code to do the following
    1.INPUT SESSION :set the XNET interface to send a remote frame and read the data frame recieved.
    2. OUTPUT SESSION : XNET interface sending the data when it recieves a remote frame.

    You might want to start a new thread and link to this one.
    Since this one was already marked as solved, a lot of people won't come back to read it.
    If you're able, I would suggest posting your VI.
    I would guess that something in your "big sequence loop" is the more likely culprit for your CAN transmission delay.
    SandyGao wrote:
    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. 
    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 not know where I can do this. Also how to make it cycling timing. And I did not have any database in NI-XNET database editor. Do I need to build it there?
    Thank you so much. 

  • Single point of failure for web dispatcher

    Hi
    I need advise on how can i resolve single point of failure for web
    dispatcher in case the web dispatcher goes down on another system, what
    are the alternative which can be used to avoid this.
    In our enviroment we have db server with two application server and web
    dispatcher is installed on db server and i need to know what can i do when
    the web dispatcher on db server crashes and cannot be restarted at all.
    We are running oracle 10.2.0.2.0 on AIX 5.3.
    Regards,
    Codlick

    Hi Codlick,
    the answer is, you cannot (switch to two web dispatchers).
    If you want to use two web dispatchers, they need something in front, like a hardware load balancer. This would actually work, as WD know their sessions and sticky servers for those. But remember you always need a single point for the incoming address (ip).
    Your problem really is about switchover groups. Both WD need to run in different switchover groups and need to switch to the same third software. I'm not sure if your switchover software can handle this (I'm not even sure if anyone can do this...), as this means the third WD needs to be in two switchover groups at the same time.
    Hope this helps,
    Regards,
    Benny

  • Why can't we have a single point of contact who de...

    Three weeks ago our house was hit by lightning and our broadband connection went on the blitz (a Linnit technical term).
    The telephone stopped working. I did an on-line check and the connection registered a fault. The on-line system logged the fault with the teachnical team. So far so good...
    I received a call from the tech team advising an engineer was coming out to us, if the fault was with our equipment we would be charged. That's fair. Engineer called. My phones were fine, BUT the BT router was where the fault lay said the engineer. We would need to raise another fault report because he only dealt with telephone AND as he was a subcontractor he would bill for the work... He disconnected the router so the phone would work and left.
    I work virtually, which means that I can work from my home, so I need the internet even more than my family want the telephone. I plugged the internet back in so that I could continue to work and called BT again from my mobile. Speaking to a very polite guy in Delhi I was asked to describe my phone socket, unplug the router from the office, carry it downstairs to the kitchen where the main socket is, plug the router in there, reconnect, try again, all sorts of stuff before finally being advised that it was probably just the 'microfilter' and that as they were very inexpensive it might be faster for me to go out and buy one and plug it in myself rather than have another engineer come out to us.
    So I did just that. In fact, as the microfilters are less than a fiver, I got two... brought them home and plugged one in... didn't work.
    Called Delhi again. Spoke to someone else who was, again, very polite. They tried to get me to unplug and plug things in and out again, but I politely declined this time explaining that now the poor internet connection that we did have was running so slowly I am having to commute in to work over Christmas. He sympathised and told us that he would escalate the issue. That was before Christmas. Since then I received a text on my phone on Christmas Day telling me they couldn't reach me!!! 
    Today I called again to BEG someone to please come out and fix things for us. We aren't technical. We cannot act as pseudo engineers. We pay BT one bill each quarter for a service. Why on earth can't BT provide me with a single point of contact when I have an issue. And if that point of contact could understand me and explain things to me in words and phrases that I understand that would be perfect!
    Last year I cancelled three mobile contracts that we'd had since the early 90's with O2 because they were so unhelpful.
    BT aren't the cheapest broadband provider but we've stayed with them out of 20+ years loyalty and the understanding that we had a one-stop-shop. Now, it looks as though I'll be shopping around for another domestic broadband provider for 2012.

    Thank you for being so helpful and constructive.
    I tried to look at the ASDL settings, john46 but it's asking me for my HomeHub password... the only password I have is for our wireless network and that one doesn't work. 
    I can't test the phone line right now because I'll have to disconnect the internet and I'm currently working on another computer whilst chatting on this one with you. However I will do that later. I'll also look at the RogerB link you provided. 
    Truth is, we're pensioners who use the internet but we havent a grain of technical understanding between us. We're old fashioned enough to admit that we just want someone who knows what he's doing to come here and fix it for us. It's already cost us £130 for an engineer to come out from OpenReach to tell us the phone line is OK and it's the router causing the problem. Best case scenario is that another BT engineer who knows about broadband comes out and does it because the last BT person that I spoke to in Delhi did actually confirm that there is a fault on the BT side. I'm getting so frustrated right now I'll probably call out an independant I find in Yellow Pages and get charged an arm and a leg again and I'll then cancel with BT in a fit of pique.

  • How can I design Load Balancing for distant Datacenters? without single point of failure

    Dear Experts,
    We are using the following very old and passive method of redundancy for our cload SaaS but it's time to make it approperiate. Can youplease advise:
    Current issues:
    1. No load balancing. IP selection is based on primary and secondary IP configurations. If Primary fails to respond, IP record for DNS changes to secondary IP with TTL=1min
    2. When primary server fails, it takes around 15 min for clients to access the servers. Way too long!
    The target:
    A. Activate a load balancing mechanism to utilized the stand-by server.
    B. How can the solution be designed to avoid single point of failure? In the previous example, UltraDNS is a single point of failure.
    C. If using GSS is the solution, how can it be designed in both server locations (for active redundancy) using ordinary DNS server?
    D. How can HSRP, GSS, GSLB, and/or VIP be used? What would be the best solution?
    Servers are running ORACLE DB, MS SQL, and tomcat with 2x SAN of 64TB each.

    Hi Codlick,
    the answer is, you cannot (switch to two web dispatchers).
    If you want to use two web dispatchers, they need something in front, like a hardware load balancer. This would actually work, as WD know their sessions and sticky servers for those. But remember you always need a single point for the incoming address (ip).
    Your problem really is about switchover groups. Both WD need to run in different switchover groups and need to switch to the same third software. I'm not sure if your switchover software can handle this (I'm not even sure if anyone can do this...), as this means the third WD needs to be in two switchover groups at the same time.
    Hope this helps,
    Regards,
    Benny

  • CAN Frame Signal Conversion With XNet

    When dealing with CAN, most new developer struggle with the Frame and Channel (or Signal) conversion.  Developers are trying to get away with using the cheapest CAN hardware, and as a result are opting to not use XNet hardware but instead use things like the USB 8473, or using non-NI hardware like the ValueCAN by Intrepid, or using Vector hardware, or CAN to serial adapaters.  The problem with all of these is you generally just read and write frames which is the raw form of CAN.  When using these cheap devices you can't ask the CAN bus what the signal Bus_Voltage is, instead you need to perform a frame read, find the frame associated with the signal, then pull out the bits for that signal, then scale the signal based on the signal selected.
    All of this is doable but a pain and can be very custom.  That's one reason NI came out with the Frame Channel Conversion Library.  This library converts from Frames to Channels using an industry standard CAN database file.  The problem with this library is it hasn't been updated in 5 years, and has known issues which likely will never be fixed.
    NI has since come out with XNet which supports reading and writing signals on XNet hardware.  The XNet drivers also support converting Frames to Signals without needing hardware at all.  This conversion has several limitations, and really only works for getting the latest value for a signal, not all values.  And in addition to that if the signal was never seen, the value will be the defaul value for that signal, not NaN.
    So I wrote a wrapper around the XNet conversion library to handle going from signals to frames, or from frames to signals.  Anyone looking to use a DBC file, on hardware that only supports frame API should use this conversion library, or at least use the XNet conversion sessions.
    CAN Frame Signal Conversion Using XNet 
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

    Hello Hooovahh,
    Nice work  . It’s very useful.
    I’m also converting CAN Raw data to Physical values in my project. Yes, your correct XNET APIs have some limitations. as you mentioned, there is one more limitation I found,
    If your Message Data length (Payload) is 4 Bytes (example) and other CAN Frames are having more than 4 Bytes then its throwing Error (Error Code -1074384737).
    While converting CAN Frames to signals, we will get different Payloads but, our selected signal message have 4 bytes then XNET will gives an error (at the time of Data Conversion).
    As per attached Snap, My Signal is related to IDxBB and I’m sending two different Frames then XNET will not convert.
    Hooovahh Wrote:
    NI has since come out with XNet which supports reading and writing signals on XNet hardware.  The XNet drivers also support converting Frames to Signals without needing hardware at all.  This conversion has several limitations, and really only works for getting the latest value for a signal, not all values.  And in addition to that if the signal was never seen, the value will be the default value for that signal, not NaN.
    When we will send Frame by Frame then we will get all values (not only recent values). XNET will take previous value (if data is not present for Next iteration)
    Please check this snippet for all values & NaN Display.
    Munna

  • 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

  • Is there an app or way that you can take a single frame out of a video shot on the iPhone and use it as a picture?

    Is there an app or way that you can take a single frame out of a video shot on the iPhone and use it as a picture?

    I don't know if there is an app, but you can take a snapshot of the video.  I do this all the time.   You just need to hold down the power and home key once and it will take a snapshot.

  • I am using pages designing a flow chart, question "I seem to have an issue with the arrows that you can add text to, it appears I can not move the point of the arrows up or down they only switch from left to right.

    I am using pages designing a flow chart, question "I seem to have an issue with the arrows that you can add text to, it appears I can not move the point of the arrows up or down they only switch from left to right.

    Last point...who archives? On my regular email page I now have the Archive icon to the left of my Delete icon which I would prefer was to the left, first in the line as this is the icon I use mostly. With Folders, my Sent and Trash lists, who needs to archive?
    I can help you only with the placement of the icon placement -- if you right-mouse click on the toolbar, then select Customize Toolbar, you can move an icon to where you want it to be.

  • NI USB CAN 8473 write single frame and log all frame of network with read notification on the same port

    Hello,
    I am trying to code an application which:
    - Write sometime (button click) a frame on a CAN network
    - Log all frame of CAN NETWORK
    My hardware is NI USB 8473 (1 port).
    1/ After reading NI help about CAN APIs, I think it is not possible to do "log all CAN frame" with Channel API because I need to install a asynchronous callback to read all message, and this functionality is only present in frame API.
    Anyone can confirm?
    2/ No problem let's use Frame API
    I have tried "CAN Receive with Notification" example delivered with NI-CAN driver, configured on virtual CAN256.
    I start other sample program to generate some frame on virtual CAN257, no problem, everything is working.
    So, i have tried to modify "CAN Receive with Notification" to add write function. I have mixed this source with "Transmit Receive same Port" sample (which works fine alone on CAN256).
    My program is running, but nothing appens when I click on WRITE button.
    I suppose some attribute are not confired, but which one.
    Anyone can help? (source of my modified sample is joined to this post).
    Thanx.
    PS: please note im a newbie with CAN
    Attachments:
    CAN Receive with Notification.zip ‏10 KB

    Hi,
    Thank you for posting your question on National Instruments' Forums.
    I'm a little puzzled by your question.
    If I understood well, you just want to receive every frame reaching the port and sometime write something through the port. Am I correct ?
    You are right when you state that the NI USB 8473 can only work with frame API. However, if the operation you want to make is the one I discribed above, I can't see where you encounter a difficulty.
    Indeed, for such a case, the example you mentionned in your post is perfectly suited. "Transmit Receive same Port" allows you to receive the frames reaching the port and write we needed too.
    I think this example shoudl do the trick.
    Or have you a more specific application in mind ?
    I hope this information will help you.
    Best regards,
    Guillaume H.
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> NIDays 2011, le mardi 8 février au CNIT de Paris La Défense

Maybe you are looking for