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

It appears: scrolling, moving the VBA window or clicking the reset button freezes then crashes Excel (while data is received). Almost as if any interruption in data received is not tolerated.

.

Hello,

I'm having a little trouble getting my PLX-DAQ(v2.3) to work. Whenever I try to run my Arduino program with PLX open, I get the error message "avrdude: ser_send():write error: sorry no info available". Whenever I run my code with the program disconnected though, it runs fine. However, when my Arduino is connected, the Excel sheet does display the column labels. Any help would be greatly appreciated!

Make sure you don't have the com port open in Excel when you try uploading in the IDE.

.

Hi,

Thanks for the response! The serial monitor was closed when I was getting that error. I'm not sure if it's a problem with my Arduino code, but here's the the portion that is supposed to send the data:

void setup (){
 Serial.begin(9600);
  Serial.println("CLEARDATA");
  Serial.println("LABEL,Load,Drum Speed,Wheel RPM,Run Time");  // These labels DO work 

// Irrelevant Stuff
}


void loop() {

// Even more of irrelevant stuff

      if((millis()- refresh) >= 100){   // When to send Data  
                Serial.print("DATA");
                Serial.print(mloadVal);
                Serial.print(",");
                Serial.print(dmph);
                Serial.print(",");
                Serial.print(wrpm);
                Serial.print(",");
                Serial.println(timerSeconds);
                refresh = millis();

// Rest of the irrelevant stuff
}

SharkWheelSDSU:
but here’s the the portion that is supposed to send the data:

                Serial.print("DATA");

Serial.print(","); <<== this one was missing
                Serial.print(mloadVal);

You were missing the , after the DATA
Try opening the direct debug window in PLX DAQ and you should be able to see how your lines are incoming from Arduino in PLX DAQ.

Well I wasn’t able to fix the problem with the UI crashing … It is totally arbitrary and I cannot put my finger on where and what and how crashes the form. It is both when moving the form as well when moving the whole application. Scrolling on the sheet works fine with me but as soon as you do some action that stops the macro from working for a few seconds it crashes some times after. For example when you move the window around you can see the logging to pause in the direct debug window.

So I just added a warning message on the UI :-X

Alongside some other staff:


=============================================================
This version is already outdated !! Link to always most recent version of PLX DAQ v2 here:
==> https://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761 <==
=============================================================


What’s new in “version 2.6” aka Change log:

  • Fixed the reset timer button (there was a useless message box implemented somehow)
  • Formatted the timer to always have 6 trailing digits
  • removed the old fashioned limit to 27 columns - now supports the thousands of columns that Excel supports (although it is getting pretty slow with too many columns)
  • Set the columns all to be aligned centrally on default and column captions to be written in bold by default
  • and well yeah - added the warning remark not to play around too much with the window during logging

I also updated the example sketch once more (included stand alone and in the zip file as well).

Image-Link: http://www.freebie-base.de/Pics/PLX_DAQ_v2.6.png
(hosted on my server, no traffic hijack)

=============================================================
This version is already outdated !! Link to always most recent version of PLX DAQ v2 here:
==> https://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761 <==
=============================================================

PLX-DAQ-v2.6.zip (132 KB)

PLX-DAQ-v2-DefaultSketch.ino (2.03 KB)

Adding the comma after "DATA" worked! Thanks so much!

:frowning: :confused:

Im a newbee
I just want to directly write serial monitor values to excel i downloaded all versions. v2 v2.2 v2.3
I dont get whats the correct code. when i clicked connect nothing changes. com3 was recognize where my arduino was connected

PS: im using DHT22 Humidity and Temperature sensor.

Untitled.png

ralphjabonga: I just want to directly write serial monitor values to excel i downloaded all versions. v2 v2.2 v2.3 I dont get whats the correct code. when i clicked connect nothing changes. com3 was recognize where my arduino was connected

Hi ralphjabonga,

the Serial.print statements in your code are written to output to the serial monitor of Arduino IDE. To see the results in Excel, please:

It is pretty simple, just take a look at the examples I provided ;-)

Greetings

please help me…

Win10 and office13

all time with all version program have the same problems

:confused: :confused:

ankoo: Win10 and office13

Hi Ankoo,

are you running Win10 on 64bit or 32bit ? same for Office 2013: 64 or 32 bit?

