LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LABVIEW 7.1 20020

Solved!
Go to solution

how do you define this case 'defaut', or can i just build a constant to Fe?

0 Kudos
Message 11 of 30
(1,372 Views)
I assume by Fe you meant Fs. Yes you may wire it to a constant. But it is better to pull this value from your settings in the code. This way if you make some changes to the sample rate. It will automatically be noticed in the following code.


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 12 of 30
(1,371 Views)

oh yes, but i don't know how to do with another cas, and in the case it isn't to build un constant?

0 Kudos
Message 13 of 30
(1,361 Views)

You have to include a value in every case. Just do as you have done in the "11025" loop. Also remember that that you can not have the upper frequency higher than Fs/2.

Tip

Delete the defualt case, then "right click" on the case structure and slect "Add Case for every value"



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 14 of 30
(1,353 Views)

Don't use a case structure, use format into string, then string to decimal:

scnfromstr.jpg

 

This will adapt to whatever elements exist in the enum, and return them exactly as they are typed.

Message Edited by Thoric on 05-26-2009 12:35 PM
Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 15 of 30
(1,353 Views)

Thoric wrote:

Don't use a case structure, use format into string, then string to decimal:

 This will adapt to whatever elements exist in the enum, and return them exactly as they are typed.


I would not have used your method inside a loop because it is very inefficient. Besides if new values are added to the enum, an error will be generated until the case structure and the enum have matching values



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 16 of 30
(1,343 Views)

Coq rouge wrote:

I would not have used your method inside a loop because it is very inefficient. Besides if new values are added to the enum, an error will be generated until the case structure and the enum have matching values


It's outside the while loop.

 

Coq rouge wrote:

I would not have used your method inside a loop because it is very inefficient. Besides if new values are added to the enum, an error will be generated until the case structure and the enum have matching values


 

Why is this a good thing? With an enum to string to decimal you no longer have to worry about what the enum contains, it will always return the numeric conversion no matter what. It's very versatile.

 

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 17 of 30
(1,335 Views)

thanks for your helps, both of your ways work well, The Thoric's is good for me because i will build sound format into a constant, but Coq rouge's is better for every case. thanks again.

 

Please forgive my ignorance, i add this filter for avoiding noises, but now it is wors, i would like to acquir

cardiac rhythm.
and also there is another question, could you help me to explain why the delete fonction does't work?
0 Kudos
Message 18 of 30
(1,333 Views)

Coq rouge wrote:

I would not have used your method inside a loop because it is very inefficient. Besides if new values are added to the enum, an error will be generated until the case structure and the enum have matching values


Very inefficient?

Comparing a loop of 1E7 iterations containing a case structure with a 1E7 iterations loop containing an enum to string to decimal, I get times of 49 and 66 ms each. That's 10 million conversions in 66 milliseconds for my method on a basic laptop. Hardly worth worrying about, and only a small percentage slower than the case structure. Not a candidate for very inefficient.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 19 of 30
(1,331 Views)

Hi xiuming,

Looking at your vi, the Delete button (Bouton Annuler?) will only delete the sound file if it is already depressed when the vi is launched. This is because the boolean control is read immediatelythe program starts, and not anytime after. You might want to consider creating an event case for the boolean value change and deleting the file from within there instead.

 

On another note, why do you delete the same file that you write your sound data to immediately after writing to it?

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 20 of 30
(1,318 Views)