Go Down

Topic: PLX-DAQ version 2 - now with 64 bit support! (and further new features) (Read 158759 times) previous topic - next topic

Power_Broker

@NetDevil,

I looked at your zip file and all of it can be version controlled through GitHub - even your xlsm file.

I highly suggest you host the files through GitHub - it will make things easier for everyone (including yourself).
"The desire that guides me in all I do is the desire to harness the forces of nature to the service of mankind."
   - Nikola Tesla

ranbros

Hi to everyone,

I need to know if there is a way to create a circolar buffer to data.
Is there a command to restar to cell a2 when a number of data is reach without deleting previous data?

I have try CREARDATA or CLEARSHEET but this delete all previous data.

my objective is create a continue plot system.

Best regards

Davide

NetDevil


I looked at your zip file and all of it can be version controlled through GitHub - even your xlsm file.
@Power_Broker:
thanks for looking into that. I'll try to get upload to git with the next release (ok that might take some years based on the current progress ... ) or maybe intermediate someday. But I'll definitely switch to git as I personally appreciate the concept of it.





I need to know if there is a way to create a circolar buffer to data.
Is there a command to restar to cell a2 when a number of data is reach without deleting previous data?
I have try CREARDATA or CLEARSHEET but this delete all previous data.
@Davide:
yes, there is a way. You might use the ROW command to make Excel fill data at a certain row once again.
Use use a counter and increase it everey time you send out data, then use a modulo division for the counter to set it back to e.g. 2.

Code: [Select]

int counter;
counter = 2; //based on your starting row in Excel

void loop() {

    Serial.println((String) "DATA,DATE,TIME," + someVariable);

    if(++counter % 30 == 0) { counter = 2; Serial.println("ROW,SET,2"); }
}

(all code from the top of my head. Syntax errors might occur)

ranbros

Thanks NetDevil. now it works.
I'll ask you:
- if I use PLX-DAQ-v2-AutoGrapher-RandomValue.xlsm I have the following error (with Excel 2007)
SYS: |15:44:18| ## ERROR within command ! ##  438 / Proprietà o metodo non supportati dall'oggetto
|15:44:18| DATA,DATE,TIME,1093,217
SYS: |15:44:18| ## ERROR within command ! ##  438 / Proprietà o metodo non supportati dall'oggetto
|15:44:18| DATA,DATE,TIME,1042,180
SYS: |15:44:18| ## ERROR within command ! ##  438 / Proprietà o metodo non supportati dall'oggetto
|15:44:18| DATA,DATE,TIME,992,484
SYS: |15:44:18| ## ERROR within command ! ##  438 / Proprietà o metodo non supportati dall'oggetto
if I use PLX-DAQ-v2.11.xlsm works without errors the same  PLX-DAQ-v2-AutoGrapher-RandomValue.ino
It is due to old Excel?
- Is there a trick to avoid the latency due to plot graph?

Thanks

Davide

OneLeafAutumn

Hello,

I was wondering if the Excel file of the PLX-DAQ be converted to .csv format automatically? I mean, not going through File > Save As. Or at least be able to have a copy of the data in the Excel file be saved as .csv format.

Thank you,

OneLeafAutumn

NetDevil

- if I use PLX-DAQ-v2-AutoGrapher-RandomValue.xlsm I have the following error (with Excel 2007)
SYS: |15:44:18| ## ERROR within command ! ##  438 / Proprietà o metodo non supportati dall'oggetto
|15:44:18| DATA,DATE,TIME,1093,217
if I use PLX-DAQ-v2.11.xlsm works without errors the same  PLX-DAQ-v2-AutoGrapher-RandomValue.ino
It is due to old Excel?
Hi Davide
yes this might be an Excel issue. The example tries to update the graph object to automatically refresh the visual. Might be that Excel 2007 simply does not support that yet. The Arduino code is pretty simple and just pushes data to Excel. It will work on mostly all modern PLX DAQ versions. Just the graph update is the fancy thing to show here.

- Is there a trick to avoid the latency due to plot graph?
I don't quite understand what you mean? The latency in updating the graph or in sending data from Arduino to Excel? I think the graph updating speed depends mostly on your PC performance. In the example it is just two lines of code with native Excel VBA - should be super fast.






I was wondering if the Excel file of the PLX-DAQ be converted to .csv format automatically? I mean, not going through File > Save As. Or at least be able to have a copy of the data in the Excel file be saved as .csv format.
Hi OneLeafAutumn,

sorry hadn't had the time to respond to your private message yet... but thanks for posting the question to the board as well. In here it will definitely help others as well.

So basically there is no option yet. no. I just did a bit of research and it can be easily accomplished. Open the marco code editor of PLX DAQ, there open the frmStampDAQ (so to see the code of PLX DAQ) and search for CASE "SAVEWORKBOOKAS". You can see the different types of commands that exist.

Just add this new one:
Code: [Select]

