From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SPI data setup

Hello Everyone,

 

I am trying to make an SPI program (connected to DAQMx)  which has 3 function mode (CW, PMCW, and FMCW). In CW and FMCW mode, when I press transmit, the SPI will send 5 words and then stop. In PMCW, when I press transmit, I want the SPI send the words continuously with configuration of bit 13 is 0 in first word, then 1 in second word, over and over. 

I want the function can be changed while i run the VI.

 

Attached my current progress. I have and issue when I change my function from PMCW to the others, the SPI send 5 words but did not stop.

can you help me with this issue?

 

Thanks in advanced

0 Kudos
Message 1 of 5
(2,902 Views)

Your VI is not so clearly document that we can easily understand it's behavior, other than that have you tried using some of the debugging tools such as breakpoints or highlighted execution to look into this behavior?

0 Kudos
Message 2 of 5
(2,874 Views)

Im sorry for that, here is the VI files with comments on it.

 

I have tried to debug it. let say i remove the stop button and change it to T/F constant. it seems the behaviour from PMCW, still running eventhough i change the function mode to CW. I wonder why?

0 Kudos
Message 3 of 5
(2,864 Views)

Hi rioriorio - From what I understand, you want to be able to change the function mode while the VI is running. You need to move the function mode control inside the while loop so that it can be updated each iteration of the loop. Is the stop button that you want to remove the conditional terminal for the while loop? 

Adena L.
Technical Support Engineer
National Instruments
0 Kudos
Message 4 of 5
(2,856 Views)

Yes, exactly Adena. The problem happen when I change the function mode from PMCW to CW, the SPI will send data continuously, not only 5 times like i plan.

0 Kudos
Message 5 of 5
(2,847 Views)