From: Mark Harriss To: James Cameron Date: Sun, Jun 13, 2004 at 04:51:46PM +1000 Dear Mr Quozl, Would it be possible to get some help with running your Linux DAS005 software? I have a project that uses a DAS005 8 channel daq. I'm hoping to use it in Linux as the Ocean Controls software does not run too well in Windows XP at all and I wondering if your Linux software can copy data to files (I'll have to look up about piping it from the console) as I'm having trouble working out the command line syntax to sample the first four channels and save them to a file. At the moment I'm using: k118 -i 50 -a 1 -a 2 -a 3 -a 4 Regards Mark Harriss (ningauble at dodo dot com dot au) -- From: James Cameron To: Mark Harriss Well, what you ask boils down to how to use Linux, rather than how to use k118, so any Linux introductory texts could help you. There are *four* ways that I use to store sample data to file, and I'm sure other ways could be found. 1) command line redirection, 2) script(1), 3) tee(1), 4) crontab(1). (by the way, the (1) means "this word has a manual page in section 1 of the manuals", and it also means "you can type 'man 1 script' to read the manual".) Covering each possibility ... 1) command line redirection, # k118 -i 50 -f 1 -a 1 -a 2 -a 3 -a 4 > data.txt The "> data.txt" in the command causes the shell program (usually bash(1)) to connect the standard output (stdout) stream to a new file data.txt before starting the program k118. The k118 program does not know that it's been redirected, it will just operate normally and the text it would normally display would go to the file instead. The "-f 1" tells k118 to flush the stdout buffers every second. If it did not do this, it may take a while for the data to appear in the file. This is less important for your command, since the sample rate will cause lots of output. 2) script(1), # script -f data.txt # k118 -i 50 -f 1 -a 1 -a 2 -a 3 -a 4 ^c # ^d The script(1) command saves everything that happens on the console after it is run. Once you've finished what you want recorded, you use control/d (shown above as ^d) to exit the subshell and close the data.txt file. 3) tee(1), # k118 -i 50 -f 1 -a 1 -a 2 -a 3 -a 4 | tee data.txt The "|" causes the shell to connect stdout of the program on the left to the stdin of the program on the right. Like connecting a pipe from one program to the other. The tee(1) program accepts whatever comes in, and places it in the file *and* on the screen. Think of it like a "T" intersection. 4) crontab(1). # crontab -e ... 9 9-17 * * 1-5 k118 -a 3 >> data.txt This isn't what you need, because it happens far slower, and you mentioned "-i 50". But this is how you would sample an analog channel at 9:17am, 10:17am through to 5:17pm on Monday through to Friday. Note the ">>" which is like ">" but doesn't erase the file, instead it appends the new text to the end of the file. Note: incidentally, on all four methods, you can type "tail -f data.txt" in another window or console to see the data being added to the file. See tail(1). --