From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problems converting dynamic data to dbl/boolean from a simulated signal

Solved!
Go to solution

HI everyone,

 

I trying to simply make a LED blink with a simulated square wave. It's been 3 hours I'm searching why the dynamic data convertion does'nt update every iteration (it seems to be the problems).

 

I tried with every option of the "convert from" object but i did not succeed (I'm desperated)

 

in the .vi enclosed, I choose "most recent value"

 

could have a look at my .vi ?

 

Thank you very much,

 

Guillaume.

0 Kudos
Message 1 of 16
(6,178 Views)

Hi,

 

you are using the simulate signal VI to create a waveform array. If you want to make your LED blink you would need to index through the array at some specified rate.

 

David
www.controlsoftwaresolutions.com
0 Kudos
Message 2 of 16
(6,175 Views)

thank you for your reply.

 

I chose most recent value so I don't understand why do I need to index ?

 

If I choose "single scalar" for example; it does'nt work either !

 

in my dynamic data should be 1 channel am I right ?

 

 

encolsed I attached the .vi with indexing.

0 Kudos
Message 3 of 16
(6,162 Views)

Your second example has the sample problem - the waveform in the tunnel is a contant so you are always reading the same point. You need to index THROUGH the array. It might be easier to toggle a single boolean every xms - do you have any more detail of your application?

David
www.controlsoftwaresolutions.com
0 Kudos
Message 4 of 16
(6,158 Views)
Also you have set converting your data to a boolean array and then trying to compare with a DBL
David
www.controlsoftwaresolutions.com
0 Kudos
Message 5 of 16
(6,155 Views)

ok,

 

I've noticed the waveform is a constant throught the tunnel but I still don't understand why !

 

My actual application is to represent a camshaft position with a gauge.

 

I'm simulating the crankshaft angle sensor :

 

so I have one signal for the speed (a tooth every degree).

 

and I have the top dead center signal, outputing one tooth when the camshaft is a the top.

 

I measure the elapsed time since i did not see the TDC tooth (in sec) and multiply this by the speed (in °/sec) so I end up with the number of degree travelled and then and send this info to the gauge.

 

I tried to add comment in the .vi to make it clearer.

 

Sorry if it is not well programmed, I am a newbie in Labview.

and sorry for my english, I'm french 🙂

 

and thank you for your help !

 

Guillaume.

 

 

Message Edited by gdlbb on 01-18-2010 08:27 AM
0 Kudos
Message 6 of 16
(6,149 Views)

I have updated your second VI to get you started.

 

I have reduced the number of points in your waveform. Also, i have converted to a DBL array is this is the type your simulate signal VI is creating.

 

The for loop in the while loop is to give you an idea of what to do although you should be able to come up with a better solution. I have used auto indexing

 

Hope this helps

David
www.controlsoftwaresolutions.com
0 Kudos
Message 7 of 16
(6,129 Views)
thank you ! but I cannot open it, can you save it back to 8.5 please ?
0 Kudos
Message 8 of 16
(6,123 Views)
8.5 - let me know if any problems - remember this is just to get you started, it is not an ideal solution
David
www.controlsoftwaresolutions.com
0 Kudos
Message 9 of 16
(6,120 Views)

Thank you for your quick answers,

 

I have a question, in problem2.vi, the LED "blink speed" is not related to the frequency of the simulated signal. (it seems to be not)

 

I mean the LED should blink twice a second if the input frequency is 2 hz, and that's not the case.

 

thxs,

Guillaume.

0 Kudos
Message 10 of 16
(6,110 Views)