LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with my while loop

I am fairly new to LABView. With my vi I want to be able to change the frequency while the vi is running ,but how do I do that without stopping it and running it again? I would also like to add an LED that corresponds to the frequency. How would I do this. It seemed easy enough but I couldn;t get it to work. I've attached my file.

 

Thank You

Download All
0 Kudos
Message 1 of 14
(3,137 Views)

I've modifed your VI to use Statemachine. You specify frequency when you create the counter so when you need to change the frequency, you have to shutdown the task and reconfigure. Hope this helps. I've done this in LabVIEW 2012.

 

 


Kudos are the best way to say thanks 🙂
Download All
Message 2 of 14
(3,121 Views)

Is there anyway of reconfiguring counter frequency without shutting down the task?

 

Thank You

0 Kudos
Message 3 of 14
(3,082 Views)

I am afraid not. I tried looking for property nodes that expose frequency but since you are creating channels that generate pulses at a particular frequency, I believe you do have to shutdown and reconfigure.

Anyone else have inputs on this ?

 

$29CB27CD823F808E.jpg


Kudos are the best way to say thanks 🙂
Message 4 of 14
(3,056 Views)

Where and how would I attach a boolean LED that corresponds to the pulses generated by the counter?

 

Thanks

0 Kudos
Message 5 of 14
(3,045 Views)

If you use an event structure you should be able to change the frequency at any point. Put your main code in the timeout case, and then make an event for frequency value change. Use a shift register (right click on the event structure) to store the frequency while it runs.

 

For the LED you would need to know something about these pulses so you can compare them. If it is a pulse at 1 then on each loop you could check that the value is equal to 1 and connect that comparison to the LED. 

Message 6 of 14
(3,043 Views)

You would place the conditions for LEDs in the "Configure" Case structure selection.

 

$1DDB648897C87AD6.jpg


Kudos are the best way to say thanks 🙂
Message 7 of 14
(3,036 Views)

There were couple of bugs in my code. Fixed them and re-attached.

 

I'd suggest using the Shipping example of statemachine that LabVIEW comes with. It has an Event structure built into it. You could use that, and copy portions of the code that I modified and you could have a nice robust customized code.


Kudos are the best way to say thanks 🙂
Download All
Message 8 of 14
(3,032 Views)

Sorry to trouble you again. I have version 2011 of LABView. and it keeps giving me an error when loading the file. How would I remedy this?

 

 

Thank You so much for your help thuis far

0 Kudos
Message 9 of 14
(3,029 Views)

Here you go. I've re-saved it in 2011 🙂


Kudos are the best way to say thanks 🙂
Download All
Message 10 of 14
(3,024 Views)