Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in using CAN library....

Hi All,

Can anyone please help me in finding what is the difference between these two CAN library functions(ncwriteobj.vi and ncwritenet.vi).

Does ncwriteobj.vi writes data on to the write queue...... and ncwritenet.vi on to the can bus.

 

Please elaborate.....or provide some suitable link or example.

 

Also if it is required to read a particular Index and sub index continuously for a particular time interval........ncreadmulti.vi will work or have to use a loop....

 

0 Kudos
Message 1 of 5
(7,202 Views)
Anyone can answer this difficult question.......
0 Kudos
Message 2 of 5
(7,187 Views)

I recommend to read the NI-CAN Hardware and Software Manual, esp chapter 9

"Using the Frame API" gives helpfulinstructions of the various object types. For all object typesyou ll find examples within the LabVIEW example finder.

0 Kudos
Message 3 of 5
(7,180 Views)

Hi Gibson....

thanks for your reply.........i had already gone through that pdf's chapter 9 but not able to find it very clearly the difference in working of the two objects.......

Can u pls through some light regarding my first question if had gone through that pdf....

0 Kudos
Message 4 of 5
(7,178 Views)

ncwriteobj.vi refers to the usage of a CAN Object.

 

The CAN Object encapsulates a specific CAN arbitration ID and its
associated data. Every CAN Object is always associated with a specific CAN Network
Interface Object, used to identify the physical interface on which the CAN
Object is located. The CAN Object provides high-level access to a specific arbitration ID.
You can configure each CAN Object for different forms of background
access. For example, you can configure a CAN Object to transmit a data
frame every 100 milliseconds, or to periodically poll for data by
transmitting a remote frame and receiving the data frame response. The
arbitration ID, direction of data transfer, data length, and when data transfer
occurs (periodic or unsolicited) are all preconfigured for the CAN Object.
When you have configured and opened the CAN Object, data transfer is
handled in the background using read and write queues. For example, if the
CAN Object periodically polls for data, the NI-CAN driver automatically
handles the periodic transmission of remote frames, and stores incoming
data in the read queue of the CAN Object for later retrieval by the ncRead
function. For CAN Objects that receive data frames, the ncRead function
provides a timestamp of when the data frame arrived, and the data bytes of
the frame. For CAN Objects that transmit data frames, the ncWrite
function provides the outgoing data bytes

 

ncwritenet.vi refers to the usage of the Network Interface Object

 

You use the CAN Network Interface Object to read and write complete
CAN frames. As a CAN frame arrives from over the network, it can be
placed into the read queue of the CAN Network Interface Object. You can
retrieve CAN frames from this read queue using the ncRead or
ncReadMult function. The read functions provide a timestamp of when
the frame was received, the arbitration ID of the frame, the type of frame
(data, remote, or RTSI), the data length, and the data bytes. You also can
use the CAN Network Interface Object to write CAN frames using the
ncWrite function.

 

In addition check the basic NI-CAN Frame API examples in the example finder.

 

gibson

0 Kudos
Message 5 of 5
(7,157 Views)