From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI USB-8473 Log Packets to File

Hello,

 

I'm very new to Labview and this project was dumped on me. The issue is I do not have the experience working with this piece of hardware to make this happen. I have experience making channels in MAX and logging info from them but you cannot do that with this hardware.

 

Basically, what I have is a few messages per second coming over a CAN bus in very quick succession that I need to log to a file.

 

The code logic would probably be this:

Loop starts here Wait for message on a given ID or multiple IDs per a mask/filter

Log message to txt file

Repeat

 

I have examples that display the data stream on screen but logging that to a file is not something I know how to do. Could someone help me by either quickly making a vi for this or pointing me in the right direction? I plan to take the courses for labview soon but getting them approved takes awhile.

0 Kudos
Message 1 of 2
(2,342 Views)

First here is some training when you get some time.

 

NI Learning Center

NI Getting Started

-Hardware Basics

-LabVEW Basics

-DAQ Application Tutorials

 

3 Hour LabVIEW Introduction

6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training

 

Secondly it sounds like you have a good start.  I'm hoping you started from an example from the Examle Finder for reading and displaying CAN frames.  The CAN hardware will have a buffer so if you perform a read you will get 0 or more frames.  So when you do a read what you want it is a condition that if the ID is equal to some value, log.  This can be done by taking the array of frames and handling them one at a time in a for loop.  Then in the for loop pull out the ID using the Unbundle by Name.  Then use a case structure where if the ID is what you want do something, or if it isn't do nothing.  In the do something case you can log to disk using something like the Write To Spreadsheet File, or Write To Text File.

 

If you get stuck post what you tried.

0 Kudos
Message 2 of 2
(2,325 Views)