PLX-DAQ version 2 - now with 64 bit support! (and further new features)

Just to let you know, i found this code. and its working properly :slight_smile:

Is there any way to reverse the raws in excel?

I have many datas and when i have more than 30 datas, its hidden on the bottom. So instead of writting on the last raw, i would like to write on the first raw.

:slight_smile:

capteur_Temp.ino (1.88 KB)

Hi Joan,

puh - a lot to answer :slight_smile:

First of all it is good to know that PLX DAQ is running fine on your PC in the end. I don't think it is an Excel 2010 issue as we had some people in this thread confirming the software to run on Excel 2010. It might be an issue with the mixture of Excel 2010 and Windows 10 but I don't think so either. Most likely there is an issue with your version of Excel 2010. For example VBA was not installed in that instance? Or the security level was set too low (thus macros were not allowed) or stuff like that.
But in the end you are running the code, let's move on.

Please take a look at the Beginners Guide Word Document which is included in the zip file. There you'll find all the details regarding the LABEL command, or the DATA command and even the AUTOSCROLL command which can be used to solve you issue with data behind display "hidden" (it is just at the end of the sheet, AUTOSCROLL will save you the effort of scrolling manually).
Otherwise you might use the "CELL,SET" command to explicitly write to the same cell all the time (or to loop over e.g. the first 20 cells only).

As said: all of that is included in the Beginners Guide :slight_smile:

Greetings

Jonathan

Jonathan,

I notice a lot of different versions (at least on the first page of the thread) for this program. For ease of download and version controlling; is there any reason you don't host the source code/ancillary documents on GitHub? Then you could just post a single link to the repo and people will always have access to the most current program (and previous versions if they dig).

Xendelaar:
So I've got my Hope's set on the removal of data and timer function. If that doesn't work. I' can always revert to version 1.x

Hi Xendelaar,

yeah there were some similar bugs in 1.x as well and I think I remember doing some tests a few years back which showed there were ways to crash 1.x by flooding as well. But nevertheless a software is only good as long as it is reliable. And that is something I will try to work on some time in the future :slight_smile:



Power_Broker:
is there any reason you don't host the source code/ancillary documents on GitHub?

Hi Power_Broker,

the main reason would be that (in my opinion) Github is good for code and code distribution. Sadly the VBA projects are always embedded in the Excel document and rely on the UI forms as well. That said I could maybe only upload the full file and it would not play the benefits of Github (highlighting of changes and version tracking). Or maybe I am missing some features? Please update me if my opinion is wrong :slight_smile:
Another reason why I choose the first post of the thread to be a summary is that I noticed a lot of people getting direct links to outdated posts out of this board or other boards. Therefore I marked each post of any outdated version as outdated and point to the static first post where I can forward to the newest version with ease. By that I hope to reduce the amount of people downloading deprecated versions and getting unnecessary problems.

Is there a beginner's guide to using this? I can't see how to get started.

I want to send data from an excel sheet into my Arduino code. It doesn't need to be real time. There's not a lot of data - 180 three digit decimal numbers. The data will be used as values for variables in my code.

I'm running excel on a mac, btw.

Hi Chis,

chis:
Is there a beginner's guide to using this? I can't see how to get started.

yes there is. It is included in the ZIP file or can be downloaded individual. Everything can be found attached to e.g. in this post of version 2.11 (at the end of the post)

chis:
I want to send data from an excel sheet into my Arduino code. It doesn't need to be real time. There's not a lot of data - 180 three digit decimal numbers. The data will be used as values for variables in my code.

Well ... 180 variables is quite a bit of data for the Arduino I guess, but it can be done sure. Best thing would be to send it in a string I guess and parse on the Arduino (e.g. semicolon separated).

chis:
I'm running excel on a mac, btw.

PLX DAQ wasn't made for Mac and there were a lot of questions about whether or not it can run on a Mac. I never got any feedback for this. To see the lastest point of knowledge please see here my response to Brilliantgp.

Hi Net Devil

Thanks for coming back so quickly :slight_smile:

I found the beginners guide. I put the value 199 into cell J9 in the excel sheet, lifted the code from the beginners guide with no additions / changes. The complete code I used is visible in the image attached.

When I tried to Connect on the PLX DAQ Control window, I got the error displayed in the image. I tried port values 1 thru 8 inclusive, btw.

Nothing appeared in the window where serial print outputs normally appear.

I suspect I need to point the Arduino at a specific spreadsheet, but don't know how to do this. I suspect also that I need to include something from a library somewhere, but again I do not know what I need include.

Any help would be greatly appreciated!

Hi Chis,

thanks for trying out and coming back on the issue!

First of all the code on the Arduino looks good and should work.
Also Arduino code does not need to contain the spreadsheet information, that is within PLX DAQ (and I can see the drop down having select "Simple Data", thus everything is fine).

The problem seems to be that PLX DAQ relies on the kernel32 DLL for communication with the serial port, which is not available within Mac. COM ports in Mac are a bit more cryptic like explained here: macos - How to find the serial port number on Mac OS X? - Stack Overflow

Please try something like that as an input and maybe you can find something like a "windows api" package for mac that includes the kernel32 file?

Hi NetDevil

Really appreciate you looking over the image I sent and checking that most of the stuff I did was OK! Thank you.

Unfortunately, I wouldn't know the difference between a kernel32 and a Brazil nut. So, my next step is to try to find out something about that, so that maybe the stack overflow link you sent will start to make some sense.

Thanks again!!

Hi aa_ra18,

at first I was confused, but I googled the message "commopen createfile" and actually landed in this thread at a post from 2017 where the problem was already mentioned and solved. Please see here: PLX-DAQ version 2 - now with 64 bit support! (and further new features) - #162 by marcf - Interfacing w/ Software on the Computer - Arduino Forum

@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).

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

Power_Broker:
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.



ranbros:
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.

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)

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

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

ranbros:

  • 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.

ranbros:

  • 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.



OneLeafAutumn:
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:

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:

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 :slight_smile:

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 :wink: 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.

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

ToniLab:
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 :slight_smile: 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 :slight_smile: Although I guess no one else has reported the same kind of issues yet (?)

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!

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!

/*
 * 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"); */
}