Case "SAVEWORKBOOKASCSV"
    Application.DisplayAlerts = False
    WStoUse.Copy
    ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\" & DataVal(1) & ".csv", FileFormat:=xlCSV, CreateBackup:=True
    ActiveWorkbook.Close
    Application.DisplayAlerts = True
    txtStatus2 = "Workbook saved as '" & DataVal(1) & ".csv' by command"


Afterwards in Arduino code you should be able to use the following line:
Code: [Select]
Serial.println("SAVEWORKBOOKASCSV,exportFileName");
It should save a copy of the sheet where the data is currently being posted to in the same folder as the main Excel file by the name exportFileName.csv
Any feedback if it is working is welcome :)

And with regards to your other question: PLX DAQ only posts the current date and time to the Excel sheet. There is no function for sending the current date and time to the Arduino. Although as shown above new and / or own functions can be included in the code easily ;-) feel free to give it a try.
In case you only need the date and/or time in Excel when logging data then yes: RTC module (DS3231) is not needed any more.

ToniLab

Hi NetDevil!
First of all, thank you so much for your work. I use your program to read a load cell and it works great.
I just want to report a little issue: using "Arduino Nano Every" the "Reset on Connect" flag does not work.
I suspect because of the ATMega4809, but I will wait for your opinion.
Do you have any suggestions or solutions?
Thank you!
Best regards

ToniLab

NetDevil

using "Arduino Nano Every" the "Reset on Connect" flag does not work.
I suspect because of the ATMega4809, but I will wait for your opinion.
Hi ToniLab,

unfortunately I think so too :) digging a bit more into the rs232 documentation I was following the path of RTS and DTR flags used by PLX DAQ to reset on startup. Looks like those pins are used with esp8266 boards a lot, with other boards it might behave differently or even worse by USB it might behave differently. In case you are an C / Arduino enthusiast and want to check how the Arduino IDE is handling the reset for all boards in general I'll gladly try to implement a more universal solution :) Although I guess no one else has reported the same kind of issues yet (?)

TonyParakka

Hi NetDevil!   

First, THANK YOU for creating and sharing this fantastic tool!  It has helped me so much already! 
I have it working quite well, receiving and plotting data from an ESP32 board, at 9600baud.
I also have the Autographing working, plotting my data.

I find after a while Excel stops running..  I wonder if it could be from having collected way too much data?
I send a new record DATE, temperature, millis(), pressure every 0.25sec.  I'd like to display just the last ~1 minute of data (240 points) but run for hours

Since storing the data is not a priority, would it be possible to create a scrolling array (not a circular array) so that array size remained fixed?  For example,
If an array of 240 points, than at 241st point, the array is moved up 1 row, and the new data is stored in row 243, and so on.  This way, the chart's start and stop remains fixed, and the plot would move smoothly.

Is this possible with commands sent from the Arduino?
I am not terribly familiar with VBA in excel, but want to take this opportunity to learn..
Can you help, or point me to how I can do this? 
Many thanks!

jdechow

Hiho,

first of all thanks for that great work!

I perpared a little test with the classic 10k poti analog read on a NodeMCU ESP8266 Board. when i open the spreadsheet and set the COM Port + Baud (9600 even tho I'd like to use more but 9600 is enough for testing). When i connect the system seems to work properly, but unfortunatly the Data Aquisition stops after 30...50 samples and Excle closes. Im using WIN10 64-Bit and Excel 2013. I post my Arduino IDE Code down below.

Cheers, Hannes!
Code: [Select]


/*
 * Oszi using "PLX DAQ v2"
 *
 */


void setup() {

  // open serial connection
    Serial.begin(9600);

    //Serial.println("CLEARDATA"); // clears sheet starting at row 2
    Serial.println("CLEARSHEET"); // clears sheet starting at row 1
    
  // define n columns named " ", " ",...
    Serial.println("LABEL,Date,Time,AnalogRead,millis");

  // set the names for the 3 checkboxes
    Serial.println("CUSTOMBOX1,LABEL,Stop logging at 250?");
    Serial.println("CUSTOMBOX2,LABEL,Resume log at 350?");
    Serial.println("CUSTOMBOX3,LABEL,Quit at 450?");

  // check 0 of the 3 checkboxes (all false)
    Serial.println("CUSTOMBOX1,SET,0");
    Serial.println("CUSTOMBOX2,SET,0");
    Serial.println("CUSTOMBOX3,SET,0");
}

void loop()
{
  int value;
  value = analogRead(A0);

    // simple print out of number and millis. Output e.g.,: "DATA,DATE,TIME,TIMER,4711,13374,AUTOSCROLL_20"
      Serial.println( (String) "DATA,DATE,TIME," + value + "," + millis() + ",AUTOSCROLL_20" );
      delay(1);
      // alternative writing method:
        /* Serial.print("DATA,DATE,TIME,TIMER,");
        Serial.print(i++); Serial.print(",");
        Serial.println(millis());
        Serial.print(","); Serial.println("SCROLLDATA_20"); */
}


jdechow

I may have found the problem already, i dont think Excel can match the data rate... If i use higher delay values it works just fine... Bummer, is there a way to collect data every ~Millisecond (+-)
Cheers, Hannes

TonyParakka

Hi All,

Has anyone run PLX_DAQ within the spreadsheet application in WPS Office?
When I tried, I cannot get the macro to launch..
Any help very much appreciated!

-tony

NetDevil

Hi there guys,

sorry for posting late, it will always be a bit more time before I can reply nowadays. Anyways, let's get to the issues:



@TonyParakka:
thanks buddy, it is always good to know the software can help people with their ideas :) Using the Autoplotter is fantastic. Very few people seemed to have used that yet.
The way I use the Autoplotter in my example is to move the data set of the graph around to only display the latest values. I never thought about a way before to move the data like a LIFO system around. I can think of several ideas now, some being more complex or less performant then others. The "best" one (although not the prettiest one) would be to use the CustomDevPoint to check if more then 240 data rows are already receiverd, and in case yes, put the new data to row #242 and delete row #2. That way you would have just the correct amount of data. Might be that the graph's data set will not cope well with rows being deleted, therefore I guess it would be best to rewrite the data set anew every iteration as well (to use e.g. B2 to B242).
I hope this will work for you as an entry point to coding things for the time being.

