Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Processing save data 3

Status
Not open for further replies.

FeX32

Mechanical
Jan 11, 2009
2,055
Hello all,

I am working on a portion of a project that involves using a micro controller as sort of a Data Acquisition tool. We have other DAQ boards directly hooked up to desktop PC's.
But basically, I want something I can just plug into my laptop (say on the field or somewhere where I don't have much equipment).
So, I am trying it out using input from a microcontrller to processing.
Problem is, I am not that familiar with Processing as I am with other languages.
Everything works fine except when I need to save my acquired signal to my computer. I can easily display it on my laptop, but saving is another story.
I can't find a decent command for processing to take values and simply save it to a text or mat ect. file.
Anyone have an idea?

[cheers]

[peace]
Fe
 
Replies continue below

Recommended for you

You ain't doing so good with English, either.

Not that there's anything terribly wrong with your grammar or spelling, but you haven't given us a single proper noun with which to estimate the scope of your ignorance, or the sort of help you really need.



Mike Halloran
Pembroke Pines, FL, USA
 
I agree with you about my structure of the OP.
It is unorganized and not very informative. I was a little tired when I wrote that a few hours ago. After a nap I'm back to my regular anal perky structured self....watch out I'm as anal as it gets [smile]
Seems After my nap I also managed to write a bit of code that does exactly what I want. This usually happens when I post to ET. This is why I tend to answer questions here more than ask them...
I just though that possibly someone with more experience in Processing lingo would have a better way.
I am not ignorant to Processing at all.... I usually use C,C++, or the like. But, I am inexperienced in interfacing serial communications for microcontrollers with C. I was pointed to Processing as apparently it's serial communication functions are flawless (I had a good source on this)

This code works fine on exporting the data I receive from the analogue in on the microcontroller:

void export_cv(){
OUTPUT = createWriter("expPoints.csv");
for(int i = 0; i < pointList.size(); ++i){
PVector V = (PVector) pointList.get(i);

OUTPUT.println(V);
}
OUTPUT.flush();
OUTPUT.close();


If anyone knows a better way to interface a microcontroller to a laptop for input of analogue signals (using any language as I am very open...) I would be willing to hear.

This would be so that I could take my laptop and microcontroller to another facility and simply connect the microcontorller to some important sensors and I could collect and analyze it right away on m laptop. (of course there are packages you can by from Mathworks, dSpace, Labview, ect. ...but I am focusing on this being totally free)
Thanks.





[peace]
Fe
 
BTW, Mike I appreciate your "smart alec" post. Those inexperienced can easily interpret that post to be very negative....
I appreciate the ET community as there are intelligible members. I also know that 'crappy' posts are often responded to with that kind of response....but I also know that this has to do with the reputation of the OP.
Anyways, thanks for responding. Made me rethink my crappy OP. [smile]

[peace]
Fe
 
Well, the first thing that confused me, is that some ID10T has gone and named a programming language with the word "Processing".

Sorry, it looks too much like C.
I hate C, and all its offspring.



Mike Halloran
Pembroke Pines, FL, USA
 
LOL. I see the confusion. There are many languages these days...too many.
No worries Mike.

[peace]
Fe
 
You know. That confusion I could have clarified if my OP was better. My fault.
[cheers]

[peace]
Fe
 
Repeat after me: Et cetera, ETC for short. I'm not normally an anal person, but this has been bugging me for a long time, you always get it wrong. In my world, ECT is Emissions Control Technology (catalysts).

I love C, gives me the horn. I quite like C++ too.

- Steve
 
Steve,
I don't quite understand. ETC? You mean ect.,?
Please elaborate.

I also enjoy C mostly.
Processing is too Java'ish :p, but not bad. I have only started using it now. I got it to convert my micro controller into kind of a low res DAQ board.

[peace]
Fe
 
lol. I never even realized I wrote that in the OP. Thanks for pointing it out Steve and IRstuff.
I have a few very odd spelling mistakes as well. I have been told this before before by teachers. There are some other odd things about me that, if you ever met me, you would for sure notice [smile]
etc. it is. (Even funnier is in the post above IRsutffs I also made the mistake...haha) I was too into finishing my code at that moment to even think about the abbreviation. Got it though.

No worries about the original question. My low res, extremely portable 'DAQ board' is functional.

On another note, do you guys use this "Processing" much? It seems not bad, particularly for an open source lingo. But, much of it is graphics based...

[cheers]

[peace]
Fe
 
Fe,

Sorry for the after-beer shout-up. Was quite a heavy weekend. I never really know when it's ok to correct language and when it's rude. Hopefully it was correct this time.

Regards.

- Steve
 
Depending on your skill level and tool availability, it might be more reasonable to either get Excel directly or with an add-on, to scarf up the data into a worksheet for processing. Your add-on could trigger the collect or just collect in midstream.

TTFN

FAQ731-376
Chinese prisoner wins Nobel Peace Prize
 
Steve,
Not to worry. I had no idea you noticed I always do that. Thanks for noticing and letting me know. I take no offence [smile]

IRstuff,

I am not a huge fan of excel for data processing. I was planning on writing something in Matlab to take in the .csv. I would say I'm proficient with Matlab and C. Not so much with excel. But, you recommend that I can get rid of Processing to take in the serial communication from the micoricontller? I never knew excel had these capabilities? Is this correct?
Thanks.

[peace]
Fe
 
Oh, OK, Matlab is certainly a viable approach. There are a couple of hooks in Matlab for interfacing with external entities like serial ports or COM clients.

Matlab also supports reading data from the Windows audio device, so if you use the audio inputs on the computer to digitize a signal, one could probably get that digital data streamed directly into Matlab.

One other option for data acquisition might be It's a USB connected oscilloscope, essentially... Looks tempting...

TTFN

FAQ731-376
Chinese prisoner wins Nobel Peace Prize
 
Cool. Thanks IRstuff. That usb connected DAQ box is not bad for 167 bucks. I might pick up one of those.
My setup right now uses an Uno I got for 30bucks. There are 2 disadvantages to the setup.
1) the sampling rate is about 0.01samples/s ( think I may be able to get is a bit higher, but the bottleneck here is the processor on the microcontroller). However, for what I need it for the sampling rate is alright.
2) All the serial communication and acquisition is custom programmed. (more time consuming, rather than just plug and play). Although, I got it running with a couple hours of work. The GUI is not very good though. There is no scale on the scope etc. (notice I didn't use ect. [pipe])

Only advantage is the price I can set it up for [smile]
I was aware of Matlab's compatibility with the sound card. And I know of the DAQ toolbox for Matlab. I don't think my superiors will be into purchasing it just for my "away parties", since we have Labview and dSapce in house.
But yea, I may pick up one of those boxes. Sampling rate is good. Seems like it comes with built-in software as well. Thanks!


[peace]
Fe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor