PLX DAQ with Propeller C
FMF
Posts: 2
I am trying to use the PLX DAQ plug in for Excel with a Propeller Activity Board in C. I have not been able to locate any resources or examples in C. I have been able to transmit using this:
However, I am not sure how to use the get cell value directive. I am trying to use the following but it seems like its getting hung up when it tries to receive. I have no idea if this is a possible way to do this, I don't fully understand these serial communications.
Thanks,any help is appreciated.
fdserial *PDAQ = fdserial_open(31, 30, 0, 9600); // serial port dprint(PDAQ, "RESETTIMER, \n"); dprint(PDAQ, "CLEARDATA, \n"); dprint(PDAQ, "LABEL, Time, Timer, Val 1 \n"); while (1) { pause(1000); dprint(PDAQ, "DATA, TIME, TIMER, 1 \n");}
However, I am not sure how to use the get cell value directive. I am trying to use the following but it seems like its getting hung up when it tries to receive. I have no idea if this is a possible way to do this, I don't fully understand these serial communications.
fdserial *PDAQ = fdserial_open(31, 30, 0, 9600); // serial port dprint(PDAQ, "CELL, GET, I1, \n"); byte = fdserial_rxChar(PDAQ);
Thanks,any help is appreciated.
Comments
From the documentation above it looks like it might not be possible to get columns past F? Is there any authoritative document on the PLX DAQ protocol?
Anyway, assuming that you can get past F you should probably remove the last "," and get rid of the extra spaces in your string
From the Spin version above it looks like the return value is a DEC string, aka something like "92754", possibly with a terminating '\0' or '\n'. Your rxChar will just return the first character ('9' in this example) without getting the full number. You should use some sort of DEC routine.
Also, I don't know where the dprint is from, so I can't provide any help there.
If you're using stdio.h you might want to check that PLX DAQ doesn't care about \r\n instead of just \n: https://sites.google.com/site/propellergcc/documentation/faq#TOC-Q:-What-s-the-deal-with-the-extra-r-when-I-get-a-n-on-the-stdin-
Sometimes we need to use fdserial_rxTime() to check if a character is available within a certain number of milliseconds.
All library documentation is in the Simple Library folders as html. We often point to the header which is on-line for convenience.
libfdserial documentation where things like fdserial_rxTime can be found is here:
https://propsideworkspace.googlecode.com/hg/Learn/Simple Libraries/Text Devices/libfdserial/Documentation fdserial Library.html
Some links in my .signature point to some Propeller C resources also.