Shop OBEX P1 Docs P2 Docs Learn Events
Changing the data in a LOOKDOWN statement — Parallax Forums

Changing the data in a LOOKDOWN statement

stamptrolstamptrol Posts: 1,731
edited 2009-06-01 18:02 in General Discussion
·Hello all,
···I have a measurement system that reads a pot and compares the present value to a group of setpoints.
···
·· I'm using LOOKDOWN to let me·compare the current value with one of 27 stored values and return the index value as per the LOOKDOWN instructions.

···For example, ·LOOKDOWN chan1val, <[noparse][[/noparse]275,400,500,600,750..............4050],lb····· ---lb ends up from 0 to 27.

··· When I first put this system together, I would make adjustments of the 27 analog values using the laptop. After getting things running, it is now apparent that being able to change those values without a laptop would be useful.

I've been practicing by starting out with a DATA statement to load the initial settings then giving the operator a "calibrate" routine to select which of the 27 values to adjust and storing that value with a WRITE command. That all works fine.

·· Is there a way to put a newly adjusted value·between the brackets of the LOOKDOWN on the fly? I know they can be variables or expressions, but
I·can't assign a separate variable for each value. (too many WORD sized numbers).

·· I have written a FOR - NEXT loop which will do the trick to replace the LOOKDOWN if necessary, but thought I'd see if there's an option to keep the LOOKDOWN structure.

· Cheers,
···

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk

http://www.siskconsult.com
·
Sign In or Register to comment.