SelmaDAQ

InvaderZim

Senior Member
I thought I'd play around with the Selmawares.

I'm not sure what I should be sending though; I can successfully send text to a terminal program, and when I 'connect' with SelmaDAQ it looks successful, with the 'R' (receive) light blinking 6 times, pausing, etc., just as my test program should do. But I don't get any data in Excel.

I've tried sending CR and LF (carriage return and line feed) characters, and combinations of commas and semicolens, but with no luck.
Code:
#rem
Example to report data to a comma separated text file on the host
through the programming cable

#endrem

#picaxe 18x
setfreq m8	'9600 baud

main:
for b0=0 to 5
sertxd (#b0,",","4",",","22",13,10)	'data followed by CR and LF; tried various combinations here
pause 2000
next b0
pause 10000
goto main
Can anyone throw me a bone?
 

Mycroft2152

Senior Member
Selmadaq requires some commands to be sent before the data:

From the Selmadaq help file:

Example pseudo-code - all strings must end with an ASCII 13 (Carriage Return):

Clear current data on the sheet using the CLEARDATA directive.
Reset the timer if time stamping by seconds using the RESETTIMER directive.
Label the columns using the LABEL directive.
Send data using the DATA directive.
Example pseudo-code - all strings must end with an ASCII 13 (Carriage Return):
Delay after connecting to allow connection to stabilize
Send a string of "CLEARDATA" to clear columns of data
Send a string of "RESETTIMER" to reset seconds' timer
Send a string for labeling columns "LABEL, time, seconds, value 1's name, value 2's name"
Start a loop
Process one or more variables of data
Send data to be spreadsheet with string of "DATA,TIME,TIMER,variable1's value, variable 2's value"
Repeat loop

Google Selmadaq PICAXE for more examples

Myc
 

InvaderZim

Senior Member
Thanks a lot, I can make pretty graphs now! Wish I'd noticed the help file :p

Here's my working example:
Code:
#rem
Example to report data to an excel spreadsheeet on the host
through the programming cable using SelmaDAQ.

ASCII 13 is a Carriage Return (CR); all commands must end with it.
All SelmaDAQ directives must be in caps.

NOTE: In this example you must program the picaxe, then hold reset while
pressing "connect" in SelmaDAQ. The data logging will begin when the chip is
taken out of reset.

#endrem

#picaxe 18x
setfreq m8	'9600 baud

sertxd ("RESETTIMER",13)		'reset SelmaDAQ timer
sertxd ("MSG, Incoming Data!",13)	'send message to SelmaDAQ (optional)
sertxd ("LABEL,Date,Time,Timer,Data1,Data2,Data3",13)	'label spreadsheet (optional, but keeps spreadsheet in sync with program)
sertxd ("CLEARDATA",13)			'clear existing data in spreadsheet (optional, but keeps things tidy)


main:
for b0=0 to 5
sertxd ("DATA,DATE,TIME,TIMER,",#b0,",4,22",13)	'data command, followed by optional fields and dummy data
pause 2000
next b0
pause 10000
goto main
 
Top