LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem in queue operation

Solved!
Go to solution

hello friends,

in the vi below if I am putting more than one commands ie strings in command control all the commands start executing one by one and after all commands are finished again they start executing as they are in loop..

for example if in the command control :  S

                                                              Z

                                                              SI

these are the commands then the order of execution is like this S then Z then SI then again S then Z then SI again S....and so on till I stop the loop..

but what I want that it should work like S then Z then SI and SI(ie the last command) should continue execution till I stop the loop.. 

can anyone help me out as I got stuck with this problem..

thanx in advance

0 Kudos
Message 1 of 12
(3,003 Views)
My first guess is that you should change the mechanical action of your Write boolean control from "Switch When Pressed" to "Latch When Pressed" (I prefer "Latch When Released" because it causes LabVIEW to wait until you've released the mouse button before setting the value of the button.)  Your first Case Structure execute when you press the button, then LabVIEW will reset the button to off.  Right-click on the control, select "Mechanical Action" then "Latch When Pressed".
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 12
(2,983 Views)

thank you..but I have to make this as sub vi with command as input and mass as output..

but still my problem is unsolved as  I think I need to first queue the command string and then dequeue it so that every dequeue operation will pop out one command and it will be send for execution..but I was facing dequeing the command string ..sorry this might be easy quetion but I am new to labview..pls help me out..    Smiley Surprised

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

Are you familiar with the Producer/Consumer design pattern?  Do you know how Queues work?

What is this "this" that you speak of making into a sub-VI?  What commands will you need to send it?

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 4 of 12
(2,962 Views)

No I have no idea about the Producer/Consumer design pattern..About queues I had an idea through labview help and I haven't work with queues before..

and I want to make my VI as subvi with one input(command control) and one output(MASS indicator)..such that if I put 3 commands in the command control all the three should execute once..

can you send me an easy example of the use of queues with strings.Smiley Indifferent

thnx

0 Kudos
Message 5 of 12
(2,953 Views)

Hi Vikki,

You have to do some work do a forum search of design patterns.Nobody here will do that for you.

Regards

 

Certified LabVIEW Architect.
Ohiofudu Israel

0 Kudos
Message 6 of 12
(2,939 Views)

Hi Vikki,

 

It took me some time to do that and i am sure that is not the best way to do it but finally it works.

Hopefully that's good for your application. Have a look at the modified version.

 

0 Kudos
Message 7 of 12
(2,923 Views)
You need to have use carriage return after each command (even after the last to work)
0 Kudos
Message 8 of 12
(2,919 Views)

Hi Dimitrios,

thanks for your effort but when I tried with your solution with carriage return error-1073807339 is occuring at the visa read which says timeout expired before operation completed.

Can you rectify that..?

0 Kudos
Message 9 of 12
(2,887 Views)
It runs perfect on mine no errors at all. Just open my VI not change anything. I have put the (S Z SI) instrunctions as default, no need to type anything extra on the Command control string.
0 Kudos
Message 10 of 12
(2,874 Views)