How to set integer with knob


Recommended Posts

Posted

Hello,

I want to set an integer value N at 1, 2, 3 ,..10 as a number of measurements, with a Knob. /Device=LabJackU3/

But in most cases it gives something around integer, for example: 1.8, 2.1, 4.2, 5.9 etc...

And the sequence:

while(N>0)

beginexport(Data)

delay(1)

N=N-1

endwhile

produces a different number of measurements, depending on where the Knob indicator is

Posted

Use floor(n) to trim the decimal, or do floor(n+0.5) to round it, so something like:

n = floor(n)

while (n > 0)

etc.

BTW: make sure and use proper indentation in your script.

Archived

This topic is now archived and is closed to further replies.