LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

state machine Sub vi doesnot work

Im designed a state machine to acquire data from a color meter.

The problem I am facing is when I create a sub Vi of the state

machine, it doesnot give out any values. It does give out values

if I open along the sub VI and run it again.

 

The other states of state machine i.e. initialize and stop just start and stop the device.

 

0 Kudos
Message 1 of 12
(3,918 Views)

Think 'Dataflow'.

 

Your state machine wait for hitting 'Stop' to exit the while structure.

 

If you define the state machine as SubVI, and you don't act on the local paramters, it's normal you don't have data in the caller.

0 Kudos
Message 2 of 12
(3,915 Views)

Ok

So what should I do, assign all the data acquired through shift register or

define all the data acquired as Global variables. Is there any right solution for this.

0 Kudos
Message 3 of 12
(3,888 Views)

Yesh wrote:

Ok

So what should I do, assign all the data acquired through shift register or

define all the data acquired as Global variables. Is there any right solution for this.


That depends ENTIRELY on what you want the SM to do.  The first thing is to complete the following sentances---

 

This State machine will...................................until the exit condition..................is met.  Its states and their responibilities are:

  • ...........That ............................
  • ...........That............................
  • ...........That........................... and
  • ...........That............................

Its inputs are

  1.  

And Outputs are

  1.     

(A+ if you already thought to copy this to the vi documentation)

 

 


"Should be" isn't "Is" -Jay
Message 4 of 12
(3,855 Views)
You haven't kept the front panel Stop button and not chosen to show the front panel did you?
Message 5 of 12
(3,851 Views)

Dennis Knutson wrote:
You haven't kept the front panel Stop button and not chosen to show the front panel did you?

 

Psst (shhh...) That's WHY I expressly encluded the "until exit condition.........is met"Thanks Dennis
Message Edited by Jeff Bohrer on 01-13-2010 02:50 PM

"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 12
(3,846 Views)

Drivers are commonly structured as :

- a library of single finite functions (one subVI per function) => example : one subVI for open, one for configuration, one for close, etc...

then the different functions of the driver are integrated in the main program (with different levels of layer depending the needs). 

or/and

- in advanced framework as a state machine justified when you must have a independant core needed a mastered processus (as some continuous acquisition or generation, communication listener, etc...). In this case, display of data & user interface and other secondary tasks are often managed in parallel loops. That means you must implement communication inter-loop with different methods. The most common way is by queue event.

  

All that lines to say that the fundamental question in your case must be: 

- Why do you believe a state machine as driver framework is efficient in your application? Is it really justified?

 

And to really help you, could you provide the corresponding part of your code?

 

Note : I have access to all LabVIEW until LV8.5.1

Message Edité par J.DECHET le 01-13-2010 10:39 PM
0 Kudos
Message 7 of 12
(3,826 Views)

I am attaching the front panel and snapshot of my VI.

Hey I can attach my VI to this mail, but the problem is

I am using Labview 9.0. I dont think you can get it in

your system. You suggested to create a separate

structure for every part of my code and then put it

through a sequence. well doing in a sequence decreases

the speed of my acquisition. Hence I planned to use the

state machine so that it stays in the acquisition mode until

i use the stop button and then it exits or stops the loop. I

hope your are understanding what I said or I am making it too

complicated. Now i have a acquisition happening every 1.5 seconds

or 2 seconds before it was 4 -5 seconds.

 

Yesh

 

I

Download All
0 Kudos
Message 8 of 12
(3,814 Views)
I will wait until I am home tonight to look at your attached images, but what do you mean "but the problem is

I am using Labview 9.0. I dont think you can get it in your system."? Quite a few pieces of code have been attached in LabVIEW 2009 in previous thread posts. Many of us are using LabVIEW 2009 at this point, although not all have access to it (I think Dennis may not be using it yet, for example, nor am I here at the office), it is just a good idea when you post code that you indicate what version it is in, to save those that might not have a compatible version from the effort of downloading a file to find out they can't open it.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 9 of 12
(3,811 Views)

My bad

here is the code.

labview 9.0

0 Kudos
Message 10 of 12
(3,809 Views)