NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending multiple CAN signals in one sequence

Hello all,

 

I am very new at TestStand, and don't have a very good grasp of how tests should be lay out. Here is what I am trying to do:

I have an ECU, and am trying to test the software inside it.

1) The ECU must receive some CAN messages every 10ms (this must happen every 10ms for the entire duration of the test)

2) Send the ECU some cam and crank signals using DIO on an NI FPGA card

2) I send some voltages to the ECU using AO from an NI FPGA card

3) Wait for 5 seconds for the ECU to set a fault

4) Send and receive CAN messages on a DIFFERENT CAN line then the first one

 

How do I set it up so that my sequence will send the CAN messages every 10ms while I am commanding the FPGA card?

 

I use LabView VIs to interface with everything, so I use a VI to send the CAN messages. I also use a VI to control the FPGA card.

 

Thanks in advance for your help.

0 Kudos
Message 1 of 4
(3,658 Views)

Hi Bladhart,

 

Here are a couple of suggestions for you to consider... to be able to send CAN messages every 10ms, you may want to create a separate thread in your TestStand sequence. This way, one thread can continually send the CAN messages, and the other thread can control what is being sent from the FPGA card.

 

To do this, you will need to create at least one other sequence in your sequence file. Then, you can add a SequenceCall step to call that sequence. By default, execution would go into the subsequence, and not continue in the main sequence until the subsequence is finished. However, when you configure the Module for your sequence call, set Execution Options to Use New Thread. This will cause the subsequence to be executed in parallel, rather than causing the main sequence to wait for it.

 

Best Regards,

 

John M

National Instruments
Applications Engineer
0 Kudos
Message 2 of 4
(3,614 Views)

Thanks for the reply.

 

In that case, how do I send a signal to the new thread to stop running when I am done?

 

In the CAN message VI, I am running it in a loop. The loop checks if the stop button is pressed to stop the loop. If I understand correctly, the stop button value is only read when I call the VI, so it is now an infinite loop?

0 Kudos
Message 3 of 4
(3,602 Views)

HI Bladhart -

When you start executing a sequence in a new thread, the sequence will run until it is finished. So, let's assume that your main sequence calls a sequence you execute in a second thread, and that sequence only has one step. That step is a LV Action Step, which calls your VI to send CAN messages. You are correct, with no changes, execution would stay in that VI, and there would be no way for us to tell it to stop.

So, to fix this, we can have the LabVIEW VI's while loop controlled by a variable from TestStand. If we connect this variable to the while loop's stop terminal, then your other TestStand thread (Main Sequence) can set the variable whenever it is time to stop the loop. Then, the VI will see that the variable has been changed, the loop will stop, the VI will return, and its sequence will finish.

Let us know if you have further questions about how this would work -

John M

National Instruments
Applications Engineer
0 Kudos
Message 4 of 4
(3,588 Views)