Automotive and Embedded Networks

Showing results for 
Search instead for 
Did you mean: 

Transmitting multiplexed signals USB-8502

Device: NI USB-8502

Driver: Xnet 17.0

I am trying to transmit multiple signals to the system by using USB-8502.

I try to change the value of multiplexer and then set different values in different multiplexed signals.

However, whatever value I set in multiplexer signal, I can not change others' values of multiplexed signals except the default multiplexed signal.

And others' signals works well/

I am very appreciated someone help me solve the problem. 

Or who can share a example of transmitting multiple signals by using USB-8502.


0 Kudos
Message 1 of 13

Do you intend on using the Frame Out Stream?  This will stop transmitting once the buffer is empty.  A better choice would probably be Signal Out Single Point, then write the signals and have the hardware figure out what the values of the MUX should be.  Have you tried one of the signal examples like CAN Signal Out Single Point?  All you should need to do is write the signal you want (in engineering units) and the rest should be taken care of.  Honestly I haven't done much in MUX writing, just MUX reading and the Signal In Single Point works this way.

Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
Interesting in learning all you can about automotive CAN bus communication? Checkout my 12 part CAN Blog series.
Checkout and help contribute to the community driven LabVIEW Wiki.

0 Kudos
Message 2 of 13

Thanks for your reply.

To be honest,  I have tried many method.

I am using Labview 2017 32bit, Xnet 17.0. Windows 7 64bit.]

The program works werll in MUX reading. And it also works well in other types mode except writing MUX.

Now, I am trying to applied the program on Windows 7 32bit and see the result.

0 Kudos
Message 3 of 13

Here is an example I threw together quickly. It demonstrates some basic multiplexing signal output using a few signals in the PS5_Settings frame of your database.



I suggest experimenting with different combinations of mode values and signals to get a feel for how it works.

Jeff L
National Instruments
0 Kudos
Message 4 of 13

Hi, Jeff.


I follow the program you post and program a new one.

I am trying to run it on my system.

However, it still can not work.

When I change the multiplexor value, it only can change the signal value with multiplexd value of 0.

I also get the result using different combinations.

It looks like I can not change the value of multiplexor in my labview program.

0 Kudos
Message 5 of 13

Can you elaborate on what is not working? Are you using my example unmodified? If not, what changes did you make? Modifying my example to demonstrate the behavior you are seeing would help me to reproduce your issue.


My example works as expected. You have two signals in the list with different multiplexer values (we call these sub-frames in XNET parlance). When XNET Write is called, values are provided for both signals in the list but only the signal with the matching multiplexer is transmitted. In other words, only a single frame is transmitted. The signal that doesn't have a matching multiplexer isn't transmitted but the value is updated in memory. 


On the receiving end, only one frame is received so it can hold only one of the signals. The multiplexer in the frame determines which signal is updated and the other signal returns the most recent value or the default.


As an experiment, change the default values of your signals in the database to be unique and non-zero i.e. 1, 2, 3, 4 ect. Then run the program to see if you see the unique default values or actual zeros.

Jeff L
National Instruments
0 Kudos
Message 6 of 13

Hello  Jeff,

Thanks for your reply.

And I tried to modify your proposed example.And please check the attachment file.

And I also tried many times to change the default values, however, the default value always keep at zero.

0 Kudos
Message 7 of 13

Your using the same interface to try and read the frame you are transmitting which doesn't work like this. Change the input session to be on a different interface than the output session i.e perform input on CAN1 and output on CAN2. Then connect the two interfaces together in a loopback. Then this example will work.


You can do input and output on the same interface but you can't self-receive (echo) with signal sessions. You can only echo a frame being transmitted into a Stream Input session on the same interface.


(edit) I checked again and the signals differ between input and output so we are not trying to self-receive. This is ok.

Jeff L
National Instruments
0 Kudos
Message 8 of 13

I double checked your code and you have different signals in the output session compared to the input session which is fine. I then hooked your code up to the XNET bus monitor and verified that it is sending the correct frame, with the correct multiplexer, and with the correct payload. 


Try this, open up the CAN Signal Input Single shipping example. Select the PS5_Bat1VoltStart signal and run it. Then run your example. It will write that signal to the bus and when you click the "Update Values" button on the shipping example it will update to the expected value of 49. So your code appears to be working as I would expect it to.

Jeff L
National Instruments
0 Kudos
Message 9 of 13

Hi Jeff,


Could you help me check the again.

You change the multiplexer value to 1 or 2, and then  Select PS5_Bat1VoltStop signal, update some value seeing the result.

In the program, update the signal value with multiplexer value is easy.

But I set multiplexer value as 1, and update the value of PS5_Bat1VoltStop signal, it still change the value of PS5_Bat1VoltStart signal.

And I am very appreciated to your help/.

0 Kudos
Message 10 of 13