01-13-2010 11:10 AM
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.
01-13-2010 11:16 AM
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.
01-13-2010 01:26 PM
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.
01-13-2010 02:38 PM
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:
Its inputs are
And Outputs are
(A+ if you already thought to copy this to the vi documentation)
01-13-2010 02:45 PM
01-13-2010 02:49 PM - edited 01-13-2010 02:50 PM
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
01-13-2010 03:34 PM - edited 01-13-2010 03:39 PM
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
01-13-2010 04:15 PM
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
01-13-2010 04:22 PM
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.
01-13-2010 04:24 PM
My bad
here is the code.
labview 9.0