LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Many Flat_sequences in one While loop

Hello all,

I have used 8 flat sequence inside  one while loop ,now i am facing the problem with operations .

but these function in individual works fine ,

it would be great help if some suggestion to improve this VI .

 

Anil8899_0-1638184430893.pngAnil8899_1-1638184445636.png like this i have 8 operations .

 

thanks ...

 

0 Kudos
Message 1 of 13
(1,285 Views)

In the published part of your code (please upload the whole vi), you can remove flat sequences altogether, they have no effect.

Before giving other suggestions, can you explain what is THE problem?

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 13
(1,273 Views)

Hello Paolo,

thanks ,

 

problem is whenever i want set different parameters like voltage, current, PWM.,in-between of the operation .

the boolean control is not working and and i am not able to send the MSG and it will be stuck , if i re-run the VI, it will work in the same manner.(after two actuation next control will not work ) ..

 

 

 

0 Kudos
Message 3 of 13
(1,268 Views)

So you want to set different parameters at once? But apparently you must use the same bus for all settings, so I wonder how could you pile up more than one command. I don't know the specifics of CAN but I think you need to complete an operation before starting another. How much time is needed to perform one operation? I would expect a fast response for a simple parameter setting.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 13
(1,248 Views)

Please do upload the actual vi (not a picture), and it is best to upload it in a LabVIEW 2019 or earlier version to get the most coverage (many on this forum have not updated to the latest version). Just looking at the small section of code shown as pincpanter noted there is no need for the flat sequences. I do suspect that you have race conditions (I see a lot of local variables).

0 Kudos
Message 5 of 13
(1,245 Views)

You're only showing 2 flat sequence structures, and 6 flat sequence frames.

 

All of them are redundant (for the part that is showing), as they force sequential execution that would also be forced by the error wire.

0 Kudos
Message 6 of 13
(1,239 Views)

Sounds to me like you should be using an Event Structure for triggering the setting of new values.


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 7 of 13
(1,212 Views)

R-click the structure -> Replace with Stacked sequence.

R-click stacked sequence -> Replace -> Replace with Case structure.

Set comments or name of the cases so it's self describing.

 

Now you've got a decent State Machine.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 13
(1,209 Views)

Anil@8899 wrote:

I have used 8 flat sequence inside  one while loop ,now i am facing the problem with operations .

but these function in individual works fine ,

it would be great help if some suggestion to improve this VI .

 

 like this i have 8 operations .

 


Sorry, we cannot "improve" a truncated image of completely messy code (hidden wires, overlapping objects, glaring overuse of sequence structure, local variables, and value property nodes, etc.)

 

So you say you have eight sequences. I cannot see that many. Since many wires are hidden and seem to randomly go in all possible directions, it is not even clear if these sequences operate in parallel or sequentially. Can all parallel sequences complete at all times? You have that silly habit of reading from a boolean local variable to select a case, the resetting that boolean with a value property node inside a case? Most likely a latch action boolean is all you need (or at least reset it with a local variable!)

 

You also need to define you terminology. What are "operations"? (you say you have eight). What are "functions"?

Does it work fine if each of the eight sequences lives it its own while loop?

What have you done for troubleshooting?

 

0 Kudos
Message 9 of 13
(1,199 Views)

Thanks all ,

I have removed the Flat sequence and avoided some local variable ,

and now it is working .

 

 

 

Message 10 of 13
(1,061 Views)