PDA

View Full Version : Negative numbers in StampDAQ



Randy
12-02-2006, 10:23 AM
Is there a way to put negative numbers into StampDAQ? I am recording temperatures, one of them being outside temperature that could be below zero. The temperature data is sent from the Stamp as bytes except for outside temperature, it·is sent as a word. If a number is negative it always comes up 255 as if only the first byte of the word is being accepted. I changed the cell format from general to number but it had no effect.

Also can the number of columns be increased? I am sending a date stamp and 9 temperatures. I would like to send 11 temperatures if possible.

Martin, I am guessing you will read this, if not respond, and I would like to thank you in particular·as well as·Parallax for StampDAQ as it is a great program, especially·for those of us that find PBasic a challenge.

Randy

·

Martin Hebel
12-02-2006, 10:42 AM
StampDAQ does negative values, I've been doing some recently.

If it looks negative in the DEBUG window, it should look negative in StampDAQ.

Are you using the SDEC modifier?

You can modify StampDAQ yourself for more columns. Go to Tools-->Macro Visual BASIC Editor

Under forms, open the StampDAQ Form

Look for this code: If cc >= 7 Then Worksheets(1).Range("G" & CStr(Row)).Value = DataVal(7)
If cc >= 8 Then Worksheets(1).Range("H" & CStr(Row)).Value = DataVal(8)
If cc >= 9 Then Worksheets(1).Range("I" & CStr(Row)).Value = DataVal(9)

And add more at the end, follow the pattern.

You will also need to find the clearsheet function and increase the range for clearing it out.

Yes, read it, thanks, much appreciated. I mentioned I'll try to roll out an updated version over our break coming up at school with some good tweaks.

-Martin

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Martin Hebel
StampPlot - Graphical Data Acquisition and Control (http://www.stampplot.com/)
AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers (http://www.selmaware.com/appbee)·

Randy
12-03-2006, 01:54 AM
Thanks Martin, that was too easy. Nothing like having someone elses code to duplicate or add to.

The negative numbers work fine also. I should have known that as some months ago when I first tested this the negative numbers showed up in StampDAQ as expected. As the program grew and I added a slot or two using GET and PUT to access data in the different slots. It really helps if you use the WORD modifier in ALL the appropriate slots. I put the value in as a word and took it out as a byte in one slot and wouldn't you know it - 255. The lcd display and the StampDAQ msg board had the correct number as they came from a different slot.

Martin Hebel
12-03-2006, 02:12 AM
Randy,
You are welcome and glad it worked out for you!

-Martin

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Martin Hebel
StampPlot - Graphical Data Acquisition and Control (http://www.stampplot.com/)
AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers (http://www.selmaware.com/appbee)·