Overview
The capability of sending different modes of same-frame multiplexed messages used to be available in NI-CAN as the Message Multiple Frame Distribution, but was not added to the NI-XNET Driver for compatibility issues. This example shows an NI-XNET work-around for this capability.
Description
A multiplexer bit can only have one value at a time, and frames can only be sent one at a time over the CAN bus. Therefore, in order to send multiple modes of a multiplexed frame we need to resend our written signals with new multiplexer values for each mode. The NI-CAN driver had an abstraction which handled iterating through the mode values automatically, so essentially this example explicitly handles that process.
Examining the block diagram of send multiplexed signals.vi, we can see how a new value of the multiplexer is assigned before each write (the initial value coming directly from the front panel). This is done in each frame of the sequence structure by accessing item 0 in the data array (in this example, the multiplexer signal is the first signal in the output list), and then writing the new mode's value to that item before sending the new array into an XNET Write VI.
Steps to Implement or Execute Code
Requirements
Software
LabVIEW 2012
NI-XNET 1.6
Hardware
1 NI-XNET Device and port along with a receiving port (2 XNET ports if you intend to use the read multiplexed messages.vi loopback)
Powered CAN Cable
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Thanks for your share.
I try to apply the exam, but it cannot change multiplexed value/
Could you check it again>?
Is the example available to USB-8502 in writing a Multiplexed CAN Messages ?