Hi Net Devil

Thank you very much for providing a great handy tool to transfer serial data to Excel. I am writing a sketch that controls Arduino by sending characters and numbers to it through serial. I am wondering if you can add functions to PLQ-DAQ version 2 that allows the user to send characters and numbers to Arduino through serial.

My project is to build a sweep frequency generator with a power detector. One can control the frequency range of the signal generated and the output of a filter under measure is measured and sent back to EXCEL to draw a graph.

Thank you in advance for your consideration.

Best regards,

Sam

jl1cny: Thank you very much for providing a great handy tool to transfer serial data to Excel. I am writing a sketch that controls Arduino by sending characters and numbers to it through serial. I am wondering if you can add functions to PLQ-DAQ version 2 that allows the user to send characters and numbers to Arduino through serial. (...) Thank you in advance for your consideration.

Hi Sam,

thanks a lot for your feedback :) Good news for you: the function is in fact already present in the program ;)

With the command

Serial.println("CELL,GET,D1,");

your Ardunio can ask Excel to send him the values from cell D1 (well in this case). In that cell (and further cells) you could put the variables that you use to operate the frequency range.

Otherwise you could use the custom dev-point "CustomDevPointNewData". There you could easily send your own defined commands from Arduino to Excel and programm in VBA any behaviour you want (e.g. check current time of PC and adjust frequency if time is pre 12:00 am or past 12:00 am. Data can be send to your Arduino from VBA via command

CommWrite cboPort.Text, "Any information can be send here"

In case you have any further questions please feel free to ask :-)

Greetings

NetDevil

Hi NetDevil,

Thank you for the quick response. It is great to know the function is already there!
I tried CELL GET function and came up with a few more questions.

  1. I tried the code below with 123 in D1. When executed, the EXCEL says “Value in cell D1=0” in A2. It seems the value in D1 is not properly read. Any problem with the code?

Serial.println(“ROW,SET,2”);
Serial.println(“CELL,GET,D1,”);
Serial.print(“DATA,”);
int cell_num = Serial.parseInt();
Serial.print(“Value in cell D1 = “);
Serial.print(cell_num);
Serial.println(”,”);

  1. I want to copy a number in C1 to D1. Then I tried the code like this. I found ‘a’ in D1. What I meant is to see the number in C1 copied to D1. How can I do it?

Serial.println(“CELL,GET,C1,”);
int a=Serial.parseInt();
Serial.println(“CELL,SET,D1,a,”);

  1. I would like to clear contents for the range of say A2 to B200. How can I do it?

Thank you very much in advance for your help.

best regards,

Sam

Hi Sam,

well - let’s see.

  1. I guess you used Larrys code from here http://forum.arduino.cc/index.php?topic=437398.msg3032364#msg3032364 ? Have you tried running the whole sketch and then stripping down to what you need?

From what I see instantly is, that you have two much commas in your code.

Serial.println("ROW,SET,2");
Serial.println("CELL,GET,D1,"); <<<== last comma after D1 is too much
Serial.print("DATA,");
int  cell_num = Serial.parseInt();
Serial.print("Value in cell D1 = ");
Serial.print(cell_num);
Serial.println(","); <<<== full line needless. Just change above line to Serial.println(cell_num);
  1. Sure it puts an “a” in the cell. You send an “a” hardcoded :wink: Change to:
Serial.println("CELL,GET,C1,");  <<== last comma needless again
int a=Serial.parseInt();    
Serial.print("CELL,SET,D1,");
Serial.println(a); <<== use variable 'a' instead of char 'a' in string above
  1. No, there is no function yet to clear a range. By the command CLEARSHEET you can clear the full sheet. What you can do is

a) loop in your Arduino and clear the cells yourself

for(int i = 2 ; i <= 200 ; i++)
{
  Serial.print("CELL,SET,A");
  Serial.print(i);
  Serial.println(",")  <<<=== used to output 'CELL,SET,A2,' ; last comma needed to say fourth parameter (aka value) is empty, thus cell A2 should be made empty
  Serial.print("CELL,SET,B");
  Serial.print(i);
  Serial.println(",") <<<=== same for cells B
}

(please note! I have no Arduino here with me right now. Code is from mind, hopefully the syntax is ok)

