LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to add a sequence structure to the true case of the case loop

Hi 

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 11 of 20
(879 Views)

i need the commands to be sent one by one, means the first command have to execute and give the reply after that second have to execute. How can I do it using for and case loop.   

0 Kudos
Message 12 of 20
(875 Views)

Hi perumpadapu,

                                      This is kind of serial processing then better use 'error out' 'error in' like 

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 13 of 20
(865 Views)

Hi 

 

 

 

Thanks

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 14 of 20
(859 Views)

In that particular case, you cannot use error terminals as they are not present but most of the vi's do have error terminals and wiring to these would ensure data flow. Sequence structures are very inflexible. The following may help:

 

http://zone.ni.com/reference/en-XX/help/371361J-01/lvhowto/avoid_overusing_sequence_structures/

 

http://zone.ni.com/reference/en-XX/help/371361J-01/lvconcepts/block_diagram_data_flow/#Flow-Through_...


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
Message 15 of 20
(849 Views)

That means here only sequence is an option.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 16 of 20
(846 Views)

@Ranjeet_Singh wrote:

That means here only sequence is an option.


The answer would be it depends. If you impement a state machine and these actions are two different states then your state machine logic will control order of execution. If this is simply some samll part of code then you would need a sequence structure. However even then I would generally use a single frame and create an artifical data dependency. Your particular example though could be placed in a two frame flat sequence structure. Though in this example I don't see any reason why they code could not execute in parallel.

 

There are lots of examples of state machines on the forums. The LabVIEW examples should also include an example. Here is a simple example as well.

 

 

 

 



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 17 of 20
(831 Views)

This is just an example having no meaning. This can be executed parallely with no problem but i just want to know how to execute them serially.

 

What do you mean by 'artifical data dependency'

 

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 18 of 20
(812 Views)

you can use a for loop and inside you create a basic serail VI. The numbers you want to be inserted into an array (build array). The appended array is wired to the write of serail communication. Then it will work serially

0 Kudos
Message 19 of 20
(807 Views)

@Ranjeet_Singh wrote:

This is just an example having no meaning. This can be executed parallely with no problem but i just want to know how to execute them serially.

 

What do you mean by 'artifical data dependency'

 


This is basically putting a single sequence frame around some code and either wire a value into or out of the sequence frame. For example, wrap the Wait VI in a single frame sequence structure and wire an error wire through the frame. This will force the Wait to execute after whatever code is passing the error in and any code after the Wait will not run until the Wait is complete if you pass the wire through the frame structure.

 

Virtual Data Dependency.png



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 20 of 20
(787 Views)