11-29-2021 05:15 AM
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 .
like this i have 8 operations .
thanks ...
11-29-2021 06:01 AM
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?
11-29-2021 06:07 AM
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 ) ..
11-29-2021 07:25 AM
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.
11-29-2021 07:32 AM
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).
11-29-2021 07:58 AM
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.
11-29-2021 09:21 AM
Sounds to me like you should be using an Event Structure for triggering the setting of new values.
11-29-2021 09:35 AM
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.
11-29-2021 10:30 AM
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?
12-06-2021 10:40 PM - edited 12-06-2021 10:41 PM
Thanks all ,
I have removed the Flat sequence and avoided some local variable ,
and now it is working .