Your second question regarding WPS Office I have no idea. Never used that software. Does it run on Windows? PLX DAQ highly makes use of Windows API calls and therefore has a huge dependency on the platform...




@jdechow:
Hi Hannes, and thanks for the feedback, much appreciated :)
You are right with what you figured out: too much data is not being supported by the current version of PLX DAQ. Every ms will flood the inbound API call. Are you really sure you need that much data? I mean .... can you even handle that on the human side ;) ?
Maybe you could collect the data in Arduino every ms, make a meridian / middle value of it every 50ms and send that to Excel?
To reduce overhead you could also collect e.g. 10 data in an array and send array to Excel every 10ms (thus the amount of communication gets reduced). But you have to parse the array on Excel side and split the values one by one yourself (although the PC is generally capable of processing that little bit of operation).
Last idea would be to get back to the original Serial.print without using the (String)-converter. This will mainly save ressources on the Arduino side but could maybe improve stability as well since communication might be smoother (because Arduino is quicker in responding  / acknowledging to send data).



Please revert back in case you have any problems.

Kind regards

Jonathan

TonyParakka

Hi Jonathan!

Much appreciate coming back on this

How do you do this : "I use the Autoplotter in my example is to move the data set of the graph"
Is this in the macro somewhere?  There may be a solution here..

I tried [1] create new row at 2 with shift down, and [2] add new data to row2
New data addition worked nicely and the data shows on the graph, but graph stretches vertically with every added rows!  Yikes!
I tried placing the graph at top, and adding new data from some row further down e.g. 40).. in this case the graph stayed blank :(   I tried placing the graph on a separate worksheet; here too, the graph stayed blank :(

I also tried the shift up method -on a small scale.
In "DATA" section, I check if row > 40; if not, then add new data at row=row+1; and if yes, then delete row2 with shift up, and add new data at row 42.
So far, the graph stays blank even as data comes in.. 

Will do more searching to learn about VBA and charts.. 
Any further thoughts appreciated of course..

-tony

BunnyTee

Hi,

This might be long, sorry.

I've scanned the whole thread and the beginner's guide as well but it seems I didn't see the way that I am planning to do or maybe I just failed to understand certain codes because I'm not expert to this field.

Anyway, the command "CELL/ROW,SET" enables you to put the data to a certain cell in the Excel itself and the command "CELL/ROW,GET", on the other hand, will be sent back to Arduino. Please correct if I've failed to comprehend or skipped it.

But what I am planning to do is that I send data from the Arduino in real time to the PLX-DAQ. Therefore, the data will log into the Excel non-stop unless I close the Excel itself (?) or I clicked the "Pause/Resume logging" button (?).

So these are my questions:
1. I am planning to get the data from the Excel and use it for forecasting and I want the logging of data to continue as I get a sample data (like working simultaneously). Is it possible? (I don't think SET/GET command can do it based on my understanding)
2. And I think if I continue to send data from Arduino to Excel, the file may be burdened as data compiles non-stop. Is it possible to save the other incoming data, say the 501st data (counter) to another Excel file? (like for Day1 data to Excel1, Day2 data to Excel2)?
3. Or is it better to just clear the sheet for every 501st, for example, but before clearing the 500 logged data will be save to a database (?) or something first and then clear the sheet.
4. And lastly, when uploaded (Arduino), PLX-DAQ can only be manually connected?

Thank you for bearing with this.
Note: All of these are just my concepts/theory only, I haven't started code anything yet so sorry again if I can't provide some sample codes.

- BunnyTee -

Go Up