Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

CAN: PlatformCAN_OS.c (Embedded Development Module)

LabVIEW Microprocessor SDK 2.5 Help
August 2007

NI Part Number:
372197A-01

»View Product Info

Use PlatformCAN_OS.c for the Embedded CAN VIs and for debugging over a controller area network (CAN) connection. PlatformCAN_OS.c contains the following functions:

MgErr LvCanOpen(uInt32 boardIdx, uInt32 controllerIdx, uInt32 *reference);

Purpose: Opens a session to a CAN controller.

MgErr LvCanClose(uInt32 reference);

Purpose: Closes an open session to a CAN controller.

MgErr LvCanGetChannel(uInt32 reference, uInt8 rx, uInt8 *pChannelNum);

Purpose: Returns an open channel to transmit or receive CAN message frames.

MgErr LvCanFreeChannel(uInt32 reference, uInt8 channelNum);

Purpose: Frees a channel you open with LvCanGetChannel.

MgErr LvCanStart(uInt32 reference);

Purpose: Starts communicating with the CAN controller.

MgErr LvCanStop(uInt32 reference);

Purpose: Stops a CAN controller from sending or transmitting messages.

MgErr LvCanRead(uInt32 reference, uInt8 channelNum, int32 *bNewData, int32 *canID, uInt8 *len, uInt8 *data);

Purpose: Reads a CAN message frame from the specified channel.

MgErr LvCanWrite(uInt32 reference, uInt8 channelNum, uInt32 canID, uInt8 len, uInt8 *data);

Purpose: Writes a CAN message frame to the specified channel.

MgErr LvCanGetGlobalFilter(uInt32 reference, int32 *filter);

Purpose: Retrieves the filter you set with LvCanSetGlobalFilter.

MgErr LvCanSetGlobalFilter(uInt32 reference, int32 filter);

Purpose: Sets the global filter for CAN messages.

MgErr LvCanGetChannelFilter(uInt32 reference, uInt8 channel, int32 *filter);

Purpose: Returns the channel filter you set with LvCanSetChannelFilter.

MgErr LvCanSetChannelFilter(uInt32 reference, uInt8 channel, int32 filter);

Purpose: Sets the CAN message filter for the specified open channel.

MgErr LvCanGetBaudRate(uInt32 reference, uInt32 *baudRate);

Purpose: Returns the current baud rate of the CAN controller.

MgErr LvCanSetBaudRate(uInt32 reference, uInt32 baudRate);

Purpose: Sets the baud rate of the CAN controller.

MgErr LvCanMessageAvail(uInt32 reference, uInt8 channel, uInt8 *bAvail);

Purpose: Polls channels for new CAN messages to read.


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit