LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending an array of different data types over a serial connection


@Scaz wrote:

Ok, thank you. I understand that part. My question is, how do I continuously run this loop N number of times, resetting it back to 0 after each N times. I need to repeatly send data over a serial connection that sets certain fields to certain values depending on this N value. Each iteration is one message and after N number of times, it resets and repeats the process. Hopefully this clarifies.


A For loop inside of a While loop.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 11 of 13
(934 Views)

You can also maintain the iteration value in a shift register and reset it back to zero.  Or you can look at the i value of the for loop, do a Quotient Remainder with the N value, and use the remainder output.  That will cause the output to roll back to 0 whenever i becomes equal to N or a multiple of N.

0 Kudos
Message 12 of 13
(927 Views)

If your number of cases is defined at edit time, you could use an enum to name your states and then just increment the enum (stored in a shift register).  The enum will roll over when you increment from the last defined value.  The bonus to this method is that your case structure has a text to the selection instead of just a number.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 13 of 13
(921 Views)