can i use a value from excel
mobile_bob
Posts: 50
what i want to know is if it is possible to use a value from a cell in a spreadsheet such as excel
in my coding of a bs2 stamp
is there a variant of the bs2 that i can use to do this?
for instance if i were to set up a spreadsheet with A1 with the number 2 , A2 with the number 3, and then in A3 sum of A1 and A2= 5 (basic spreadsheet stuff)
is there a way to read the cell contents of A3 and use it in a program something like and if/then statement
IF (A3 = 5 or greater) then Goto
or something like that?
if it is possible, is there an example somewhere showing how this might be done.
failing that option
i can use a spreadsheet to get the values i need and reprogram the stamp each time there is a change in cell contents
to reflect that value, however i am not sure this is the best way to do it, or if it would quickly wear out the chip due to reprogramming on a daily basis.
so maybe i could take the values, put them into some sort of storage that the stamp can go to and read, and act upon based on the program that is in the stamp?
does that make sense.
any help or direction would be most appreciated. i know enough to make my project work as is very well, however having this added capability would be a huge next step for me.
thanks
bob g
in my coding of a bs2 stamp
is there a variant of the bs2 that i can use to do this?
for instance if i were to set up a spreadsheet with A1 with the number 2 , A2 with the number 3, and then in A3 sum of A1 and A2= 5 (basic spreadsheet stuff)
is there a way to read the cell contents of A3 and use it in a program something like and if/then statement
IF (A3 = 5 or greater) then Goto
or something like that?
if it is possible, is there an example somewhere showing how this might be done.
failing that option
i can use a spreadsheet to get the values i need and reprogram the stamp each time there is a change in cell contents
to reflect that value, however i am not sure this is the best way to do it, or if it would quickly wear out the chip due to reprogramming on a daily basis.
so maybe i could take the values, put them into some sort of storage that the stamp can go to and read, and act upon based on the program that is in the stamp?
does that make sense.
any help or direction would be most appreciated. i know enough to make my project work as is very well, however having this added capability would be a huge next step for me.
thanks
bob g
Comments
If you can only have a connection intermittently, you could use PLX-DAQ to read a value from Excel to the Stamp and use the WRITE statement to store the value in the Stamp's EEPROM for use when there's no connection to a PC. You'd have to initiate this operation by pushing a button or switch to tell the Stamp that there's a connection and it should try to read the value from Excel. The actual program in the BS2 wouldn't change although the area in the EEPROM where you'd store the value (in an area not used by the program) would change and can be changed > 1,000,000 times.
variables in cells become part of a program that can be loaded into a BASIC Stamp. E.g., where $F$11, F27 and G27 are cell references that
="longitude DATA Word " & INT($F$11*100)
="DATA Word " & F27 & ", Word " & G27
But I gather you are looking for a more dynamic coupling via a serial port or something like that.
Have you looked into PLX-DAQ Real-Time Data Acquisition for Microsoft Excel? I'm not sure, but it looks like it is only one-way though, from Stamp to Excel.
PS I see Mike already made the suggestion!
A few years back, I wrote a program in Excel VBA that read weights from a digital scale into an Excel spreadsheet. The purpose was to evaluate variations in product weights in a plastic molding process. The program also determined the density of the raw materials based on volume and weight.
After receiving data the program sent back information to zero or tare the scale.
(Also, if weights were out of tolerance, the program would send an email to all departments and facilities involved with the product.)
So... yeah, it can be done.
Amanda
bob g
I had a same question.
Greetings, Pavo.