LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

daq configuration data validation

I needed to allow the user to change the sample rate and sample interval of my accelerometer setup from an INI file. So now im going to have to ensure that the sampleinterval is divisable into the buffer size. The first way I thought to do it was to just check if the user value has a mod remainder when divided into input buffer size. once I had a remainder I was going to break up the user value into individual numbers and coerce each number to an appropriate value to ensure the program didnt crash.

 

the problem I didnt think about was I broke the number up using a byte array and then realized that gives me the ascii value of each number and so doesn work.

 

is there another way to break up the user defined string from the INI file into discrete numbers to test and coerce?

am I over thinking this and theres an easier way to do this?

0 Kudos
Message 1 of 3
(2,733 Views)

There might be some easier way, but what i think of is

-For loop, with sttring length to N

-String subset-i to offset and length to numeric constant 1

-string to decimal number 

 

 

Thanks
uday
Message 2 of 3
(2,700 Views)

It took me a minute to realize thats a single solution, I get what you're saying now. I ended up realizing that I could subtract an offset from the ascii values I was getting from the byte array and then manipulate that and add back the offset. I attached a snippet of my solution. probably not great but I think it works.

 

Thanks though

0 Kudos
Message 3 of 3
(2,697 Views)