Jump to content

Break/abort a long sequence


Recommended Posts

Hello,

In my VI which is use with a turbojet I use a finite state machine with the following state

STOP / AUTOSTART / MANUAL / PROG

I can modify throttle manualy (using a slider) when the state is set to MANUAL.

I can send a predefined sequence when the state is set to PROG.

The predefined sequence for test is for example a self made square signal generated using

a Labview "sequence"

for example

throttle=40

wait 5000 ms

throttle=60

wait 5000 ms

and so one...

When I click on a "STOP PROG" button I would like

that the state instantly turn to MANUAL.

So my problem, is that now when I click on "STOP PROG" tge state is

only set to MANUAL ***after*** every step of the sequence are finished !

If my PROG (predefined sequence) is very long it's not very conveniant as

I have to wait the end of the sequence to abord.

Is there an easy way to solve my problem ?

Best regards

Link to comment

QUOTE (scls19fr @ Apr 7 2008, 04:28 PM)

Hello,

In my VI which is use with a turbojet I use a finite state machine with the following state

STOP / AUTOSTART / MANUAL / PROG

I can modify throttle manualy (using a slider) when the state is set to MANUAL.

I can send a predefined sequence when the state is set to PROG.

The predefined sequence for test is for example a self made square signal generated using

a Labview "sequence"

for example

throttle=40

wait 5000 ms

throttle=60

wait 5000 ms

and so one...

When I click on a "STOP PROG" button I would like

that the state instantly turn to MANUAL.

So my problem, is that now when I click on "STOP PROG" tge state is

only set to MANUAL ***after*** every step of the sequence are finished !

If my PROG (predefined sequence) is very long it's not very conveniant as

I have to wait the end of the sequence to abord.

Is there an easy way to solve my problem ?

Best regards

I apologise if I am incorrect, this is starting to sound like school work. We prefer not to answer these things for folks who ought to be working them out alone for school credit.

Can you show us a little of your own attempts at coding this so we have an easier chance at making useful suggestions?

I am not going to try to model this if you have already done it. And if you haven't already done it, then I shouldn't be doing it for you. IMO.

Mike

Link to comment

QUOTE (scls19fr @ Apr 7 2008, 12:28 PM)

The predefined sequence for test is for example a self made square signal generated using

a Labview "sequence"

...

When I click on a "STOP PROG" button I would like

that the state instantly turn to MANUAL.

...

Is there an easy way to solve my problem ?

What Mike said is right, but I'll give you a couple nuggets:

  • You can't "break" a sequence. All the frames must execute, from beginning to end.
  • You shouldn't be solving your problem with a sequence. The concept you are looking for is state machine.

Link to comment

Thanks Ross and Justin for your replies.

I think I need to explain the facts.

First I'm thirty years old and I pass my exams a long time ago !

Secondly, I teach electronic and physics (thermal science) at Poitiers Institute of Technology (France)

So, I'm not a "Labview Advanced Virtual Architect"... therefore I'm looking for help here !

(I won't get credits for this !!!! .... can additional credits be changed for money ?)

We own a turbojet WrenTurbines MW54 Mk3.

This turbojet has an engine control unit ECU / FADEC (Full Authority Digital Engine Control)

Using a serial COM I get data (RPM, EGT, pump power)

I also add more sensors (like strain gauges to get thrust, like a pression tranceiver to get air flow

using a venturi) and a Labjack U12 data acquisition board.

We would like to make a test cell for students.

For now we modify throttle using a radio controlled receiver. I design an USB servo tester

that simulate the radio controlled receiver when receiving data from Labview (using an ATMEL

AVR ATmega8, a FTDI chip, Virtual COM Port driver and NI VISA)

http://www.celles.net/wikini/wakka.php?wik...steurDeServoUSB

Now I'm looking for a way to send predefined sequences.

You can have a look at my VI about this part.

see the test_input_step.vi

The whole project is in a Subversion directory

Web access

http://svn.berlios.de/viewcvs/openphysic/l...bo-wrenturbines

Anonymous access

svn checkout svn://svn.berlios.de/openphysic/labview/turbo-wrenturbines

See the trunk directory.

"Tags" directory also contains some files

Link to comment

QUOTE (scls19fr @ Apr 7 2008, 10:28 PM)

So my problem, is that now when I click on "STOP PROG" tge state is

only set to MANUAL ***after*** every step of the sequence are finished !

If my PROG (predefined sequence) is very long it's not very conveniant as

I have to wait the end of the sequence to abord.

Is there an easy way to solve my problem ?

You'll have to create a way to signal that a sequence is aborted, so that the main VI sets a running state and the subVIs just reads the status to see if another step should be taken. This can be done using a number of different primitives/patterns;

* using notifiers/queues/occurrences, using these primitives means that you'll have to feed every "sequence runner" with the queue/notifier reference.

* using a functional global, i.e. a VI with an uninitialized shiftregister that stores the status information you need.

* ...

/J

Link to comment

QUOTE (scls19fr @ Apr 7 2008, 10:34 PM)

Aha! So it is for schoolwork! :P

QUOTE (scls19fr @ Apr 8 2008, 02:07 AM)

Wow ! Not sure of being able to do this !

Maybe you have a link that could explain these patterns (using some use cases)

I haven't downloaded your code to look at it, but there's some information about state machines in the LabVIEW help, and there are some built-in templates that you can find under File >> New... in VI >> From Template >> Frameworks >> Design Patterns.

Link to comment

I ever made a state machine for STOP/AUTOSTART/MANUAL/PROG

About the way of generating a signal (instead of using sequence) I found this

http://forums.lavag.org/Generate-my-own-in...ice-t10532.html

Express / Input / Simulate arbitrary signal

(not sure of the translation because in french it's

Express / Entrée / Simuler un signal arbitraire)

so I would have to "break" a sequence ! but I also have some questions that could be answered in this post

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.