That method is dirty. Better would be to define your own command and use it in the custom dev point CustomDevPointLineRead as recommended above.

Arduino code with new function and parameters:

Serial.println("MyCustomClearCommand,A,2,B,200");

VBA code extension in Excel (press F11 to get to VBA code editor in Excel) in the module frmStampDAQ (right click ‘Show code’):

Private Function CustomDevPointLineRead(newLine As String) As Boolean

    CustomDevPointLineRead = True 'be true if not stated otherwise in this function
    Dim DataVal() As String

If Data <> "" Then
    DataVal = Split(Data, ",")
    If (UCase(DataVal(0)) = "MYCUSTOMCLEARCOMMAND") Then
        WStoUse.Range(WStoUse.Cells(DataVal(2), DataVal(1)), WStoUse.Cells(DataVal(4), DataVal(3))).ClearContents
        'line above translates to = Range(Cells(2,A),Cells(200,B)).ClearContents
        CustomDevPointLineRead = False
        'line above says that command was operated and no need to pass to main function
    End If
End If

End Function

The Range-clear-Command could be useful for many people so maybe I should integrate it into the standard and release with version 2.7. However that way you should be able to use it now already.

Hi, NetDevil

Thank you for your quick reply as always. I appreciate it.

As for 2. and 3., it works fine. Although you said 3. a) is dirty, it showed me a way to overwrite data in certain range, which is more suitable for my purpose than clearing contents then filling data. Thank you soooo much! I am looking forward to seeing new Range-clear-Command incorporated into Ver 2.7 in the near future, though. This tool is going to be a perfect solution to me.

What is still annoying me is 1. As you suggested, I just copied and pasted LarryD's entire code and ran it with no joy. It seems to me that his code works properly except GET function. Then I tried Ver 2.4, which I believe he used for his code. No joy. Then I changed his code based on your suggestion still with no joy. I am totally lost. Any idea? I really want to use his tool.

Best regards,

Sam

jl1cny:
What is still annoying me is 1. As you suggested, I just copied and pasted LarryD’s entire code and ran it with no joy. It seems to me that his code works properly except GET function. Then I tried Ver 2.4, which I believe he used for his code. No joy. Then I changed his code based on your suggestion still with no joy. I am totally lost. Any idea?

Hi Sam,

I tried using my Arduino and your code is working fine for me as long as I read numbers(!). Reading chars or strings is not working because of the used

Serial.parseInt();

In case you want to read chars / strings try this one:

Serial.println("ROW,SET,2");
Serial.println("CELL,GET,D1");
Serial.print("DATA,");
String cell_content = Serial.readString(); <<== Changed data type, variable name and Serial-function
Serial.print("Value in cell D1 = ");
Serial.println(cell_content); <<== used new variable nane

The command for ClearRange is already included in v2.7 which I will release in the next post (in a few minutes)

As announced here we are (new post for clear hyperlinking):


=============================================================
This version is already outdated !! Link to always most recent version of PLX DAQ v2 here:
==> https://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761 <==
=============================================================


What’s new in “version 2.7” aka Change log:

  • Added a new command: ClearRange that allows for a range to be cleared in the sheet.
    Syntax is Serial.println(“ClearRange,StartColumn,StartRow,EndColumn,EndRow”); ==> e.g., Serial.println(“ClearRange,B,2,D,50”);
  • fixed a bug when closing the form while still logging. The macro was not paused correctly but will do so now

Backlog for next version(s):

  • find a good solution for Excel crashing when moving the window around while logging. Priority: low

I also updated the example sketch once more with the ClearRange command (included stand alone and in the zip file as well).

Image-Link: http://www.freebie-base.de/Pics/PLX_DAQ_v2.7.png
(hosted on my server, no traffic hijack)

=============================================================
This version is already outdated !! Link to always most recent version of PLX DAQ v2 here:
==> https://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761 <==
=============================================================

PLX-DAQ-v2.7.zip (136 KB)

PLX-DAQ-v2-DefaultSketch.ino (2.19 KB)

a minor fix. There’s a missing end quote in the example in your post (49):

Serial.println("ClearRange,B,2,D,50);

Pete

el_supremo: a minor fix. There's a missing end quote in the example in your post (49):

Serial.println("ClearRange,B,2,D,50);

Pete

Thanks, I fixed it. :)