plx-daq able to post text using variables?
jhtoolman2000
Posts: 9
hello all,
using the plx-daq and not sure if i can do this--want to be able to read serial code·(11101010) or something like that from bs2sx and then based on the serial code, use a lookup tabel to find a name of someone that matches that code and then send that to a cell in the plx-daq.· Not sure if i can use text as a variable.· for example:
chad var word
chad con 1001
start:
if in8 = 1001 then jump
jump:
LOOKUP index, [noparse][[/noparse]"chad","john","mike"], result
SEROUT 16,240,[noparse][[/noparse]CELL, SET,C4,result,CR]
goto start
or something like this.· want to be able to crossreference the code to a name and then post name to·a cell.· Or can i do this at all?· hope this makes sense.· thanks to all in advance.
jon
using the plx-daq and not sure if i can do this--want to be able to read serial code·(11101010) or something like that from bs2sx and then based on the serial code, use a lookup tabel to find a name of someone that matches that code and then send that to a cell in the plx-daq.· Not sure if i can use text as a variable.· for example:
chad var word
chad con 1001
start:
if in8 = 1001 then jump
jump:
LOOKUP index, [noparse][[/noparse]"chad","john","mike"], result
SEROUT 16,240,[noparse][[/noparse]CELL, SET,C4,result,CR]
goto start
or something like this.· want to be able to crossreference the code to a name and then post name to·a cell.· Or can i do this at all?· hope this makes sense.· thanks to all in advance.
jon
Comments
Got your Email, but was in Chicago this weekend so haven't gotten around to answering.
Strings get tricky and the indexing is based on the number of bytes.· While not as elegant, you would probably be better off using·a SELECT CASE structure to decide which name to send to the spreadsheet and have it hardcoded in the CASE.
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies
some how i knew you would have an answer.· Perhaps you could expand on that a little more when you have time.· my work email or here would be fine.· thanks again for all the help.
jon
Use the help files and look up SELECT CASE for more info.
Also, in your code, I notice you check IN8 = 0101110101 or such.· First, IN8 is a single bit, so it can never be anythign other than 1 or 0.·2nd, if you use a binary value, you need to preceed it with %.
If you ever want to take a drive down with your setup, we could probably sit in the lab and get some code straightened out.
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies