LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

change all VI s in Project from Double to single Precision

hi,

 

1.  I could save some time  by doing all calculations in Single Precision.

 

2.  how to change the type of  all controls & indicators in all VIs in a project  frm double to single

 

regards

akshay

 

0 Kudos
Message 1 of 16
(3,236 Views)

Hi,

 

1. Why do you think you will save some time? Which calculations do you want to perform? Did you perform some (good) benchmarks?

 

2.

- You can do this manually by right-clicking each control/indicator.

- You can select all controls/indicators on your FP (of a single VI) and set the datatype to SGL at once.

- You could write your own VI scripting routine to change the datatype of all controls…

 

Again: Are you REALLY sure you want to change to SGL for the whole project?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 16
(3,223 Views)

Hi,

 

well if there   are  1 Million  calculations going on  yes  I save time  in case of 2 mins I need only 1 min.

 

I have   saved time by using SGL.

0 Kudos
Message 3 of 16
(3,210 Views)

Hi aparab,

 

which target do these calculations run on?

What kind of calculations did you perform?

 

As soon as "more advanced" functions from the math or signal palette come into play you mostly limited to perform your calculations using DBL datatype…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 16
(3,203 Views)

I can see you saving a little bit of time by going with SGL, but I wouldn't expect it to be truely measurable.  And then you also loose accuracy when going to SGL.  Depending on what you are doing that may be acceptable.  My other concern is, as GerdW has already stated, which libraries are you using?  Many of them are only written for DBL.  The coersion is likely more expensive than the possible gain from using SGL.

 

With that said, if you have scripting enabled, you can use a property node to set the representation of a numeric control/indicator.  There is also a VI in the Application->VI Scripting palette called Traverse for GObjects.vi that you will find useful.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 16
(3,190 Views)
So again why do ALL floats in the application need to be singles? It sounds to me from what you are saying that the structure carrying you million points of data needs to be SGL, but that can be accomplished by definIng a typedef.

And converting to SGL will only work if there is no timestamp data in your dataset. Timestamps have to be DBL.

And then there is Tim''s point that the analysis routines all work (in at least) DBL. You may be talking about recoding portions of what is in the analysis library.

Finally, why process all million points at once? You haven't mentioned what analysis you are doing, but there is likely a way of doing it piecewise.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 16
(3,173 Views)

thanks all for the cooeration & fast replies,

 

I measure voltage  amplitude to be specific , min max values & based on that do more measurements .

I divide my waveform into parts atleast 3000 &  in each part in   the waveform "Y" value is analyzed.

this is time consuming!

 

from my previous project I had  Time value in "Y" & for most calculations  I  used  SGL  & as said it saved me a Minute.

 

so I am trying to implement SGL

 

It was a far cry  to ask to change all DBLs to SGLs

 

If its possible to  change all the Variables of one type to other type  , I would like to  know that.

0 Kudos
Message 7 of 16
(3,154 Views)

Some responses are quite negative about SGL here. I agree, when using built-in functions which are only for DBL then it doesn't make sense. But otherwise - of course ONLY if precision is sufficient - SGLs can really save lots of time. We have a tight RT loop with PI controllers, filters and other calculations which would never run at the desired rate when using DBL. We rewrote some built-in analysis VIs for SGL to avoid coercions. Using SGL can really make a big difference!

 

Back to your actual question: you can select multiple terminals and switch their representation at once from the properties dialog. Or use scripting.

 

0 Kudos
Message 8 of 16
(3,136 Views)

Hi dan,

 

We have a tight RT loop with PI controllers

That's why I asked about the target before - the OP never answered that question…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 16
(3,126 Views)

It's not only about RT. Sometimes you also want calculations to be faster on a Windows machine.

Ever did a histogram calculation on a large array (~1M points) of DBL or SGL? The difference can be seconds... (of course this needs a custom histogram VI, since the built-in one only supports DBL)

 

 

 

 

0 Kudos
Message 10 of 16
(3,120 Views)