Arduino Forum

Using Arduino => Interfacing w/ Software on the Computer => Topic started by: NetDevil on Nov 24, 2016, 01:51 am

Title: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Nov 24, 2016, 01:51 am




=============================================================
Most recent version 2.11 to be found here:
http://forum.arduino.cc/index.php?topic=437398.msg3251256#msg3251256 (http://forum.arduino.cc/index.php?topic=437398.msg3251256#msg3251256)
=============================================================




Download specific versions directly:
v2.0 (http://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761) - v2.2 (http://forum.arduino.cc/index.php?topic=437398.msg3015101#msg3015101) - v2.3 (http://forum.arduino.cc/index.php?topic=437398.msg3016944#msg3016944) - v2.4 (http://forum.arduino.cc/index.php?topic=437398.msg3034633#msg3034633) - v2.5 (http://forum.arduino.cc/index.php?topic=437398.msg3047267#msg3047267) - v2.6 (http://forum.arduino.cc/index.php?topic=437398.msg3056839#msg3056839) - v2.7 (http://forum.arduino.cc/index.php?topic=437398.msg3124928#msg3124928) - v2.8 (http://forum.arduino.cc/index.php?topic=437398.msg3143601#msg3143601) - v2.9 (http://forum.arduino.cc/index.php?topic=437398.msg3160058#msg3160058) - v2.10 (http://forum.arduino.cc/index.php?topic=437398.msg3172623#msg3172623) - v2.11 (http://forum.arduino.cc/index.php?topic=437398.msg3251256#msg3251256)




So well well well - here it is :-)

I have re-written the well know PLX-DAQ to be able to be run on modern Office suites.

What's new in "version 2:


Tested the code on Windows 7 64bit with Office 2013 32 bit and Office 2013 64 bit - both are working fine.
I would appreciate if anyone could test it further on other operating systems (maybe Mac as well ;-) ) and Office versions and post feedback.

All source code is available within the Excel, no more closed DLLs ! :-)

Attached is a default sketch as well for you to test the new PLX DAQ if you want to.
Attached is of course the new Worksheet with the new Macro as well.

If you have questions please feel free to ask :-)

Well - it is nearly 2am in Germany right now ... this is going to be a short night ....

cYa !

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

(This is just for all google folks that are trying to get PLX DAQ "version 1" to run and have the "Stamp.disconnect" error - this new version will solve the issue!)

(http://www.freebie-base.de/Pics/PLX_DAQ_v2.png)


====================================================================
==> https://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761 (https://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761) <==

This version (v2.00) is already outdated !! Link to always most recent version of PLX DAQ v2 above
====================================================================

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Nov 24, 2016, 11:48 pm
ok so this was quick

I have not yet received one single feedback to version 2.0 and am already releasing version 2.2 ....
Sorry for kind of "double posting"

=============================================================
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 (https://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761) <==
=============================================================


What's new in "version 2.2" aka Change log:



Code attached in zip file


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

(http://www.freebie-base.de/Pics/PLX_DAQ_v2.2.png)

P.S.: skipped release 2.1 for no reason I guess. Might have been a private development release  8)

=============================================================
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 (https://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761) <==
=============================================================
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: el_supremo on Nov 25, 2016, 12:22 am
Works just fine on Win 7 Pro x64 with Excel 2010. It does require that you allow the macro to run by changing the security level.
One minor problem I had was that it only seems to allow COM port numbers up to 15 and the Teensy I was using was COM30. But I switched to one on COM4 and all is well.
I don't have an immediate need for it but it's nice to have it here ready to roll.

Pete
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Nick_Pyner on Nov 25, 2016, 12:58 am
Congratulations and karma. I am not able to test this myself but a lot of users out there are going to appreciate this. I have published PLX notes and I will link to your breakthrough.

Further to COM ports, that is a problem I also have. My main laptop gets Arduino's bluetooth on COM 40 and I can't use PLX with it.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Nov 25, 2016, 08:16 am
Hi there,
thanks a lot for the feedback.

I will try to enhance the COM port list. Performing some basic tests with virtual ports this morning I was not able to use any port greater then 9. Might be I find the time on Sunday to fix it.

Could you two give me some info how you managed to get that high Port number? So I can copy your setting and test.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: el_supremo on Nov 25, 2016, 04:08 pm
The port numbers were assigned by the system but you can change an existing port.
Control Panel | Device Manager | Ports
Select the device you want to change and right click on it.
Select Port Settings and click on Advanced. The small drop down selector at the bottom of the dialog gives the current COM number and allows you to change it.

Pete
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Nick_Pyner on Nov 26, 2016, 02:51 am
Thanks
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Nov 26, 2016, 02:58 pm
Hey Pete,
all right thanks a lot. I found that information elsewhere on the internet as well but didn't think it was this simple to actually change it :-D Quick question: why are running your Arduino on such high ports then anyway? You don't actually have 39 further COM ports in use do you?

What so ever: I fixed the coding and it is now working with up to 256 ports. Actually port number and baud rate are free text fields now. Just for fun I tested with baud rate 1 (Serial.begin(1);) and 400.000 ==> both worked fine  8)



=============================================================
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 (https://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761) <==
=============================================================




What's new in "version 2.3" aka Change log:


Code attached in zip file

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


(http://www.freebie-base.de/Pics/PLX_DAQ_v2.3.png)

=============================================================
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 (https://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761) <==
=============================================================
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: el_supremo on Nov 26, 2016, 04:26 pm
I don't know why it gets to such high COM port numbers. I use Teensys a lot and usually once a Teensy has been assigned a port, it will be that port whenever I plug it in again. But sometimes the system decides to change it and what used to be COM6 is now COM18. Same thing happened when I was using NANO, although not as much because I didn't have as many of them.
Occasionally, I open Device Manager, look at the list of COM ports, including the hidden ones that aren't currently plugged in, delete them all, reboot and then start plugging them in again to get lower COM port numbers.

Pete
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: el_supremo on Nov 26, 2016, 04:47 pm
It works with COM30 :)
For Teensy, and perhaps other processors, I added while(!Serial); after Serial.begin so that the code waits for the port to be opened before sending data to PLX-DAQ.

Pete
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: SASv on Dec 04, 2016, 12:05 am
For the absolute noob, also state that before pressing the Connect button the user should close the arduino serial communications box.

NetDevil,what you did is absolutely great.  I will be using your spreadsheet in my research and in my teaching (I am a prof). Many many thanks.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: larryd on Dec 06, 2016, 07:17 am
Looks Interesting.

This is what I get, seems like the form is chopped (Using Microsoft Office 365), suggestions?
(http://forum.arduino.cc/index.php?action=dlattach;topic=437398.0;attach=189691)

Edit:
Made this change all OK.  Works well on Microsoft Office 365.

frmStampDAQ.Width = 220

Changed to:

frmStampDAQ.Width = 480

.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Dec 06, 2016, 07:42 am
This is what I get, seems like the form is chopped (Using Microsoft Office 365), suggestions?
Hi LarryD,
well yeah - that does not look perfect ;-) What happens when you press the button for "Display direct debug =>" ? Is the window expanding?
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: larryd on Dec 06, 2016, 07:48 am
Made this change all OK.  Works well on Microsoft Office 365.

frmStampDAQ.Width = 220

Changed to:

frmStampDAQ.Width = 480



Will be a good tool to add to our collection +1


Quote
Is the window expanding?
Yes

.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Dec 06, 2016, 08:06 am
But that way the direct debug window is shown on startup already. I wanted to keep it lightweight for starter users.

Is the button generally working with your office version? (should expand / collapse the debug window)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: larryd on Dec 06, 2016, 08:18 am
But that way the direct debug window is shown on startup already. I wanted to keep it lightweight for starter users.

Is the button generally working with your office version? (should expand / collapse the debug window)
Right, in this case I have it maximized at start up.

480 seems to be just perfect.

Yes on 'Windows 10', Microsoft Office 365 (2016 Excel)  works perfect.

Thanks again!

(http://forum.arduino.cc/index.php?action=dlattach;topic=437398.0;attach=189702)

:smiley-sleep:   12:17AM


.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: larryd on Dec 06, 2016, 08:22 am
Private Sub cmdDebugWindow_Click()
   
   If (cmdDebugWindow.Caption = "Display direct debug =>") Then
       frmStampDAQ.Width = 480
       '#### 470
       cmdDebugWindow.Caption = "<= Hide direct debug"
   Else
       frmStampDAQ.Width = 230
       '#### 220
       cmdDebugWindow.Caption = "Display direct debug =>"
   End If
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: larryd on Dec 07, 2016, 01:08 am
This is fun.
(http://forum.arduino.cc/index.php?action=dlattach;topic=437398.0;attach=189848)

Code: [Select]

/*
   very basic sketch for PLX DAQ test
   for new "Version 2.3" of PLX DAQ

   http://forum.arduino.cc/index.php?topic=437398.0

*/

int i = 0;

void setup()
{

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

  Serial.println("ROW,SET,1");
  Serial.println("LABEL,Time,Value,millis");

  Serial.println("ROW,SET,2");
  //this command reads the Cell value from the specified cell
  Serial.println("CELL,GET,D1,");
  Serial.print("DATA,TIME,");
  delay(10);
  int  cell_num = Serial.parseInt();
  Serial.print("Value in cell D1 = ");
  Serial.print(cell_num);
  Serial.println(",");
  delay(100);
  Serial.println("ROW,SET,8");

}

void loop()
{

  // simple print out of number and millis
  // output "DATA,TIME,4711,13374"
  Serial.print("DATA,TIME,");
  Serial.print(i++); Serial.print(",");
  Serial.println(millis());

}


(http://forum.arduino.cc/index.php?action=dlattach;topic=437398.0;attach=189846)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Dec 08, 2016, 05:11 pm
Ok i guess there is no real use behind your sketch but the image with the colourful arrows are worth it  :D  :D

Anyways, I changed the code to determine the used Office version (special treatment for Office 365) so the UI looks better now. Also a second improvement got implemented: "custom dev points" where one can post his own VBA code to perform any kind of action based on the information passed and can afterwards decide whether he wants the main code to continue or not (e.g. read every line before it gets posted to the sheet, if the line contains a value equal to 200 do not post to sheet).



=============================================================
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 (https://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761) <==
=============================================================




What's new in "version 2.4" aka Change log:



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


(http://www.freebie-base.de/Pics/PLX_DAQ_v2.4.png)


Quote from: Older changelogs
What's new in "version 2.3" aka Change log:
  • Port and baud rate not drop down box anymore but free text fields
  • Port number bug fixed thus ports > 10 can be used (max set to 256 as of modern Windows OS limit)

What's new in "version 2.2" aka Change log:
  • Enhanced 64 bit support (even better stability now)
  • Added a dropdown box to select with sheet to post to (got rid of the radio buttons)
  • Minor adjustment for faster startup of logging

What's new in "version 2.1" aka Change log:
  • --- version never released ---
  • --- it was more of an "internal development version"

What's new in "version 2":
  • Support for both Office versions 64 bit as well as Office 32 bit
  • No more installation needed! All within the workbook
  • I got rid of the selmaDAQ_Ver2.ocx and use API calls now
  • Fully compatible to all previous PLX-DAQ commands in your code!
  • Got rid of some old stuff like "Max row size of 65000" (Office limit is 1048576 rows with 64 bit) or Baud rate only up to 128000 (now supports 230400 and 250000 as well)
  • Added a direct debugging window for better testing as well as a VBA code module for testing and debugging
  • Setting for selecting where to post data (first most left sheet or currently active sheet)
  • Disabled the control boxes as Stamp object is no more in use

=============================================================
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 (https://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761) <==
=============================================================
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: larryd on Dec 08, 2016, 11:19 pm
You have done the community a great service.

"Ok i guess there is no real use behind your sketch but the image with the colourful arrows are worth it  :D  :D "
Now my feelings are hurt :(

I added a BEEP and STOPLOGGING case to the sheet, you may want to consider this too.
Maybe enable 'Reset Timer' click and enable the check buttons to the form also.

What can I say, well done.

.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: larryd on Dec 09, 2016, 05:39 am
Quote
Fixed a UI problem with Office 365
Yes

Quote
Implemented 2 "custom dev points" ("new line was read" and "new data row recognized") which get called by the system automatically and where custom code can be pasted and used (example included in code)
'    If (newLine = "CLEARDATA") Then
'        MsgBox "Looks like we are about to get started!"
'    End If

If the above lines are uncommented EXCEL crashes.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Dec 10, 2016, 08:34 pm
Mea culpa - I never wanted to hurt your feelings :) It is just the picture looks quite funny and the code behind quite ... unique ;)

I think I get the idea behind your "stop logging" - at the moment this is done by just disconnecting. But ok, there might be a use case behind this. I'll note that for the next version. Thanks for the input.
What do you mean by beep? I am familiar with the VBA "beep" command but I wouldn't know where to place it with any reason. I even removed it from the original code as it annoyed me too much on connect/disconnect :-X
All disabled buttons are disabled for good reasons, as they relate to the old "stamp" module that is no longer in place. Someday I might either remove all parts of it from the macro or code anew, I don't know yet :) The reset Timer is something I haven't dealt with at all at the moment. That's all "old stuff" from version 1.

And yeah, the example code crashes? Good thing it is an example code :) I will change with 2.5 to something as useless but more stable ;) I can image some code like "ignore cleardata if day of month is even" example :)

Thank you very much for testing all versions and providing feedback! It is much appreciated!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: larryd on Dec 11, 2016, 06:15 pm
Quote
I never wanted to hurt your feelings
Just joking around.
Thought noobs could trace a command received to what happens on the EXCEL. sheet.


Did something like this:

Code: [Select]
  Select Case DataVal(0)
.
.
.

    'Stop logging.     Under sketch control Arduino stops logging in EXCEL,  LarryD
    Case "STOPLOGGING"
          Call cmdConnect_Click
          
    'Make Beep.        To get attention, Arduino can make EXCEL Beep,  LarryD
    Case "BEEP"
         Beep


And

Code: [Select]
Private Sub cmdResetTimer_Click() 'LarryD
        TimeStart = Timer    
        TimeLast = Timer    
        TimeAdd = 0            
        txtStatus2 = "Timer Reset"  
End Sub
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: CBJARL on Dec 13, 2016, 03:05 pm
Great work! I'm looking at doing something similar in a Windows application.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Dec 15, 2016, 08:46 pm
Hi Larry,
sorry for the late response - somehow I wasn't notified about the two replies. Or I accidentally deleted the mails  :P  dunno

Now I get what you are talking about. Ok. But just as a question: if I don't want the data to be logged I would just stop sending the data from my Arduino to the serial port :-X I am a bit unsure whether to blow up code or not by adding commands .... a screw it - it will be added! "The customer is always right" ;)
I will however add a "Pause Logging" feature in the PLX DAQ UI as well thus one can keep being connected to the Arduino but pause logging from PC side. Both features go hand in hand.

Beep is good as well.

Timer I have to check as I said I never looked at it before. But many thanks for providing a code preview.

I hope I will find time for the next version before Christmas.

@CBJARL: thanks a lot! :)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: larryd on Dec 16, 2016, 03:35 am
IMHO, I would not worry about adding functionality, make it your own.

The point of stoping logging is the Arduino could do this if a certain condition was met while you sleep ;)

Edit:
'Pause Logging' would be good as connection would not be broken

.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Dec 16, 2016, 07:37 pm
The point of stoping logging is the Arduino could do this if a certain condition was met while you sleep ;)
sure yes, but look. I guess you would do:

Code: [Select]

void loop()
{

//do Stuff

Serial.print("DATA,TIME,Whatsoever")

if(Sensorvalue==false)
   Serial.print("STOPLOGGING")
else
   Serial.print("STARTLOGGING")

}


Why not to keep it simple rather:

Code: [Select]

void loop()
{

//do Stuff



if(Sensorvalue<>false)
   Serial.print("DATA,TIME,Whatsoever")
}


In the end I do not need to tell PLX DAQ to stop logging (aka ignore input send from Arduino) if I simply not send data from the Arduino to PLX DAQ.

Or am I missing something here?

The Button on the UI for pausing logging will be build in nevertheless. Even with a GET thus Arduino can check for if logging is paused at the moment. Afterwards it won't be a huge thing to implement STOPLOGGING and STARTLOGGING command as well (simple invoke button) I am just not getting the real use case you see :-/
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: larryd on Dec 16, 2016, 07:56 pm
Quote
Why not to keep it simple rather:
I was thinking a bit further, maybe stop logging, saving the file and then shutting down EXCEL.
Not sure if this can be done in the Macro.


I do like simple. :)


I have used your work several times now and really do appreciate being able to do so.

Thanks for the Christmas present!

Larry


FYI:
You might want to review Megunolink's offering for ideas.
http://www.megunolink.com/ (http://www.megunolink.com/)


.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Dec 18, 2016, 05:59 pm
Duh - I did it.
I reworked lots of the code once more to get it more stable and easier to maintain (added comments, formatted code etc.)
Also I looked at  Megunolink (thanks for the info) but I guess they are just hardcore sophisticated with their Software. PLX DAQ should be for the easy user or at least for pros that would like to build out of the box possibilities for simple consumers. What looks promising is http://docs.blynk.cc/ (http://docs.blynk.cc/) if you want your data to be available on a smartphone.

@CBJARL: one more thing, you could basically paste 90% of the code to Visual Basic and build a native Windows application. But well - you still need some sheet or further use for the commands received ;)

So without further delay:



=============================================================
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 (https://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761) <==
=============================================================




What's new in "version 2.5" aka Change log:



Might be I implemented even further things but I think I lost track of what I did today :D

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


(http://www.freebie-base.de/Pics/PLX_DAQ_v2.5.png)


Quote from: Older changelogs
What's new in "version 2.4" aka Change log:
  • Fixed a UI problem with Office 365
  • Implemented 2 "custom dev points" ("new line was read" and "new data row recognized") which get called by the system automatically and where custom code can be pasted and used (example included in code)

What's new in "version 2.3" aka Change log:
  • Port and baud rate not drop down box anymore but free text fields
  • Port number bug fixed thus ports > 10 can be used (max set to 256 as of modern Windows OS limit)

What's new in "version 2.2" aka Change log:
  • Enhanced 64 bit support (even better stability now)
  • Added a dropdown box to select with sheet to post to (got rid of the radio buttons)
  • Minor adjustment for faster startup of logging

What's new in "version 2.1" aka Change log:
  • --- version never released ---
  • --- it was more of an "internal development version"

What's new in "version 2":
  • Support for both Office versions 64 bit as well as Office 32 bit
  • No more installation needed! All within the workbook
  • I got rid of the selmaDAQ_Ver2.ocx and use API calls now
  • Fully compatible to all previous PLX-DAQ commands in your code!
  • Got rid of some old stuff like "Max row size of 65000" (Office limit is 1048576 rows with 64 bit) or Baud rate only up to 128000 (now supports 230400 and 250000 as well)
  • Added a direct debugging window for better testing as well as a VBA code module for testing and debugging
  • Setting for selecting where to post data (first most left sheet or currently active sheet)
  • Disabled the control boxes as Stamp object is no more in use

=============================================================
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 (https://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761) <==
=============================================================
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Nick_Pyner on Dec 18, 2016, 11:52 pm
What looks promising is http://docs.blynk.cc/ (http://docs.blynk.cc/) if you want your data to be available on a smartphone.
I found Bluetooth Graphics Terminal a more or less direct equivalent to the the way I was using PLX.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: larryd on Dec 19, 2016, 05:42 am
Thanks for all your work, again  :) .

Looks like this can turn into quite an nice tool.

Note:  
If 2.5 is running and accepting data from your supplied INO, things function fine.

- If however, when you move the VBA window, I have noticed Excel sometimes crashes 10 or so seconds later.
- Maybe freeze the ability of moving VBA window while data is being received.

- Also, if you try to use the vertical scroll bar on the right side of the Excel screen while data is being received, Excel crashes.
(so Larry don't scroll  :smiley-confuse: )

- Quitting at 450 works great.



Edit
Also, when data is being received and you click the 'Reset Timer' button, Excel crashes.


OK, maybe the rule should be while data is received do not touch. ;)
.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Dec 19, 2016, 08:28 pm
Thanks for all your work, again  :)

(...)

OK, maybe the rule should be while data is received do not touch. ;)
Thanks for the feedback :)

I could use the buttons and checkboxes quit frequently but let me have another look over the next days. Maybe it has something to do with Office365 again ;)

Anyways we are getting better and better with each release and bring PLX DAQ back to its glory days :) 
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: larryd on Dec 19, 2016, 08:43 pm
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.


.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: SharkWheelSDSU on Dec 25, 2016, 10:21 am
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!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: larryd on Dec 25, 2016, 09:04 pm
Make sure you don't have the com port open in Excel when you try uploading in the IDE.


.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: SharkWheelSDSU on Dec 26, 2016, 09:03 am
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:


Code: [Select]

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
}

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Dec 26, 2016, 04:32 pm
but here's the the portion that is supposed to send the data:

Code: [Select]

                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.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Dec 26, 2016, 06:19 pm
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 (https://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761) <==
=============================================================




What's new in "version 2.6" aka Change log:



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 (http://www.freebie-base.de/Pics/PLX_DAQ_v2.6.png)
(hosted on my server, no traffic hijack)


(http://www.freebie-base.de/Pics/PLX_DAQ_v2.6.png)


Quote from: Older changelogs
What's new in "version 2.5" aka Change log:
  • Added a "Pause logging" / "Resume logging" button that can (well no surprise) stop the logging of the data without disconnecting the Arduino. The Button is enabled when connected
  • Removed the old 4 checkboxes as the functions are useless without Stamp nowadays and replaced with 3 custom checkboxes. As with old PLX DAQ v1 these checkboxes can be controlled by Arduino code: change text, check/uncheck box, read status of boxed (if checked or not). Codes changed from "DOWNLOAD" / "STORED" / "USER1" to CUSTOMBOX1 / CUSTOMBOX2 / CUSTOMBOX3. "USER2" was removed completely.
  • Moved "Reset on Connect" around a bit for better UI layout
  • Re-implemented the code for "Reset Timer" button. I don't know why I removed that anyways in version 2.1 ....
  • I added a new example sketch that demonstrates the new functions and how one can use them
  • I also rework the example codes in the custom dev points for not crashing Excel anymore - hopefully ;)
  • Added new functions to call in Excel by Arduino:
    • Beep : makes a simple beep
    • Pauselogging : stops printing logged data to the Excel sheet
    • Resumelogging: continues pasting data again
    • Stoplogging : disconnects the Arduino
    • Saveworkbook : simply saves the workbook
    • SaveworkbookAs,Filename : saves the workbook as a new copy in the same folder by the name Filename.xlsm
    • ForcequitExcel: forces Excel to close. Note: the workbook will not be saved by this!


What's new in "version 2.4" aka Change log:
  • Fixed a UI problem with Office 365
  • Implemented 2 "custom dev points" ("new line was read" and "new data row recognized") which get called by the system automatically and where custom code can be pasted and used (example included in code)

What's new in "version 2.3" aka Change log:
  • Port and baud rate not drop down box anymore but free text fields
  • Port number bug fixed thus ports > 10 can be used (max set to 256 as of modern Windows OS limit)

What's new in "version 2.2" aka Change log:
  • Enhanced 64 bit support (even better stability now)
  • Added a dropdown box to select with sheet to post to (got rid of the radio buttons)
  • Minor adjustment for faster startup of logging

What's new in "version 2.1" aka Change log:
  • --- version never released ---
  • --- it was more of an "internal development version"

What's new in "version 2":
  • Support for both Office versions 64 bit as well as Office 32 bit
  • No more installation needed! All within the workbook
  • I got rid of the selmaDAQ_Ver2.ocx and use API calls now
  • Fully compatible to all previous PLX-DAQ commands in your code!
  • Got rid of some old stuff like "Max row size of 65000" (Office limit is 1048576 rows with 64 bit) or Baud rate only up to 128000 (now supports 230400 and 250000 as well)
  • Added a direct debugging window for better testing as well as a VBA code module for testing and debugging
  • Setting for selecting where to post data (first most left sheet or currently active sheet)
  • Disabled the control boxes as Stamp object is no more in use

=============================================================
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 (https://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761) <==
=============================================================
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: SharkWheelSDSU on Dec 27, 2016, 12:18 pm
Adding the comma after "DATA" worked! Thanks so much!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: ralphjabonga on Jan 13, 2017, 02:28 pm
 :(  :smiley-confuse:

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.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jan 15, 2017, 05:57 pm
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
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: ankoo on Jan 23, 2017, 10:28 am
please help me..

Win10 and office13

all time with all version program have the same problems

 :smiley-confuse:  :smiley-confuse:
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jan 29, 2017, 12:15 pm
Win10 and office13
Hi Ankoo,

are you running Win10 on 64bit or 32bit ?
same for Office 2013: 64 or 32 bit?
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: jl1cny on Feb 08, 2017, 04:37 am
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

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Feb 08, 2017, 08:51 am
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
Code: [Select]
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
Code: [Select]
CommWrite cboPort.Text, "Any information can be send here"

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

Greetings

NetDevil
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: jl1cny on Feb 08, 2017, 09:32 pm
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(",");

2. 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,");

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

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Feb 09, 2017, 05:30 pm
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 (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.

Code: [Select]

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);


2. Sure it puts an "a" in the cell. You send an "a" hardcoded ;) Change to:
Code: [Select]

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


3. 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
Code: [Select]

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:
Code: [Select]

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'):
Code: [Select]

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.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: jl1cny on Feb 10, 2017, 04:12 am
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

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Feb 10, 2017, 10:31 am
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
Code: [Select]
Serial.parseInt();

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

Code: [Select]

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)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Feb 10, 2017, 10:54 am
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 (https://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761) <==
=============================================================




What's new in "version 2.7" aka Change log:


Backlog for next version(s):

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 (http://www.freebie-base.de/Pics/PLX_DAQ_v2.7.png)
(hosted on my server, no traffic hijack)


(http://www.freebie-base.de/Pics/PLX_DAQ_v2.7.png)


Quote from: Older changelogs
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

What's new in "version 2.5" aka Change log:
  • Added a "Pause logging" / "Resume logging" button that can (well no surprise) stop the logging of the data without disconnecting the Arduino. The Button is enabled when connected
  • Removed the old 4 checkboxes as the functions are useless without Stamp nowadays and replaced with 3 custom checkboxes. As with old PLX DAQ v1 these checkboxes can be controlled by Arduino code: change text, check/uncheck box, read status of boxed (if checked or not). Codes changed from "DOWNLOAD" / "STORED" / "USER1" to CUSTOMBOX1 / CUSTOMBOX2 / CUSTOMBOX3. "USER2" was removed completely.
  • Moved "Reset on Connect" around a bit for better UI layout
  • Re-implemented the code for "Reset Timer" button. I don't know why I removed that anyways in version 2.1 ....
  • I added a new example sketch that demonstrates the new functions and how one can use them
  • I also rework the example codes in the custom dev points for not crashing Excel anymore - hopefully ;)
  • Added new functions to call in Excel by Arduino:
    • Beep : makes a simple beep
    • Pauselogging : stops printing logged data to the Excel sheet
    • Resumelogging: continues pasting data again
    • Stoplogging : disconnects the Arduino
    • Saveworkbook : simply saves the workbook
    • SaveworkbookAs,Filename : saves the workbook as a new copy in the same folder by the name Filename.xlsm
    • ForcequitExcel: forces Excel to close. Note: the workbook will not be saved by this!


What's new in "version 2.4" aka Change log:
  • Fixed a UI problem with Office 365
  • Implemented 2 "custom dev points" ("new line was read" and "new data row recognized") which get called by the system automatically and where custom code can be pasted and used (example included in code)

What's new in "version 2.3" aka Change log:
  • Port and baud rate not drop down box anymore but free text fields
  • Port number bug fixed thus ports > 10 can be used (max set to 256 as of modern Windows OS limit)

What's new in "version 2.2" aka Change log:
  • Enhanced 64 bit support (even better stability now)
  • Added a dropdown box to select with sheet to post to (got rid of the radio buttons)
  • Minor adjustment for faster startup of logging

What's new in "version 2.1" aka Change log:
  • --- version never released ---
  • --- it was more of an "internal development version"

What's new in "version 2":
  • Support for both Office versions 64 bit as well as Office 32 bit
  • No more installation needed! All within the workbook
  • I got rid of the selmaDAQ_Ver2.ocx and use API calls now
  • Fully compatible to all previous PLX-DAQ commands in your code!
  • Got rid of some old stuff like "Max row size of 65000" (Office limit is 1048576 rows with 64 bit) or Baud rate only up to 128000 (now supports 230400 and 250000 as well)
  • Added a direct debugging window for better testing as well as a VBA code module for testing and debugging
  • Setting for selecting where to post data (first most left sheet or currently active sheet)
  • Disabled the control boxes as Stamp object is no more in use

=============================================================
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 (https://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761) <==
=============================================================
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: el_supremo on Feb 10, 2017, 04:28 pm
a minor fix. There's a missing end quote in the example in your post (49):
Code: [Select]
Serial.println("ClearRange,B,2,D,50);

Pete
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Feb 10, 2017, 04:40 pm
a minor fix. There's a missing end quote in the example in your post (49):
Code: [Select]
Serial.println("ClearRange,B,2,D,50);

Pete
Thanks, I fixed it. :)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: jl1cny on Feb 10, 2017, 11:47 pm
Hi,

Thank you for uploading Ver2.7! The new function works very well.

I am still investigating the reason GET function does not properly work in my Arduino.

I just created a simple sketch below to see if the 123 in E2 will be copied to D2 and 'TEST' in E3 will be copied to D3. When executed, it is weird enough to see 0 in D2 and 123 not 'TEST' in D3. It seems to me as if the data transfer from the EXCEL to my Arduino was delayed so that 123 which should be input to variable 'b' was actually input to variable 'd'.

   Serial.println("ClearRange,D,2,E,202");
   
   int a = 123;
   Serial.print("CELL,SET,E2,");
   Serial.println(a);

   Serial.println("CELL,GET,E2");
   int b = Serial.parseInt();
   
   Serial.print("CELL,SET,D2,");
   Serial.println(b);  

   String c = "TEST";
   Serial.print("CELL,SET,E3,");
   Serial.println(c);  
   
   Serial.println("CELL,GET,E3");
   String d = Serial.readString();

   Serial.print("CELL,SET,D3,");
   Serial.println(d);

Than I inserted 'while (!Serial.available()){}' to see if my Arduino receives data from the EXCEL by the execution of  'Serial.println("CELL,GET,E2");' command. In this case, the program stays at 'while (!Serial.available()){}' command and never goes beyond.

  Serial.println("ClearRange,D,2,E,202");
   
   int a = 123;
   Serial.print("CELL,SET,E2,");
   Serial.println(a);

   Serial.println("CELL,GET,E2");
   while (!Serial.available()){} // << inserted
   int b = Serial.parseInt();
   
   Serial.print("CELL,SET,D2,");
   Serial.println(b);  

   String c = "TEST";
   Serial.print("CELL,SET,E3,");
   Serial.println(c);  
   
   Serial.println("CELL,GET,E3");
   String d = Serial.readString();

   Serial.print("CELL,SET,D3,");
   Serial.println(d);


I am a newbie in terms of programming. I wonder if there exist some timing issues. Does anyone have any clue?

Sam
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Feb 17, 2017, 08:39 pm
Hi jl1cny,

might be I found the problem. I was able to recreate the same issue when using baud rates greater then 19200. Might be that it is just to fast for my PC / your PC and or Excel or the Arduino.

When using baud rate of 9600 or 19200 all my get / set commands were executed correctly.

I attached a test sketch and a special Excel sheet for you to try.

The sketch has 4 test cases:


All is running well with baud up to 19200.

Please just give it try and in case it is running well try to reduce your baud rate.

And one more thing, when posting code please use the code tags for better readability.

Code: [Select]
[ code]put code here[/ code]

and remove blanks'
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Feb 21, 2017, 09:41 pm
Updates Updates Updates  :D  :D



=============================================================
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 (https://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761) <==
=============================================================



What's new in "version 2.8" aka Change log:


Backlog for next version(s):


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


(http://www.freebie-base.de/Pics/PLX_DAQ_v2.8.png)


Quote from: Older changelogs
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

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

What's new in "version 2.5" aka Change log:
  • Added a "Pause logging" / "Resume logging" button that can (well no surprise) stop the logging of the data without disconnecting the Arduino. The Button is enabled when connected
  • Removed the old 4 checkboxes as the functions are useless without Stamp nowadays and replaced with 3 custom checkboxes. As with old PLX DAQ v1 these checkboxes can be controlled by Arduino code: change text, check/uncheck box, read status of boxed (if checked or not). Codes changed from "DOWNLOAD" / "STORED" / "USER1" to CUSTOMBOX1 / CUSTOMBOX2 / CUSTOMBOX3. "USER2" was removed completely.
  • Moved "Reset on Connect" around a bit for better UI layout
  • Re-implemented the code for "Reset Timer" button. I don't know why I removed that anyways in version 2.1 ....
  • I added a new example sketch that demonstrates the new functions and how one can use them
  • I also rework the example codes in the custom dev points for not crashing Excel anymore - hopefully ;)
  • Added new functions to call in Excel by Arduino:
    • Beep : makes a simple beep
    • Pauselogging : stops printing logged data to the Excel sheet
    • Resumelogging: continues pasting data again
    • Stoplogging : disconnects the Arduino
    • Saveworkbook : simply saves the workbook
    • SaveworkbookAs,Filename : saves the workbook as a new copy in the same folder by the name Filename.xlsm
    • ForcequitExcel: forces Excel to close. Note: the workbook will not be saved by this!


What's new in "version 2.4" aka Change log:
  • Fixed a UI problem with Office 365
  • Implemented 2 "custom dev points" ("new line was read" and "new data row recognized") which get called by the system automatically and where custom code can be pasted and used (example included in code)

What's new in "version 2.3" aka Change log:
  • Port and baud rate not drop down box anymore but free text fields
  • Port number bug fixed thus ports > 10 can be used (max set to 256 as of modern Windows OS limit)

What's new in "version 2.2" aka Change log:
  • Enhanced 64 bit support (even better stability now)
  • Added a dropdown box to select with sheet to post to (got rid of the radio buttons)
  • Minor adjustment for faster startup of logging

What's new in "version 2.1" aka Change log:
  • --- version never released ---
  • --- it was more of an "internal development version"

What's new in "version 2":
  • Support for both Office versions 64 bit as well as Office 32 bit
  • No more installation needed! All within the workbook
  • I got rid of the selmaDAQ_Ver2.ocx and use API calls now
  • Fully compatible to all previous PLX-DAQ commands in your code!
  • Got rid of some old stuff like "Max row size of 65000" (Office limit is 1048576 rows with 64 bit) or Baud rate only up to 128000 (now supports 230400 and 250000 as well)
  • Added a direct debugging window for better testing as well as a VBA code module for testing and debugging
  • Setting for selecting where to post data (first most left sheet or currently active sheet)
  • Disabled the control boxes as Stamp object is no more in use

=============================================================
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 (https://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761) <==
=============================================================
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: SASv on Mar 01, 2017, 01:19 am
Hi NetDevil

Many thanks for the ClearRange command.  This enables an easy workaround for the inability to read from other sheets.  Just set a cell in Simple Data (that is not cleared) equal to the cell in the other sheet you want to read from.

SASv

P.S.  In your version 2.8 update you state in Backlog for next version(s):
"solve get cell / set cell mix up reported by jl1cny here. Priority: high ; Workaround: none(!)"
But for those who can afford lower baud rates you already posted a workaround, it is to lower the baud rate.  I checked it and it works. As I have occasional issues with 9600 baud, I will be using 4800.




Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Mar 02, 2017, 06:15 pm
Hi SASv,
thanks for your feedback. Let's see:
This enables an easy workaround for the inability to read from other sheets. Just set a cell in Simple Data (that is not cleared) equal to the cell in the other sheet you want to read from.
Interesting issue. You are right, you can only read values from the current sheet and with having had only CLEARSHEET your reference cell was deleted as well. I will add a feature within the next version to read data from other sheets (by name) as well. Right now I am thinking of something like:

Code: [Select]
// ## NOTE: function not yet implemented in PLX DAQ v2
Serial.println("CELL,GET,FROMSHEET,MyConfigSheet,C,5");


P.S.  In your version 2.8 update you state in Backlog for next version(s):
"solve get cell / set cell mix up reported by jl1cny here. Priority: high ; Workaround: none(!)"
But for those who can afford lower baud rates you already posted a workaround, it is to lower the baud rate.  I checked it and it works. As I have occasional issues with 9600 baud, I will be using 4800.
Good to know it is working well for you. I still need to get to the bottom of the issue and was hoping the workaround would suite for more people. Could you post me the code you are having issue with at 9600 baud? Are you using more then 1 variable to store data?





Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: SASv on Mar 02, 2017, 11:52 pm
Hi NetDevil

Apologies, I should have specified that I had occasional issues at 9600 baud with version 2.3.  Version 2.8 has no issues at 9600 baud, and I will be switching to version 2.8.

A "CELL,GET,FROMSHEET,MyConfigSheet,C,5" command would be great.

Many thanks!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Mar 04, 2017, 06:49 pm
Hey there, I added the command to the programm and did some more research on the issues with the window crash and cell mix up. Unfortunately there is no update on those issues yet. Still pretty mysterious ... Nevertheless I'll reduce the priority as baud rates of around 9600 seem to work without any problems.


=============================================================
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 (https://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761) <==
=============================================================



What's new in "version 2.9" aka Change log:

Backlog for next version(s):

Guideline to migrate from old version to new one:


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


(http://www.freebie-base.de/Pics/PLX_DAQ_v2.9.png)


Quote from: Older changelogs
What's new in "version 2.8" aka Change log:
  • fixed an issue with the LABEL command. Columns that should labeled either TIME, TIMER or DATE where translated as well thus the column was not labeled with e.g., DATE but accidentally resolved to current system date (e.g., 21.02.2017)
  • fixed in issue with 32 bit Office versions and sleep function. Should be working on 64 bit and 32 bit versions again. Issue was reported by ankoo here (http://forum.arduino.cc/index.php?topic=437398.msg3097598#msg3097598)
  • removed two deprecated commands from PLX DAQ v1 (RESET and CMD?) as they were of no use anymore
  • realigned source code for better readability, reused functions more often to reduce redundancy, commented out old checkbox calls from PLX DAQ v1 that are deprecated within commands
  • corrected a mistake in the comments of the default sketch (column naming)

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

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

What's new in "version 2.5" aka Change log:
  • Added a "Pause logging" / "Resume logging" button that can (well no surprise) stop the logging of the data without disconnecting the Arduino. The Button is enabled when connected
  • Removed the old 4 checkboxes as the functions are useless without Stamp nowadays and replaced with 3 custom checkboxes. As with old PLX DAQ v1 these checkboxes can be controlled by Arduino code: change text, check/uncheck box, read status of boxed (if checked or not). Codes changed from "DOWNLOAD" / "STORED" / "USER1" to CUSTOMBOX1 / CUSTOMBOX2 / CUSTOMBOX3. "USER2" was removed completely.
  • Moved "Reset on Connect" around a bit for better UI layout
  • Re-implemented the code for "Reset Timer" button. I don't know why I removed that anyways in version 2.1 ....
  • I added a new example sketch that demonstrates the new functions and how one can use them
  • I also rework the example codes in the custom dev points for not crashing Excel anymore - hopefully ;)
  • Added new functions to call in Excel by Arduino:
    • Beep : makes a simple beep
    • Pauselogging : stops printing logged data to the Excel sheet
    • Resumelogging: continues pasting data again
    • Stoplogging : disconnects the Arduino
    • Saveworkbook : simply saves the workbook
    • SaveworkbookAs,Filename : saves the workbook as a new copy in the same folder by the name Filename.xlsm
    • ForcequitExcel: forces Excel to close. Note: the workbook will not be saved by this!


What's new in "version 2.4" aka Change log:
  • Fixed a UI problem with Office 365
  • Implemented 2 "custom dev points" ("new line was read" and "new data row recognized") which get called by the system automatically and where custom code can be pasted and used (example included in code)

What's new in "version 2.3" aka Change log:
  • Port and baud rate not drop down box anymore but free text fields
  • Port number bug fixed thus ports > 10 can be used (max set to 256 as of modern Windows OS limit)

What's new in "version 2.2" aka Change log:
  • Enhanced 64 bit support (even better stability now)
  • Added a dropdown box to select with sheet to post to (got rid of the radio buttons)
  • Minor adjustment for faster startup of logging

What's new in "version 2.1" aka Change log:
  • --- version never released ---
  • --- it was more of an "internal development version"

What's new in "version 2":
  • Support for both Office versions 64 bit as well as Office 32 bit
  • No more installation needed! All within the workbook
  • I got rid of the selmaDAQ_Ver2.ocx and use API calls now
  • Fully compatible to all previous PLX-DAQ commands in your code!
  • Got rid of some old stuff like "Max row size of 65000" (Office limit is 1048576 rows with 64 bit) or Baud rate only up to 128000 (now supports 230400 and 250000 as well)
  • Added a direct debugging window for better testing as well as a VBA code module for testing and debugging
  • Setting for selecting where to post data (first most left sheet or currently active sheet)
  • Disabled the control boxes as Stamp object is no more in use

=============================================================
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 (https://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761) <==
=============================================================
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: SASv on Mar 07, 2017, 10:41 pm
Possible Workaround to GET/SET Issues for High Baud Rates

I found that the GET, SET, and the new Serial.println("CELL,GET,FROMSHEET,SheetName,Column,Row");
commands can work well even at high baud rates if a small delay is added after serial interactions.
The following test code was tested in three computers (two Windows 7 and one Windows 10):


// First you must have NetDevil's Excel file PLX-DAQ-v2.9.xlsm open and
// PLX-DAQ-v2.9 connected at the appropriate port with the desired baud rate.
// Download it from
// https://forum.arduino.cc/index.php?topic=437398.msg3160058#msg3160058
// Enter a numerical value in cell J3 of sheet Simple Data
// Enter a numerical value in cell F6 of sheet Further sheet
// Code for a second serial port (SoftSerial) has been added so that one serial port can
// be dedicated for output to Excel using NetDevil's PLX-DAQ-v2.9 and the
// other serial port to the Arduino monitor
// A CP2102 cable does the job well for connecting the Arduino soft serial
// pins to a 2nd computer USB.

//PRELIMINARIES
#include <SoftwareSerial.h>  // include the software serial port library

//Soft serial pins
#define rxPin 8   //connect to green wire of CP2102 or to orange wire of FTDI
#define txPin 7   //connect to white wire of CP2102 or to yellow wire of FTDI

// set up a new serial port
SoftwareSerial excelSerial =  SoftwareSerial(rxPin, txPin);

unsigned long baudr = 38400;  //Do not forget to change the baud rate in PLX-DAQ and in the serial monitor
byte tdelay = 3; 

void setup(void) {
  // define pin modes for tx, rx:
  pinMode(rxPin, INPUT);
  pinMode(txPin, OUTPUT);
  // set baud rates for both ports
  excelSerial.begin(baudr);
  delay(tdelay); 
  Serial.begin(baudr);
  delay(tdelay);  //A workaround to the GET/SET issues is to put a small delay after serial interaction commands
  // testing SET
  excelSerial.println("ClearRange,A,1,F,100");
  delay(tdelay);
  float Ans = 42;
  Serial.println(Ans);
  delay(tdelay);
  excelSerial.print("CELL,SET,D3,"); 
  delay(tdelay);
  excelSerial.println(Ans);
  delay(tdelay);
  // testing GET
  Serial.print(F("Test print is "));
  delay(tdelay);  // To be safe I have added delays even where they are probably not needed
  excelSerial.println("CELL,GET,J3");
  delay(tdelay);
  float NotAns = excelSerial.parseFloat();
  delay(tdelay);
  Serial.println(NotAns);
  delay(tdelay);
  // testing GET FROMSHEET (thanks NetDevil)
  excelSerial.println("CELL,GET,FROMSHEET,Further sheet,F,6");
  delay(tdelay);
  float AnsAns = excelSerial.parseFloat();
  delay(tdelay);
  Serial.println(AnsAns);
  delay(tdelay);
  Serial.println("DONE");
}

void loop(void) {;}

//End of code



Update:
Further testing using a Windows 10 computer showed that this workaround is not effective 100% of the time at 115200 baud. 
At 115200 baud & tdelay = 3, all printouts were correct about 85% of the time (34/40 trials). 
At 115200 baud & tdelay = 10, all printouts were correct about 90% of the time (18/20 trials).
At 38400 baud & tdelay =10, 20 out of 20 trials were completely successful.
At 38400 baud & tdelay =3, 30 out of 30 trials were completely successful.

Previous Caution Removed:
I had previously cautioned that an inexpensive CP2102 cable from China failed to perform.  I was incorrect, it was a loose wire. 
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: SASv on Mar 10, 2017, 04:53 am
UPDATED - Further Investigation on the delay GET/SET workaround - UPDATED

I investigated which delays are really needed in the above code using an Adafruit CP2102 cable.  My starting point was 38400 baud with 3 msec delays, which had successes in 30 out of 30 previous trials.  This time I used a Windows 8.1 computer.

1. 20 new trials at 38400 baud with all delays active at 3 msec: 20 complete successes

As I had the number 53.90 in "SimpleData"!J3 and 42.42 in "Further sheet"!F6, the correct result is to print on the Arduino monitor:

42.00
Test print is 53.90
42.42
DONE

2. 20 new trials at 38400 baud with all delays commented out: 0 complete successes

16 out of the 20 answers were:

42.00
Test print is 0.00
53.90
DONE

which pointed out that a delay may be necessary before the CELL,GET command

3. 20 new trials at 38400 baud activating the delay before the CELL,GET,J3 command: 19 complete successes

The only failure was the first test

4. 20 trials at 115200 baud with 3 msec delays before the CELL,GET and CELL,GET,FROMSHEET commands: 15 complete successes. 

5. 20 trials at 115200 baud with 10 msec delays before the CELL,GET and CELL,GET,FROMSHEET commands: only 5 complete successes!

The majority of failures printed 

42.00
Test print is 53.00
942.42
DONE

6. 10 trials at 115200 baud with 100 msec delays before the CELL,GET and CELL,GET,FROMSHEET commands: 0 complete successes!

Update: If tdelay is changed from byte to integer
Result: 10/10 complete successes

7.  20 trials at 57600 baud with 3 msec delays before the CELL,GET and CELL,GET,FROMSHEET commands: 20 complete successes.

8.  20 trials at 74880 baud with 3 msec delays before the CELL,GET and CELL,GET,FROMSHEET commands: 20 complete successes.

REVISED CONCLUSION
Placing delays before CELL,GET and CELL,GET,FROMSHEET commands seems to be completely effective for rates <= 74880 baud.

Delays of 3 msec were successful for the above test, but larger delays are needed if the Excel cells read from involve lengthy calculations.

I am not sure what is happening at 115200 baud.  Perhaps it is an issue of the software serial port.  Even though the current documentation states that it works up to 115200 baud, older documentation indicated issues at that rate.






Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Mar 10, 2017, 08:09 am
Hi SASv,

thank you very very much for all the effort you put in researching the issue and the posts you've made !! I still owe you an email as well  ;)

I will try to reproduce your results over the weekend and try to verify them. Also I might publish a demo sheet for general testing purposes thus everyone can participate. It seems to be coming down to a general Arduino issue and maybe not Excel / PLX DAQ which would be kind of hard to fix other then to use your mentioned delays.

Thanks again and I'll get back to you :)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: sunvivek10 on Mar 10, 2017, 10:35 pm
sir, where should placed this zip code..i am not understand ?? please give steps to use it?
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: SASv on Mar 12, 2017, 06:55 pm
On the delay workaround for the CELL, GET and CELL, GET,FROMSHEET commands for 115200 baud

As indicated in the earlier post, I started suspecting that the issue at 115200 baud may be related to the software serial port I have been using.  The code below has removed it and gave the correct result (in cells J7-J11) in 18 out of 20 trials.

Code: [Select]

// 1. Open NetDevil's Excel file PLX-DAQ-v2.9.xlsm but do not connect PLX-DAQ
// (https://forum.arduino.cc/index.php?topic=437398.msg3160058#msg3160058)
// Enter a numerical value in cell J3 of sheet Simple Data
// Enter a numerical value in cell F6 of sheet Further sheet
// 2. Setting the port for the Arduino USB (in Tools), upload the sketch
// 3. With the Arduino serial monitor CLOSED connect PLX-DAQ at the same port
// 4. For repeating trials disconnect and reconnect PLX-DAQ

unsigned long baudr = 115200;  //Do not forget to change the baud rate in PLX-DAQ
 
int tdelay = 100;

void setup(void) {
  Serial.begin(baudr);
  Serial.println("ClearRange,A,1,F,100");
  Serial.println("ClearRange,J,7,J,11");
  delay(tdelay);
  delay(tdelay);
  // 1st test of CELL,SET
  float Ans = 42;
  delay(tdelay);
  Serial.print("CELL,SET,J7,");
  Serial.println(Ans);
  delay(tdelay);
  // 2nd test of CELL,SET
  Serial.print("CELL,SET,J8,");
  Serial.println(F("Test print is "));
  // Test of CELL,GET
  delay(tdelay);
  Serial.println("CELL,GET,J3");
  float NotAns = Serial.parseFloat();
  delay(tdelay);
  Serial.print("CELL,SET,J9,");
  Serial.println(NotAns);
  // Test of GET FROMSHEET (thanks NetDevil)
  delay(tdelay);
  Serial.println("CELL,GET,FROMSHEET,Further sheet,F,6");
  float AnsAns = Serial.parseFloat();
  delay(tdelay);
  Serial.print("CELL,SET,J10,");
  Serial.println(AnsAns);
  // Final printout
  delay(tdelay);
  Serial.print("CELL,SET,J11,");
  Serial.println("DONE");
}

void loop(void) {;}



Testing results:
delay = 0 :  completely correct 0/10
delay =10 : completely correct 19/20
delay = 100: completely correct 18/20

CONCLUSIONS
1. Delays help but do not guarantee success at 115200
2. Failures do not seem to be an issue with the previously used software serial port
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Mar 12, 2017, 08:21 pm
Hi SASv,

I tried to reproduce your findings but somehow I wasn't successful ... I used one and two flushs before and after each Serial.parseInt(); and also delays before and after Serial.parseInt(); But still I got mix-ups even at 30.000 baud.

Attached you can find a ZIP file which contains a sketch and an Excel sheet. In this Excel sheet there are 4 test case scenarios and the sketch will cover those scenarios. In the sketch you can set whether you want to use one or two flushs before or after Serial.parseInt(); as well as if you want to use a delay before and after Serial.parseInt(); and which amount if milliseconds it should wait.

May I ask you to try to verify your experiences with it? In the end, only 100% accuracy is acceptable. That's why I appreciate you running like 20 tries of the same text case and get 18 of 20 or so. This shows that there is no 100% accuracy yet and I have to work on improving the program.

As I am a bit short on time lately I will have to cover all the other open issues some time soon.

Greetings
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Mar 12, 2017, 08:44 pm
=============================================================
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 (https://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761) <==
=============================================================




Anyways I created a new version today and even created a Beginner Guide for people to get a better understanding of how PLX DAQ v2 works and how they can start using it. It also lists all commands that are available for Arduino thus even the more experienced users might benefit from that guide :)





What's new in "Version 2.10" aka Change log:

Backlog for next version(s):


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


(http://www.freebie-base.de/Pics/PLX_DAQ_v2.10.png)


Quote from: Older changelogs
What's new in "version 2.9" aka Change log:
  • Extended the CELL,GET command to read cells from other sheets as well.
    Syntax is Serial.println("CELL,GET,FROMSHEET,SheetName,Column,Row"); ==> e.g., Serial.println("CELL,GET,FROMSHEET,Simple Data,E,4");
  • Updated the default sketch to include the new command

What's new in "version 2.8" aka Change log:
  • fixed an issue with the LABEL command. Columns that should labeled either TIME, TIMER or DATE where translated as well thus the column was not labeled with e.g., DATE but accidentally resolved to current system date (e.g., 21.02.2017)
  • fixed in issue with 32 bit Office versions and sleep function. Should be working on 64 bit and 32 bit versions again. Issue was reported by ankoo here (http://forum.arduino.cc/index.php?topic=437398.msg3097598#msg3097598)
  • removed two deprecated commands from PLX DAQ v1 (RESET and CMD?) as they were of no use anymore
  • realigned source code for better readability, reused functions more often to reduce redundancy, commented out old checkbox calls from PLX DAQ v1 that are deprecated within commands
  • corrected a mistake in the comments of the default sketch (column naming)

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

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

What's new in "version 2.5" aka Change log:
  • Added a "Pause logging" / "Resume logging" button that can (well no surprise) stop the logging of the data without disconnecting the Arduino. The Button is enabled when connected
  • Removed the old 4 checkboxes as the functions are useless without Stamp nowadays and replaced with 3 custom checkboxes. As with old PLX DAQ v1 these checkboxes can be controlled by Arduino code: change text, check/uncheck box, read status of boxed (if checked or not). Codes changed from "DOWNLOAD" / "STORED" / "USER1" to CUSTOMBOX1 / CUSTOMBOX2 / CUSTOMBOX3. "USER2" was removed completely.
  • Moved "Reset on Connect" around a bit for better UI layout
  • Re-implemented the code for "Reset Timer" button. I don't know why I removed that anyways in version 2.1 ....
  • I added a new example sketch that demonstrates the new functions and how one can use them
  • I also rework the example codes in the custom dev points for not crashing Excel anymore - hopefully ;)
  • Added new functions to call in Excel by Arduino:
    • Beep : makes a simple beep
    • Pauselogging : stops printing logged data to the Excel sheet
    • Resumelogging: continues pasting data again
    • Stoplogging : disconnects the Arduino
    • Saveworkbook : simply saves the workbook
    • SaveworkbookAs,Filename : saves the workbook as a new copy in the same folder by the name Filename.xlsm
    • ForcequitExcel: forces Excel to close. Note: the workbook will not be saved by this!


What's new in "version 2.4" aka Change log:
  • Fixed a UI problem with Office 365
  • Implemented 2 "custom dev points" ("new line was read" and "new data row recognized") which get called by the system automatically and where custom code can be pasted and used (example included in code)

What's new in "version 2.3" aka Change log:
  • Port and baud rate not drop down box anymore but free text fields
  • Port number bug fixed thus ports > 10 can be used (max set to 256 as of modern Windows OS limit)

What's new in "version 2.2" aka Change log:
  • Enhanced 64 bit support (even better stability now)
  • Added a dropdown box to select with sheet to post to (got rid of the radio buttons)
  • Minor adjustment for faster startup of logging

What's new in "version 2":
  • Support for both Office versions 64 bit as well as Office 32 bit
  • No more installation needed! All within the workbook
  • I got rid of the selmaDAQ_Ver2.ocx and use API calls now
  • Fully compatible to all previous PLX-DAQ commands in your code!
  • Got rid of some old stuff like "Max row size of 65000" (Office limit is 1048576 rows with 64 bit) or Baud rate only up to 128000 (now supports 230400 and 250000 as well)
  • Added a direct debugging window for better testing as well as a VBA code module for testing and debugging
  • Setting for selecting where to post data (first most left sheet or currently active sheet)
  • Disabled the control boxes as Stamp object is no more in use

=============================================================
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 (https://forum.arduino.cc/index.php?topic=437398.msg3013761#msg3013761) <==
=============================================================
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: SASv on Mar 13, 2017, 04:09 am
Hi NetDevil

The PLX-DAQ-Cellvalue-Manipulator-Test-v4 is impressive.  And unfortunately, what had worked best in my tests, putting delays before GET and SET commands, did not work.  (I had also tried flushes previously with mixed results, worse than adding the delays).  So, I hope your much more capable hands will come up with a solution.
CORRECTION:  See post below

And thanks for the new SET command.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: SASv on Mar 14, 2017, 05:26 am
Hi again NetDevil

I spoke too soon.  It seems the more involved the test the longer the delays needed before GET and SET commands. 

I used your test with the flags set:
Code: [Select]

bool useFlushPriorToRead = 0;
bool useDoubleFlushPriorToRead = 0;
bool useFlushAfterRead = 0;
bool useDoubleFlushAfterRead = 0;

bool useDelayPriorToRead = 0;
int delayPriorToRead = 500;
bool useDelayAfterRead = 0;
int delayAfterRead = 1000;
int tGETSET = 500; //place before every GET and SET


In other words, I replaced the test delays and flushes with a large delay before every GET and SET command (what had worked in my tests).

Here are the results:

38400 baud:  100% success for all tests (if I understood tests 03 and 04 correctly).
57600 baud:  100% success for all tests
74880 baud:  mostly correct but no longer 100%

Increasing the delays to 1000 did not help at 74880 baud, but the slower scroll rate helped me verify continual success at 57600 baud.

In my own program I had failure of a SET command at 9600 baud (it did not show up in the raw data logger).  It required a 500 msec delay (200 did not work) in the line above it to work.

UPDATE: Further testing showed that placing a 30 msec delay before each of the 8 GETs and SETs of the test gave continual success at 38500 and 57600 baud.  However, even increasing the delays to 10000 msec did not make the test continually successful at 74880 baud.

Finally, another clue to the puzzle might be what I observed in a program I am developing.  The code involves 9600 baud communication and has several GETs and SETs in the infinite loop.  After several iterations there is a final GET and SET (the infinite loop "ends" with a very long delay).  The last SET failed until I increased the delay before it to 500 msec.  At that time some of the loop GETs and SETs had 100 msec delays.  However, when I decreased them to 3 msec, the final SET again failed.  To return to success I had to increase its delay to 800 msec.  So there seems to be a cummulative effect from prior GETs and SETs.   

FURTHER UPDATE: Increasing the stop bits to 2 (Serial.begin(baudRate,SERIAL_8N2); ) might help a bit.  It is no solution, but it seems to increase the frequency of correct results.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Mar 17, 2017, 06:11 pm
Hi SASv,

thanks once more for the intensive testing you have done :) I implemented your suggestion into the cellvalue manipulator (500ms delay for every GET and SET) and it did indeed do the trick for higher baud rates (I had some successful test runs with 60.000 baud :) ).

I am still kind of clueless why it is working this way though. Having a delay before GET/SET shouldn't hamper the read later on .... I mean, why pause, then send a GET, then read directly and it is ok? I would understand if we need a delay between the GET and the read to get the buffer free. Or use a flush on Arduino side or Excel side before the read / send ... crazy ....


Its sad to see such large delays are needed since they really slow down the overall performance. However using "only" standard DATA,Value1,Value2,Value3 commands never produced any issues even at highest baud rates so far and I guess thats the most important part.
I will add a note to my Beginners Guide to be careful with CELL,GET and CELL,SET and using at least some delays prio to it (between 100 ms and 500 ms) thus everyone should at least be aware of the issue. I need to update that guide anyways to format chapter headings and include a table of contents.

That adding up of needed delays based on the number of prio GETs/SETs is crazy and confusing as well. One could write a bachelor thesis I guess in order to figure out what the exact needed value for your final GET/SET must be based on how many prior GETs/SETs were used with which delay :D

You definitely earned yourself some Karma points (at least that is all I can offer right now over the internet :) )

I might try some times querying the checkbox values to see if it is the same behavior (well I guess it will be). 

One more thing I wanted to ask you about: when posting code please use the code tags for better readability. It helps a lot especially with the long code statements ;)

Code: [Select]
[ code]put code here[/ code]

and remove blanks


Greetings!

P.S.: I will try to give you an answer to your email within the next days as well! I promise.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: SASv on Mar 17, 2017, 11:19 pm
Hi NetDevil:

I will corroborate your statement "However using "only" standard DATA,Value1,Value2,Value3 commands never produced any issues even at highest baud rates so far and I guess thats the most important part."  Also the ClearRange command has never failed me.  And a lot of programs do not require high baud rates.  Furthermore, in most cases 500 ms delays are overkill.  I run successfully your test with delays as low as 30 ms at 57600 baud.  My recommendation to users is to start with a small delay, test it, and increase it only if it proves unsuccessful.  I also recommend increasing the stop bits to 2 (Serial.begin(baudRate,SERIAL_8N2); ).

The class I am designing has benefited tremendously from PLX-DAQ version 2.  I am very grateful to you.

P.S.  And thanks for the information about code tags.  I will be using them from now on :) .
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: CapiHidalgo on Mar 21, 2017, 01:25 pm
hey, thank you for all the work, I will test it later for my project
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on May 07, 2017, 07:18 pm
Hey guys. Well it's been a while - nearly 2 months! But there is a new version available now! I did some groundwork and tried to tidy up a lot of code but in the end I'm just half done ... that's why I thought I might release the updates I already have and keep the rest for later ;-) And well there are quite a few new features!





What's new in "Version 2.11" aka Change log:


Backlog for next version(s):

Guideline to migrate from old version to new one ==> see Beginners Guide attached


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


(http://www.freebie-base.de/Pics/PLX_DAQ_v2.11.png)


Quote from: Older changelogs
Changelogs of older versions can be found in the attached document "__Old-Versions-changelog.doc"
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: scardu on May 10, 2017, 06:52 pm
@NetDevil

Thanks a lot for the PLX_DAQ updates, it's working like a charm. You'll probably be able to tell I'm a newbie by the nature of my question, but where in the demo code exactly does it get the data for Date, Time, Timer, and milli? I'm trying to modify your demo to print temperature, however I get this:

http://imgur.com/a/yD78e

I modified the code a bit but left pretty much everything intact. https://pastebin.com/dNMuHbvQ
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on May 11, 2017, 12:02 pm
Hi scardu,

thanks a lot :) No problem answering your questions.

1. The buzzwords "Date, Time, Timer" are switched to actual date, time and runtime in the Excel on your PC - simply because Arduino does not know the current date and time ;) Timer is just a counter for how long PLX DAQ is already receiving data.

2. On the other hand "millis()" is an Arduino function counting how long the Arduino is already running. That is done before sending the information to PLX DAQ.

3. You defined four columns by using
Code: [Select]
Serial.println("LABEL,Temp1,Temp2,Temp3,Temp4"); however when passing data from Arduino to PLX DAQ you send him 9 information
Code: [Select]
Serial.print("DATA,Temp1,Temp2,Temp3,Temp4");
Serial.print(sensors.getTempC(Probe01));
Serial.print(",");
Serial.print(sensors.getTempC(Probe02));
Serial.print(",");
Serial.print(sensors.getTempC(Probe03));
Serial.print(",");
Serial.print(sensors.getTempC(Probe04));
Serial.print(",");
Serial.println("SCROLLDATA_20");


String transferred is (concatenated): "DATA,Temp1,Temp2,Temp3,Temp4Probe01,Probe02,Probe03,Probe04,SCROLLDATA_20"

Split by each comma (",") that is:


You should use the following string:

Code: [Select]
Serial.println( (String) "DATA," + sensors.getTempC(Probe01) + "," + sensors.getTempC(Probe02) + "," + sensors.getTempC(Probe03) + "," + sensors.getTempC(Probe04) + ",SCROLLDATA_20");

Thus you only transfer 6 information. Therefore 2 are buzzwords (DATA and AUTOSCROLL) and the other 4 are exactly what you defined as columns in the first place :-)


Your full code is sufficient with:

Code: [Select]

 
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS_PIN 2

OneWire oneWire(ONE_WIRE_BUS_PIN);
DallasTemperature sensors(&oneWire);
 
DeviceAddress Probe01 = { 0x28, 0xFF, 0x73, 0x01, 0xA2, 0x16, 0x05, 0x24 }; // 1
DeviceAddress Probe02 = { 0x28, 0xFF, 0xA4, 0xF0, 0xA1, 0x16, 0x05, 0x31 }; // 2
DeviceAddress Probe03 = { 0x28, 0xFF, 0x99, 0x10, 0xA2, 0x16, 0x05, 0xF4 }; // 3
DeviceAddress Probe04 = { 0x28, 0xFF, 0x4A, 0x0A, 0xA2, 0x16, 0x05, 0xC7 }; // 4
 
void setup() {
 
  // open serial connection
    Serial.begin(9600);

  Serial.println("CLEARSHEET"); // clears sheet starting at row 1
   
  // define columns
    Serial.println("LABEL,Temp1,Temp2,Temp3,Temp4");
 
  /*-----( Temp Probe Setup )-----*/
  sensors.begin();
  sensors.setResolution(Probe01, 10);
  sensors.setResolution(Probe02, 10);
  sensors.setResolution(Probe03, 10);
  sensors.setResolution(Probe04, 10);

}
 
void loop() {

  /*-----( Temp Probe Loop )-----*/

  sensors.requestTemperatures();
  getTemp(Probe01);
  getTemp(Probe02);
  getTemp(Probe03);
  getTemp(Probe04);

  Serial.println( (String) "DATA," + sensors.getTempC(Probe01) + "," + sensors.getTempC(Probe02) + "," + sensors.getTempC(Probe03) + "," + sensors.getTempC(Probe04) + ",SCROLLDATA_20");
   
}
 
void getTemp(DeviceAddress deviceAddress)
{
  float tempC = sensors.getTempC(deviceAddress);
}


If you have any other questions please feel free to ask :-)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: ChicagoJohn on Jun 17, 2017, 01:22 pm
First, thank you so much for providing this upgrade for PLX-DAQ, software I've been using in it's original form.  Now I can use it with WIN10 and 64 bit. 

On page 9 of your guide, you reference the Sub "DataReady".  I'm a novice to VBA (but trying to learn), and having gone through all of the code I am able to see in the VBA Editor for V2.11, I cannot find this subroutine.

I am creating an application involving rapid DAQ data transfer from Arduino to Excel, and I've found it necessary to disable Excel auto-calculate during data transfer to avoid crashing Excel.  So I want to add the capacity to disable it from Arduino during data transfer and then re-enable it after completion using Application Calculation = xlManual / xlAutomatic in VBA, and that is why I was searching for the sub you referenced as a place users can add commands.

As a workaround, I am thinking about designating a criterion worksheet cell which Arduino will control the value of and add VBA code in the subject worksheet to switch autocalculate contingent upon that value. 

I have not carefully read all other entries in the thread and apologize if this has already been covered. Thanks again, NetDevil, for this awesome contribution !
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jun 17, 2017, 02:00 pm
Hi John,

thanks a lot for your feedback :-) great to hear the software is in use and people get along with it.

Regarding your question you are right with the reference to DataReady on page 9, but the real reference on that page is the "CustomDevPoints". DataReady is called for each new line read by Arduino and is then checking for the common standard commands (such as DATA, BEEP, LABEL among others).

The custom DevPoints however are triggered in parallel and allow for any user desired action without effecting the standard code.

In your case, take a look at the following code in "cmdConnect_Click" routine.
Code: [Select]

'## Pass data to CustomDevPoint - if function returns "true" pass to DataReady
If (CustomDevPointLineRead(Target)) Then
   Call DataReady(Target)
End If

This code is executed every time a new line is read - and before the read information is passed to DataReady to check for the common standard codes the custom DevPoint "CustomDevPointLineRead" is called with the same information read (stored in "Target").

In "CustomDevPointLineRead" you could do something like this:
Code: [Select]

Private Function CustomDevPointLineRead(newLine As String) As Boolean

   CustomDevPointLineRead = True

   if ( newLine = "YourCommandToStopAutoCalcing" ) then
      Application.Calculation = xlManual
      CustomDevPointLineRead = False
   end if

   if ( newLine = "YourCommandToStartAutoCalcing" ) then
      Application.Calculation = xlAutomatic
      CustomDevPointLineRead = False
   end if

End Function


Setting CustomDevPointLineRead = True in the beginning will result in the function to be true and thus the data will be passed to DataReader. In case one of your commands is recognized (e.g., "YourCommandToStopAutoCalcing" or "YourCommandToStartAutoCalcing") the Excel-VBA codes are executed. Afterwards CustomDevPointLineRead is set to False because well, the data read does not need to be passed to DataReady because your code won't be recognized by DataReady anyways.

In you Arduino code you can then use:

Code: [Select]
Serial.println( (String) "YourCommandToStopAutoCalcing" );
or
Code: [Select]
Serial.println( (String) "YourCommandToStartAutoCalcing" );

The question wasn't asked yet so no worries. CustomDevPoints weren't used much until now and the chapter in the Beginners Guide isn't very complex yet. Also because using custom DevPoints isn't much of a beginners part but more rather an advanced thing ;-)

In case you have any further questions just ask, I'll be there!

Greetings

Net^Devil
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: ChicagoJohn on Jun 17, 2017, 03:06 pm
Thanks for the very unexpectedly fast reply, Net Devil !  

I understand the route you've outlined, and I'll will try to implement it.  That will be a much better solution than the one I was contemplating.

It turns out that my failure to locate the critical portions of the code was due to my unfamiliarity with VBA -- I was simply double-clicking to access object code, and when I did that for frmStampDAQ, all I got was the ActiveX graphic.  I just now tried right-clicking and selecting "view code", and as you might imagine, there it was all along !   :)

I'd been limited to using PLX-DAQ on an old netbook that has XP on it as all my other boxes run 64bit  Win10 now.  So what you've done breathes new life into this unique software, and your inclusion of capability for users to further modify your version to accommodate nuances of their projects makes it even better.    

Thanks again, and if you don't hear further from me, it means I was successful in implementing your suggested path.
================
I elected to add two Cases to the list, CALCON and CALCOFF with auto calculate normally off.  After transfer of 1200 data sets in 60 seconds, I send the "on" command, wait 3 seconds and then turn it off again to wait for the next trigger event.  Works perfect !   Your work opens up a wide range of possibilities for Arduino to effect execution of VBA code within the rich Excel environment. 
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Moki995 on Jun 18, 2017, 07:44 pm
Hello !! i need help with my code....you did really great job but i don't understand how to merge this with my code...my code is simple so please if  you can help me i need to put Voltage and sensorvalue in excel file



void setup() {
  Serial.begin(9600);
}


void loop() {
  int sensorValue = analogRead(A0);
  float SensorVoltagedc = sensorValue * (5.0 / 1023.0);
  float Voltage = SensorVoltagedc * 200;

  Serial.print("DC NAPON= ");
  Serial.println(Voltage);

  Serial.print("Napon na ulazu= ");
  Serial.println(SensorVoltagedc);

  Serial.print("Biti= ");
  Serial.println(sensorValue);

}
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jun 18, 2017, 09:58 pm
 Hi Moki995,

a simlar question has been answered by me here ==> http://forum.arduino.cc/index.php?topic=437398.msg3256213#msg3256213 (http://forum.arduino.cc/index.php?topic=437398.msg3256213#msg3256213).
Please take a look there as well as the Beginners Guide I wrote and attached to the most recent version 2.11.

In general you are still using you Arduino IDE SerialMonitor print and println commands. For PLX DAQ you must define your LABELs first, followed by each new data set having a DATA command at the beginning. It is really easy to use once you get the syntax :-)

Greetings

Net^Devil
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: ChicagoJohn on Jun 22, 2017, 10:08 pm
Serial.println("CELL,SET,G2,lvdtmin") is putting "lvdtmin" at G2, not the value stored in lvdtmin.  This syntax comes from the Beginners' Guide section 6a. 

Variants that place the value of the variable in the specified cell (as indicated earlier in the Guide):

Serial.println((String)"CELL,SET,G2," + lvdtmin);

Serial.println("CELL,SET,G2," + (String) lvdtmin)

Serial.print("CELL,SET,G2,");
Serial.println(lvdtmin);





Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: clomo on Jun 28, 2017, 08:47 pm
Hello everybody! I'm really new in Arduino. I have a project going on right now about the MPU6050 gyroscope and accelerometer sensor. I was trying to gather the data and plot in PLX-DAQ in real time but for some reason the PLX-DAQ is not showing any values in the table. Also, the values that's coming from the sensor is reading in Display direct debug window but nothing is showing up in the excel spreadsheet. I just want the raw data from coordinate x, y, z displaying and graphing realtime in excel spreadsheet. Below is my program and some screens shots. It would be a very big help if someone can help me with this one. Thank you everybody.

 #include <Wire.h>

long gyroX, gyroY, gyroZ;
float rotX, rotY, rotZ;

void setup() {
  Serial.begin(9600);
  Serial.println("CLEARDATA");
  Serial.println("LABEL,X=,Y=,Z=");

  Wire.begin();
  setupMPU();
  Serial.println("RESETTIMER");
}


void loop() {
  recordGyroRegisters();
  Serial.print("Gyro (deg/sec)");
  Serial.print(" X=");
  Serial.print(rotX);
  Serial.print(" Y=");
  Serial.print(rotY);
  Serial.print(" Z=");
  Serial.println(rotZ);
  delay(100);
}

void setupMPU(){
  Wire.beginTransmission(0b1101000); //This is the I2C address of the MPU (b1101000/b1101001 for AC0 low/high datasheet sec. 9.2)
  Wire.write(0x6B); //Accessing the register 6B - Power Management (Sec. 4.28)
  Wire.write(0b00000000); //Setting SLEEP register to 0. (Required; see Note on p. 9)
  Wire.endTransmission(); 
  Wire.beginTransmission(0b1101000); //I2C address of the MPU
  Wire.write(0x1B); //Accessing the register 1B - Gyroscope Configuration (Sec. 4.4)
  Wire.write(0x00000000); //Setting the gyro to full scale +/- 250deg./s
  Wire.endTransmission();
  Wire.beginTransmission(0b1101000); //I2C address of the MPU
  Wire.write(0x1C); //Accessing the register 1C - Acccelerometer Configuration (Sec. 4.5)
  Wire.write(0b00000000); //Setting the accel to +/- 2g
  Wire.endTransmission();
}

void recordGyroRegisters() {
  Wire.beginTransmission(0b1101000); //I2C address of the MPU
  Wire.write(0x43); //Starting register for Gyro Readings
  Wire.endTransmission();
  Wire.requestFrom(0b1101000,6); //Request Gyro Registers (43 - 48)
  while(Wire.available() < 6);
  gyroX = Wire.read()<<8|Wire.read(); //Store first two bytes into accelX
  gyroY = Wire.read()<<8|Wire.read(); //Store middle two bytes into accelY
  gyroZ = Wire.read()<<8|Wire.read(); //Store last two bytes into accelZ
  processGyroData();
}

void processGyroData() {
  rotX = gyroX / 131.0;
  rotY = gyroY / 131.0;
  rotZ = gyroZ / 131.0;
}

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jun 29, 2017, 07:45 pm
Hi clomo,

you were pretty close to get it working but you missed using the DATA command ;)
CLEARDATA is good, LABEL is correct as well. RESETTIMER is not necessary since the timer gets reset on startup anyways (but won't do no harm to call it, thus don't worry about it).

The issue is, that your loop is sending data the way a human would read it. Not in a way PLX DAQ can read it.

You should change yours:
Code: [Select]

void loop() {
  recordGyroRegisters();
  Serial.print("Gyro (deg/sec)");
  Serial.print(" X=");
  Serial.print(rotX);
  Serial.print(" Y=");
  Serial.print(rotY);
  Serial.print(" Z=");
  Serial.println(rotZ);
  delay(100);
}


into

Code: [Select]

void loop() {
  recordGyroRegisters();
  Serial.println( (String) "DATA," + rotX + "," + rotY + "," + rotZ);
  delay(100);
}


and that's it already :)
That way the line in DirectDebugWindow will read e.g., "DATA,0.21,0.06,0.08"
And that will be interpreted by PLX DAQ because of the DATA at the beginning, afterwards every value will be posted to the columns (as many columns as data is given, thus 3 columns in this case).

If you have any further questions please feel free to ask :)

Greetings!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: clomo on Jul 03, 2017, 05:21 pm
Hi clomo,

you were pretty close to get it working but you missed using the DATA command ;)
CLEARDATA is good, LABEL is correct as well. RESETTIMER is not necessary since the timer gets reset on startup anyways (but won't do no harm to call it, thus don't worry about it).

The issue is, that your loop is sending data the way a human would read it. Not in a way PLX DAQ can read it.

You should change yours:
Code: [Select]

void loop() {
  recordGyroRegisters();
  Serial.print("Gyro (deg/sec)");
  Serial.print(" X=");
  Serial.print(rotX);
  Serial.print(" Y=");
  Serial.print(rotY);
  Serial.print(" Z=");
  Serial.println(rotZ);
  delay(100);
}


into

Code: [Select]

void loop() {
  recordGyroRegisters();
  Serial.println( (String) "DATA," + rotX + "," + rotY + "," + rotZ);
  delay(100);
}


and that's it already :)
That way the line in DirectDebugWindow will read e.g., "DATA,0.21,0.06,0.08"
And that will be interpreted by PLX DAQ because of the DATA at the beginning, afterwards every value will be posted to the columns (as many columns as data is given, thus 3 columns in this case).

If you have any further questions please feel free to ask :)

Greetings!
NetDevil, I really appreciate your help! Thank you very much!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: clomo on Jul 03, 2017, 06:34 pm
Hello Netdevil, I have another problem quite similar to the one that I have above about the PLX-DAQ not reading into the excel spreadsheet. This time the code is about calculating angle in degrees in MPU 6050 I tried to do similar solution above. I added this command  "Serial.println((String)"DATA," + "/t" + "," + " ");"but the excel still not reading it. I spent few hours trying to edit the program but I just couldn't make it work. Below is the code and some screen shots. Thank you again for the assistance.


#include "Wire.h"


#include "I2Cdev.h"
#include "MPU6050.h"

// class default I2C address is 0x68
// specific I2C addresses may be passed as a parameter here
// AD0 low = 0x68 (default for InvenSense evaluation board)
// AD0 high = 0x69
MPU6050 accelgyro;

int16_t ax, ay, az;
int16_t gx, gy, gz;

#define LED_PIN 13
bool blinkState = false;

// accelerometer values
int accel_reading;
int accel_corrected;
int accel_offset = 200;
float accel_angle;
float accel_scale = 1; // set to 0.01

// gyro values
int gyro_offset = 151; // 151
int gyro_corrected;
int gyro_reading;
float gyro_rate;
float gyro_scale = 0.02; // 0.02 by default - tweak as required
float gyro_angle;
float loop_time = 0.05; // 50ms loop
float angle = 0.00; // value to hold final calculated gyro angle

// time stamp variables
int last_update;
int cycle_time;
long last_cycle = 0;

void setup() {
  // join I2C bus (I2Cdev library doesn't do this automatically)

Wire.begin();

// initialize serial communication
Serial.begin(9600);
Serial.println("CLEARDATA");
Serial.println("LABEL,DegreesC");

// initialize device
Serial.println("Initializing I2C devices...");
accelgyro.initialize();

// verify connection
Serial.println("Testing device connections...");
Serial.println(accelgyro.testConnection() ? "MPU6050 connection successful" : "MPU6050 connection failed");

// configure Arduino LED for
pinMode(LED_PIN, OUTPUT);
}

void loop(){
  // read raw accel/gyro measurements from device
  accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
  Serial.println((String)"DATA," + "/t" + "," + " ");

  // accelerometer_X_Axis angle calc
  accel_reading = ax;
  accel_corrected = accel_reading - accel_offset;
  accel_corrected = map(accel_corrected, -16800, 16800, -90, 90);
  accel_corrected = constrain(accel_corrected, -90, 90);
  accel_angle = (float)(accel_corrected * accel_scale);
  Serial.print(accel_angle);
  Serial.print("\t");
 
   
  // gyro_Y_Axis angle calc 
  gyro_reading = gy;
  gyro_corrected = (float)((gyro_reading/131) - gyro_offset);  // 131 is sensivity of gyro from data sheet
  gyro_rate = (gyro_corrected * gyro_scale) * -loop_time;      // loop_time = 0.05 ie 50ms       
  gyro_angle = angle + gyro_rate;
 
  // print values to serial monitor for checking
  Serial.print(gyro_angle);
  Serial.print("\t");
  Serial.print(" ");

   
  // blink LED to indicate activity
  blinkState = !blinkState;
  digitalWrite(LED_PIN, blinkState);
 
//timestamp
time_stamp();
}
void time_stamp(){
  while ((millis() - last_cycle) < 50){
  delay(1);
  }
  // once loop cycle reaches 50ms, reset timer value and continue
  cycle_time = millis() - last_cycle;
  last_cycle = millis();
}
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: clomo on Jul 05, 2017, 03:07 pm
I'm sorry here is the original code for calculating the angles, The code above was already been edited by me. Any help would be appreciated! Thank you again.


#include "Wire.h"

// I2Cdev and MPU6050 must be installed as libraries, or else the .cpp/.h files
// for both classes must be in the include path of your project
#include "I2Cdev.h"
#include "MPU6050.h"

// class default I2C address is 0x68
// specific I2C addresses may be passed as a parameter here
// AD0 low = 0x68 (default for InvenSense evaluation board)
// AD0 high = 0x69
MPU6050 accelgyro;

int16_t ax, ay, az;
int16_t gx, gy, gz;

#define LED_PIN 13
bool blinkState = false;

// accelerometer values
int accel_reading;
int accel_corrected;
int accel_offset = 200;
float accel_angle;
float accel_scale = 1; // set to 0.01

// gyro values
int gyro_offset = 151; // 151
int gyro_corrected;
int gyro_reading;
float gyro_rate;
float gyro_scale = 0.02; // 0.02 by default - tweak as required
float gyro_angle;
float loop_time = 0.05; // 50ms loop
float angle = 0.00; // value to hold final calculated gyro angle

// time stamp variables
int last_update;
int cycle_time;
long last_cycle = 0;

void setup() {
  // join I2C bus (I2Cdev library doesn't do this automatically)
Wire.begin();

// initialize serial communication
Serial.begin(9600);
Serial.println("CLEARDATA");
Serial.println("LABEL,Angle");
// initialize device
Serial.println("Initializing I2C devices...");
accelgyro.initialize();

// verify connection
Serial.println("Testing device connections...");
Serial.println(accelgyro.testConnection() ? "MPU6050 connection successful" : "MPU6050 connection failed");

// configure Arduino LED for
pinMode(LED_PIN, OUTPUT);
}

void loop(){
  // read raw accel/gyro measurements from device
  accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);

  // accelerometer_X_Axis angle calc
  accel_reading = ax;
  accel_corrected = accel_reading - accel_offset;
  accel_corrected = map(accel_corrected, -16800, 16800, -90, 90);
  accel_corrected = constrain(accel_corrected, -90, 90);
  accel_angle = (float)(accel_corrected * accel_scale);
  Serial.print(accel_angle);
  Serial.print("\t");
   
  // gyro_Y_Axis angle calc 
  gyro_reading = gy;
  gyro_corrected = (float)((gyro_reading/131) - gyro_offset);  // 131 is sensivity of gyro from data sheet
  gyro_rate = (gyro_corrected * gyro_scale) * -loop_time;      // loop_time = 0.05 ie 50ms       
  gyro_angle = angle + gyro_rate;
 
  // print values to serial monitor for checking
  Serial.print(gyro_reading);
  Serial.print("\t");
  Serial.print(gyro_corrected);
  Serial.print("\t");
  Serial.print(gyro_angle);
  Serial.print("\t");
  Serial.println(" ");
   
  // blink LED to indicate activity
  blinkState = !blinkState;
  digitalWrite(LED_PIN, blinkState);
 
//timestamp
time_stamp();
}
void time_stamp(){
  while ((millis() - last_cycle) < 50){
  delay(1);
  }
  // once loop cycle reaches 50ms, reset timer value and continue
  cycle_time = millis() - last_cycle;
  last_cycle = millis();
}
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: clomo on Jul 05, 2017, 03:12 pm
I figured out the answer thank you so much!!!! ^_^
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: jimdyer on Jul 07, 2017, 05:41 pm
Hello Netdevil,  I am using your software (2.10) to move data to and from arduino with success however when I run another macro that manipulates the data your macro freezes.  Is there a way that they both can run simultaneously or give control back and forth?  Using windows 7 and 32bit excel.

Thanks!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: simon_126 on Jul 11, 2017, 12:59 pm
Hey guys. Well it's been a while - nearly 2 months! But there is a new version available now! I did some groundwork and tried to tidy up a lot of code but in the end I'm just half done ... that's why I thought I might release the updates I already have and keep the rest for later ;-) And well there are quite a few new features!





What's new in "Version 2.11" aka Change log:

  • Extended DATA command by the parameter AUTOSCROLL_XY. Autoscroll will automatically scroll your Excel sheet along with each new row of data which is read and posted. XY can be replaced by any number (e.g., 20) to control how many additional lines should be shown above as well during scrolling.
  • Added a new function: GetRandom(min,max). It basically just returns a random number between min and max. Very useful if you need a random number for Arduino's randomSeed() to be initialized
  • Added several features to the direct debug window. The size can now be increased or decreased (to a certain extend), content can be cleared and you can decide what you want to log: incoming data, outgoing data, system data. Also a time stamp can be added if wanted.
  • Added a default line break after all data send to the Arduino. Thus no more delays are necessary before or after get/set calls. In order to read incoming data one should use either Serial.readStringUntil(10); or Serial.readStringUntil(10).toInt(); or Serial.readStringUntil(10).toFloat(); from now on
  • Optimized the way Excel processes multiple incoming lines of data for better performance
  • There are some new parameters which can be changed on the (hidden) settings sheet in Excel. Those "Expert Configs" should be handled with care. They are about the buffer sizes for your COM port. In case you decide to spam massive amount of data to Excel and increase the baud rate you might experience data loss. Try increasing the buffer sizes then.
  • Added a "PowerDemos" directory with some nice (at least I think so) demos. First demo is a moving self updating graph visualizing data from the Arduino.
  • Updated the Beginners Guide to reflect all new commands - and optimized the formatting as well
  • Updated the default sketch to include the new commands

Backlog for next version(s):
  • find a solution for Excel crashing when moving the window around while logging. Priority: low ; Workaround: don't move window while logging ; Status: clueless...
  • Double check if issue above existed in PLX DAQ v1 as well. In case yes => we are screwed
  • Rework API calls and general COM port communication handling for better stability. Very promising example to be found here (http://michael-schwimmer.de/vba117.htm). Works with up to 2.000.000 baud

Guideline to migrate from old version to new one ==> see Beginners Guide attached


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


(http://www.freebie-base.de/Pics/PLX_DAQ_v2.11.png)
Can you please fix the links. None of them is working.
Thanks in advance
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jul 11, 2017, 01:06 pm
Can you please fix the links. None of them is working.
Thanks in advance
Hi Simon,

what links aren't working exactly? The one's to the image is working correctly ( http://www.freebie-base.de/Pics/PLX_DAQ_v2.11.png (http://www.freebie-base.de/Pics/PLX_DAQ_v2.11.png) ) as does the link to the "promising example".

Do you mean the underlined words and sentences in the text? Those are no links but just highlighted text to better show the most significant changes in the new version.

Explainations to the new features can most likely be found in the Beginners Guide (see Post here (http://forum.arduino.cc/index.php?topic=437398.msg3251256#msg3251256) for most recent version in the attachments)

Greetings
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Alejandro561 on Jul 11, 2017, 08:49 pm
Hi, I have a problem with the v2.11, I have Windows 10, Excel 2016, when I clic Connect, after a while Excel stops and close.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jul 12, 2017, 06:41 am
Hi, I have a problem with the v2.11, I have Windows 10, Excel 2016, when I clic Connect, after a while Excel stops and close.
Hi Alejandro,

could you give me a bit more detail? Are you already sending data from your Arduino to PLX DAQ? Is incoming data shown in the DirectDebug window? Is data being posted to Excel sheet already? And (maybe most important) what baud rate are you using?
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: simon_126 on Jul 12, 2017, 07:15 am
Hi Simon,

what links aren't working exactly? The one's to the image is working correctly ( http://www.freebie-base.de/Pics/PLX_DAQ_v2.11.png (http://www.freebie-base.de/Pics/PLX_DAQ_v2.11.png) ) as does the link to the "promising example".

Do you mean the underlined words and sentences in the text? Those are no links but just highlighted text to better show the most significant changes in the new version.

Explainations to the new features can most likely be found in the Beginners Guide (see Post here (http://forum.arduino.cc/index.php?topic=437398.msg3251256#msg3251256) for most recent version in the attachments)

Greetings
I have tried many times to download PLX DAQ v2.11, 16 to be correct. Right at the end, it says file corrupted, couldn't be downloaded and etc. I really need that scroll down function and much more that you implemented to the original one. Please if that is possible reupload install files or upload them on another server. For the time you are the only distributor of it.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jul 12, 2017, 07:36 am
I have tried many times to download PLX DAQ v2.11, 16 to be correct. Right at the end, it says file corrupted, couldn't be downloaded and etc. I really need that scroll down function and much more that you implemented to the original one. Please if that is possible reupload install files or upload them on another server. For the time you are the only distributor of it.
Hi Simon,

the download is working fine for me, same for unpacking the zip file.
Nevertheless I uploaded the latest version here as well => http://freebie-base.de/Stuff/PLX-DAQ-v2.11.zip (http://freebie-base.de/Stuff/PLX-DAQ-v2.11.zip) <=
Please post feedback whether it is working or not.
Thanks.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: el_supremo on Jul 12, 2017, 05:18 pm
FYI: I don't have any problem with either link.

Pete
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: simon_126 on Jul 17, 2017, 12:20 pm
First of all, problem regarding link was my mistake at the office Kerio Control was ignoring download. When I tried download PLX from URLs everything was just perfect.
But second problem may be I am doing wrong can't get cell info from excel.

  Serial.println("CELL,GET,B3,");
cell_num=Serial.read();// this command reads the sell value from the specified cell

//now return this namber to EXCELL:
Serial.print("DATA,TIME,");
Serial.print(bla);
bla=random(1,100);
Serial.print(",");
Serial.print(cell_num);
Serial.print(",");

But in excel instead og providing info from B3 cell it just prints in consequent columns GET CELL B3

What I am doing wrong. Really need your help
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: dummy55555 on Jul 18, 2017, 08:00 pm
Hi guys, I need a little help here. I tried the default sketch given and together with the latest PLX-DAQ version 2.11. I noticed that the AUTOSCROLL is not functioning. The excel does not scroll automatically when new data received. I am using Office Excel 2007. Can anyone guide me? Thanks
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jul 19, 2017, 07:04 am
But second problem may be I am doing wrong can't get cell info from excel.

Code: [Select]

Serial.println("CELL,GET,B3,");
cell_num=Serial.read();// this command reads the sell value from the specified cell

//now return this namber to EXCELL:
Serial.print("DATA,TIME,");
Serial.print(bla);
bla=random(1,100);
Serial.print(",");
Serial.print(cell_num);
Serial.print(",");

But in excel instead og providing info from B3 cell it just prints in consequent columns GET CELL B3
Hi Simon,

your code needs some rework.
First of all, make sure to end your commands to PLX DAQ with "println" instead of "print". Plus there is no need to add a final "," at the end of the statement.
And you use the variable "bla" before assigning a random value to it, better to switch it around ;-)

My rework suggestion is:

Code: [Select]

Serial.println("CELL,GET,B3"); // <= remove ","
cell_num= Serial.readStringUntil(10).toInt(); // <= new read function


Serial.print("DATA,TIME,");
bla=random(1,100); // <= switched command
Serial.print(bla); // <= switched command
Serial.print(",");
Serial.println(cell_num); // <= changed to "println"
//Serial.print(","); <<== ignore
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jul 19, 2017, 07:16 am
Hi guys, I need a little help here. I tried the default sketch given and together with the latest PLX-DAQ version 2.11. I noticed that the AUTOSCROLL is not functioning. The excel does not scroll automatically when new data received. I am using Office Excel 2007. Can anyone guide me? Thanks
Hi dummy,

sorry to say but the scroll function was added in Office 2013. Therefore no scrolling is possible in your version 2007...

I googled the issue and there was a dirty workaround in earlier versions of Excel. If you are familiar with Excel / VBA please try pressing Alt+F11 to open the code editor, search for the AUTOSCROLL part and replace with the following:

Code: [Select]

'## Check for AUTOSCROLL command and handle
If (InStr(1, UCase(DataVal(x)), "AUTOSCROLL_", vbBinaryCompare) >= 1) Then
    DontPostDataThisIteration = True ' Autoscroll will not be posted to sheet
    If (ActiveSheet.Name = WStoUse.Name) Then
        '## Autoscroll command checks should only be done if the currently active sheet is the sheet where data is pasted to
        '## Autoscroll command was added in Office 2013 (version 15.0) - dont use for earlier versions)
        Dim offset As String
        offset = Trim(Mid(DataVal(x), InStr(1, DataVal(x), "AUTOSCROLL_", vbBinaryCompare) + Len("AUTOSCROLL_"))) 'get value right side of "AUTOSCROLL_"
        If (IsNumeric(offset)) Then
            If ((row - offset) >= 1 And (row - offset) <= ActiveSheet.Rows.Count) Then 'if row - offset is too low (< 0) or too high ( > max row possible) set to row
                Application.Goto Range("A" & Range("A" & Rows.Count).End(xlUp).row - offset)
            Else
                Application.Goto Range("A1")
            End If
        End If
    End If
End If


I was not able to check the full code, however the workaround should basically work (it does with Excel 2013 on my PC).

Would be great to get some feedback from you

Greetings
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: dummy55555 on Jul 20, 2017, 12:25 pm
Hi NetDevil,

The code works in excel 2007.
THanks alot for your help.  :) 
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: KTVK on Aug 03, 2017, 03:55 pm
Hi, thanks for the really useful DAQ.

I'm having trouble sampling data every 100 ms (well I'm in fact sampling 4 signals). Is there a limit to that?


I've tried increasing the data rate to 128000 (instead of the default 9600 in the original file I had) thinking that it would do the trick but Excel just crashes. I get a feeling that when it does crash it's because the data is not being written at the specified rate (here 10 Hz).


I'm using a 2013 version of Excel on a Win 7 64 bits system.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: GijKieken on Aug 03, 2017, 10:10 pm
Hi Netdevil,
I used to work with version1 and somewhat altered the code to my needs.(Win7,WinVista,WinXp)
Now I downloaded your latest version (Win7 Home 64bits Excel2007), everything works fine.
Had some issue with Cell,Set ,but by reading the posts solved the problem.
Just to let you know, great job you have done.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: EvilKnivel on Aug 09, 2017, 09:47 am
Hello,

using this software as well... I've modified the VBA user interface for my needs and add some extra serial commands but the core of the software isn't modified. It works absolute perfect! Thanks a lot for this great work - really fun to work with! :)

I observe, that every time I push the "connect" button and the program starts to read values that the laptop fan starts to run on really high rpm... noisy.
Never hear the fan when I do even big calculation jobs or something else, which has high CPU charge to capacity.

Unfortunately I didn't check the Task manager jet how resources look like while connected to COM port.

Anyway, did some else observe that as well? Any idea why?

Kind regards

Christoph

(Win10 64bit; 4GB RAM, 3Ghz 4Core CPU, Excel 2016, PLX DAQ v2.11 mod user interface & add. Serial commands)

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Aug 09, 2017, 10:42 am
Hi folks,

sorry for now getting back to you more early ... I am heavy busy at the moment and it does not look like there will be any relief anytime soon ... nevertheless it is a good kind of busy  ;) I just not got the time to care for PLX DAQ at the moment  :smiley-cry:

@dummy55555: good to hear, thanks for the feedback!

@GijKieken: you're welcome  :smiley-red: nice to know Excel 2007 is working as well!

@EvilKnivel: could you maybe upload screenshots of your UI ? I would be interested to see what you optimized. I am not familiar with UI layout, so there might be a lot to improve :-) The CPU fan issue I haven't experienced myself yet - although I am working on a desktop PC most of the time where it is harder for me to notice these kind of things. But Excel with for-loops (even with DoEvent included) produces heavy loads, that's unfortunately normal I guess ... There is one loop to check for new full-read inputs (sentences) and one loop to check the COM port for new bits and bytes and concat them to form new sentences.

@KTVK: there are issues with reading data at higher baud rates then 9600 that's true. I had ideas of optimizing the system and had success on sampling about 100.000 data per second (at over 2.000.000 baud) but never got it working in real PLX DAQ .... 10 samples per second (thus every 100ms) should be possible nevertheless with 9600 baud as well. I think my highest measure was 20 samples a second with 9600 baud. Are you sure your code is good? Could you post it maybe?


Please allow a few days for me to revert to your posts since ... well ... busy.

Sorry once more and have fun with the software :-)

Greetings
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: GijKieken on Aug 09, 2017, 11:48 am
Hi NetDevil,

Maybe in the future something you could implement in a new update for then convenience of working.
It would be nice when you swith between Simple Data (the first worksheet) and other Further sheets
(no matter what name you give to them) to automaticaly hide the Form (PLX-DAQ for Excel "Version 2" by Net^Devil).
So in the event of opening an other sheet than the first workSheet, you could set <form.visible = false>

Greetings, Gij Kieken
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: EvilKnivel on Aug 09, 2017, 12:11 pm
Picture of my UI is attached but will not help to otimze the "normal" UI.

I will use PLX-DAQ (under developement) for an Arduino based time measurement system (already exist but w/o data logging) we use for RC race plane competitions.

We can directly see on the UI the laptimes per pilot (three race against each other) as well as offense per lap etc... So it's very unique. Sorry.

Tonight I will check CPU usage etc before and while logging... lets see ;)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: ThisIsFun on Aug 10, 2017, 01:28 am
Hello all,

Special thanks to NetDevil for the awesome work!

I'm using PLX-DAQ version 2 to read temperature data from four ds18b20 temp sensors. I've modified the default sketch to collect data from all 4 sensors but when I hit connect on the spreadsheet UI only 3 of the 4 sensor data are displayed. See the attached image for reference.

I've double checked that the device address for probe 4 is correct. I'm a total beginner and would appreciate some help on getting all of the temp data to show up!

Here's my code!

Code: [Select]
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS_PIN 2

OneWire oneWire(ONE_WIRE_BUS_PIN);
DallasTemperature sensors(&oneWire);
 
DeviceAddress Probe01 = { 0x28, 0x94, 0x72, 0xA7, 0x04, 0x00, 0x00, 0x2C }; // 1
DeviceAddress Probe02 = { 0x28, 0x8C, 0xB6, 0xA8, 0x04, 0x00, 0x00, 0x71 }; // 2
DeviceAddress Probe03 = { 0x28, 0x27, 0x6C, 0xA7, 0x04, 0x00, 0x00, 0xAC }; // 3
DeviceAddress Probe04 = { 0x28, 0x95, 0xD0, 0xA7, 0x04, 0x00, 0x00, 0xAB }; // 4

 int i = 0;

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 9 columns named "Date", "Time", "Timer", "Counter" and "millis"
    Serial.println("LABEL,Date,Time,Timer,Counter,millis,Temp1,Temp2,Temp3,Temp4");

  // 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 2 of the 3 checkboxes (first two to true, third to false)
    Serial.println("CUSTOMBOX1,SET,1");
    Serial.println("CUSTOMBOX2,SET,1");
    Serial.println("CUSTOMBOX3,SET,0");

    sensors.begin();
    sensors.setResolution(Probe01, 10);
    sensors.setResolution(Probe02, 10);
    sensors.setResolution(Probe03, 10);
    sensors.setResolution(Probe04, 10);
}

void loop() {

    sensors.requestTemperatures();
    getTemp(Probe01);
    getTemp(Probe02);
    getTemp(Probe03);
    getTemp(Probe04);

   
    // simple print out of number and millis. Output e.g.,: "DATA,DATE,TIME,TIMER,4711,13374,AUTOSCROLL_20"
      Serial.println( (String) "DATA,DATE,TIME,TIMER," + i++ + "," + millis() + sensors.getTempC(Probe01) + "," + sensors.getTempC(Probe02) + "," + sensors.getTempC(Probe03) + "," + sensors.getTempC(Probe04) + ",AUTOSCROLL_20" );
      // alternative writing method:
        /* Serial.print("DATA,DATE,TIME,TIMER,");
        Serial.print(i++); Serial.print(",");
        Serial.println(millis());
        Serial.print(","); Serial.println("SCROLLDATA_20"); */

    // clear some cells in Excel (rectangle range from B10 to D20)
      if(i==100)
        Serial.println("ClearRange,B,10,D,20");

    // do a simple beep in Excel on PC
      if(i==150)
        Serial.println("BEEP");

    // read a value (in this case integer) from Excel (from a sheet by name)
      if(i==200)
      {
        Serial.println("CELL,GET,FROMSHEET,Simple Data,E,4"); // ==> request value from sheet
          // Serial.println("CELL,GET,E4"); ==> short version to read from active sheet in Excel
        int readvalue = Serial.readStringUntil(10).toInt(); // get response. Note: the '10' is important! Always use but never change ;-)
        Serial.println( (String) "Value of cell E4 is: " + readvalue); // result displayed in Excel DirectDebugWindow to double check
      }

    // check value of custombox1 on PLX DAQ in Excel and if
    // checkbox is checked then send the command to pause logging
      if(i==250)
      {
        Serial.println("CUSTOMBOX1,GET");
        int stoplogging = Serial.readStringUntil(10).toInt();
        // this information can be seen in the direct debug window on PLX DAQ in Excel
        Serial.println( (String) "Value of stoplogging/checkbox is: " + stoplogging);
        if(stoplogging)
          Serial.println("PAUSELOGGING");
      }

    // get a true random number from the computer
      if(i==300)
      {
        Serial.println("GETRANDOM,-4321,12345"); // between -4321 to 12345
        int rndseed = Serial.readStringUntil(10).toInt();
        Serial.println( (String) "Got random value '" + rndseed + "' from Excel" );
        // Note: this information is not posted to the Excel sheet because "DATA" is missing
        // instead this information can be seen in the direct debug window
      }

    // and now resume logging
      if(i==350)
      {
        Serial.println("CUSTOMBOX2,GET");
        int resumelogging = Serial.readStringUntil(10).toInt();
        if(resumelogging)
          Serial.println("RESUMELOGGING");
      }   

    // post to specific cells on default sheet as well as named sheet
      if(i==400)
      {
        Serial.println("CELL,SET,G10,400 test 1 string"); // default sheet active in PLX DAQ Excel
        Serial.println("CELL,SET,ONSHEET,Simple Data,G,11,400 test 2 string"); // named sheet available in PLX DAQ Excel
      }
       
    // and for forced quit of Excel with saving the file first
      if(i==450)
      {
        Serial.println("CUSTOMBOX3,GET");
        if(Serial.readStringUntil(10).toInt()) {
          Serial.println("SAVEWORKBOOKAS,450-Lines-File");
          Serial.println("FORCEEXCELQUIT");
        }
        else
          Serial.println("No forced Excel quit requested!");
      }
}

void getTemp(DeviceAddress deviceAddress)
{
  float tempC = sensors.getTempC(deviceAddress);
}
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: GijKieken on Aug 10, 2017, 04:46 pm
Hi, ThisIsFun
I think there is a comma missing in the loop at

 Serial.println( (String) "DATA,DATE,TIME,TIMER," + i++ + "," + millis() + sensors.getTempC(Probe01) + "," + sensors.getTempC(Probe02) + "," + sensors.getTempC(Probe03) + "," + sensors.getTempC(Probe04) + ",AUTOSCROLL_20" );

between millis() and sensors.getTempC(Probe01)

Greetings,
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Aug 10, 2017, 04:55 pm
GijKieken is right.

You see only three sensor temperatures, but that doesn't mean that number 4 is wrong => it is number 1 that is wrong.

Your column millis shows values like 1338824 - that is way more milliseconds then your Arduino is already running => it is millis + sensor1 value.

Stripped down to the necessary (and included the missing comma before probe1) your code should look like this:

Code: [Select]
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS_PIN 2

OneWire oneWire(ONE_WIRE_BUS_PIN);
DallasTemperature sensors(&oneWire);
 
DeviceAddress Probe01 = { 0x28, 0x94, 0x72, 0xA7, 0x04, 0x00, 0x00, 0x2C }; // 1
DeviceAddress Probe02 = { 0x28, 0x8C, 0xB6, 0xA8, 0x04, 0x00, 0x00, 0x71 }; // 2
DeviceAddress Probe03 = { 0x28, 0x27, 0x6C, 0xA7, 0x04, 0x00, 0x00, 0xAC }; // 3
DeviceAddress Probe04 = { 0x28, 0x95, 0xD0, 0xA7, 0x04, 0x00, 0x00, 0xAB }; // 4

 int i = 0;

void setup() {

    Serial.begin(9600);

    Serial.println("CLEARSHEET");
    Serial.println("LABEL,Date,Time,Timer,Counter,millis,Temp1,Temp2,Temp3,Temp4");


    sensors.begin();
    sensors.setResolution(Probe01, 10);
    sensors.setResolution(Probe02, 10);
    sensors.setResolution(Probe03, 10);
    sensors.setResolution(Probe04, 10);

}

void loop() {

    sensors.requestTemperatures();
    getTemp(Probe01);
    getTemp(Probe02);
    getTemp(Probe03);
    getTemp(Probe04);


    Serial.println( (String) "DATA,DATE,TIME,TIMER," + i++ + "," + millis() + "," + sensors.getTempC(Probe01) + "," + sensors.getTempC(Probe02) + "," + sensors.getTempC(Probe03) + "," + sensors.getTempC(Probe04) + ",AUTOSCROLL_20" );


}

void getTemp(DeviceAddress deviceAddress)
{
  float tempC = sensors.getTempC(deviceAddress);
}
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: ThisIsFun on Aug 10, 2017, 05:41 pm
GijKieken and NetDevil,

Thank you for the help guys!  :D 
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Ardweeb on Aug 25, 2017, 01:31 am
Hello all,

First of all, thanks for keeping PLX-DAQ up to date NetDevil!

I've been reading this forum trying to figure out how to use a temperature sensor with PLX-DAQ, but I haven't been able to make the link. I was hoping someone could help me bridge the gap!

Here's what I have:


Code: [Select]
const int temperaturePin = 0;


void setup()
{
 Serial.begin(9600);
 
 Serial.println("CLEARDATA");
 Serial.println("Date,Time,Voltage,deg C,deg F");
}


void loop()
{
 

 float voltage, degreesC, degreesF;


 voltage = getVoltage(temperaturePin);
 
 degreesC = (voltage - 0.5) * 100.0;
 
 degreesF = degreesC * (9.0/5.0) + 32.0;
 
 
 Serial.println( (String) "DATE,TIME," + voltage + "," + degreesC + "," + degreesF );

 delay(1000);
}


float getVoltage(int pin)
{
 
 
 return (analogRead(pin) * 0.004882814);
 
}
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: perigalacticon on Aug 25, 2017, 09:47 pm
Hello, I found PLX-DAQ and it's exactly what I've been looking for for debugging.  How fast should I expect to be able to log data?  Using your example I've found I need between 100-200 msec delay between logs otherwise excel disappears!  I am using Office 2017 on Win10 64bit Pro with an Uno at 9600 BAUD.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: perigalacticon on Aug 28, 2017, 01:57 am
Hello, is there a way to specify the excel cell address for GET and SET commands as variables?  Such as:

Original:
Serial.println("CELL,SET, ONSHEET,AnySheet,C,9,MyValue");

Variable Cell Address:
Serial.println("CELL,SET, ONSHEET, AnySheet, CollumnAddress, RowAddress, MyValue");

?
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: el_supremo on Aug 28, 2017, 02:17 am
You could write the command in pieces such as in this untested snippet:
Code: [Select]
char CollumnAddress = 'C';
int RowAddress = 19;
int MyValue = 42;
.
.
.
Serial.print("CELL,SET, ONSHEET, AnySheet, ");
Serial.write(CollumnAddress);
Serial.print(", ");
Serial.print(RowAddress);
Serial.print(", ");
Serial.println(MyValue);


In theory, this will write 42 into cell C19.

(Collumn should be Column)

Pete
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: perigalacticon on Aug 28, 2017, 02:33 am
Ok but what if I want to to an array-fill in excel from an Arduino for loop, or get the column number from some calculations and I need to use a number for the column instead of a letter.  Can excel somehow accept a number for the column address??
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: el_supremo on Aug 28, 2017, 02:52 am
You'll have to do add some code in the for loop to generate the correct column name. e.g. if CollumnAddress=27, convert it to "AA" and send that.

Pete
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: perigalacticon on Aug 29, 2017, 11:47 pm
Yes but I think this can also be done easily in Excel VBA if I remember correctly there is a cell(X,Y) method that could be utilized.  Anything to reduce the arduino sketch size!  P.S. other arduino to excel programs can do this.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Aug 30, 2017, 03:17 pm
Hi there,
sorry for not getting into the communication more early.

@Ardweeb: basically your code looks right. Is it working when using the SerialMonitor in Arduino IDE? What does the DirectDebugWindow in PLX DAQ show? You could although change your
Code: [Select]
Serial.println("Date,Time,Voltage,deg C,deg F"); to
Code: [Select]
Serial.println("LABEL,Date,Time,Voltage,deg C,deg F"); This will give you correct column headings

@perigalacticon: I generally suggest to use PLX DAQ with 9600 baud only. At that rate I was able to log without any delays in the code and thus received about 20 samples per second. Tested on a slightly older computer with Office 2013 at Windows 7 and an UNO as well.

@perigalacticon (second post): "P.S. other arduino to excel programs can do this" - show me  ;)
PLX DAQ can do as well by the way. "CELL,SET,ONSHEET" utilizes VBA code
Code: [Select]
Sheets(DataVal(3)).Cells(DataVal(5), DataVal(4)).Value = ReplaceData(DataVal(6)) With this 'Cells(row,column).Value' I can either use 'Cells(19,"C").Value' or I can use 'Cells(19,3).Value' which will both fill the same cell. Give it a try.

@Pete: thank you for responding to the post :)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Ardweeb on Aug 30, 2017, 05:09 pm
SerialMonitor is working fine and gives the following:

LABEL,Date,Time,Voltage,deg C,deg F
DATE,TIME,0.79,29.10,84.38
DATE,TIME,0.80,29.59,85.26
DATE,TIME,0.80,29.59,85.26
DATE,TIME,0.80,29.59,85.26
DATE,TIME,0.80,29.59,85.26
DATE,TIME,0.80,29.59,85.26


The DirectDebugWindow in PLX DAQ seems fine as well and displays the attached image below.

The issue is that the data is not registering on Excel.

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Aug 30, 2017, 09:10 pm
The DirectDebugWindow in PLX DAQ seems fine as well and displays the attached image below.

The issue is that the data is not registering on Excel.
On the screenshot the button "Resume logging" suggests, that you paused the logging? You are only pressing "connect", right? Is nothing shown in Excel?
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Ardweeb on Aug 31, 2017, 12:05 am
I was toggling the settings. Pressing "pause logging/resume logging" has no affect. I am only pressing "connect" when I initially begin. The titles display, but the data is not showing up. See attached image.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Aug 31, 2017, 10:13 pm
OOOOOOOH BOY IT JUST HIT ME !!!

Looks like you forgot the "DATA" before "DATE"  :D  :D

Correct syntax is:
Code: [Select]
Serial.println( (String) "DATA,DATE,TIME," + voltage + "," + degreesC + "," + degreesF );
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Ardweeb on Aug 31, 2017, 10:41 pm
Perfect! Thank you so much for the help NetDevil!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: tonypaul57 on Sep 01, 2017, 04:29 am
Thank you so much!
I'm rookie and it's help me a lot!
But there is something I don't know, how to modify the com port in mac office 2016, there is no com port number, in Mac the port only show "/dev/cu.usbmodem1421".
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Sep 01, 2017, 08:32 am
But there is something I don't know, how to modify the com port in mac office 2016, there is no com port number, in Mac the port only show "/dev/cu.usbmodem1421".
well ... I don' own a Mac and therefore cannot provide any support for that - but you could maybe try to unhide the settings sheet on Excel (I hid it by default) and manually add your port number in there in the correct cell (will be labeled). Might be that Excel on Mac translates that number to the correct address? Sorry, but that is all I can suggest.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: perigalacticon on Sep 03, 2017, 09:05 pm
- show me  ;)
Well I hate to advertise for a competitor on your thread, but if you search for Arduino Excel you can see it.  Sometimes it's better to take a break and keep testing than to post your problems I guess!  Thanks!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: adwsystems on Sep 11, 2017, 02:40 pm
@NetDevil, question for you. Since PLX-DAQ takes control of the comport, nothing else can send or receive data while it is connected. Have you considered adding the ability to send data to the Arduino from a text box?

Currently the only way I understand to send data to the attached Arduino is for it to request data from excel. Otherwise there is basically no data going from the PC to the Arduino. This would allow the ability to connect and then send a command from the text box to start/pause/resume/stop data logging (or any other command the user wished to enter into PLX-DAQ that they have programmed in their Arduino sketch).
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Toinedrd on Sep 12, 2017, 03:57 pm
Hello everyone,

I'm an arduino beginner trying to collect datas from a MPU 6050 sensor to work with excel. I'm using Jeff Rowberg's code and the serial monitor is working correctly. I also managed to make things work with the 2007 version of excel but for some reasons I have to make it work on the 2013 version, (windows 7). Sadly, when I click on the "connect" button on the 2013 excel version, it almost directly stops the arduino working. I was able to determine that with a check led on the arduino.
Do you have an idea what it might be?

Thank you in advance, have a good day!

Antoine

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: GijKieken on Sep 12, 2017, 07:09 pm
It should work propely,check the Baud-rate and port settings.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Sep 12, 2017, 07:45 pm
@adwsystems: you are right, there is only that one option to send data from PLX DAQ to Arduino. I haven't had any other use case ; yet. Attached you can find a special version of 2.11 with a new text field to send data to Arduino (please expand DirectDebugWindow to fully see the field + button + label). It only works while being connected (obviously  :D ). Give it a try and I might add the same (in beautiful) to the next release. I might add two or three text fields at the same time thus one can post different pre-defined commands more rapidly.

@Toinedrd: never had that kind of issue before. But: during connection establishment PLX DAQ resets the Arduino by default. This can be disabled by unchecking the box "Reset on Connect" on the UI. Keep in mind that you will have your Arduino start in the middle of the loop function, thus no "LABEL" or "CLEARSHEET" written in main function will be read. Also the first data received might be corrupted. But if it works you know your code might be buggy. Did you try with a really simple one like only posting numbers to Serial.println ?
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: ianthetraveller on Sep 12, 2017, 11:13 pm
Just a big thankyou it works well.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: adwsystems on Sep 13, 2017, 03:22 am
@adwsystems: you are right, there is only that one option to send data from PLX DAQ to Arduino. I haven't had any other use case ; yet. Attached you can find a special version of 2.11 with a new text field to send data to Arduino (please expand DirectDebugWindow to fully see the field + button + label). It only works while being connected (obviously  :D ). Give it a try and I might add the same (in beautiful) to the next release. I might add two or three text fields at the same time thus one can post different pre-defined commands more rapidly.
Works Great! I have just the simplest commands setup ('start' and 'end') in the Arduino. I can issue the start command to begin the data log transfer, and end command to stop the transfer. The Arduino does not need to be reset in order to synchronize the start/stop of the transfer and avoids any data corruption due to the port being opened without the reset on connect.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: ianthetraveller on Sep 13, 2017, 04:49 pm
Many thanks NetDevil -- works really well. Appreciated.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Miniunder on Sep 26, 2017, 10:57 am
Hello everybody. I'm a rookie in the Arduino world and I had a question. I have a pH meter that works perfectly. I want to pass the data to Excel with PLX-DAQ V2. I have been able to name the columns ... etc, but I can not get the pH value out of the pH column. Can you help me? Thank you very much. I leave the code:

Code: [Select]

String inputstring = "";  
String sensorstring = "";                            
boolean input_string_complete = false;                
boolean sensor_string_complete = false;              
float sensortring;
                                            
int LABEL = 1;
void setup() {                                        
  Serial.begin(9600);    
  Serial3.begin(9600);                                
  Serial.println("CLEARDATA");
  Serial.println("LABEL,pH,TIMER");
  inputstring.reserve(10);                            
  sensorstring.reserve(30);                          
}

void serialEvent() {                                  
  inputstring = Serial.readStringUntil(13);          
  input_string_complete = true;                      
}


void serialEvent3() {                                
  sensorstring = Serial3.readStringUntil(13);        
  sensor_string_complete = true;                      
}


void loop() {                                        

  if (sensor_string_complete == true) {              
    Serial.println(sensorstring);
    Serial.println((String)"DATA,,TIME");
    delay(100);                                      
  }
  sensorstring = "";                                  
  sensor_string_complete = false;                    
}


(http://<a href="https://ibb.co/gXUQpQ"><img src="https://preview.ibb.co/jVxZik/sdfsdf.png" alt="sdfsdf" border="0" /></a>)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Sep 26, 2017, 11:36 am
Hi miniunder,

Nearly perfect, but you placed the variables in the wrong order for printing. Also you didn't do it in 1 command but in 2.

Correct world be:

Code: [Select]

if (sensor_string_complete == true) {               
    Serial.println((String)"DATA," + sensorstring + ",TIME");
    delay(100);                                       
  }


Notice how the sensorstring now is part of the single serial.println command and how all three commands (data / sensorstring / time) are divided by a comma.

I'm not at my computer thus I wasn't able to test the code, but I think it should work. In case not just post a reply.

Greetings
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Miniunder on Sep 26, 2017, 04:14 pm
Yes, it works!!!! Thanks you so much NetDevil!!!!

Hi miniunder,

Nearly perfect, but you placed the variables in the wrong order for printing. Also you didn't do it in 1 command but in 2.

Correct world be:

Code: [Select]

if (sensor_string_complete == true) {               
    Serial.println((String)"DATA," + sensorstring + ",TIME");
    delay(100);                                       
  }


Notice how the sensorstring now is part of the single serial.println command and how all three commands (data / sensorstring / time) are divided by a comma.

I'm not at my computer thus I wasn't able to test the code, but I think it should work. In case not just post a reply.

Greetings
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Miniunder on Sep 27, 2017, 02:38 pm
Hi again, everybody. I wanted to add a K-type thermocouple with MAX 31856 to my program. I included the library in the previous program and added the function to read (or so I think). The case is that the command of the PLX I have not put it well ... can you help me please? I leave the code:
Code: [Select]
#include <Adafruit_MAX31856.h>
Adafruit_MAX31856 max = Adafruit_MAX31856(10, 11, 12, 13);
String inputstring = "";   
String sensorstring = "";                             
boolean input_string_complete = false;               
boolean sensor_string_complete = false;               
float sensortring;
                                             
int LABEL = 1;
void setup() {
                                 
  Serial.begin(9600);     
  Serial3.begin(9600);                               
  Serial.println("CLEARDATA");
  Serial.println("LABEL,pH,TEMP,TIMER");
  inputstring.reserve(10);                           
  sensorstring.reserve(30);
  max.begin();

  max.setThermocoupleType(MAX31856_TCTYPE_K);                         
}

void serialEvent() {                                 
  inputstring = Serial.readStringUntil(13);           
  input_string_complete = true;                       
}


void serialEvent3() {                                 
  sensorstring = Serial3.readStringUntil(13);         
  sensor_string_complete = true;                     
}


void loop() {                                         

if (sensor_string_complete == true) {               
    Serial.println((String)"DATA," + sensorstring + ", + (max.readThermocoupleTemperature) + ,TIME," );
    delay(1000);                                                                           
  }
  sensorstring = "";                                 
  sensor_string_complete = false;                     
}


Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Sep 27, 2017, 03:29 pm
Hi miniunder,

well this time I won't help your directly but just point out, that your mistake is, that you included your readThermocoupleTemperature in the string, not as a variable.

Running your code please take a look at the DirectDebugWindow in PLX DAQ and you well see the difference between the sensorstring and the readThermocoupleTemperature both used in your serial.println command ;)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Miniunder on Sep 28, 2017, 01:55 pm
ok. It works!!! Thanks you so much!!!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Bride on Sep 29, 2017, 09:07 am
Hi Guys,

How can I auto save the spreadsheet when the time is equal to 07:00 AM.
How do you use the tick boxes, can they be used to do a auto save when selected?
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Bride on Sep 29, 2017, 09:12 am
Hi Guys,

How do I Auto save the spread sheet when the time is equal to 07:00 AM.

Is that what the tick boxes is for?

How do you use them.


Regards

Bride
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Sep 29, 2017, 11:13 am
How can I auto save the spreadsheet when the time is equal to 07:00 AM.
How do you use the tick boxes, can they be used to do a auto save when selected?
Hi Bride,
the tick boxes can be used for whatever you want them to be used. But: it is only good for controlling your Arduino. Via Ardunio you can set the label of the boxes, check/uncheck each box and get the status of each box (is checked / is not checked). Therefore you could name a box e.g. "pause every 100 samples", and check its status via Arduino every 10 seconds to see if the user on the PC checked the box and in case yes use a counter on Arduino to count to 100 and do a pause.

For your purpose I would suggest to use the CustomDevPoints (have a look at the Beginners Guide please). Each time data is read by PLX DAQ the custom DevPoint is triggered. In there you could use some VBA code to save the workbook if the time is equal to 07:00 AM.
On the other hand you could also use the SAVEWORKBOOK command from Arduino (via Serial.println) but you won't have the current time on your Arduino (only milliseconds since start via millis() ...).

Better to go for the CustomDevPoint and some VBA code.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: GijKieken on Oct 04, 2017, 12:19 am
Hi NetDevil
I somehow somewhere can not figure out how this piece of code works?

Code: [Select]

Private Sub clearData()
    WStoUse.Range("A2:" & Split(WStoUse.UsedRange.Address, ":", , vbBinaryCompare)(1)).NumberFormat = "General"
    WStoUse.Range("A2:" & Split(WStoUse.UsedRange.Address, ":", , vbBinaryCompare)(1)).Value = Null
End Sub

My aim is to clear only colums A B C D (Data logging four channels),the count of columns determined in function <countChar>,
because I manualy fill in data in cells E2 F2 and H2 which I want to keep if I press Clear Columns.

However I can solve my problem when I search for the last row in the active sheet and then do a resize, but I guess this is not a proper solution?
I do understand the individual things like WStoUse , UsedRange and the Split function, but can not figure out how to alter the code to my needs.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Oct 05, 2017, 05:58 pm
Hi GijKieken,

I had to think about your question for a while and came up with three options:

1. Rewrite the ClearData command: I would not recommend this since you would have to copy your changes to every new version (although there weren't so many new versions lately  :smiley-zipper:

2. Implement your own commmand: using CustomDevPoints this is possible, but it takes some knowhow and you still need to copy that code to every new version of PLX DAQ

3. using the ClearRange command: this came to me this morning. If you know the data you want to remove you could just use the CLEARRANGE which is available out of the box. If you want to delete all content from columns A, B, C and D (without the headers) and you know the amount of data you pasted to PLX DAQ by Arduino this would be good for you:
Code: [Select]
Serial.println((String) "CLEARRANGE,A,2,D," + yourRowCounter);In case you don't know how many rows you pasted to the sheet ... well ... just delete 100.000 - that should be enough :D
Code: [Select]
Serial.println((String) "CLEARRANGE,A,2,D,100000");

I hope this works for you !?
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: GijKieken on Oct 05, 2017, 10:01 pm
Hi NetDevil,
For sure it makes more sence if one can examine the Arduino code.
The options you offer are indeed worthwhile and I will considder to alter the code.
Thanks anways for the ideas.

Code: [Select]

/*
 @ Purpose of this program is to Log two independent speeds and two
 @ Lambda values from a combustion engine
 @ Speed of the Engine measured with inductive clamp 0--12.000 Rpm
 @ 1 puls per revolution (12000rpm/60sec) 200Hz
 @ Speed of the Drum with photo-sensor 0--2500 Rpm
 @ 60 pulses per revolution (2500rpm*60[encoder-disc]/60sec) 2500Hz
 @ int0 (digitalpin 2)highest priority is used for Engine speed
 @ int1 (digitalpin 3)lower priority is used for Drum speed
 @ A0 & A1(alias input 14 & 15) connected via an impedance interface
 @ to measure 2-channel Lambda
 */

#include <TimerOne.h>
#define field_separator ","    //used for .csv file
volatile int revEngine=0;
volatile int revDrum=0;
byte lambdaSensorPin0 = A0;  //input for first Lamda measurement
byte lambdaSensorPin1 = A1;  //input for second Lambda measurement
int lambdaValue0 = 0;        //variable to store the value coming from Lambda sensor0
int lambdaValue1 = 0;        //variable to store the value coming from Lambda sensor1

void isrEngine() //interrupt service routine Engine
{
  revEngine++;
}                 //last curley bracket initiates a Return

void isrDrum()  //interrupt service routine Drum
{
  revDrum++;
}               //last curley bracket initiates a Return

void plot()
{
  detachInterrupt(0);           // detaches the interrupt 0
  detachInterrupt(1);           // detaches the interrupt 1
  //Serial.println((String)"DATA," + revDrum + field_separator + revEngine + field_separator + millis());
  //Serial.println((String)"DATA," + revDrum + "," + revEngine + "," + lambdaValue0 + "," + lambdaValue1 );
  //Get rid off String object
  Serial.print("DATA,");
  Serial.print(revDrum);     
  Serial.print(field_separator);
  Serial.print(revEngine);   
  Serial.print(field_separator);
  Serial.print(lambdaValue0);
  Serial.print(field_separator);
  Serial.println(lambdaValue1);

  attachInterrupt(0,isrEngine,CHANGE);
  attachInterrupt(1,isrDrum,CHANGE);
}

void setup()
{
  Serial.begin(9600);

  //Serial.println("CLEARDATA"); // clears sheet starting at row 2
  Serial.println("CLEARSHEET"); // clears sheet starting at row 1

  //define 5 columns named RevDrum,RevEngine,Lambda0,Lambda1,Date&Time
  Serial.println("LABEL,RevDrum,RevEngine,Lambda0,Lambda1,Date&Time");

  attachInterrupt(0,isrEngine,CHANGE);  // attaching interrupt Engine
  attachInterrupt(1,isrDrum,CHANGE);    // attaching interrupt Drum
  Timer1.initialize(250000);            // sample time 250ms
  Timer1.attachInterrupt(plot);         // attach the service routine here
  //post to specific cells on default sheet as well as named sheet
  //Serial.println("CELL,SET,G10,400 test 1 string"); // default sheet active in PLX DAQ Excel
  //Serial.println("CELL,SET,ONSHEET,Simple Data,G,11,400 test 2 string"); // named sheet available in PLX DAQ Excel
  Serial.println("CELL,SET,E2,DATE");   // default sheet active in Gij Kieken Excel
  Serial.println("CELL,SET,E3,TIME");   // default sheet active in Gij Kieken Excel
}
void loop()
{
  lambdaValue0 = analogRead(lambdaSensorPin0);  //read the first sensor
  lambdaValue1 = analogRead(lambdaSensorPin1);  //read the second sensor
  delay(2);  //give the A-D converters some time to settle 
}



Meanwhile I made this of it in Excel and that means I have to copy it in all later versions.
Code: [Select]

Private Sub clearData()

    'WStoUse.Range("A2:" & Split(WStoUse.UsedRange.Address, ":", , vbBinaryCompare)(1)).NumberFormat = "General"
    'WStoUse.Range("A2:" & Split(WStoUse.UsedRange.Address, ":", , vbBinaryCompare)(1)).Value = Null
    '------------------------------------------------------------------------------------------------------------
    'lastRow = WStoUse.Cells(Rows.Count, ColumnCount).End(xlUp).offset(1, 0).row
 
lastRow = WStoUse.Cells.Find("*", SearchOrder:=xlByRows, LookIn:=xlValues, SearchDirection:=xlPrevious).row
lastCol = WStoUse.Cells.Find("*", SearchOrder:=xlByColumns, LookIn:=xlValues, SearchDirection:=xlPrevious).column
'bij de lastCol formule is geen regelnummer opgegeven dus kiest Excel standaart row1
lastCol = lastCol - 1   'lastCol=5 door de Header Time&Date in row1, dus -1 voor de cellen met Data
Range(Cells(2, 1), Cells(lastRow, lastCol)) = Null  'enkel de Data in kolom A..D wissen,starten bij row2
WStoUse.Range("A1").Select

End Sub

The values I send are rawValues ,I do the calculations for conversion in Excel.
Sorry for the comments I have to translate them to make it more universal(my native language is dutch).
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: GijKieken on Oct 07, 2017, 11:44 am
Addendum to my post above.
So in Excel Plx, via Arduino Setup (setup only runs once)
I place a header Time&Date in Cell E1
Date in Cell E2
Time in Cell E3
In Excel Cell F2 a title <My Dyno> for the workbook (project) is placed which I tranfer to other sheets for printout of graphs
In Excel Cell H2 via an inputBox I provide a fileName_xx (xx is a counter to increment on each save) the fileName is also transfered to other sheets for printouts

That is the reason why I had to change the code for clearData an clearSheet.
So when I do a run on the Dyno I need to run stop (connect , disconnect) several times and does not want to fill in the title and fileName again.
I could uncheck <Reset on Connect> but with a hit on <Clear Columns> my Date and Time (which I prefer to keep) is also gone.
Maybe this short info gives more explanation to the issue.

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: GijKieken on Oct 07, 2017, 12:19 pm
A snapshot of the Main page.
(https://forum.arduino.cc/index.php?action=dlattach;topic=437398.0;attach=228791)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: egsc on Oct 11, 2017, 02:07 am
Is there an instability for running for too long?
After some time, some values start getting a little crazy (even though they seen okay on Direct Debug Window).

Is it because there're many cells being sent/written?

Should I lower the baudRate? Increase buffer?

OBS:
Have a look at the examples in Serial Input Basics (http://forum.arduino.cc/index.php?topic=396450.0) - simple reliable ways to receive data.

The technique in the 3rd example will be the most reliable.
...R
On another topic about the Serial Data being reliable, they cited this 3rd example. Don't know if the idea of using start-marker and end-marker is the same of PLX-DAQ code.
=========================
Apparently solved after setting baudRate to 2400.

Tip for others having same problem: READ the begginer's guide made by NetDevil! I discovered my switch wasn't working because I was using Serial.readStringUntil(10).toFloat() and should be using Serial.readStringUntil(10).toInt() !

Thanks!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: egsc on Oct 14, 2017, 01:09 am
Hi, NetDevil, what is the License for this worksheet, sicne you got rid of selmaDAQ?

Thanks
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Oct 14, 2017, 02:04 am
Hi egsc,

please don't think I haven't seen your posts. I am particular busy at the moment but will try to post you an answer tomorrow ( 2am in Germany at the moment....)

Greetings! 
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: TeoGr on Oct 14, 2017, 12:00 pm
OK I am a new with Arduino

I read the Beginners guide, look in this forum, installed Version 2.11, and everything seems fine. I can even read the Arduino data in the "Raw data logger:" but no data goes into the spreadsheet. I can even clear  the existing data with the "Clear columns". Everything seems to be working exactly as it supposed to expect there is no data being written in the spreadsheet.

I am using Windows 10 and Excel 2016.

Any idea of what is going wrong and how to fix it?

Thanks
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Oct 14, 2017, 12:14 pm
@GijKieken: don't you worry about your comments - at least for me. Because I'm German I could roughly guess / translate those  :P
On another piece of paper: I don't mind the UI being reworked for special needs - but keeping the credits in the title of the form would be nice (my nickname at least) ;)


@egsc:


@TeoGr: could you please post your code? And by that please use the "[ code]" and "[/ code]" tags for better readability. My first guess is, that you didn't use the "DATA" command correctly. But we will have to see. Please also post a screenshot of PLX DAQ in action with the DirectDebugWindow visible. Thanks :)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: TeoGr on Oct 14, 2017, 12:33 pm
Sure, let see if can do it right.

Code: [Select]

#include <LiquidCrystal.h>
#include <PID_v1.h>
#include <Wire.h>
#include <Sodaq_SHT2x.h>
#include <Servo.h>

int pos = 45;// variable to store the servo position
int n = 1;
unsigned long previousMillis = 0; // to control the frequency of move
const unsigned long interval = 6000000; // intervals of movement
unsigned long previousMillisLCD = 0;
const unsigned long intervalLCD = 5000; // change LCD display every 3 seconds
double Temp, TempMax, Tempmin, Humi, HumiMax, Humimin;  //to display in the LCD
double T_Setpoint, H_Setpoint, T_Output, H_Output;  // for controlling via PID
double T_Kp = 10, T_Ki = 5, T_Kd = 1; //parameters for PID setting
double H_Kp = 10, H_Ki = 5, H_Kd = 1;

LiquidCrystal lcd(13, 12, 8, 7, 4, 2); //only digital pins, PWMs are for fan control and PID output
Servo myservo;
PID T_PID(&Temp, &T_Output, &T_Setpoint, T_Kp, T_Ki, T_Kd, DIRECT);
PID H_PID(&Humi, &H_Output, &H_Setpoint, H_Kp, H_Ki, H_Kd, DIRECT);
#define T_pinout 6  //PID output, must be a PWM
#define H_pinout 10  // PID output, must be PWM

void setup() {
  lcd.begin(16, 2);
  lcd.print("fxt 2000");
  delay(1500);
  Wire.begin();
  Serial.begin(9600);
  myservo.attach(3);  // attaches the servo on pin 3 to the servo object
  myservo.write(pos);
  Temp = SHT2x.GetTemperature();  // reads Temperature in Celsious degrees
  Humi = SHT2x.GetHumidity();  // reads humidity in %
  T_Setpoint = 35;  //temperature setpoint for the PID
  H_Setpoint = 65;  // Humidity setpoint for PID
  Tempmin = Temp;
  Humimin = Humi;
  T_PID.SetMode(AUTOMATIC);
  H_PID.SetMode(AUTOMATIC);
  analogWrite(9,150);  //PWM controlled fan

  Serial.println("CLEARDATA");
  Serial.println("CLEARSHEET");
  Serial.println("Temp,Humidty,T_out,H_out");
}

void loop() {
  Temp = SHT2x.GetTemperature();
  Humi = SHT2x.GetHumidity();
  T_PID.Compute();
  analogWrite(T_pinout, T_Output);
  H_PID.Compute();
  analogWrite(H_pinout, H_Output);


  unsigned long currentTime = millis();
  if ((currentTime - previousMillis >= interval) and (pos <= 90)) {
    previousMillis += interval;
    for (pos = 45; pos <= 135; pos += 1) { // goes from XX degrees to XX degrees
      // in steps of 1 degree
      myservo.write(pos);              // tell servo to go to position in variable 'pos'
      delay(30);                       
    }
  }
  if ((currentTime - previousMillis >= interval) and (pos >= 90)) {
    previousMillis += interval;
    for (pos = 135; pos >= 45; pos -= 1) { // goes from xx degrees to xx degrees
      myservo.write(pos);              // tell servo to go to position in variable 'pos'
      delay(30);                       
    }
  }
  if (Temp >= TempMax) {
    TempMax = Temp;
  }
  if (Temp <= Tempmin) {
    Tempmin = Temp;
  }
  if (Humi >= HumiMax) {
    HumiMax = Humi;
  }
  if (Humi <= Humimin) {
    Humimin = Humi;
  }

  if ((currentTime - previousMillisLCD >= intervalLCD) and (n==1)) {
    previousMillisLCD += intervalLCD;
    n=2;
  }
 
  if ((currentTime - previousMillisLCD >= intervalLCD) and (n==2)) {
    previousMillisLCD += intervalLCD;
    n=1;
  }

  if (n==1){
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("T");
    lcd.setCursor(1, 0);
    lcd.print(Temp);
    lcd.setCursor(6, 0);
    lcd.print(" ");
    lcd.setCursor(7, 0);
    lcd.print(TempMax,1);
    lcd.setCursor(11, 0);
    lcd.print("/");
    lcd.setCursor(12, 0);
    lcd.print(Tempmin,1);
    lcd.setCursor(0, 1);
    lcd.print("H");
    lcd.setCursor(1, 1);
    lcd.print(Humi);
    lcd.setCursor(6, 1);
    lcd.print(" ");
    lcd.setCursor(7, 1);
    lcd.print(HumiMax,1);
    lcd.setCursor(11, 1);
    lcd.print("/");
    lcd.setCursor(12, 1);
    lcd.print(Humimin,1);
  }
 
  if (n==2) {
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print((int) currentTime/86400000);  // print the numbers of Days
    lcd.setCursor(3, 0);
    lcd.print("Days");
    lcd.setCursor(8, 0);
    lcd.print("Heat");
    lcd.setCursor(13, 0);
    if ((T_Output * 100) / 255>=100){
      lcd.print("99");
    }else{
    lcd.print((T_Output * 100) / 255);
    }
    lcd.setCursor(15, 0);
    lcd.print("%");
    lcd.setCursor(8, 1);
    lcd.print("Humi");
    lcd.setCursor(13, 1);
    if ((H_Output * 100) / 255>=100){
      lcd.print("99");
    }else{
    lcd.print((H_Output * 100) / 255);
    }
    lcd.setCursor(15, 1);
    lcd.print("%"); 
 }

//  Serial.print(millis()/1000);
//  //Serial.print("  ");
//  Serial.print(Temp);
//  Serial.print("  ");
//  Serial.print(TempMax);
//  Serial.print("  ");
//  Serial.print(Tempmin);
//  Serial.print("  ");
//  Serial.print(Humi);
//  Serial.print("  ");
//  Serial.print(HumiMax);
//  Serial.print("  ");
//  Serial.print(Humimin);
//  Serial.print("  ");
//  Serial.print((T_Output * 100) / 255);
//  Serial.print("  ");
//  Serial.println((H_Output * 100) / 255);

Serial.print(Temp);
Serial.print(",");
Serial.print (Humi);
Serial.print(",");
Serial.print((T_Output * 100) / 255);
Serial.print(",");
Serial.println((H_Output * 100) / 255);
 
  delay(1000);


}




btw I just added the:
  Serial.println("CLEARDATA");
  Serial.println("CLEARSHEET");
  Serial.println("Temp,Humidty,T_out,H_out");

the Spreadsheet clear as it should and I noticed the paste function in the excel is disable and the clipboard remains empty. Pausing data log does not stop the raw data log.


Thanks
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: TeoGr on Oct 14, 2017, 12:46 pm
OK hold on, I think I got it. I will add a line data,date,time and see if it works....

cheers
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: TeoGr on Oct 14, 2017, 12:51 pm
Damm it, why it is always some thing simple....

any way, problem solved!

Cheers
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: egsc on Oct 14, 2017, 11:57 pm
On my worksheet, with baudRate=9600, CELLGET fails (returns 0 or 2) after some time (100-400seconds after start), goes back to sending the right values, but eventually Excel crashes (can occur at 300-600 seconds after start).

I already added delay(200) before CELLGET, dind't solved, and other delay(200) before CELLSET, it keeps senging wrong values and eventually crashing (before 200s).

Thenk I tried to ""force"" reading the right values.


Code: [Select]

delay(200); //supposed to, but didn't solve the wrong values
Serial.println("CELL,GET,FROMSHEET,Control,AV,20"); //read AV20
valAD20 = Serial.readStringUntil(10).toFloat(); //(yes, valAD20 was declared as double before setup())
//verify if it was correctly read
while (setpoint == 0 || setpoint == 2) { //because 0 and 2 are wrong values that appear for me
                                          Serial.println("Wrong read, read again until get it right!");
                        delay(300); //even bigger delay
                        Serial.println("CELL,GET,FROMSHEET,PainelControle,AV,20");
                        valAD20= Serial.readStringUntil(10).toFloat();
                        Serial.println("PAUSELOGGING");
                        Serial.println("SAVEWORKBOOKAS,ReadWrongValAD20");
                        Serial.println("RESUMELOGGING");
                 }


This generates a CORRUPTED .xlsm (ReadWrongValAD20.xlsm), so I deleted the lines to create a new .xlsm. So the code is:

Code: [Select]

delay(200); //supposed to, but didn't solve the wrong values
Serial.println("CELL,GET,FROMSHEET,Control,AV,20"); //read AV20
valAD20 = Serial.readStringUntil(10).toFloat(); //(yes, valAD20 was declared as double before setup())
//verify if it was correctly read
while (setpoint == 0 || setpoint == 2) { //because 0 and 2 are wrong values that appear for me
                                          Serial.println("Wrong read, read again until get it right!");
                        delay(300); //even bigger delay
                        Serial.println("CELL,GET,FROMSHEET,PainelControle,AV,20");
                        valAD20= Serial.readStringUntil(10).toFloat();
                 }


========

WEIRD=> I disconnected PLX-DAQ and Excel crashed while it was disconnected. Maybe it isn't PLX-DAQ?
But it keeps crashing after ~150s.


Sometimes, after long running, this error occurs: it """"forgets""" to jump to row above and inserted the values on the next cells on the same row.

It also crashes somewhere 100-600s, like in this video.
https://youtu.be/NVkkY8E-2ko

===========
CORRECTION - Decreasing baudRate to 2400 really improved stability (26min running with no Excel crashes). However, mistakes still occured eventually on sending values to Excel.
And decreasing baudRate made the rows sent go from 1s period to 4-6 period.... Wish I could have stability + fast frequency :S. Where to change buffer size? Here? (Picture sent)
(https://i.imgur.com/ryeSI5b.png)


"DirectDebugWindow it would imply and issue within Excel - most likely due to too many cells being used. That would be a pity but I guess hard to solve :-/"
The error was present in DirectDebugWindow. It was a PID() library value (ATune_RunTim(), which is 0 if running autotune and 1 if completed). So it wasn't from CELLGET....

26min running
https://youtu.be/VicPBG-S_IM

=====UPDATE
@SASv
I saw you got sucess on running at baudRate 115200.
........
6. 10 trials at 115200 baud with 100 msec delays before the CELL,GET and CELL,GET,FROMSHEET commands: 0 complete successes!

Update: If tdelay is changed from byte to integer
Result: 10/10 complete successes
.....
Sorry, what? "tdelay changed from byte to integer", what do you mean?

........
Finally, another clue to the puzzle might be what I observed in a program I am developing.  The code involves 9600 baud communication and has several GETs and SETs in the infinite loop.  After several iterations there is a final GET and SET (the infinite loop "ends" with a very long delay).  The last SET failed until I increased the delay before it to 500 msec.  At that time some of the loop GETs and SETs had 100 msec delays.  However, when I decreased them to 3 msec, the final SET again failed.  To return to success I had to increase its delay to 800 msec.  So there seems to be a cummulative effect from prior GETs and SETs.   

FURTHER UPDATE: Increasing the stop bits to 2 (Serial.begin(baudRate,SERIAL_8N2); ) might help a bit.  It is no solution, but it seems to increase the frequency of correct results.
.....
I missed this answer on the long post! I'll try it and update here about my results!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: GijKieken on Oct 16, 2017, 11:35 am
Hi NetDevil,
For sure I put your nick name back,for me it was just a way of trying to understand what all the the pieces of code induvidualy are made for ,and how things works.
So are the lines of code for clear sheet and clear data a hard time for me to figure out how they work.
Also there is no intension do distribute the altered Excel anyways.

So you definitively get a couple of beers when we meet in Germany.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: kobayeshi on Oct 25, 2017, 04:09 pm
Hi to everyone,

I have read all post but I don't find any solution for my question.

PLX-DAQ works like a charm sendig data from Arduino to Excel. Every minute I send temperature sensor to excel.

Now I am trying to read from excel a entire column data to send to an arduino and draw a pixel in a X,Y position.

For example

Column A - Time
Column B -  temperature
Column C - temperature

B2= 24,33
B3=25,03
.
.
.
B40=33,21
.
.
.
B100=""

with (CELL,GET,B3) I only read B3 value. I need to read all B column data.

My project is when I push a button, the screen turns black. Then read Bx value and using this value print a pixel in position (Bx,Y) until in Column B / Row X there's no data.

Thanks in Advanced

Thanks in advanced.

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Oct 25, 2017, 05:44 pm
Hi kobayeshi,

there is no such functionality at the moment.
For your use case I can think of three solutions:



I hope this helps you to get started?
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: GijKieken on Oct 25, 2017, 10:40 pm
Hi, kobayeshi
Why not ,just use Excel to plot a simple graph, or am I missing the point of the story?
 
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: kobayeshi on Oct 26, 2017, 08:48 am
@NetDevil:

Second Option is that I want to do. How could I do?

@GijKieken:

Yes, I have plotted a graph in excel and in real time. This was my first goal and with PLX-DAQ is a piece of cake. But my project is more complex than I have explained here.

I need at any time an operator can see a graph of the data collected by a sensor outside the offices.

Thanks a lot for all the answers.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: GijKieken on Oct 26, 2017, 10:37 am
@kobayeshi
At the rate (1min) put your Data or a copy of it in a database or cloud.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: marcf on Nov 10, 2017, 01:50 am
I very much appreciate PLX DAQ ver 2, and have been using it.  Just lately, I am getting the message
"Com Error: Error(2): CommOpen(Create File): The System cannot find the file specified.   Aborting!"
When I select connect.
I am running windows 10 pro with Excel 2007
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Nov 10, 2017, 12:06 pm
Just lately, I am getting the message
"Com Error: Error(2): CommOpen(Create File): The System cannot find the file specified.   Aborting!"
When I select connect.
Hi marcf,
this error is usually shown when the COM port is busy due to another application. Might be that you have:

Greetings
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Linkfan5 on Nov 10, 2017, 08:51 pm
Hi everyone.

I downloaded PLX-DAQ version 2.11 to use with Microsoft Excel 2016 on Windows 10 64-bit, but when I load the PLX-DAQ Spreadsheet, I first get the error: "Could not load some object because it is not available on this machine," then another: "Could not load some objects because they are not available on this machine." Pressing "OK" on both opens a Microsoft Visual Basic Run-time error '424': "Object required," with an option to Debug, which opens the code with "Stamp.Disconnect" under "Private Sub cboPort_Click()" highlighted.

I've set Excel to allow macros just like Islam Negm said on Medium.
I don´t know why it doesn´t work because no one seems to have this problem with this version.
I hope someone can help me.
Thanks in advance.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Nov 11, 2017, 12:50 pm
"Could not load some objects because they are not available on this machine." Pressing "OK" on both opens a Microsoft Visual Basic Run-time error '424': "Object required," with an option to Debug, which opens the code with "Stamp.Disconnect" under "Private Sub cboPort_Click()" highlighted.
Hi Linkfan5,
(I hope your name is a reference to Legend of Zelda - in that case: nice :) )

I'm sorry to start of rude, but are you really really really sure you have opened PLX DAQ v2.11? Because the problem you describe is the typical 64-bit problem from PLX DAQ v1 ... and Stamp.Disconnect is not used in 2.11 anymore (not even in 2.01 anymore....) Not at any place in the whole source code....

The file to open is named "PLX-DAQ-v2.11.xlsm" by default.

Could you please post a screenshot of your Excel with the error included or the line highlighted? That would help a lot. Otherwise just download 2.11 anew from here: http://forum.arduino.cc/index.php?topic=437398.msg3251256#msg3251256 (http://forum.arduino.cc/index.php?topic=437398.msg3251256#msg3251256)

Greetings!

Thanks a lot

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Linkfan5 on Nov 11, 2017, 07:11 pm
Hi NetDevil,

First thing first thanks for the fast reply (and yeah my name is a reference to the TLoZ games).

I should really tidy up my PC because i had indeed still an old version of PLX DAQ on my PC and I started the old version even so i downloaded the newest version. I didn´t even notice that it would be named PLX-DAQ-v2.11 now.

Sry that i didn´t see the obvious answer to this problem.


Now i can see the button to open PLX DAQ UI.

I will use it for my master thesis and i´m sure it will help me a lot.

Thank you NetDevil for the answer (to my very dumb question)  and for the new updates for PLX-DAQ for 64 bit.

(and sry for my bad english)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Rocket777 on Dec 09, 2017, 07:15 pm
Hi NetDevil,

Thank you for an amazing job.

I am a total NOOB with a problem.

I installed PLX-DAQ this morning, and got it running. While looking for help, I came across this forum, downloaded V2.11, and opened the spreadsheet. Enabled the macro's and opened the UI, selected the correct COM port (1) and Baud rate, clicked on "Connect" and opened "Direct Debug".  No data is visible.

When reverting back to the original PLX-DAQ, the data streams in.

Am I missing something obvious?
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: GijKieken on Dec 10, 2017, 11:23 am
Hi, Rocket
Start with posting your code ,,,,
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Rocket777 on Dec 10, 2017, 05:31 pm
Hi NetDevil,

The code is written in C for the CCS compiler, but I do not think it to be relevant.
The code (the old functions) works on the older version of PLX-DAQ. But nothing apears, not even in the debug window. 

If I try to "connect" to COM1 while the terminal emulator has it open, an error message is displayed, this is correct behavior.  When the terminal emulator does not have control of COM1, PLX-DAQ opens the port without a error message. 

I include a sample of what a terminal emulator collects via the serial port.
Baud: 9600 8 n 1



CELL,GET,E2<CR>
CELL,GET,G2<CR>
CELL,GET,F2<CR>
CLEARSHEET<CR>
LABEL,Batt Voltage, AmpHour, WattHour<CR>
DATA,10.019,  0.000,    0.000,<CR>
DATA,10.019,  0.000,    0.000,<CR>
DATA,10.019,  0.000,    0.000,<CR>
DATA,10.018,  0.000,    0.000,<CR>
DATA,10.019,  0.000,    0.000,<CR>

Thank you for your time and help.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: GijKieken on Dec 10, 2017, 06:52 pm
Hi Rocket, maybe your missing the Line Feed <LF>
In the same way as in Println  <CR><LF>
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Rocket777 on Dec 10, 2017, 08:01 pm
Thank you GijKieken
Problem sorted...
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Linkfan5 on Dec 27, 2017, 06:47 pm
Hi NetDevil

i´m using PLX-DAQ v2.11 and have some problem with the performance.
When i´m running PLX-DAQ and run my Arduino code i see the data but after some lines (after 52 sometimes after 107) Excel stops working.

The port is right (because of the data in excel) and the baudrate is the lowest (9600). The code is simple enough but i will share it here:

Code: [Select]
/*
  ReadAnalogVoltage
  Reads an analog input on pin 0, converts it to voltage, and prints the result to the serial monitor.
  Graphical representation is available using serial plotter (Tools > Serial Plotter menu)
  Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.

  This example code is in the public domain.
*/

// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
  //Serial.println("CLEARDATA"); // clears starting at row 2
    Serial.println("CLEARSHEET"); // clears starting at row 1
   
  // define 5 columns named "Date", "Time", "Timer", "DATA" and "millis"
    Serial.println("LABEL,Timer,Voltage,miilis");


}

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
  float voltage = sensorValue * (5.0 / 1023.0);
  // simple print out of number and millis
    // output "DATA,DATE,TIME,TIMER,4711,13374,AUTOSCROLL_20"
    Serial.println( (String) "DATA,TIMER," + voltage + "," + millis() + ",AUTOSCROLL_20");
    delay(100);

}


As you can see i only changed the example code of ReadAnalogVoltage so i can read the sensor value of my temperature sensor.
Even with the delay at the end and uncheking the Checkboxes in the direct debug window excel still stops working after a while.

For my specs: I´m using a Asus Laptop with intel core i5 and 8 GB RAM. OS is Windows 10 Home 64-Bit. Excel Version is 2016 and also 64-Bit.
Thanks in advance.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: GijKieken on Dec 27, 2017, 07:34 pm
Hi, Linkfan
I think your problem is not PLX-DAQ or Exel but is your Arduino code.
    Serial.println( (String) "DATA,TIMER," + voltage + "," + millis() + ",AUTOSCROLL_20");
By using String you run out of memory,,,
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jan 01, 2018, 06:48 pm
@Linkfan5: the code is pretty simple you're right. Excel might be crashing because there exists some problems in the communication between PLX DAQ, Excel and Ardunio when data is flooding in - which shouldn't be the case with your code.... however you could try to reduce the baud rate even more. Having a delay of 100 in your code looks like you can handle the data taking a few milliseconds more to be transferred ;)

To help with GijKieken's answer try rewriting the code as this:
Code: [Select]
Serial.print("DATA,TIMER,");
Serial.print(voltage);
Serial.print(",");
Serial.print(millis());
Serial.println(",AUTOSCROLL_20");


@GijKieken: I recommended using the String version since thus one can write inline - never had any problems of buffer sizes / memory with that, but it is sure worth a try.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Linkfan5 on Jan 06, 2018, 06:22 pm
thanks that works like a charm
i can now measure multiple analog inputs, use higher baudrates and less delay (50 millis) without crashes  :)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: drizzer on Jan 10, 2018, 04:31 pm
@NetDevil First of all I just wanna say thank you so much for your kindness in sharing your version of plx-daq my brother. I have used it in my project and it works smoothly. I just have a few questions and I am very much hoping that you can spare the time to answer me. I have a new project which is a wireless power monitoring system. It will monitor the real power,apparent power, power factor, supply voltage and Irms of an electrical system. Wireless in a way that I am using an 433MHz rf module to send my data from one arduino uno connected to the rf transmitter(stand alone) to another arduino uno connected to the rf receiver and connected to my laptop for the monitoring purposes.

I already have this project running with the following code below. Now I am not really that good at programming, I was able to have this project working by combining and understanding codes I found in the internet. Now I already have the data running on my laptop using the arduino serial monitor. Now I really really want to display these data using your PLX-DAQ version. I have already tried it using only one arduino connected directly to my laptop (without using the RF module) and I was able to display the readings in the excel using the PLX-DAQ. My problem now is how to convert my data from an array (which I use to send it from the transmitter to the receiver of the rf module) back to int or string so that I can incorporate it to the commands needed for the PLX-DAQ. I am really hoping you could help me a bit with this.

Thanks a lot in advance and Im sorry for the very long post. P.S. The codes are found below
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: drizzer on Jan 10, 2018, 04:38 pm
@NetDevil these are the codes for the transmitter and receiver. I believe that I need to tweak sumthing on the code for the receiver side.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: drizzer on Jan 10, 2018, 04:50 pm
Here is a picture of my output using your PLX-DAQ when a connected my arduino directly to my laptop without using the RF module. I really want to make the output the same when transmission using the module is already involved in the process. I am hoping you could help me. Thanks in advance brother. Cheers!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: drizzer on Jan 10, 2018, 04:56 pm
Here is a picture of my output using your PLX-DAQ when a connected my arduino directly to my laptop without using the RF module. I really want to make the output the same when transmission using the module is already involved in the process. I am hoping you could help me. Thanks in advance brother. Cheers!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Iwrk4dedpr on Jan 11, 2018, 02:27 am
Wow glad I found this thread.  Had come across the same code module ( modComm ) and have been trying to get it to work.  Had been having some success but not having success, well I could read it but it seemed to read the entire buffer or something.


So ..... Thanks for this.  I'm hoping that I can study this and make use of it.  Awesome work!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jan 14, 2018, 06:45 pm
@NetDevil these are the codes for the transmitter and receiver. I believe that I need to tweak sumthing on the code for the receiver side.
Hi drizzer,

thanks for your feedback! Looks interesting what you are doing there with two systems communicating.
As long as I got your code correct you need to send the data you have in you final_receiver_code.ino file to Excel, right?
In that file I guess this part is where your data is being listed in SerialMontor:
Code: [Select]

for (int i=0; i < RF_DATA_ARRAY_SIZE; i++)
{
    Serial.print(inArray[i]);
    Serial.print(", ");
}

Thus that is where we need to alter. My suggestion is to go with something like this:
Code: [Select]

Serial.print("DATA,DATE,");
for (int i=0; i < RF_DATA_ARRAY_SIZE; i++)
{
    if( i < (RF_DATA_ARRAY_SIZE - 1) {
        Serial.print(inArray[i]);
        Serial.print(",");
    }

    if( i = (RF_DATA_ARRAY_SIZE - 1) {
        Serial.println(inArray[i]);
    }
}


That way you start with "DATA,DATE" to tell PLX DAQ that data is coming.
In the loop to differentiate between normal data (upper if condition) and concat data with comma as long as it is not the last data to be send. In the lower loop (where it is the last data set) you just append the last data and use println (instead of print) to send the data to PLX DAQ.

I hope this works.
Greetings!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Wingnut on Jan 15, 2018, 12:20 pm
New to Arduino and new to PLX-DAQ. Nice product - I've been trying with Open "COM4" ... on my own but this seems an easier solution.

1) Is there a reference list of the commands that can be sent to PLX-DAQ?
2) I note that when I press connect it forces a reset on the Arduino. How is that achieved?
3) I note that when I press "Clear Columns", whilst the columns are cleared the next line of data to appear carries on from the row it was at and not back at row 2. Is that a bug?

Thanks

Graham
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: drizzer on Jan 15, 2018, 02:26 pm
@NetDevil.. Good day to you brother. Thank you very much for he reply. Your code was very helpful. However it can only display 2 of the 4 data I wanted to display so I did some tweaking and I finally got it. I can't make it without your code by the way. It gives me something to begin with. This is the part where I edited it based on your suggestions.
Code: [Select]

          Serial.print("DATA,DATE,TIME,");
       
        for (int i=0; i < 4; i++)
       
     {
       
        for (int i=0; i < 1; i++)
         {
           Serial.print(inArray[i]);
           Serial.print(", ");
         }
       
       
        for (int i=1; i < 2; i++)
         {
           Serial.print(inArray[i]);
           Serial.print(", ");
         }
         
       
        for (int i=2; i < 3; i++)
         {
           Serial.print(inArray[i]);
           Serial.print(", ");
         }
         
       
        for (int i=3; i < 4; i++)
         {
           Serial.print(inArray[i]);
         }
         
         {
           Serial.println("AUTOSCROLL_20");
         }
         
         
}
  }

}


I also attached here a picture of the data I was able to display on your version of the PLX-DAQ excel. Again thank you so much for sharing your ideas to this community. God bless you brother.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jan 16, 2018, 09:39 pm
1) Is there a reference list of the commands that can be sent to PLX-DAQ?
2) I note that when I press connect it forces a reset on the Arduino. How is that achieved?
3) I note that when I press "Clear Columns", whilst the columns are cleared the next line of data to appear carries on from the row it was at and not back at row 2. Is that a bug?
Hi Graham,
thanks for the feedback! Regarding your questions:



@drizzer: most important is it is working :) However your code looks extremely .... workaround-ish if there is something like that :D

In that case you could also try this:

Code: [Select]

Serial.print("DATA,DATE,TIME,");
Serial.print(inArray[0]);
Serial.print(", ");
Serial.print(inArray[1]);
Serial.print(", ");
Serial.print(inArray[2]);
Serial.print(", ");
Serial.print(inArray[3]);
Serial.println(",AUTOSCROLL_20");


But that way you only read the first 4 entries! In case your buffer size is bigger you might not transfer all data.
Even better (more readable) would be:
Code: [Select]
Serial.println ( (String) "DATA,DATE,TIME," + inArray[0] + "," + inArray[1] + "," + inArray[2] + "," + inArray[3] + ",AUTOSCROLL_20" );

Greetings!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: glaimmy on Jan 25, 2018, 12:24 pm
Hello everyone,

Can PLX-DAQ automatically save Excel files by date? (Date file name)

Thank you in advance, have a good day!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jan 25, 2018, 07:16 pm
Can PLX-DAQ automatically save Excel files by date? (Date file name)
Hi glaimmy,

no PLX DAQ can't do that by default. You can use either

What you can do is using the custom dev point to add a new command or simply change the "SAVEWORKBOOKAS" command to include "DATE" in the string for file name. You can access the code by pressing ALT+F11, open the form, right click => view code, search for "SAVEWORKBOOKAS", there you should be able to see how the workbook is saved and add the date.

Since we are all programmers in some kind of way (because we use Arduino) I hope you will be able to find the position :-)

I'm working on a Linux system at the moment and have no access to the macro code in Microsoft Excel at the moment....
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: glaimmy on Jan 29, 2018, 07:41 am
Thanks NetDevil for answering..

In fact, I just want to save the file do not cover the same one,
Want to save multiple files automatically.



Thank you in advance, have a good day!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Feb 01, 2018, 10:12 pm
In fact, I just want to save the file do not cover the same one,
Want to save multiple files automatically.
Hi glaimmy,
for that I suggest you simply add a counter to your Arduino code and use SAVEWORKBOOKAS to include said counter.
In case you restart your Arduino and need to have a unique number even after restart maybe use the random command provided by PLX DAQ to replace the counter.

Of course: best would be to rewrite SAVEWORKBOOKAS function in Excel with the code to save the workbook by pattern 'PassedNameByArduino' + '_' + CurrentDate + '_' + CurrentTime + '.xls'. By that you would never override an existing workbook.
Currently I cannot provide you with that solution as I don't have access to a Windows PC (to use Excel). But it is not that hard to do ;)

Greetings
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Makuto20 on Feb 04, 2018, 09:44 am
Backlog for next version(s):

find a solution for Excel crashing when moving the window around while logging. Priority: low ; Workaround: don't move window while logging ; Status: clueless...
Double check if issue above existed in PLX DAQ v1 as well. In case yes => we are screwed
Rework API calls and general COM port communication handling for better stability. Very promising example to be found http://michael-schwimmer.de/vba117.htm. Works with up to 2.000.000 baud

Can you please Provide English Version
Thanks in advance
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Feb 04, 2018, 01:15 pm
Can you please Provide English Version
Thanks in advance
Hi Makuto20,
the content on the page of michael-schimmer.de ist not mine. Therefore I cannot provide you any English version of it. Basically I am just lucky to be able to understand it :-X

If anything here is a link to an automatically translated version of the website by Google:

https://translate.google.com/translate?hl=en&sl=de&tl=en&u=http%3A%2F%2Fmichael-schwimmer.de%2Fvba117.htm (https://translate.google.com/translate?hl=en&sl=de&tl=en&u=http%3A%2F%2Fmichael-schwimmer.de%2Fvba117.htm)

Hopefully google did not try to translate the VBA code as well and screwed that one up. To be on the safe side I suggest to copy the VBA code from the original side and only use the translated version to read the basic information
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: keninladia on Feb 11, 2018, 05:16 pm
hey, i have a problem here...
i want to store the data from excel to arduino and the data will store in SD card module... the problem is that there is no data being stored in the SD Card...

this is the code snippet that i used...

Code: [Select]

  int myDelayValue;
  Serial.println("CELL,GET,R2");
  myDelayValue = Serial.readStringUntil(10).toFloat();


thank you very much...
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Feb 14, 2018, 04:41 pm
Code: [Select]

  int myDelayValue;
  Serial.println("CELL,GET,R2");
  myDelayValue = Serial.readStringUntil(10).toFloat();

Hi kenialadia,
what does Arduino show when you Serial.print 'myDelayValue'? I want to check whether the value is transmitted corretly to Arduino but lost while saving to SD card.
Please use:
Code: [Select]
Serial.println( (String) "Read value is: " + myDelayValue);
and take a look at the DirectDebugWindow in PLX DAQ what is reverted back.

What is your value in Cell R2 ? Is it a pure decimal or a value with a point or a comma in it?
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: rmetzner49 on Feb 21, 2018, 06:03 pm
When I open the PLX-DAQ-v2  spreadsheet, and enable Editing, I get an error:

"Object Variable or With block variable not set" with the Source Code highlighted on frmStampDAQ.Show.

The application seems to capture all my Arduino data in the debug window but the sheet is not being populated with values. 

Is there something simple to fix this?  Great job by the way, it populates the Debug Window with my ESP32-Dev at 115200 rate on COM33.

Thanks.
Bob M.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: petery2016 on Feb 24, 2018, 05:08 pm
Thanks for the awesome work!!

I have some problem with PLX-DAQ. I would like to run it as the datalogger, but sometime the excel needed to be closed or hang up. Once I reopen and reconnect the excel. The previous logged data on "Simple Data" worksheet will be overwritten (since the write command started from the first row).

To handle this case, I copy & paste to another worksheet once there are any update in "Simple Data".
but I found this may make the excel running very slow... even hang up if there are many inputs at the same time.

So my question is are there any better / simpler way to avoid the overwriting? Thanks a lot.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Feb 25, 2018, 11:29 am
"Object Variable or With block variable not set" with the Source Code highlighted on frmStampDAQ.Show.
The application seems to capture all my Arduino data in the debug window but the sheet is not being populated with values.
Hi Bob,
well actually that is pretty strange .... I can't explain that behavior. In case data is actually being captured by PLX DAQ DirectDebugWindow the software is working. With version of PLX DAQ are you using, which version of Excel and which Windows version? Could you maybe provide screenshots of the issue?




I have some problem with PLX-DAQ. I would like to run it as the datalogger, but sometime the excel needed to be closed or hang up. Once I reopen and reconnect the excel. The previous logged data on "Simple Data" worksheet will be overwritten (since the write command started from the first row).
To handle this case, I copy & paste to another worksheet once there are any update in "Simple Data".
but I found this may make the excel running very slow... even hang up if there are many inputs at the same time.
So my question is are there any better / simpler way to avoid the overwriting? Thanks a lot.
Hi Peter,
that is a very interesting feature and you are right, that was not possible - until now  :D  8) .

Attached you can find a "special" version of PLX DAQ v2.11 in which I extended the "ROW,SET" command.
Now you have an additional option for the third parameter:

I would really appreciate if you could give a short feedback whether or not the new code is working. I tested on my setup and it was running well.

Greetings

Jonathan
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: freakapotumas on Feb 26, 2018, 05:32 pm
Hello,

I've upgraded to the PLXdaq v2 and I've got a project built that uses a baud rate of 115200.  I can't seem to get any data to the plx spreadsheet despite getting data to my serial monitor in the arduino IDE.  I'm wondering if an inability to read at that specific baud rate is what's causing my problems.  I can probably go down to 9600 but it would just involve taking apart this machine so I can reprogram but that is my absolute last resort.

Thanks
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: petery2016 on Mar 04, 2018, 02:08 pm



Hi Peter,
that is a very interesting feature and you are right, that was not possible - until now  :D  8) .

Attached you can find a "special" version of PLX DAQ v2.11 in which I extended the "ROW,SET" command.
Now you have an additional option for the third parameter:
  • ROW,SET,LATEST ==> will put the row counter to the latest row filled (according to column A). I suggest to place 'serial.println("ROW,SET,LATEST");' as a command into your setup function - thus data transferred by Arduino to PLX DAQ will always start being logged to the latest new line on the current sheet
  • ROW,SET,241 ==> will further work like in the past (whereby 241 can be replaced by any specific row number of course)

I would really appreciate if you could give a short feedback whether or not the new code is working. I tested on my setup and it was running well.

Greetings

Jonathan
Hi Jonathan,

Sorry for late reply. I just tried your special version recently and it WORKS PERFECTLY!!
This helps me a lot,thanks for your amazing support!!


Thanks,
Peter
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: kostasb on Mar 10, 2018, 11:28 am
Hello,

Is it possible to work with Nano or Pro mini?
(I just started using Arduino.)

Thanks
Kostas
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: manacapleo321 on Mar 13, 2018, 02:45 pm
#include <SPI.h>
#include <MFRC522.h>
#include <LiquidCrystal.h>
 
#define SS_PIN 10
#define RST_PIN 9
MFRC522 mfrc522(SS_PIN, RST_PIN);   // Create MFRC522 instance.

#define beep_pin 8

LiquidCrystal lcd(2, 3, 4, 5, 6, 7);

int i = 0;

void setup(void)
{
   
    Serial.begin(9600);   // Initiate a serial communication
  Serial.println("CLEARSHEET"); // clears sheet starting at row 1   
     Serial.println( (String)"LABEL,Date,Time,name");
     delay(1000);
     
  pinMode(beep_pin,OUTPUT);
  digitalWrite(beep_pin,LOW);

   
  lcd.begin(16, 2);
  lcd.setCursor(3, 1);
  lcd.print("Welcome!!");
  lcd.setCursor(0, 0);
  lcd.print("Circuit is Ready");
  delay(1500);
  lcd.clear(); 
 
   
  SPI.begin();      // Initiate  SPI bus
  mfrc522.PCD_Init();   // Initiate MFRC522
  Serial.println("Put your card to the reader...");

}
void loop(void)
{
 
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Put your card to");
  lcd.setCursor(0, 1);
  lcd.print("the reader......");
  delay(300);

 
   
  // Look for new cards
  if ( ! mfrc522.PICC_IsNewCardPresent())
  {
    return;
  }
  // Select one of the cards
  if ( ! mfrc522.PICC_ReadCardSerial())
  {
    return;
  }
  //Show UID on serial monitor
  Serial.print("UID tag :");
  String content= "";
  byte letter;
  for (byte i = 0; i < mfrc522.uid.size; i++)
  {
     Serial.print(mfrc522.uid.uidByte < 0x10 ? " 0" : " ");
     Serial.print(mfrc522.uid.uidByte, HEX);
     content.concat(String(mfrc522.uid.uidByte < 0x10 ? " 0" : " "));
     content.concat(String(mfrc522.uid.uidByte, HEX));
  }
  Serial.println();
  Serial.print("Message : ");
  content.toUpperCase();
 

 
  if (content.substring(1) == "E0 87 34 1A") //change here the UID of the card/cards that you want to give access
  {
    digitalWrite(beep_pin,HIGH);
    delay(200);
    digitalWrite(beep_pin,LOW);
    delay(100);
    lcd.setCursor(0, 0);
    lcd.print("ID : ");
    lcd.print(content.substring(1));
    lcd.setCursor(0, 1);
    lcd.print("Leo Aude Manacap");
    Serial.println("Leo Aude Manacap");
    delay(1200);     
  }
 
 else   {
    digitalWrite(beep_pin,HIGH);
    lcd.setCursor(0, 0);
    lcd.print("ID : ");
    lcd.print(content.substring(1));
    lcd.setCursor(0, 1);
    lcd.print("Access denied");
    Serial.println(" Access denied");
    delay(1500);
     }
}


GUYS CAN YOU HELP PLEASE I DONT KNOW HOW TO .. GUys pLease i Need this for the sake of our Grade , Please

BTW. It is all about RFID based attendance Monitoring Please Guuys.. Help me Thank you :D
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Velkrome on Mar 14, 2018, 07:41 am
Hello, i'm using PLX-DAQ for my project. I've successfully received data from my Arduino to my Excel file via USB serial COM using PLX-DAQ. However, i'm now trying to send the data over via Bluetooth serial COM. It works and I can receive my data in the serial monitor in arduino IDE. However, the command for sending the data via Bluetooth is BTserial.println but PLX-DAQ only detect Serial.println so my data isn't getting imported into Excel. Is there a way to change the trigger command from Serial.println to BTserial.println? I don't know much about VBA so I can't change it myself.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: manacapleo321 on Mar 14, 2018, 04:04 pm
GUYS I NEED YOUR HELP PLEASE HOW CAN THE MESSAGE SEND TO EXCEL once we tap a Card into a RFID
#include <SPI.h>
#include <MFRC522.h>
#include <LiquidCrystal.h>
 
#define SS_PIN 10
#define RST_PIN 9
MFRC522 mfrc522(SS_PIN, RST_PIN);   // Create MFRC522 instance.

#define beep_pin 8

LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
 
 int i = 9;
 
void setup()
{
  Serial.begin(9600);               //Fastest baudrate
  Serial.println("CLEARDATA");
 Serial.println("LABEL,Date,Time,Name,Message");

 
  pinMode(beep_pin,OUTPUT);
  digitalWrite(beep_pin,LOW);
 
  lcd.begin(16, 2);
  lcd.setCursor(3, 1);
  lcd.print("Welcome!!");
  lcd.setCursor(0, 0);
  lcd.print("Circuit is Ready");
  delay(1500);
  lcd.clear(); 
 
   
  SPI.begin();      // Initiate  SPI bus
  mfrc522.PCD_Init();   // Initiate MFRC522
  Serial.println("Put your card to the reader...");
  Serial.println();

 

}
void loop()
{

  Serial.print("DATA,TIME,");
   Serial.print(i++); Serial.print(",");
    Serial.println(millis());
}
                   
  digitalWrite(beep_pin, LOW);
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Put your card to");
  lcd.setCursor(0, 1);
  lcd.print("the reader......");
  delay(200);
 
  // Look for new cards
  if ( ! mfrc522.PICC_IsNewCardPresent())
  {
    return;
  }
  // Select one of the cards
  if ( ! mfrc522.PICC_ReadCardSerial())
  {
    return;
  }
 
 

  //Show UID on serial monitor
  Serial.print("UID tag :");
  String content= "";
  byte letter;
  for (byte i = 0; i < mfrc522.uid.size; i++)
  {
     Serial.print(mfrc522.uid.uidByte < 0x10 ? " 0" : " ");
     Serial.print(mfrc522.uid.uidByte, HEX);
     content.concat(String(mfrc522.uid.uidByte < 0x10 ? " 0" : " "));
     content.concat(String(mfrc522.uid.uidByte, HEX));
  }
       
  Serial.println();
  Serial.print("Message : ");
  content.toUpperCase();
       

 
  if (content.substring(1) == "E0 87 34 1A")//change here the UID of the card/cards that you want to give access
 
  {
   
  Serial.print("DATA,TIME,");
  Serial.print(",");
 
    digitalWrite(beep_pin,HIGH);
    delay(200);
    digitalWrite(beep_pin,LOW);
    delay(100);
    lcd.setCursor(0, 0);
    lcd.print("ID : ");
    lcd.print(content.substring(1));
    lcd.setCursor(0, 1);
    lcd.print("You are Log in!!");
    Serial.println("Leo Aude C. Manacap");
    delay(1200);     
  }
 
 else   {
    digitalWrite(beep_pin,HIGH);
    lcd.setCursor(0, 0);
    lcd.print("ID : ");
    lcd.print(content.substring(1));
    lcd.setCursor(0, 1);
    lcd.print("Access denied");
    Serial.println(" Access denied");
    delay(1500);
     }
}




Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: futi on Mar 15, 2018, 09:04 am
How about "TX: Transmit" data transmission in the opposite direction?
Is it possible?
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: tasmod on Mar 18, 2018, 03:11 pm
Hi NetDevil,

Many thanks for your amazing work.

I am working on a windspeed indicator using a Nano and currently have it working OK but need some help refining the Excel part.

I used PLX-DAQ original and setup the parameters for a dynamic graph.  It scales nicely according to the input on the vertical axis.  I limited it to one hour of display else it wan't possible to comfortably see the data.
However it doesn't quite do what I want in respect of the graph lines for the data.  I have to set the graph type to one with data points so that the further data can be seen.

The data consists of one second windspeed (which graphs nicely) and a 2 minute average of the previous values. Along with this is the maximum gust speed.
For metrological purposes the windspeed is given over the 2 minute period average along with the gust speed.

In the graph I get the speed as the line graph but the average and the max gust only show up on a data point chart display. Even then they are only shown as points. Ideally I would have liked the average to line graph as well.

I set your PLX-DAQ v2.11 up to match the parameters and get the same result but the graph line is thicker (?) I can't seem to find how to change that!

Apart from the above there is one thing I would really like and that is for the graph to act like a strip recorder or at least to restart when the hours sampling finishes. At the moment it just stops.
I understand that just disconnecting and reconnecting with reset will restart the sampling all over again but it would be nice if I could make it say 30 minutes with an automatic restart.  Is that possible?

Rob
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: tasmod on Mar 18, 2018, 06:41 pm
OK I'm no VB programmer but using your mantra.."Even you can do it"  I looked at the frm vb code.

Now I think if I create a new    Case "CHART"     function I can call it from the Arduino and it will run.

I suspect if I added the reset code to this it would clear the chart and start again.  But, I'm not sure which part is the reset code ! 
However I used your ROW function using a timer in the Arduino code and had the data restart at Row 2 again. At least that's something.

I then found via google this line    Chart1.Series[0].Points.Clear()  as a way to clear the chart plotted points. 
I don't know how to incorporate this though.  I did try but only succeeded in creating errors.....

Rob
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: tasmod on Mar 19, 2018, 11:23 am
OK I found that CLEARDATA will reset the chart but it seems I need to examine the Arduino code as after one new reading it halts.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: glaimmy on Apr 03, 2018, 03:47 am
Hi glaimmy,
for that I suggest you simply add a counter to your Arduino code and use SAVEWORKBOOKAS to include said counter.
In case you restart your Arduino and need to have a unique number even after restart maybe use the random command provided by PLX DAQ to replace the counter.

Of course: best would be to rewrite SAVEWORKBOOKAS function in Excel with the code to save the workbook by pattern 'PassedNameByArduino' + '_' + CurrentDate + '_' + CurrentTime + '.xls'. By that you would never override an existing workbook.
Currently I cannot provide you with that solution as I don't have access to a Windows PC (to use Excel). But it is not that hard to do ;)

Greetings
Thank you very much for your guidance.
I will try again!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: ThisIsFun on Apr 05, 2018, 10:17 pm
Hi all,

I'm using PLX-DAQ v2 to gather temperature data from 16 DS18B20 temp probes. The program works great and I'm receiving data in Excel. However, I'd like to know how to specify the collection rate. For example, if I want a temperature reading recorded every 20 sec.

Thanks in advance!

Here's my code and an image for reference:


Code: [Select]
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS_PIN 2

OneWire oneWire(ONE_WIRE_BUS_PIN);
DallasTemperature sensors(&oneWire);
 
DeviceAddress Probe01 = { 0x28, 0xE4, 0x35, 0xA8, 0x04, 0x00, 0x00, 0x96 }; // 1
DeviceAddress Probe02 = { 0x28, 0x2B, 0xA8, 0xA8, 0x04, 0x00, 0x00, 0x76 }; // 2
DeviceAddress Probe03 = { 0x28, 0x90, 0x1B, 0xA8, 0x04, 0x00, 0x00, 0x88 }; // 3
DeviceAddress Probe04 = { 0x28, 0x87, 0xB1, 0xE6, 0x08, 0x00, 0x00, 0x96 }; // 4
DeviceAddress Probe05 = { 0x28, 0x93, 0x9B, 0xE5, 0x08, 0x00, 0x00, 0xDC }; // 5
DeviceAddress Probe06 = { 0x28, 0x49, 0x7F, 0xE2, 0x08, 0x00, 0x00, 0x94 }; // 6
DeviceAddress Probe07 = { 0x28, 0x6C, 0x36, 0xA8, 0x04, 0x00, 0x00, 0x93 }; // 7
DeviceAddress Probe08 = { 0x28, 0xBA, 0xAB, 0xA8, 0x04, 0x00, 0x00, 0xBE }; // 8
DeviceAddress Probe09 = { 0x28, 0x51, 0x78, 0xA8, 0x04, 0x00, 0x00, 0x7F }; // 9
DeviceAddress Probe10 = { 0x28, 0xD4, 0x2A, 0xA8, 0x04, 0x00, 0x00, 0x68 }; // 10
DeviceAddress Probe11 = { 0x28, 0x44, 0xA2, 0xE5, 0x08, 0x00, 0x00, 0xEA }; // 11
DeviceAddress Probe12 = { 0x28, 0x2B, 0x1E, 0xA8, 0x04, 0x00, 0x00, 0xA5 }; // 12
DeviceAddress Probe13 = { 0x28, 0xB8, 0xB3, 0xA8, 0x04, 0x00, 0x00, 0x92 }; // 13
DeviceAddress Probe14 = { 0x28, 0x4F, 0x6C, 0xA8, 0x04, 0x00, 0x00, 0x54 }; // 14
DeviceAddress Probe15 = { 0x28, 0xDB, 0x99, 0xA8, 0x04, 0x00, 0x00, 0x4D }; // 15
DeviceAddress Probe16 = { 0x28, 0xC7, 0x17, 0xA8, 0x04, 0x00, 0x00, 0x02 }; // 16
 

int i = 0;

void setup() {

    Serial.begin(9600);

    Serial.println("CLEARSHEET");
    Serial.println("LABEL,Date,Time,Timer,Counter,millis,Temp1,Temp2,Temp3,Temp4,Temp5,Temp6,Temp7,Temp8,Temp9,Temp10,Temp11,Temp12,Temp13,Temp14,Temp15,Temp16");


    sensors.begin();
    sensors.setResolution(Probe01, 10);
    sensors.setResolution(Probe02, 10);
    sensors.setResolution(Probe03, 10);
    sensors.setResolution(Probe04, 10);
    sensors.setResolution(Probe05, 10);
    sensors.setResolution(Probe06, 10);
    sensors.setResolution(Probe07, 10);
    sensors.setResolution(Probe08, 10);
    sensors.setResolution(Probe09, 10);
    sensors.setResolution(Probe10, 10);
    sensors.setResolution(Probe11, 10);
    sensors.setResolution(Probe12, 10);
    sensors.setResolution(Probe13, 10);
    sensors.setResolution(Probe14, 10);
    sensors.setResolution(Probe15, 10);
    sensors.setResolution(Probe16, 10);
   

}

void loop() {

    sensors.requestTemperatures();
    getTemp(Probe01);
    getTemp(Probe02);
    getTemp(Probe03);
    getTemp(Probe04);
    getTemp(Probe05);
    getTemp(Probe06);
    getTemp(Probe07);
    getTemp(Probe08);
    getTemp(Probe09);
    getTemp(Probe10);
    getTemp(Probe11);
    getTemp(Probe12);
    getTemp(Probe13);
    getTemp(Probe14);
    getTemp(Probe15);
    getTemp(Probe16);

    Serial.println( (String) "DATA,DATE,TIME,TIMER," + i++ + "," + millis() + "," + sensors.getTempC(Probe01) + "," + sensors.getTempC(Probe02) + "," + sensors.getTempC(Probe03) + "," + sensors.getTempC(Probe04) + "," + sensors.getTempC(Probe05) + "," + sensors.getTempC(Probe06) + "," + sensors.getTempC(Probe07) + "," + sensors.getTempC(Probe08) + "," + sensors.getTempC(Probe09) + "," + sensors.getTempC(Probe10) + "," + sensors.getTempC(Probe11) + "," + sensors.getTempC(Probe12) + "," + sensors.getTempC(Probe13) + "," + sensors.getTempC(Probe14) + "," + sensors.getTempC(Probe15) + "," + sensors.getTempC(Probe16) + ",AUTOSCROLL_20" );
   
}

void getTemp(DeviceAddress deviceAddress)
{
  float tempC = sensors.getTempC(deviceAddress);
}
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: larryd on Apr 05, 2018, 10:41 pm
@ThisIsFun
Start your own thread.

See these links:
https://forum.arduino.cc/index.php?topic=503368.0    (https://forum.arduino.cc/index.php?topic=503368.0)

http://forum.arduino.cc/index.php?topic=223286.0    (http://forum.arduino.cc/index.php?topic=223286.0)

https://forum.arduino.cc/index.php?topic=526696.0    (https://forum.arduino.cc/index.php?topic=526696.0)

https://forum.arduino.cc/index.php?topic=525240.0     (https://forum.arduino.cc/index.php?topic=525240.0)

Also, you might want to read up on using an RTC.





Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: jarus on Apr 16, 2018, 10:40 pm
Excel seems to keep crashing on me. Is it bc of my sample rate? CPU usage goes up to 60% while the app is running but doesn't seem to be draining resources completely. It collects data for about 400 rows and then crashes. I tried baud rate 9600 and 115200. It seems to be more stable if I increase the delay to 100ms (sampling rate of 10Hz) But realistically I need to sample at least 50Hz.

I am using an Arduino Uno, ADXL335, Windows 10 (also tried on windows 7), both 64-bit, tried with Excel 2016 and 2013. Developer mode was activated and macros were allowed to run.

I've spent all day trying to get this to work and I'm starting to get frustrated and I don't know how to fix this. Any help would be much appreciated! Thanks

Below is my code and screenshots of the error messages.

Code: [Select]
float Xread;
float Xrest;
const int Xpin = A0;

float Yread;
float Yrest;
const int Ypin = A1;

float Zread;
float Zrest;
const int Zpin = A2;

float Acceltotal;

const int trig = A3;
float trigread;
float trigprnt;

const int analogtoG = ((.330*1023)/3.3);


void setup() {
  Serial.begin(115200);      // sets the serial port baud rate
  analogReference(EXTERNAL);

  pinMode(Xpin, INPUT);
  
  pinMode(9, OUTPUT);
  digitalWrite (9, HIGH);
  delay(500);
  
  Xrest = analogRead(Xpin);      
  Yrest = analogRead(Ypin);      
  Zrest = analogRead(Zpin);      
 
  delay(499);
  digitalWrite (9, LOW);


  Serial.println("CLEARDATA");

  Serial.println("LABEL,Time,Gforce,Trigger, Millis");
  


}

void loop() {
  delay(1);
  Xread = (analogRead(Xpin) - Xrest)/analogtoG;
  Yread = (analogRead(Ypin) - Yrest)/analogtoG;
  Zread = (analogRead(Zpin) - Zrest)/analogtoG;
  Acceltotal = (abs(Xread) + abs(Yread) + abs(Zread));
  trigread = analogRead(trig);


if (trigread > 1000)
{
  trigprnt=1;
}
else if (trigprnt<1000)
{
  trigprnt=0;
}
 

Serial.print("DATA,TIME,AUTOSCROLL_20,"); Serial.print(Acceltotal, 2); Serial.print(","); Serial.print(trigprnt); Serial.print(",");   Serial.println(millis());




  delay(40);

}



Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Schildkroete1 on Jun 04, 2018, 03:15 pm
I use it on Win 10 Pro 64 bit with office 365 (2016) and it works perfect-
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jun 05, 2018, 08:06 pm
Hi guys,
first of all sorry for not replying to any message so far - I didn't get a single mail notification and thought PLX DAQ is just running fine and smooth :-)

I'll recheck the thread more frequently from now on.

Excel seems to keep crashing on me. Is it bc of my sample rate? CPU usage goes up to 60% while the app is running but doesn't seem to be draining resources completely. It collects data for about 400 rows and then crashes. I tried baud rate 9600 and 115200. It seems to be more stable if I increase the delay to 100ms (sampling rate of 10Hz) But realistically I need to sample at least 50Hz.
Hi Jarus,

sadly that is a commonly known issue I hope I'll find the time to work on any time soon. For now however the only know workaround is to try to minimize load on the communication by adding delays (~50ms) and running on low baud rates (around 9600). That way most of the tests were running stable. Not using autoscroll might help (not sure). Also don't use Excel while communication is ongoing. Like don't click into cells, don't move the Excel window around, don't move PLX DAQ window around. Doing any of that kind of "locks" Excel for the time being and can heavily mess with the input buffer and cause problems.

If you need anything more just let me know.

Greetings

Jonathan
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: dynamos on Jun 15, 2018, 03:51 pm
Hello,

Thank you for this application "free and without advertising"

My Excel sheet does not fill,
but I have all the information received on the serial port (3)
and on the direct debug of the PLX-DAQ app.

https://i43.servimg.com/u/f43/18/28/13/45/affich12.png
(https://i95.servimg.com/u/f95/18/28/13/45/th/whatsa12.jpg) (https://servimg.com/view/18281345/1311)

https://i43.servimg.com/u/f43/18/28/13/45/plx-da11.png
(https://i43.servimg.com/u/f43/18/28/13/45/th/plx-da11.png) (https://servimg.com/view/18281345/1320)

(windows 10/64, excel 2016)


Do you have a solution to offer me?


Thank you

Sorry for my very bad English, I'm French (Google translate)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jun 16, 2018, 12:05 pm
Hi dynamos,

please make sure to use the correct PLX DAQ syntax. It is described in the Beginners Guide Word document included in my post of version 2.11 (link to post) (http://forum.arduino.cc/index.php?topic=437398.msg3251256#msg3251256))

Basically it is important to use:



First clear the sheet
Seconds define your column headins
Third send your data (put that in your loop and replace the "SomeText" with your variables

Greetings

Jonathan
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: dynamos on Jun 16, 2018, 05:11 pm
Thank you Jonathan for your answer,

I move forward, I now have a display but not the results


(https://i43.servimg.com/u/f43/18/28/13/45/th/code_110.png) (https://servimg.com/view/18281345/1321)


(https://i43.servimg.com/u/f43/18/28/13/45/th/excel_10.png) (https://servimg.com/view/18281345/1322)




If you have an idea?

As you can see I start in the program
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jun 16, 2018, 08:56 pm
Well yeah,

your loop contains "CLEARSHEET" - thus you delete all your data before sending new :-) Clearsheet should be used at the beginning of your code only once (e.g., in Arduino init function).

Also in DirectDebugWindow I still see some non-PLXDAQ confirm data being posted. You should check your serial.println in order not to send too many unused data over the cable (will decrease stability)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Natha7 on Jun 21, 2018, 03:11 pm
Hi NetDevil,

I am getting the following Error when trying to connect to my Arduino Uno:

"Error open port

COM Error: Error(5): CommOpen (CreateFile) -Access denied

Aborting!"

Do you have any idea of what could be the matter? I folloed the steps in your guide but I still cannot fix it x.x

Thank you very much in advance,

Natalia


Edit: Problem was solved connecting and disconnecting Arduino. Thanks again for making this awesome program.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jun 25, 2018, 05:12 pm
I am getting the following Error when trying to connect to my Arduino Uno:

"Error open port
COM Error: Error(5): CommOpen (CreateFile) -Access denied
Aborting!"

Edit: Problem was solved connecting and disconnecting Arduino. Thanks again for making this awesome program.
Hi Natalia,
you've figured it out already on your own, but nevertheless here is the answer for all future users having the same problem:


Greetings and thanks a lot for your feedback :)  
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: jhale005 on Jun 30, 2018, 03:50 pm
Hi
Having some trouble opening the PLX-DAQ-v2.11.xlsm file.

I am using windows 10, But , have access to Excel 2003.


I have an earlier version of PLX-DAQ (cersion 1 I think).  This one appears to work following installation (.exe). 

Is there something I am leaving out???

Thanks in advance.

John
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jul 01, 2018, 10:52 pm
Hi John
in case you need support you must provide some more details. Like a screenshot or an error message or some me text.
That way it is impossible to help you.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Trickyriky on Jul 03, 2018, 07:21 pm
hi all, have been playing with plx-daq V2.11 and must say i am very impressed (massive thank you), but does the autoscroll feature actually work with windows 7 (ultimate if counts) and excel 2010?

I have tried to work off the example, but just can not get excel to autoscroll.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jul 03, 2018, 07:30 pm
Hi Trickyriky,

thank you very much for the feedback :) And I have to give it back to you as well: you got yourself a point there.

=> AUTOSCROLL relies on VBAs ActiveWindow.ScrollRow feature which was added in Office 2013 and does not work on any earlier version.

That is mentioned in the source code of PLX DAQ but neither in any of my posts nor in the Beginners Guide. In case I ever release v2.12 I'll try to remember to include that at a more popular position.

Greetings
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Trickyriky on Jul 03, 2018, 07:44 pm
Hi Trickyriky,

thank you very much for the feedback :) And I have to give it back to you as well: you got yourself a point there.

=> AUTOSCROLL relies on VBAs ActiveWindow.ScrollRow feature which was added in Office 2013 and does not work on any earlier version.

That is mentioned in the source code of PLX DAQ but neither in any of my posts nor in the Beginners Guide. In case I ever release v2.12 I'll try to remember to include that at a more popular position.

Greetings
Thank you very much for the ultra fast reply, now i know its not me i can stop playing and wait patiently.
In case your interested, your macro is logging the dataset of my home solar monitor, SysVoltage, Ampsin, Ampsout, Wattsin, Wattsout, Ah in, Ah out, Watthours in, Watthous out, and some time values. Eventually (posty dependent) it will also be monitoring the AC side of the system and my grid supply.

Again i thank you. :)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: vicolula on Jul 05, 2018, 11:36 am
Hello

Thanks for your program is really useful.

I have a problem when I try to add to my program, I am reading a flow sensor and the code works well but I'm not able to see the data in excel. I can see it on the direct debug window so I know is working but does not apear in the columns. In the control message box appears "setting labels".

What am I doing wrong?  I add a copy of my program

 thanks



unsigned long runTime;
int flowMeter = A0;              //analog pin 0
int Vo = 2500;                    // when U=0uL/min V=2.5V

void setup() {

 Serial.begin(9600);
 Serial.println("CLEARDATA");
 Serial.println("LABEL, Time, Flow");
 
}

void loop() {

    int Signal = analogRead (flowMeter); //read analog signal 0-1023
   int V = Signal * (6000 / 1023);   // signal in mV
     int Vs = V-Vo;                    // signal establishing 0
     float Vs2 = Vs/1000.0;
    int flow = Vs2 * 3171;        // 3171 nL/min/ 1V
     

      runTime = millis();
     
     Serial.print (runTime);      //show time ms
   
    Serial.println(flow); //show average flow

     delay (500);

}


Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jul 06, 2018, 07:41 am
@vicolula: you are using Arduino standard syntax. Please take a look into the Beginners Guide included in PLX DAQ as well as these posts where the same issue was solved: first post (http://forum.arduino.cc/index.php?topic=437398.msg3774084#msg3774084) and second post (http://forum.arduino.cc/index.php?topic=437398.msg3774508#msg3774508).

@Trickyriky: thanks a lot for sharing your project :) it is always great to know what people are using the software for :) I really enjoy to get to know the different kind of projects and ideas and programs people are able to achieve thanks to Arduino :) Hopefully your solar system produces at least more energy than your Arduino consumes  :smiley-mr-green:
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: dran11 on Jul 09, 2018, 04:53 am
   Hi,

I am having problem with the new PLX-DAQ : It cannot start serial transmission. There is no any activity in the PLX debug window. Although, everything looks fine when the serial on the same port is observed through some other Win Serial port monitors. Therefore I assume it is macro /excel problem with serial port opening.

I am using 64bit Win7 and Win10 , Excel 2010.
Tried all PLX  2.x versions. After pressing CONNECT button, controller message says "Timer reset"..no any data in debug window. The Excel macros and Active x are enabled. Excel never asks for permission as all settings in Trust center are enabled.

By the way, The original Paralax PLX-DAQ (uploaded on Paralax website 2014) works fine with same Excel 2010 , on both win7/10.

Thanks for any help,

Dan

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jul 09, 2018, 10:15 pm
Tried all PLX 2.x versions. After pressing CONNECT button, controller message says "Timer reset"..no any data in debug window.
Hi Dan,
duh tough question. Never heard of such an issue before. Can you post your code and a screenshot please?
"Timer reset" sounds at least like he is connecting to Arduino correctly. Is the baud rate adjusted as in your code?

By the way, The original Paralax PLX-DAQ (uploaded on Paralax website 2014) works fine with same Excel 2010 , on both win7/10.
Yeah as long as you stick with Office 32bit it will - regardless of your Windows installation. As soon as you upgrade to Office 64bit it won't work any further.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: morrisx on Jul 09, 2018, 10:43 pm
Hello NetDevil,

I am simply trying to run the example AutoGrapher-RandomValue you have in the zip file with the version 2.11, but it crashes after maybe 70 rows. Is this normal? I followed the advice and have not moved or even clicked anything after clicking connect.

Excel kept crashing on my other program I have been trying for a few days to use, so I decided to go back to the basics and use some code you provided. It's not working either. I've got Windows 10, and Microsoft 365.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Dhanraj_Gupta on Jul 26, 2018, 12:39 pm
I am unable to download the new version. Every time the link is taking me to the same page after clicking.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Wosche on Jul 30, 2018, 10:05 am
Hey guys.

I have a question to the PLX-DAQ Version 2

is there the possibility to transfer a decimal number to the Arduino program? just like 4.3 or so?

Currently I'm using the commands

Code: [Select]
  Serial.println("CELL,GET,FROMSHEET,Simple Data,G,5");   dac1_voltage = (float) Serial.readStringUntil(10).toFloat(); 

It seems tha PLX only sends the rounded number 4 instead of 4.3
I already have changed the decimal seperater to "." in Excel, but still.

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jul 30, 2018, 10:26 pm
I am unable to download the new version. Every time the link is taking me to the same page after clicking.
Hi Dhanraj: this is more an forum issue. Have you tried rightclick and "Save as"?


is there the possibility to transfer a decimal number to the Arduino program? just like 4.3 or so?
Hi Wosche: I remember having the same issue. At least in the Beginners Guide I gave a recommendation to send Strings and Integers only. But I think I said that because sending Floats is just a bit tricky. What is your DirectDebugWindow showing? There should be a line for send information as well.
Changing the decimal delimiter to a point should help, otherwise the question is whether or not your dac1_voltage variable is declared as float?
In the end you could just increase the number by 10 (depends on your places after the decimal delimiter), thus send full integers, and divide by that in Arduino.... ugly but should work....
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Wosche on Jul 31, 2018, 07:52 am
Hi NetDevil Yeah my debug window shows that for example "4,3" is sent. And this is the Problem, because than it interprets it as two separated things.

My solution  to this issues on the Arduino side was, that I just save the sent data into a String, make a for-loop iterating over all of the fieldelements and than compare and replace the "," with "." and save  it in a float afterwards. :)

Maybe you have an more elegant solution to this, that doesn't need that much processing time, escpacially when someone has a lot of variables to transfer :)


But another question came to my mind. At the moment I'm just reading out a couple of cells in excel to the Arduino program. Is there a possibilty to read out TextBoxes of an Excel GUI for example?
I would have an ugly solution for this, So that that what I write into the GUI textboxes is written into cells, and the PLX-DAQ takes it from there, but is there a more direct solution for this?

And thanks a lot!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: monamomeni on Aug 01, 2018, 08:42 am
Hello,

Just wanted to ask if PLX-DAQ v2.11 is supported on Mac. I don't have a mac but the code I am working on is probably tested on a macbook.

Thank a lot for good work!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: monamomeni on Aug 01, 2018, 09:32 am
Hey,

I just tried to run DefaultSketch.ino on MKR1000 with Arduino IDE version 1.8.4, but every time I try to Connect and start logging, the UI kind of crashes and the excel shut down. It restarts and recovers the PLX-DAQ xlms file. I am on Windows 10, 64bits.

Will be very thankful if you have any idea.

Edit: I am using Office 365 ProPlus, so may be this is the reason. Can I install an older office and keep my own at the same time if Office 365 is not supported with PLX-DAQ?

Best regards,
Mona
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: atExcel on Aug 02, 2018, 06:24 pm
Hi net^devil,
thank you so much four your Excel-File. I just startet in electronics and programming my arduino. I was not happy with the serial monitor and plotter - now I should be able to work with my output data in Excel.

My question. Is it okay for you, if I publish some tutorials of your software at YouTube? I've got a German Excel YouTube-Channel www.youtube.com/athehos and would like to demonstrate PLX-DAQ.

Thanks a lot
Andreas
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Aug 04, 2018, 10:37 am
Duh, a lot to reply on :) let's give it a try!


@Wosche:
Yeah my debug window shows that for example "4,3" is sent. And this is the Problem, because than it interprets it as two separated things. (...) Maybe you have an more elegant solution to this, that doesn't need that much processing time
That shouldn't be the case. If it sends the string with a comma already you need to work on your delimiter in Excel. Maybe try using '=4.3 (make sure of the apostrophe) or format the cell as text and type 4.3. Since I don't have direct access to my Arduino dev IDE at the moment all I can say is that I once managed to make it send a point-separated float to the Arduino. It is possible :)

Is there a possibilty to read out TextBoxes of an Excel GUI for example?
I would have an ugly solution for this, So that that what I write into the GUI textboxes is written into cells, and the PLX-DAQ takes it from there, but is there a more direct solution for this?
And thanks a lot!
No, there is currently no possibility. A maybe lightly less ugly workaround is to label the checkboxes and tick them to switch between values. Of course you can only story 4 values by that and your Arduino needs to know which box is what and interpret the checked/unchecked values (1/0) to the numbers again. Is ugly as well....
In case you are familiar with VBA (isn't that hard) you can adjust the code (insert a textbox, create a new command "GETCONTENTFROMTEXTBOX" and instead of reading the cell value read the text box value).
And: you're welcome :)



@Mona:
Just wanted to ask if PLX-DAQ v2.11 is supported on Mac. I don't have a mac but the code I am working on is probably tested on a macbook.
Neither do I, sorry :-/ just give it a try but I reckon since there is a lot of API calls it might fail. I guess a similar question has been asked in this thread as well once before  :smiley-confuse:

I just tried to run DefaultSketch.ino on MKR1000 with Arduino IDE version 1.8.4, but every time I try to Connect and start logging, the UI kind of crashes and the excel shut down. It restarts and recovers the PLX-DAQ xlms file.
Edit: I am using Office 365 ProPlus, so may be this is the reason. Can I install an older office and keep my own at the same time if Office 365 is not supported with PLX-DAQ?
Office 365 is the web version, isn't it? That will surely have trouble to connect to all the APIs used.
Not sure about having to versions installed at the same time. It might work that they can start and run, but I don't know if they might have problems with updating / overriding system files they both use.
What I did (in the beginning to find out why PLX DAQ v1 wasn't running on specific Windows / Office versions) was to use Virtual PC software and install another version of Office in there. It is quite unhandy but at least it works even with Arduino



@Andreas:
Hi net^devil,
thank you so much four your Excel-File. I just startet in electronics and programming my arduino. I was not happy with the serial monitor and plotter - now I should be able to work with my output data in Excel.
Funny thing, that is exactly where I started from as well :) I just wanted a way better way to visualize my data.

My question. Is it okay for you, if I publish some tutorials of your software at YouTube? I've got a German Excel YouTube-Channel www.youtube.com/athehos and would like to demonstrate PLX-DAQ.
Well, since I am German as well let me put it like this: na siggi ! ("sure do")
As mentioned in the code PLX DAQ v2 is widely inspired by v1 and I do not hold any rights on the code or rather do not want to hold any rights. Use it as you like, mod it as you like, spend me a beer if we meet one time and you like (you sure might have a higher chance meeting me since we are both from Germany ;) ). It will be my pleasure to have a wider audience get in touch with the software and it might increase my motivation to finally get to work on v3 (alternative main code with hopefully much more stability).



Greetings to all of you!

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: atExcel on Aug 06, 2018, 09:13 pm
Hi net^devil,

Quote
na siggi ! ("sure do")
this is how it should be done!
1. the YouTube-Tutorial
2. the beer ;-)


You can find my contact information on my channel.
Glück Auf!
Andreas
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: joseph_1234 on Aug 23, 2018, 09:53 am
hi,

I am trying to  extract  my data from  arduino (i have both nano and uno) wirelessly and wish to  plot the data on a graph.

I make use of the wifi module  esp 8266 and follow the procedure from this link

https://github.com/Cloudino/Cloudino-Doc/wiki/Make-your-first-Cloudino

to make a wifi cloud connector and i will be using cloudino.io cloud server to program my arduino wirelessly.

Is it possible to  use plx daq to  obtain data from the arduino from my sensor  as i will not be connecting my arudino to any usb port ?

If so ,  can i trouble you to advise me on what kind of modifications which need to be done  to implement this idea.

Thanks for your time in advance.




Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Aug 26, 2018, 03:46 pm
Is it possible to  use plx daq to  obtain data from the arduino from my sensor [wifi esp 8266] as i will not be connecting my arudino to any usb port ?
If so ,  can i trouble you to advise me on what kind of modifications which need to be done  to implement this idea.
Hi joseph,

first of all => sadly PLX DAQ does not work with wifi modules like esp 8266. The communication is build on USB comm port communication only.

PLX DAQ could be modded to receive data not from "that one connection" but rather from a generalized module. This module could then be extended to receive data from USB or Network. For network a separate listener would be needed (thus e.g., a server side component to listen within your wifi). It will be some kind of larger design of an architecture.

Actually this is what I wanted to develop in the first place - but I never got my freaking ESP 8266 modules to work properly !!! The voltage converter to 3V (I guess) always resulted in garbage being send between my Arduino and the ESP 8266 ...
The USB communication is kind of problematic for PLX DAQ and I would like think about switching to ethernet communication. Although I don't have any time at the moment to do that ...
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: joseph_1234 on Aug 26, 2018, 04:55 pm
Hi joseph,

first of all => sadly PLX DAQ does not work with wifi modules like esp 8266. The communication is build on USB comm port communication only.


Hi,
thanks for your reply,
no worries , i will try something else :)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: joshjoshjosh123 on Sep 03, 2018, 03:50 pm
Hey NetDevil,

Sorry if this has already been asked/answered, I couldn't find it anywhere.

Is it possible to use PLX-DAQ in combination with a APC220? I'm able to print and read the prints using a serial monitor program, but PLX-DAQ doesn't see anything. It recognises that the COM port is in use and able to connect, but nothing in the spreadsheet or raw data logger.

Any ideas?

Thanks in advance!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Sep 08, 2018, 12:05 pm
Is it possible to use PLX-DAQ in combination with a APC220? I'm able to print and read the prints using a serial monitor program, but PLX-DAQ doesn't see anything. It recognises that the COM port is in use and able to connect, but nothing in the spreadsheet or raw data logger.
Hi Josh,

basically PLX DAQ is compatible with all kinds of hardware, as long as the data can be send via the Serial Monitor. Please check out the Beginners Guide included in the downloads to get to know the syntax.

In case there really is nothing shown in the DirectDebugWindow I guess it will most likely be a wrong baud rate? Please make sure baud rate in PLX DAQ is the same as in your Arduino code.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: ankit643 on Oct 02, 2018, 08:36 am
Hello,
I have multiple systems that log data one time when system is turned on.
My problem is that each time it store data on first column. Is there any way i can store each data in different column??

Thanks in advance.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Oct 02, 2018, 09:10 am
Is there any way i can store each data in different column??
Hi,
might be that CELL,SET command can be used to solve your problem.
Please take a look at the beginners guide for instructions.

Greetings
Jonathan
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: ankit643 on Oct 09, 2018, 03:03 pm
Thanks
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: ankit643 on Oct 10, 2018, 07:36 am
I tried Cell Set feature it stores data in first row,

I want to know how can we find number of rows in which data is already stored so that when next time I reconnect my module it stores data after that.

I will row set that number
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Oct 15, 2018, 06:47 pm
I want to know how can we find number of rows in which data is already stored so that when next time I reconnect my module it stores data after that.
Hi,
there currently is no function for that. You could uncheck the box "Restart Arduino on connection" (or something like that) to keep your counter, but it only works in case your Arduino has not been rebooted otherwise (e.g., power cut).

Another way is to implement a new function like "GETMAXROWS", similar to "CELL,GET" syntax. Since you are already developing code you will be capable of this - VBA is not that hard and there is plenty of code to cop from. You can access PLX DAQ code by pressing ALT+F8.
To get max rows use code like this: ActiveSheet.Cells(ActiveSheet.Rows.count, 1).End(xlUp).Row
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: bogus105 on Dec 26, 2018, 10:06 pm
Mr NetDevil!

Thank you for the tool you've made!

I'm interested in device that will send data to excel spreadsheet. It will measure the distance during the device movement and those measurements should be transfered to excel spreadsheet on-the-fly (because arduino doesn't have enough internal RAM, or writing to SD card is probably too slow). Each measurement will be 8 bit signed value as i plan to send the distance difference (increment) only (so it will be positive or negative number) instead of absolute distance.
The measurement will be taken up to 5000 times a second so every 0,2 usec. Is it possible to send data via serial connection via PLX-DAQ at that speed - 1 byte per 0.2 micro second? It is 5k Bytes a second. Probably the serial connection should be 57 600 kbps or higher, right?

Next thing: after the data is loaded to excel i will process it and then i want the processed data to be sent back to arduino over serial.
But this time the device will replicate the measured profile at much slower speed. As arduino doesn't have much memory for the buffer to receive all the data from serial is it possible to monitor if the arduino buffer is full and to stop data transfer over serial until arduino have a room for the next data.

Is it possible to make arduino to initiate the data transfer from excel when it is ready to replicate the profile?


Or maybe esp8266 for that?;/
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Redwire on Dec 28, 2018, 07:39 am
I'm using Excel 2019 with v2.11.   I can view the data from the Arduino pro-micro in the "display direct debug" box in Excel,  but nothing will display in the Excel spreadsheet cells.  I'm using a very simple sketch as the example provided with  2.11 locks up Excel 2019.     If I click "Clear Columns"  it will clear the columns.    The controller message just says "timer reset"  after connecting.     Any suggestions?
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Dec 30, 2018, 08:01 pm
Hi Redwire, let's see:

I'm using Excel 2019 with v2.11.
Interesting, I haven't tested Office 2019 yet. Please keep us posted if PLX DAQ is working with it (once we solved your problems ;) )

I can view the data from the Arduino pro-micro in the "display direct debug" box in Excel,  but nothing will display in the Excel spreadsheet cells.
Can you please post the exact content that is posted in the DirectDebugWindow? I assume the Serial.println syntax is not according to PLX DAQ needs

I'm using a very simple sketch as the example provided with  2.11
Yeah, the devil is in the details ;) Let's see according to what's your answer to aboves question.





Hi bogus105, you're next :)

Mr NetDevil!

Thank you for the tool you've made!
Oh come on!  :D but thanks a lot :)


The measurement will be taken up to 5000 times a second so every 0,2 usec. Is it possible to send data via serial connection via PLX-DAQ at that speed - 1 byte per 0.2 micro second? It is 5k Bytes a second. Probably the serial connection should be 57 600 kbps or higher, right?
Honestly I am not sure any Arduino can measure 5000 times per second. Try using the for loop with nothing more but Serial.println(millies()); I guess you will get one line every firth millisecond. Thus no way to have 5000 data sets per second. But my experience is from Arduino Uno. Might be other boards are (way) faster.
Transfer rate to PLX DAQ (or via Serial connection in any scenario) are measured in BAUD. There sure are tools to calculate the respectively needed baud rate, but please be aware that PLX DAQ struggles with some very high baud rates over longer time periods. This might have to do with your PCs performance.

Next thing: after the data is loaded to excel i will process it and then i want the processed data to be sent back to arduino over serial.
But this time the device will replicate the measured profile at much slower speed. As arduino doesn't have much memory for the buffer to receive all the data from serial is it possible to monitor if the arduino buffer is full and to stop data transfer over serial until arduino have a room for the next data.
Is it possible to make arduino to initiate the data transfer from excel when it is ready to replicate the profile?
You can use CELL,GET command to ask for the content of any specific cell out of Excel. As of now there is the need to do an endless wait-loop and wait for the data to be received. That might stop all your other measurements. However that loop can also be included in the main loop with some clever programming.

Or maybe esp8266 for that?;/
Naaa, wifi is not supported by PLX DAQ, sorry for that ;)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Redwire on Dec 31, 2018, 07:21 pm
NetDevil   attached is the output
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jan 01, 2019, 11:16 am
NetDevil   attached is the output
Yeah as expected. You are not using the required PLX DAQ syntax. Please read the Beginners Guide attached in the download package and get familiar with the DATA-syntax for your Serial.println command.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Redwire on Jan 02, 2019, 01:24 am
Not seeing the issue   according to the Beginner Guide   "All communication will be done by Serial.println commands just like the commands you use to send from Arduino to monitor in your Arduino IDE Serial Monitor."
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jan 02, 2019, 05:35 am
Not seeing the issue   according to the Beginner Guide   "All communication will be done by Serial.println commands just like the commands you use to send from Arduino to monitor in your Arduino IDE Serial Monitor."
Yes, but you need to use the correct syntax of commands you send to Excel. Namely DATA as mentioned. Starting with DATA followed by each columns value separated by a comma. It's all in the guide
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: ianthetraveller on Jan 03, 2019, 08:39 pm
Just like to thank you NetDevil for writing this macro. I've used it successfully for a year or so with a sketch to measure the Ah capacity of lead-acid batteries with an arduino. Should have thanked you earlier. I found macros quite tricky to write so karma to you.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: seshadvm on Jan 17, 2019, 11:36 pm
Hey NetDevil,
Thanks a lot for the updates. I am trying to add more sensor values into different columns but am unable to do that. Do you have any suggestions for that.

Regards
Vik
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jan 20, 2019, 04:06 pm
Just like to thank you NetDevil for writing this macro. I've used it successfully for a year or so with a sketch to measure the Ah capacity of lead-acid batteries with an arduino. Should have thanked you earlier. I found macros quite tricky to write so karma to you.
Hi ianthetraveller,
thank you very much for feedback :) I really enjoy getting to know the projects people are doing with PLX DAQ. This is what inspires me the most with Arduino, everyone can become a creator. Good luck with your project!




Hey NetDevil, Thanks a lot for the updates. I am trying to add more sensor values into different columns but am unable to do that. Do you have any suggestions for that.
Hi Vik,
you can easily add multiple values in your DATA command like this: Serial.println( (String) "DATA,date,time," + value1 + "," + value2 + "," + value3); There are multiple examples of it within this thread as well as in the BeginnersGuide I guess. Have fun :)

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: moneill717 on Jan 29, 2019, 10:28 pm
Does anyone know how to get this working with a Mac? The ports for the Arduino are not listed in the same way "/dev/cu.usbmodem143101" etc. rather than "COM4" etc.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jan 30, 2019, 09:24 am
Does anyone know how to get this working with a Mac? The ports for the Arduino are not listed in the same way "/dev/cu.usbmodem143101" etc. rather than "COM4" etc.
Hi Moneill717,
thanks for posting your question of the PM in the board as well :) Sadly there has never been a Mac user who reported back on possibilites. Last guess I had was here to modify the settings sheet to force using the port: https://forum.arduino.cc/index.php?topic=437398.msg3397276#msg3397276 (https://forum.arduino.cc/index.php?topic=437398.msg3397276#msg3397276)
Please keep me / us updated in case you have any success :)

Greetings

Jonathan
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: 877 on Feb 26, 2019, 09:10 pm
@NetDevil just discovered this, and already used it to take average measurements from my BME280 sensors.
Just wanted to say thanks!!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: marcorba2 on Mar 03, 2019, 09:39 am
Hello NetDevil, I am using PLX-DAQ, congratulations!!!.

I´ve tried read the cell value and I would like to read the active cell. not its value. Could I do it with PLX-DAQ?
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Mar 03, 2019, 07:27 pm
@NetDevil just discovered this, and already used it to take average measurements from my BME280 sensors.
Just wanted to say thanks!!
Hi 877 and thank you very much for your feedback! It's always much appreciated :) Funny thing: I started updating PLX DAQ v1 to take measures with a BME180 pressure sensor :) Good luck with yours (nice to know it exists as an advantaged version including all types of different sensors)




Hello NetDevil, I am using PLX-DAQ, congratulations!!!.
I´ve tried read the cell value and I would like to read the active cell. not its value. Could I do it with PLX-DAQ?
Hi marcorba2, well there is no feature out of the box for that. I reckon you want to have the cells address right? Like "C2" or "E53"? Or do you want to have the value of the currently selected cell? Anyways you can use the CustomDevPoints which are described in the Beginners Guide chapter "Doing your own stuff" an need to code that yourself, although it is pretty simple. Open the code editor in Excel (Alt + F11) and search for the function named something like CustomDevPoint. There you can create your own command (similar to DATA or TIMER or SAVEWORKBOOKAS) let's say "VALUEOFACTIVECELL" or "ADDRESSOFACTIVECELL") and paste the VBA code. It should be something like ThisWorkbook.ActiveCell.Value or ThisWorkbook.ActiveCell.Address. The commands are really simple, Google should be able to help you pretty fast.
Thanks as well for your feedback and in case you have any questions feel free to ask.



Greetings to both of you

Jonathan

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: jasonn0413 on Mar 12, 2019, 08:38 am
Hi, I'm in need of some help with using this PLX-DAQ software and Excel, I'm a complete blank slate when it comes to programming or coding and I would really appreciate the help.

I'm conducting an experiment which I need to measure people's skin conductance and I'm doing it with Arduino, I'm going to provide the link to where I got the idea from to measure skin conductance using Grove-GSR Sensor here so that anyone willing to help can get an idea of where I'm coming from. (http://wiki.seeedstudio.com/Grove-GSR_Sensor/)

I'm using the code for Arduino IDE and not the raspberry pi.

My problem here is that I do not know how to transfer the data that I've obtained from the serial plotter into Excel. I've done some reading on guides on how to but I've still no idea on how to do it, as I'm completely new in this..

Any help is very much appreciated and I know I'm asking to be spoon-fed here but I'm really out of options.

Thanks in advance.

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Mar 12, 2019, 10:25 am
Hi Jason,

good thing you pointed out yourself how spoon-fed the issue sounds - otherwise I might have done that :)

The good news on the other hand is, that as long as your data can be posted to Serial Monitor in Arduino IDE it can be posted to Excel as well using PLX DAQ. All you have to do is replace your "Serial.println(yourOutputHere);" commands with the PLX DAQ syntax which basically is "Serial.println("DATA,ValueForColumnA,ValueForColumnB,ValueForColumnC,....,ValueForColumnX");

You can read all about it in the Beginners Guide that is attached to the zip file or attached to the v2.11 post (http://forum.arduino.cc/index.php?topic=437398.msg3251256#msg3251256).

Try starting with the default sketch and try to understand the syntax. All it does is spam data in a loop to Excel, just the same way you want to send data. Next step, try to change the data to some different values and the final step is to implement the data you have measured using your build.

In case you have any specific questions rather then general ones please feel free to post here.

Greetings

Jonathan
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: jasonn0413 on Mar 12, 2019, 12:08 pm
Hi Jason,

good thing you pointed out yourself how spoon-fed the issue sounds - otherwise I might have done that :)

The good news on the other hand is, that as long as your data can be posted to Serial Monitor in Arduino IDE it can be posted to Excel as well using PLX DAQ. All you have to do is replace your "Serial.println(yourOutputHere);" commands with the PLX DAQ syntax which basically is "Serial.println("DATA,ValueForColumnA,ValueForColumnB,ValueForColumnC,....,ValueForColumnX");

You can read all about it in the Beginners Guide that is attached to the zip file or attached to the v2.11 post (http://forum.arduino.cc/index.php?topic=437398.msg3251256#msg3251256).

Try starting with the default sketch and try to understand the syntax. All it does is spam data in a loop to Excel, just the same way you want to send data. Next step, try to change the data to some different values and the final step is to implement the data you have measured using your build.

In case you have any specific questions rather then general ones please feel free to post here.

Greetings

Jonathan
Hi there, thanks very much for the reply, I still haven't solve the problem but I have a rough idea of how the code and program works, I just have one last problem.

I've just made a little tweak towards the original code I got from the website.

const int GSR=A0;
int sensorValue=0;
int gsr_average=0;

void setup() {

Serial.begin(9600);

Serial.println("CLEARDATA");

Serial.println("LABEL,SkinConductance,Time,TIMER");

Serial.println("RESETTIMER");

}

void loop(){
  long sum=0;
  for(int i=0;i<10;i++)           //Average the 10 measurements to remove the glitch
      {
      sensorValue=analogRead(GSR);
      sum += sensorValue;
      delay(5);
      }
   gsr_average = sum/10;
   Serial.println( (String) "DATA,gsr_average,TIME,TIMER,AUTOSCROLL_20" );
}

All of the above was able to be recorded in Excel like the time and timer except for the gsr_average value, instead it records the literal word "gsr_average" instead of the value. Am I doing something wrong here? Sorry for the noob questions.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: cryotan on Mar 12, 2019, 06:41 pm
I am so excited about this package!  Thanks for the wonderful work, NetDevil.   

Did anybody report that the following println code consume so much memory?

// set the names for the 3 checkboxes
  Serial.println("CUSTOMBOX1,LABEL,Stop logging at 5 min?");
  Serial.println("CUSTOMBOX2,LABEL,Resume log at 360?");
  Serial.println("CUSTOMBOX3,LABEL,Quit at 3600?");

  // check 2 of the 3 checkboxes (first two to true, third to false)
  Serial.println("CUSTOMBOX1,SET,1");
  Serial.println("CUSTOMBOX2,SET,1");
  Serial.println("CUSTOMBOX3,SET,0");

The following is with them included:
---------------------------------------------
Global variables use 1642 bytes (80%) of dynamic memory, leaving 406 bytes for local variables. Maximum is 2048 bytes.
Low memory available, stability problems may occur.

and with them commented out:
---------------------------------------------
Global variables use 1484 bytes (72%) of dynamic memory, leaving 564 bytes for local variables. Maximum is 2048 bytes.


Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Mar 12, 2019, 08:53 pm
I just have one last problem.
Code: [Select]
Serial.println( (String) "DATA,gsr_average,TIME,TIMER,AUTOSCROLL_20" );
All of the above was able to be recorded in Excel like the time and timer except for the gsr_average value, instead it records the literal word "gsr_average" instead of the value. Am I doing something wrong here?
Hi Jason,
thanks for digging into the documentation and congratz on making it (nearly :) ) work.
The issue is you literally put your variable name in the string. Try changing it to:
Code: [Select]
Serial.println( (String) "DATA," + gsr_average + ",TIME,TIMER,AUTOSCROLL_20" );




@cryotan:
thank you very much for your feedback.
And well, no, that issue has never been brought up yet :) So let's see:
- first of all the amount of memory consumed depends on your Arduino. I am developing on an Arduino Uno (which is already pretty weak) but honestly I have never paid much attention to those warnings.... is 2048 the max for all kind of Arduinos? The Mega2560 for example seems to have 4 times the SRAM.
- Excluding the command will most likely free up the space that would normally be allocated for the large strings. However if one wants to label the command boxes I guess there is no other way then to hardcode the names :-/ or one could put the information to Excel and query + rewrite it (would be only commands stored in Arduino).
- I guess the boxes will be rarely used and hopefully people will reduce code only to what is needed :) otherwise Arduino might be able to page swap - or does it not compile if > 100% are used?

-----------------

Greetings to both of you.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: cryotan on Mar 13, 2019, 01:16 am
@NetDevil  Thanks for your prompt reply.    I have a 4 channel temperature shield and it fails when the memory reaches the limit. I have to drop those Serial.print lines for it to operate.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: cryotan on Mar 13, 2019, 07:19 am
@NetDevil  I want to replace the customcheckbox 1 and 2 with two set of spinbutton and textbox; and use GET from arduino to set sampling frequency and recording duration. i need some help with VB script. How do I save the last config values in settingsheet?

Code: [Select]
Private Sub SpinButton1_Change()
On Error Resume Next
TextBox1.Text = SpinButton1.Value
End Sub

Private Sub TextBox1_Change()
On Error Resume Next
SpinButton1.Value = TextBox1.Text
End Sub

Private Sub SpinButton1_SpinDown()
   TextBox1.Text = Val(TextBox1.Text) - 1
End Sub
Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
   Select Case KeyAscii
     Case vbKey0 To vbKey9, 8
     Case Else
       KeyAscii = 0
       Beep
   End Select
End Sub

Private Sub SpinButton1_SpinUp()
   TextBox1.Text = Val(TextBox1.Text) + 1
End Sub

Private Sub SpinButton2_Change()
On Error Resume Next
TextBox2.Text = SpinButton2.Value
End Sub
Private Sub TextBox2_Change()
On Error Resume Next
SpinButton2.Value = TextBox2.Text
End Sub

Private Sub SpinButton2_SpinDown()
   TextBox2.Text = Val(TextBox2.Text) - 1
End Sub

Private Sub SpinButton2_SpinUp()
   TextBox2.Text = Val(TextBox2.Text) + 1
End Sub

Private Sub TextBox2_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
   Select Case KeyAscii
     Case vbKey0 To vbKey9, 8
     Case Else
       KeyAscii = 0
       Beep
   End Select
End Sub


(https://drive.google.com/a/memoryimprintstudio.com/file/d/1EngNu6A-c5VgUU3OpD8_W5LsexQM94xo/view?usp=drivesdk)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: 30percent on Mar 13, 2019, 07:08 pm
@NetDevil

This is some really good work you have done here. I've been going over the guide and demo code all morning. You deserve more than karma and kudos for the work! Before I get too far in experimenting with the demo code, I would like to know if what I'm trying to do is possible using PLX-DAQ and the cell.get.xx command. Instead of using it for data logging, I need to scroll through a list of numbers in Excel, multiple columns, multiple rows, values 1-124. Each row has two cells/values that need to trigger a specific LED on an 8x16 NeoPixel LED Matrix (two 8x8 in a row). As you scroll down the list active row/cell it shuts off the last LED's from the previous row and turns on the new. It sounds fairly simple, but the exchange from Excel to Sketch is my road block. Is what I'm trying to do possible with the chosen hardware? Thank you for your time and excellance!

Photo Album, WIP
https://photos.app.goo.gl/5ycw7RMZxF44q31p8 (https://photos.app.goo.gl/5ycw7RMZxF44q31p8)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: cryotan on Mar 14, 2019, 01:06 am
Wondering if somebody can help with this.  I am playing with CustomDevPointNewData to stop logging at certain duration (set at a textBox). I am thinking to get the millis or timer from the newdata string to pause the logging! But never can get it to work.  Any help will be appreciated!!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Mar 14, 2019, 09:18 am
Hi 30percent,

You deserve more than karma and kudos for the work!
Thanks a lot :) that is my I published under the beer license. Come to Germany and toast me a Hefeweizen (Wheat beer) if you like ;) You are more then welcome.

Before I get too far in experimenting with the demo code, I would like to know if what I'm trying to do is possible using PLX-DAQ and the cell.get.xx command.
Ok let's get to the real work here :)
It is actually possible, yes. As you know the dimensions of your matrix in Excel you can create a loop counter in Arduino to go from x to y and from column a to b and read the value, wait for the response, act according to it and move on. However I fear the delay between request and response might be pretty long. Also it requires some tricky programming because you can either a) request-and-wait for the response (which would block the execution of all other code) or b) request, set a global variable to name to current LED you are looking for, continue with the standard Arduino loop all over as long as you have no response, once you get the response react on it (as you know which LED you are currently operating on) and move on to the next LED.
How frequent do you want to change the LEDs? Like 24 times per second to show a movie or like playing Tetris and changing some of them once per second?
I would really like to know if it works :)





Hi cryotan,
well let's see:

I am playing with CustomDevPointNewData to stop logging at certain duration (set at a textBox). I am thinking to get the millis or timer from the newdata string to pause the logging! But never can get it to work.
Why not read the value from the textbox to Arduino and stop sending log data there once the value is reached?
Otherwise "CustomDevPointNewData" can be used, sure. It is called each and every time a DATA command is received. Simply split up the information passed to function by the "," and select n-th part (your millis-part, e.g. the 4-th one in "DATA,TIME,DATE,millis(),Something,Something")), compare that to the value in your textbox and in case it is larger return a "false" by the function. As far as i know (got no access to the code at the moment) that should prevent PLX DAQ from logging. Otherwise just create a global variable on your own and set it to false and expand my function that actually writes to the sheet to check that variable. Or if you are comfortable with completely stop PLX DAQ from running programmatically click the "Stop logging" button (something like btn_loggin.click() or stuff like that).

I have a 4 channel temperature shield and it fails when the memory reaches the limit. I have to drop those Serial.print lines for it to operate.
Ok that is though. Would you mind doing me the favor to check how much memory my demo sketch takes upon just by itself? The 8% for that few lines is though but there won't be any good workaround in case someone really needs to use those boxes as the command is pretty long itself already....

How do I save the last config values in settingsheet?
That is kind of tricky ... on load there is a function that looks up all values on the (hidden in Excel) sheet and puts them into variables. Just look for the function that has multiple identical lines - it was dirty coding ;) Saving to the sheet by VBA is pretty simple. It is just Sheetname.cells(row,column).value = YourValue. That's all.


-----------------------------

Greetings
Jonathan

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: 30percent on Mar 14, 2019, 02:19 pm

Hefeweizen! We are definitely on the same page Sir. The night is on me if I ever make it to German. Salute!

I will be working on this all day. Hopefully have something to share later. The operation I need this for is much slower, manually controlled between LED changes approximately 10sec to 2 minutes apart. I think option B) is where I'll start. I will create global variables for each x,y LED and have the value in the cell trigger the variable/turn on the LED until the next row/cell is selected. Unfortunately its not for anything as cool as animation or imaging. This is to control LED light through hundreds (124x2)of 1mm fiber optic end light cable strands and turn off/on individual strands from each matrix from Excel. There are some photos in the album attached above showing some 3D printed parts securing the fiber strand. When I get the software operational, mechanical won't take long to finish so I can share the complete project/purpose, (o.-).

Off topic, Are you signed up on Code Mentor?
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: cryotan on Mar 14, 2019, 07:02 pm
@NetDevil  Hi Jonathan,  

The memory consumption for the full default sketch:
------------------------------------------------------------------
Sketch uses 5258 bytes (16%) of program storage space. Maximum is 32256 bytes.
Global variables use 844 bytes (41%) of dynamic memory, leaving 1204 bytes for local variables. Maximum is 2048 bytes.

and after removing the following lines:

Code: [Select]
// 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 2 of the 3 checkboxes (first two to true, third to false)
 //  Serial.println("CUSTOMBOX1,SET,1");
 //  Serial.println("CUSTOMBOX2,SET,1");
 //  Serial.println("CUSTOMBOX3,SET,0");


-------------------------------------------------------------------
Sketch uses 5054 bytes (15%) of program storage space. Maximum is 32256 bytes.
Global variables use 688 bytes (33%) of dynamic memory, leaving 1360 bytes for local variables. Maximum is 2048 bytes.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Snaggles on Mar 19, 2019, 03:55 pm
Hi NetDevil,

I'm hoping that you or anyone can help me.

I'm will be running 8 probes (only 2 for now) and I can get data to go into Excel great. I even have it able to tell me which probe is with which data. The only problem is that it all goes into 1 sheet and I really would like it to go to their own sheets based off of which probe it's reading from.

I tried CELL,SET,ONSHEET but that didn't work the way I wanted. I'm thinking that I might have to do some VBA in the Excel sheet but I'm a little lost there as well.

Thanks!

This is what I have now:

Code: [Select]

// WhiteBox Labs -- Tentacle Shield -- I2C example
// www.whiteboxes.ch
//
// How to retrieve continuous sensr readings from op to 8 Atlas Scientific devices on the I2C bus
// and send the readings to a host computer via serial.
//
// This code is intended to work on all 5V tolerant Arduinos. If using the Arduino Yun, connect
// to it's usb serial port. If you want to work with the Yun wirelessly, check out the respective
// Yun version of this example.
//
// USAGE:
//---------------------------------------------------------------------------------------------
// - Set all your EZO circuits to I2C before using this sketch.
//    - You can use the "tentacle-steup.ino" sketch to do so)
//    - Make sure each circuit has a unique I2C ID set
// - Adjust the variables below to resemble your setup: TOTAL_CIRCUITS, channel_ids, channel_names
// - Set host serial terminal to 9600 baud
//
//---------------------------------------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------------------------
//
//Adapted with PLX-DAQ V 2
//
//---------------------------------------------------------------------------------------------

#include <Wire.h>                     // enable I2C.

char sensordata[30];                  // A 30 byte character array to hold incoming data from the sensors
byte sensor_bytes_received = 0;       // We need to know how many characters bytes have been received

byte code = 0;                        // used to hold the I2C response code.
byte in_char = 0;                     // used as a 1 byte buffer to store in bound bytes from the I2C Circuit.

#define TOTAL_CIRCUITS 2        // <-- CHANGE THIS | set how many I2C circuits are attached to the Tentacle shield(s): 1-8

int channel_ids[] = {97, 98};// <-- CHANGE THIS.
// A list of I2C ids that you set your circuits to.
// This array should have 1-8 elements (1-8 circuits connected)

char *channel_names[] = {"Probe 1", "Probe 2"}; // <-- CHANGE THIS.
// A list of channel names (must be the same order as in channel_ids[])
// it's used to give a name to each sensor ID. This array should have 1-8 elements (1-8 circuits connected).
// {"PH Tank 1", "PH Tank 2", "EC Tank 1", "EC Tank2"}, or {"PH"}

/*
   Setup Save Workbook Timer
*/

unsigned long previousMillis = 0;
const long interval = 30000;

/*
   End Save Workbook Timer
*/

void setup() {                      // startup function
  Serial.begin(9600);                // Set the hardware serial port.
  Wire.begin();                // enable I2C port.


  //Serial.println("CLEARDATA"); // Clears starting at row 2
  Serial.println("CLEARSHEET"); //Clears sheet Probe 1 starting at row 1


  //Define Columns
  Serial.println("LABEL,Time,Timer,Probe,mg/L 02,");

  //Set the names for the 3 checkboxes
  //Serial.println("CUSTOMBOX1,SET,0");
  //Serial.println("CUSTOMBOX2,SET,0");
  //Serial.println("CUSTOMBOX3,SET,0");

}

void loop() {
  //Read Probe Data
  for (int channel = 0; channel < TOTAL_CIRCUITS; channel++) {       // loop through all the sensors

    Wire.beginTransmission(channel_ids[channel]);     // call the circuit by its ID number.
    Wire.write('r');                              // request a reading by sending 'r'
    Wire.endTransmission();                            // end the I2C data transmission.

    delay(1000);  // AS circuits need a 1 second before the reading is ready

    sensor_bytes_received = 0;                        // reset data counter
    memset(sensordata, 0, sizeof(sensordata));        // clear sensordata array;

    Wire.requestFrom(channel_ids[channel], 48, 1);    // call the circuit and request 48 bytes (this is more then we need).
    code = Wire.read();

    while (Wire.available()) {          // are there bytes to receive?
      in_char = Wire.read();            // receive a byte.

      if (in_char == 0) {               // null character indicates end of command
        Wire.endTransmission();         // end the I2C data transmission.
        break;                          // exit the while loop, we're done here
      }
      else {
        sensordata[sensor_bytes_received] = in_char;      // append this byte to the sensor data array.
        sensor_bytes_received++;
      }
    }

    //End Read Probe Data

    //Print Probe Data

    Serial.println(':');

    switch (code) {                          // switch case based on what the response code is.
      case 1:                               // decimal 1  means the command was successful.
        Serial.println( (String)"DATA,TIME,TIMER," + channel_ids[channel] + "," + sensordata + ",AUTOSCROLL_20");       // print the actual reading
        break;                                // exits the switch case.

      case 2:                                // decimal 2 means the command has failed.
        Serial.println("command failed");   // print the error
        break;                                 // exits the switch case.

      case 254:                              // decimal 254  means the command has not yet been finished calculating.
        Serial.println("circuit not ready"); // print the error
        break;                                 // exits the switch case.

      case 255:                              // decimal 255 means there is no further data to send.
        Serial.println("no data");          // print the error
        break;                              // exits the switch case.

    }
  }

  // for loop

  //Automatically save workbook every minute (60000ms)
  unsigned long currentMillis = millis();

  if (currentMillis - previousMillis >= interval) {
    previousMillis = currentMillis;
    Serial.println("SAVEWORKBOOK");
  }
  //End Workbook Saving

}

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Mar 19, 2019, 08:06 pm
Hi @all,
first of all sorry for the late responses. I am moving houses at the moment and will be pretty busy over the next days. Therefore any responses will be delayed. And worst of all .... there are currently problems with the internet connection at my new place ... might be I won't be able to respond at all for a few weeks ....

That's said let's solve what is here:




Hi NetDevil,
(...)
I tried CELL,SET,ONSHEET but that didn't work the way I wanted. I'm thinking that I might have to do some VBA in the Excel sheet but I'm a little lost there as well.
@Snaggles,
hi :) there are two ways to solve your problem I think.

The first one is to use CELL,SET,ONSHEET,SheetNameX => what didn't work here? The big advantage of the DATA command is that it automatically writes to the next free row; CELL,SET on the other hand does not. For that one to work in your case you need a counter for each probe indicating the current line to write to on the respective sheet. Also please note the information in the Beginners Guide about adding a short delay of maybe 3 ms before each CELL,SET command to clear the buffer. Otherwise many times 0's were written in Excel.

The other option is indeed using VBA and to write an own command like "SETACTIVESHEET,SheetNameX" to set the globally used variable in PLX DAQ to the posted SheetNameX. That way all DATA commands coming in afterwards will be routed to that sheet. The command can be added within the CustomDevPoint function. However I guess there might be issues with the row variable for the sheet since that is a global counter as well I guess. Therefore it should be adjusted as well each time the sheet changes (there is a function to get the currentMaxRow for a sheet).

If I were you I'd start with the first option as all changes can be done in Arduino code.




@cryotan,
great, thanks for checking and posting that!
The strings really take up a lot of dynamic memory. I should warn the users in future versions to be careful with such long written commands. But I'm glad the basic code does not take away that much space  :smiley-mr-green:




@30percent,
those pictures look really cool! Especially the 3D printed parts are amazing. 3D printing is a fantastic thing in combination with Arduino. One can build his own hardware, software and even cases to make a project look totally professional and robust. Nice work :) Good luck on finishing the code!
I never knew about CodeMentor but checked the site and it is a really great idea. Can I somehow see what kind of questions or projects or coding langues are popular there? And in the end one can even sign up for a paid project :o good way to earn some money ;) but shouldn't tell my boss about it  :smiley-cool:




Greetings to all of you
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: 30percent on Mar 20, 2019, 03:23 pm



@30percent,
those pictures look really cool! Especially the 3D printed parts are amazing. 3D printing is a fantastic thing in combination with Arduino. One can build his own hardware, software and even cases to make a project look totally professional and robust. Nice work :) Good luck on finishing the code!
I never knew about CodeMentor but checked the site and it is a really great idea. Can I somehow see what kind of questions or projects or coding langues are popular there? And in the end one can even sign up for a paid project :o good way to earn some money ;) but shouldn't tell my boss about it  :smiley-cool:




Greetings to all of you
Thank you Jonathan! Learning 3D printing has been a lot of fun along the way. Glad you checked out code mentor. There are mentors for all code languages, some that specialize in one, some that special in all.  As good as you are helping people here, thought you might earn some $ at the same time. :D

Made some more progress on remixing the PLX demo sketch. I can see data pulled from Excel in the serial monitor. So cool! Almost got this sketch solved.

Good luck on the housing/internet change.





Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Snaggles on Mar 21, 2019, 05:05 pm




@Snaggles,
hi :) there are two ways to solve your problem I think.

The first one is to use CELL,SET,ONSHEET,SheetNameX => what didn't work here? The big advantage of the DATA command is that it automatically writes to the next free row; CELL,SET on the other hand does not. For that one to work in your case you need a counter for each probe indicating the current line to write to on the respective sheet. Also please note the information in the Beginners Guide about adding a short delay of maybe 3 ms before each CELL,SET command to clear the buffer. Otherwise many times 0's were written in Excel.

The other option is indeed using VBA and to write an own command like "SETACTIVESHEET,SheetNameX" to set the globally used variable in PLX DAQ to the posted SheetNameX. That way all DATA commands coming in afterwards will be routed to that sheet. The command can be added within the CustomDevPoint function. However I guess there might be issues with the row variable for the sheet since that is a global counter as well I guess. Therefore it should be adjusted as well each time the sheet changes (there is a function to get the currentMaxRow for a sheet).

If I were you I'd start with the first option as all changes can be done in Arduino code.
@NetDevil Thanks for your reply. I would prefer to get it to work in Arduino myself. Here are some troubleshooting trials I've tried.

If I put in
Code: [Select]

Serial.println("CELL,SET,ONSHEET,Probe 2");


(Probe 2 is my 2nd sheet name) I get all the data printed on the first sheet still and a Error within command 9/Subscript out of range. I've tried different combinations of commas added in thinking it might be a missing variable confusing it but get the same problem.

If I put in my string that I want printed
Code: [Select]

Serial.println("CELL,SET,ONSHEET,Probe 2, (String)DATA,TIME,TIMER," + channel_ids[channel] + "," + sensordata + ",AUTOSCROLL_20");


I get nothing printed and an error 13/Type mismatch

If I follow the beginner's guide and do
Code: [Select]

Serial.println("CELL,SET,ONSHEET,Probe 2,B,2,DATA");


It prints the actual word DATA in sheet Probe 2, Cell B2 just fine but also keeps overwriting it. All the probe data is still printed on the first sheet as well even though I'm not changing the sheet again.

 I guess I'm not exactly clear on the syntax of the command or maybe I'm trying to do something that it can't do...?
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: dasaya007 on Mar 24, 2019, 10:44 am
Thanks for this program.
it works ,but sometimes comerror pops up
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: zueses on Mar 26, 2019, 02:54 am
hi, does anyone know the fastest sampling rate the plx-daq/excel can handle?

trying to analyze sound frequencies and so need to take readings at a few hundred Hz at the minimum, not sure if i can do that with excel. was initially going for a sampling rate of 1000Hz

after experimenting I feel like what I'm having trouble with also is printing the time elapsed from progam start to excel as the code works fine with serial monitor

Code: [Select]
// EmonLibrary examples openenergymonitor.org, Licence GNU GPL V3

#include "EmonLib.h"             // Include Emon Library



#define VOLT_CAL 269
#define CURRENT_CAL 60
unsigned long time;

EnergyMonitor emon1;             // Create an instance

void setup()

  Serial.begin(9600);

  Serial.println("CLEARDATE");
  Serial.println("LABEL, Time Elapsed,Wall Voltage,Wall Current, Wall Power, Mic Voltage");
 
  emon1.voltage(A0, VOLT_CAL, 1.7);  // Voltage: input pin, calibration, phase_shift
  emon1.current(A1, CURRENT_CAL);       // Current: input pin, calibration.
}

void loop()
{
  emon1.calcVI(20,50);         // Calculate all. No.of half wavelengths (crossings), time-out

  float currentDraw     = emon1.Irms;             //extract Irms into Variable
  float supplyVoltage   = emon1.Vrms;                    //extract Vrms into Variable
  int sensorValue = analogRead(A4);

   time = millis();

  Serial.print(time);
  Serial.print(",");
 
Serial.print(supplyVoltage);
Serial.print(",");
Serial.print(currentDraw);
Serial.print(",");
Serial.print(supplyVoltage*currentDraw);
Serial.print(",");
Serial.println(sensorValue);

 
}
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: jandres on Mar 29, 2019, 02:42 am
Hi. I have some problems printing data from MPU6050. Excel goes out frecuently. I want print almost 1000 data but I get around 100. Thanks.

Andres Bravo
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: JRArduino on Mar 29, 2019, 08:53 am
Hi friends!
Firts, thanks for this fantastic program! But, I have a question about PLX-DAQ. I need to import about 50 columns of dates in Excel. Is it possible to do? Exist any version capable to do it?
Thanks you!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: ddominique on Mar 29, 2019, 09:39 pm
Hi,

Thank you for this beautiful application.

I currently use it to test it with an Arduino Uno, and that seems to work.

I would like to use your Macro to read and place in Excel the value of a RFID Tag.

The RFID reader is directly connected to RS232 (without Arduino).

Could you guide me to change the part of the macro?

I am asking you this because I am absolutely not a specialist in this language VBA.

Regards
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Mar 29, 2019, 10:27 pm
Oh wow, a lot that happened here!
Internet is still not stable, but good enough to post some replies (although time is short as well, should be building furniture instead of Arduino :) )




@Snaggles
Yeah you need to use the full command for writing to a specific sheet.
Code: [Select]
Serial.println("CELL,SET,ONSHEET,Probe 2");missing arguments (too few)
Code: [Select]
Serial.println("CELL,SET,ONSHEET,Probe 2, (String)DATA,TIME,TIMER," + channel_ids[channel] + "," + sensordata + ",AUTOSCROLL_20");wrong syntax of String parsing. The "(String)" thing needs to be right after the "(" of "Serial.println(". Also the AUTOSCROLL might not work with CELL,SET - not quite sure right now.
Code: [Select]
Serial.println("CELL,SET,ONSHEET,Probe 2,B,2,DATA");that code will only print the word DATA to cell B2 on sheet "Probe 2", you should use a counter to increase the row (here 2) by one in each loop.
What seems to be best for you is:
Code: [Select]
Serial.println((String)"CELL,SET,ONSHEET,Probe 2,A," + i + "," + "TIMER");
Serial.println((String)"CELL,SET,ONSHEET,Probe 2,B," + i + "," + channel_ids[channel]);
Serial.println((String)"CELL,SET,ONSHEET,Probe 2,C," + i + "," + sensordata);
i = i + 1;

You need to paste each value you want to have specifically to a cell. Thus in your example it is three data per row what makes three commands one for each column A and B and C. Starting with row "i" which is increased afterwards.

I must admin that command is not very cool at the moment - I should put that on my bucket list to improve it with the next version.




@dasaya007
You're welcome :) Thanks for the feedback.
The COM error is typically a result of an already in use COM port. Most likely the running PLX DAQ was closed without disconnecting first or the connection between the computer and Arduino was interrupted e.g. by pulling the cable. Afterwards the port is still blocked and it is best to close PLX DAQ and disconnect + reconnect Arduino.





@zueses
I transferred data at over 1.000.000 baud but it got unstable. At the moment I would recommend going over 18.000. But it also depends on how many delays you have in your code. The baud rate is only the speed of transfer - if you transfer one data set every 10 seconds all is fine, but if you spam data at 1.000.000 baud in your loop function it will most likely crash.
1000 Hz is once every millisecond which is quite fast. That will most likely not work at the moment.

Regarding your issue: your code is fine, but you need to start with the "DATA" key word for the correct command in Excel to trigger.
Using String class your code can be shortened (however this is not good regarding performance since the class has a huge memory consumption):
Code: [Select]

  Serial.println( (String) "DATA," + time + "," + supplyVoltage + "," + currentDraw + "," + (supplyVoltage*currentDraw) + "," + sensorValue );





@jandres
Try lowering your baud rate (at maybe 5xxx) and building in some delays of maybe 3 to 10 milliseconds. Spamming too much data in too little time can kill PLX DAQ




@JRArduino
Thank you very much :)
The standard version of PLX DAQ should be able to do that. Using the DATA command followed by each value separated by a comma from the next one. I programmed it to be dynamically in size - let's hope that works with up to 50 :)




@ddominique
Beautiful is a nice word :) thanks a lot :)
There is no need for you to be a VBA specialist. All you need is the C language as you will write all your code in Arduino IDE. Simply read your RFID ID as normal with Arduino, maybe save it in a variable and use the CELL,SET command to post it to a sheet in Excel with a specific column + row combination (e.g. cell D5 if you want it there).
Otherwise you can also use the DATA command to just post it to the next free row on your Excel sheet.
Take a look at the Beginners Guide where all those commands are explained.





Greetings to all of you.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Brilliantgp on Apr 01, 2019, 04:18 pm
Hey NetDevil,

I want to ask, I am using Mac OS currently, and is trying to use the PLX-DAQ. What I am confused is that in my arduino application, which I have reinstalled multiple times just in case. I just can't seem to find COM in port? Or is it possible to use usbmodem in PLX-DAQ excel?

Thx
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: CarlosOliveira on Apr 02, 2019, 11:31 pm
Hello!
Thank you for the great effort

I'm trying to send data from an Excel Document to Arduino UNO

Basically what I'm doing is changing the set point of the temperature every second to make a "Reflow profile for soldering"

is it possible to do that with the PLX-DAQ ?

Thanks
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: sumguy on Apr 03, 2019, 01:48 am
If you look at the "Beginners Guide" that comes packaged with PLX-DAQ-v2 there is a command called CELL,GET, this is a command sent from the arduino, the Excel app responds with the value of the specified row + column. Although it does not show in the example you might realize that if the row value is replaced by a variable you would be able to retrieve different values from the desired column at any particular time period you set in your arduino code.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Apr 03, 2019, 09:19 am
I'm trying to send data from an Excel Document to Arduino UNO
is it possible to do that with the PLX-DAQ ?
Hi Carlos,
yes it is possible, just the way sumguy described it (http://forum.arduino.cc/index.php?topic=437398.msg4122223#msg4122223). And many thanks for the feedback :)




If you look at the "Beginners Guide" that comes packaged with PLX-DAQ-v2 there is a command called CELL,GET, this is a command sent from the arduino, the Excel app responds with the value of the specified row + column. Although it does not show in the example you might realize that if the row value is replaced by a variable you would be able to retrieve different values from the desired column at any particular time period you set in your arduino code.
@sumguy:
thanks for the perfect answer, Karma for you! Welcome to the team  ;D no we are ..... two :smiley-mr-green:




I want to ask, I am using Mac OS currently, and is trying to use the PLX-DAQ. What I am confused is that in my arduino application, which I have reinstalled multiple times just in case. I just can't seem to find COM in port? Or is it possible to use usbmodem in PLX-DAQ excel?
Hi Brilliantgp,
MacOS is nothing I was ever able to test, therefore I can not give you an answer. Nevertheless it was discussed multiple times in the past, sadly no one has ever taken the time to deep dive into it, research, trial and error or post feedback.
It would be much appreciated if you can take a shot at it?
See previous requests first one here (http://forum.arduino.cc/index.php?topic=437398.msg4038298#msg4038298) and second one here (https://forum.arduino.cc/index.php?topic=437398.msg3397276#msg3397276).




Greetings to all of you
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: OneLeafAutumn on Apr 19, 2019, 04:01 pm
Good day !
If it is  inappropriate please ignore.

I just want to ask what is the difference of using PLX-DAQ to other such as Cool Term, Tera Term, Putty, etc. ?
And is the latest version 2.11?
Lastly, this is compatible with sensors (current)?
Thanks and sorry for the inconvenience.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Apr 20, 2019, 08:57 pm
I just want to ask what is the difference of using PLX-DAQ to other such as Cool Term, Tera Term, Putty, etc. ?
And is the latest version 2.11?
Lastly, this is compatible with sensors (current)?
Hi OneLeafAutumn,

well no problem asking those questions. I don't know CoolTerm and Tera Term but it lines in with PuTTY as command line orientated tools for serial communication I guess? In some way PLX DAQ is similar but the main difference is, that PLX DAQ comes shipped as a bundle with Microsoft Excel, whereby in Excel macros were programmed to listed to the data being received via the serial port and to act accordingly (e.g. adding data to rows, deleting data, transforming certain key words to variables). It is more then just communication via serial port, it is about plotting received data in a more structured format.

2.11 is the currently newest version, yes. Although it already is a bit older and there is a certain change list in my head I am not having the time at the moment to implement further changes.

It is compatible with everything that the Arduino (or other micro controller) can work with. All it does is receive data in a structure format via the serial interface. There should be any kind of hardware between PLX DAQ and the sensors which can read the current values from the sensors and transform that into plain text.

In case you have further questions please feel free to ask.

Greetings

Jonathan
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: OneLeafAutumn on Apr 29, 2019, 02:38 pm
Hello NetDevil,

Sorry haven't checked your reply, been busy with school and stuffs.
Thanks for answering my questions. It's a great help since I am currently planning to do a project and wondering whether I can use PLX-DAQ.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: ScapeZ on May 10, 2019, 12:49 pm
Hey, I am new to arduino and programming in general. For school I am working on a project where I want to meassure Humidity and Temperature using the DHT22 sensor. I also have to transfer the data on Excel to make diagramms and tables. Could you please take a look at the attached sketch and help me with the PLX-DAQ ?
Thanks for all the efforts in advance,
Jonas
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Hugocad on May 10, 2019, 01:48 pm
Hello!

I'm currently using PLX-DAQ V2.11 on a laptop on which Windows 10 has just been installed and I have issues that I didn't have before.

Indeed, even if my Arduino is connected on COM4 and I set the frequency to 128000 as it used to work on Windows 7, when I start my analysis, no data are written on my Excel File.

I discovered that when I connect my Arduino/Mega to my PC, when I go into the "Device Manager", in the "COM & USB" Section, my Arduino is called "USB Serial Device" while it used to be "Arduino Mega".
I thought it could come from Arduino Drivers that should be re installed for Windows 10 maybe?

Any help is appreciated, thanks!

Hugo

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on May 15, 2019, 05:22 pm
Could you please take a look at the attached sketch and help me with the PLX-DAQ ?
Hi Jonas,
we are both German but let's keep this in English thus everyone can participate (just wanted to say I do understand your code and comments made ;) )
What is your problem anyways? You are prompting two outputs to Serial Monitor I see. First one being in line 28 looks fine, although you just send your i variable to Excel - nothing fancy there I guess?
Next one in line 34 to 39 is a bit tricky. Do you not want to have in Excel via PLX DAQ? In that case ok, but if you want it you need to do it in the proper format (like the one in line 28). Just replace your i variable with the once for humidity and temperature.






I discovered that when I connect my Arduino/Mega to my PC, when I go into the "Device Manager", in the "COM & USB" Section, my Arduino is called "USB Serial Device" while it used to be "Arduino Mega".
I thought it could come from Arduino Drivers that should be re installed for Windows 10 maybe?
Hi Hugo,

sadly I do not have any experience with Win10 and PLX DAQ / Arduino yet. Still using Win 7 ;) but there were some users with Win10 being able to use the software I guess already. Have you tried reinstalling the drivers? As long as your Arduino is not working fine on Win10 I guess PLX DAQ would suffer recognizing the device as well and won't work. Just try to solve that one out and everything should be fine.



Greetings to both of you.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: doidgy on May 26, 2019, 05:32 pm
Brilliant, please keep up the great work.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: chemtec on May 27, 2019, 05:58 pm
Net_Devil this is great work you have done.  I'm having trouble figuring out how to add more analog channels to the PLX-DAQ v2. 
Arduino code:
oid loop() {
  milli_time = millis();
  voltTC = 5.000 * analogRead(A0) / 1024.000;
  voltTH = 5.000 * analogRead(A1) / 1024.000;
  voltpH = 5.000 * analogRead(A2) / 1024.000;
  Serial.print("DATA,TIME,");
  Serial.print(milli_time);
  Serial.print(",");
  Serial.println(voltTC);
  Serial.print(",");
  Serial.println(voltTH);
  Serial.print(",");
  Serial.println(voltpH);
  //Serial.print(",");
   
  delay(1000);             

Is there anything I have to do in DataReady subroutine?
Thanks
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: sumguy on May 27, 2019, 06:37 pm
Try using just the one println and see if it helps.

Code: [Select]
oid loop() {
  milli_time = millis();
  voltTC = 5.000 * analogRead(A0) / 1024.000;
  voltTH = 5.000 * analogRead(A1) / 1024.000;
  voltpH = 5.000 * analogRead(A2) / 1024.000;
  Serial.print("DATA,TIME,");
  Serial.print(milli_time);
  Serial.print(",");
  Serial.print(voltTC);
  Serial.print(",");
  Serial.print(voltTH);
  Serial.print(",");
  Serial.println(voltpH);  //last serial command uses println
 
   
  delay(1000);             
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: chemtec on May 27, 2019, 07:32 pm
Sum guy, that was it!  Thanks man.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: ScapeZ on May 30, 2019, 04:20 pm
Thanks for the response! As you already assumed I only want the Temperature, Humidity and time in the Excel sheet. But sadly I have absolutely no idea how to write that in the proper format. So it would be really nice if you or anyone else could help me with it. Btw I'm sorry for taking up your time. I really appreciate your help.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: niltonfelipe on May 31, 2019, 11:47 pm
Net Devil Congratulations on the excellent project!

 I have an ultrasonic sensor JSN-SR04T with arduino mega 2560 connected to a raspberry pi 3B + and I want to do exactly what this solution proposes (Save the water level in a reservoir in a worksheet). Is it possible to perform the task in linux environment? Will the libre office or open office run the macro?

Thank you!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jun 03, 2019, 07:31 pm
@sumguy: thank you very much for taking care!

@Jonas (ScapeZ): as already said you do have one code block in the correct format and one in the wrong format. If in doubt please take a look at the Beginners Guide which is included in the zip file as it will answer your questions. The trick is to write the code in the format "Serial.println( (String) "Buzzword1,Buzzword2,Buzzword3" + Variable1 + "," + Variable2);"

@niltonfelipe: thanks a lot :) I am acutally running a Linux on my laptop but never really tried to get it to work with it (it is a Lubuntu with really limited processing power...). My best guess is that it won't work since PLX DAQ is heavily relying on some Windows API calls to work, but it might be that Libre or Open Office ported them to Unix. If you can, please give it a try and post your feedback :)

Greetings to all of you.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Idahowalker on Jun 04, 2019, 03:59 pm
@NetDevil

First, great product. Thank you for your efforts.

I have a project running on an ESP32 through the Arduino IDE. I set up PLX-DAQ to gather information produced by my project. All went well in collecting the data. After selecting Pause, Disconnect, I highlighted the rows to chart, and selected a chart the workbook disappeared and, moments later, restarted, without the data collected.

I am using Microsoft Excel 2019 MSO 64bit


If I copy the information, open a new workbook, paste, I am able to graph the info.

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jun 05, 2019, 01:51 pm
All went well in collecting the data. After selecting Pause, Disconnect, I highlighted the rows to chart, and selected a chart the workbook disappeared and, moments later, restarted, without the data collected.

I am using Microsoft Excel 2019 MSO 64bit

If I copy the information, open a new workbook, paste, I am able to graph the info.
Hi Idahowalker,
and thank you very much for your feedback :)

Just to get this correct: "the workbook disappeared" means Excel crashed? And automatically restarted? In that case it would make sense that data was lost and maybe try saving the workbook first (either manually or with a sporadic command send from PLX DAQ [there is chapter in the Beginners Guide for that]).

Truly speaking PLX DAQ does have some stability issues which increase the more data is read or the faster data is read (baud rate). I do have an enhancement for the API calls on my bucket list, but that is already on said list for a very very long time sadly ....

Or is it really directly related to the data on the sheet? Like the macro ist pasting the data to the cells in a wrong format that crashes Excel? In that case: never heard of the problem, but I never hear of anyone using MS Excel 2019 up until now :) Does it happen all the time? Even with very simple data (like only DATE,TIME)?

Greetings
Jonathan
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Idahowalker on Jun 05, 2019, 04:38 pm
Hi Idahowalker,
and thank you very much for your feedback :)

Just to get this correct: "the workbook disappeared" means Excel crashed? And automatically restarted? In that case it would make sense that data was lost and maybe try saving the workbook first (either manually or with a sporadic command send from PLX DAQ [there is chapter in the Beginners Guide for that]).

Truly speaking PLX DAQ does have some stability issues which increase the more data is read or the faster data is read (baud rate). I do have an enhancement for the API calls on my bucket list, but that is already on said list for a very very long time sadly ....

Or is it really directly related to the data on the sheet? Like the macro ist pasting the data to the cells in a wrong format that crashes Excel? In that case: never heard of the problem, but I never hear of anyone using MS Excel 2019 up until now :) Does it happen all the time? Even with very simple data (like only DATE,TIME)?

Greetings
Jonathan
Yes, Excel crashes. I select pause to stop the data collection, then I select disconnect, my thinking is to free up resources, I then select the 3 columns of data collected, and then select Insert | Charts and then the crash occurs. If I, after selecting the 3 rows, select copy and paste the data into another workbook, things work well.

My project, I have two magnetometers connected with each plane 180 degrees out of phase with each other. Magnetometer 0 is read and its readings are stored in a structure, then magnetometer 1 is read, its readings are summed to 0 and that summation data is sent to be serial printed. The process is then set to be retriggered every 70mS after the Serial println is completed
Code: [Select]
const TickType_t xFrequency = pdMS_TO_TICKS( 70 );. The uController being used is a ESP32, the task to read magnetometer 0 is set to core 0 and the task to read magnetometer 1 is set to core 1. The Arduino IDE has all the components loaded to program a ESP32 running freeRTOS. The serial prints are
Code: [Select]
Serial.print( "DATA," );
    Serial.print( String(xMag.x) );
   Serial.print( ", " );
     Serial.print( String(xMag.y) );
     Serial.print( ", " );
    Serial.print( String(xMag.z) );
    Serial.print( ", " );
    Serial.print( "AUTOSCROLL_20" );
    Serial.println();
. I typically collect about 100 data sets before pausing and disconnecting. My development computer is running Windows 10, 3Ghz, 8GB ram, the connection is via (USB) com 4 at 115200 baud. As, I have a workaround, I consider things to be working.

I just discovered that the issue goes away if the Arduino IDE (not just serial monitor) is closed during data collection.

This projects goal is to see if 2, 3 axis magnetometers mounted with each respective axis 180 degrees out of phase with the corresponding axis, can be made to be auto calibrating.

Awesome product. Thank you very much.

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: jj56379 on Jun 07, 2019, 12:14 am
First off, thank you for all your work on this software.

I am just getting my feet wet using it to read data from an Arduino reading a 32 bit encoder via SPI.

Adding the following to my sketch seems to work fine: 

Code: [Select]
   

    Serial.println("LABEL,Encoder Counts");
    Serial.print("DATA,");
    Serial.print(encoderValue);
    Serial.println(",");


It updates one cell with the data, but it continues streaming, I really don't need that and I think it might make Excel unstable. 

So, what I would like to do is create a control button in Excel that I can "click", send a command to the Arduino to take 20 readings and average them, then return the value to a cell and turn off data-logging until the control button is pushed again.

I do have the manual and I'm struggling along, but I thought someone on here might have some insight.

Any help is appreciated.

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: sumguy on Jun 07, 2019, 02:15 am
Robin2 has a must read article for you

https://forum.arduino.cc/index.php?topic=288234.0 (https://forum.arduino.cc/index.php?topic=288234.0)

On the PLX side providing you keep your serial connection open PLX will keep track of the current row so all you need to do is add a button to your worksheet with the following macro

Code: [Select]
Sub Button1_Click()

lngStatus = CommWrite(frmStampDAQ.cboPort.Text, "<Ready>")

End Sub


and use Robin2's code to capture the Ready string

You only need to transmit the "LABEL" instruction once and then in a loop

Code: [Select]
Serial.print("DATA,");
Serial.println(encoderValue); // adjusted to match the edit
   

EDIT the last line transmitted to PLX should be sent with println
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: jj56379 on Jun 07, 2019, 03:35 am
sumguy,

Thanks for the input.  I was placing the "LABEL" instruction in the loop to get the data to populate and refresh the data in one cell and not create a column of data.  Unfortunately, this causes Excel to look a little "jumpy".

Is there a better way to do this?

I have also tried using the AUTOSCROLL_x function.  A short column of data would be acceptable, but I cannot get it to work with my 2010 version of Excel.  I did see the modification for AUTOSCROLL in a prior post, but that didn't work either  :smiley-confuse:
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: sumguy on Jun 07, 2019, 05:01 am
If you wish to restrict the data to a single cell there is a command in the manual, again you should not include "LABEL" inside the loop, "LABEL" is executed once only.

Here is the "CELL,SET" command virtually straight from the manual

Code: [Select]
Serial.print("CELL,SET,C9,");
Serial.println(encoderValue);



I don't know why auto scroll does not work for you, I may look at that sometime later.

An alternative might be to clear the data after 10 or 20 rows and start from cell 2 again.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: jj56379 on Jun 07, 2019, 05:12 am
THANK YOU!!!

I read about the "CELL,SET" command, but I assumed the "DATA" command had to be used after the "LABEL" command.

Moved the "LABEL" command out of the loop, added a version of the "CELL,SET" command and it works GREAT!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Snaggles on Jun 12, 2019, 09:09 pm
@NetDevil

It's been a while but I wanted to say thank you for all your help. I have 8 probes running at once, logging into individual sheets, and dynamically graphing as the data comes in.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jun 13, 2019, 09:36 am
Hi guys,
been quite some time, sorry for the delay! Let's get started:




@Idahowalker:
to be honest I still don't get your setup and what it should do (sounds sophisticated ;) :smiley-mr-green: ) but very good to know it is working. Looking at your code the only minor optimizations which come to my mind are: eliminating the spaces after each explicit "," wrote and using the println already with the AUTOSCROLL line and not dedicated with a blank string. Maybe but just maybe the String(xMag.x) prints the value comma separated and not dot separated as Excel would expect? In case it is comma separated PLX DAQ might interpret that as a delimiter. You can check what is actually received in the DirectDebugWindow.




@sumguy:
Thanks once more for helping the people out here! Karma to you :)
To solve the mystery of AUTOSCROLL, the functions used by the VBA macro got added to Excel with Office 2013, thus versions prior to that do not support the feature. There is hardcoded check in PLX DAQ to skip the call if an earlier version is detected.

Code: [Select]

'## Check for AUTOSCROLL command and handle
If (InStr(1, UCase(DataVal(x)), "AUTOSCROLL_", vbBinaryCompare) >= 1) Then
    DontPostDataThisIteration = True ' Autoscroll will not be posted to sheet
    If (ActiveSheet.Name = WStoUse.Name And Split(Application.Version, ".")(0) >= 15) Then
        '## Autoscroll command checks should only be done if the currently active sheet is the sheet where data is pasted to
        '## Autoscroll command was added in Office 2013 (version 15.0) - dont use for earlier versions)
        Dim offset As String
        offset = Trim(Mid(DataVal(x), InStr(1, DataVal(x), "AUTOSCROLL_", vbBinaryCompare) + Len("AUTOSCROLL_"))) 'get value right side of "AUTOSCROLL_"
        If (IsNumeric(offset)) Then
            If ((row - offset) >= 1 And (row - offset) <= ActiveSheet.Rows.Count) Then 'if row - offset is too low (< 0) or too high ( > max row possible) set to row
                ActiveWindow.ScrollRow = row - offset
            Else
                ActiveWindow.ScrollRow = 1
            End If
        End If
    End If
End If


Sadly I missed putting that information in the post and in the Beginners Guide .... sorry for that ... I've updated the information in the v2.11 Release Post.




@Snaggles:
good to know. That should be one of the more complex setups build with the tool => gratulations :) do you mind posting some screenshots of it as an inspiration?
On top: what is your baud setup and runtime and PC setup? As told multiple times PLX DAQ does have stability issues when it comes to much data or fast data or long running logging. You seem to have a good balance on the setup :)

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: kcpilotguy on Jun 13, 2019, 07:03 pm
Hi all,

I'm trying to use PLX DAQ 2.11 on my new windows computer, 64 Bit Windows Pro and the newest version of excel.  I'm using an Arduino Uno board with it.

The PLXDAQ works for a bit but on data capture at about line 3400 or so it crashes excel.  I have tried various things to see if it was on my end but it seems to repeat every time. 

Anyone else having this issue or have any advice?

Also, here is the code I'm running on the Arduino:

Code: [Select]

unsigned long prevMillis;

int buttonPushCounter = 0;
int sensorValue = 0;  // variable to store the value coming from the sensor

const byte sensorPin = A0;
const byte buttonPin = 2;
const byte ledPin = 13;

byte buttonState = 0;
byte lastButtonState = 0;

bool start = false;

//**************************************************************************************************************
void setup()
{
  Serial.begin(9600);
  Serial.println("CLEARDATA"); //clears up any data left from previous projects
  Serial.println("LABEL,Time,Timer,Sensor Value"); //always write LABEL, so excel knows the next things will be the names of the columns
  Serial.println("RESETTIMER"); //resets timer to 0

  pinMode(ledPin, OUTPUT);

  pinMode(buttonPin, INPUT);
  lastButtonState = digitalRead(buttonPin);

} //END of setup()

//**************************************************************************************************************
void loop()
{
  //****************************
  //check the switch every 50ms
  if (millis() - prevMillis >= 50)
  {
    //restart timer
    prevMillis = millis();

    checkSwitch();
  }

  //****************************
  if ( start == true)
  {
    sensorValue = analogRead(sensorPin);
    //writes the time in the first column A and the time since the measurements started in column B
    Serial.println(String("") + "DATA,TIME,TIMER," + sensorValue);
  }
  //****************************

} //END of loop()


//**************************************************************************************************************
void checkSwitch()
{
  buttonState = digitalRead(buttonPin);

  //Compare the buttonState to its previous state
  if (buttonState != lastButtonState)
  {
    //update to the new state
    lastButtonState = buttonState;

    //if button state is pushed
    if (buttonState == HIGH)
    {
      buttonPushCounter++;
      digitalWrite(ledPin, HIGH);

      //enable printing
      start = !start;
    }
  }
 
} //END of checkSwitch()

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Idahowalker on Jun 13, 2019, 08:28 pm
Hi all,

I'm trying to use PLX DAQ 2.11 on my new windows computer, 64 Bit Windows Pro and the newest version of excel.  I'm using an Arduino Uno board with it.

Have you tried closing the Arduino IDE before trying to collect data?
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: kcpilotguy on Jun 13, 2019, 09:00 pm
Have you tried closing the Arduino IDE before trying to collect data?
Yes, had that closed.  Issue repeats every time.  Not sure if it is the windows machine, the version of excel or the PLX software but something isn't happy about all my data
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Xendelaar on Jun 14, 2019, 12:35 am
I'm using plx daq v.2.0 for some time now and it's truly awesome. 
I've been using it mainly for the simple task  of reading and recording pulses from a hall effect sensor that I use for my custom built odometer.
It works brilliantly but there is one thing the program does not allow me to do:

Increase the number of readings per second..
  If I increase the interval above 2 readings per second, Excel isn't able to keep up the incoming data stream which results in a slide show of data trickling in, way after any data should  come in.
Eventually excel crashes at what appears to be a random interval (which is probably not the case)

I wonder why I'm not able to get more data points per second out of excel.
I do admit my excel sheet is pretty big (700 kb without any data lines). So maybe excel has trouble recalculating every cell when a new data line is fed?
Still.. I would guess that a 2 year old (7th gen i3 8gb ram laptop) with excel 2013 would have no trouble retrieving approximately 10 characters 4 times per second?
Increasing the baudrate from 9600 to higher rates doesn't have any positive effect and even feels like its having a negative effect. Why isn't a higher baudrate better in any case?

Sorry if these are dumb questions.  I'm not looking for solution since I don't have a real problem. I'm just wondering how excel/plc daq/ and arduino communicate together.. I would really appreciate it if anybody could explain to me what's causing the slowdown of data frequency when I increase the reading frequency.

I'm still very grateful with the extension and don't mean to bash it. :)

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Idahowalker on Jun 14, 2019, 01:24 am
Yes, had that closed.  Issue repeats every time.  Not sure if it is the windows machine, the version of excel or the PLX software but something isn't happy about all my data
I am using Windows 10, with Excel 2019, and a ESP32 sending a good bit of data to the PLX-DLX. Works good as long as the Arduino IDE, not just monitor, is closed.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jun 25, 2019, 10:36 am
Hi folks,

just a quick heads up, I'l be travelling the next fews days, therefore there will be no chance to answer... although my answer rate dropped quite a bit anyways over the last few months ;)





Yes, had that closed.  Issue repeats every time.  Not sure if it is the windows machine, the version of excel or the PLX software but something isn't happy about all my data
Hi kcpilotguy:
I think the problem is, that you are checking for new values every 50ms only, but spamming Serial.println every loop (which can be like every 2ms as you have no heavy other operation in you loop). Try putting the Serial.println in the 50ms delay as well or creating a second delay-check for that. Too much fast data can flood and cras the input of PLX DAQ.





Hi Xendelaar:
thank you for your feedback and no worries here, no offence taken :) I am pissed myself Excel is crashing when there is too much data pouring in (see above), it is like the number one problem reported. I do have a glimpse of a hope there is a solution, as there is some other code I tried once and it was working more stable in the first test runs. Although I never found the time to fully implement and stress test it, it is number one on my bucket list for "the future"....
Increasing the baud rate really isn't the best way, as it is only how fast data is being transferred. The best way is to have a balance between speed and frequency. Like using 5600 baud but with a few delays in the Arduino code. If you really need fast data try to optimize the format. E.g. not sending DATE or TIME or not using the STRING cast. That way Arduino can work faster, baud rate can be decreased. In case of expert mode you might also eliminate the DATE and TIME command from Serial.println but put it in the VBA code to be printed by default. I never had an issue with the performance of the PC or Excel operations (just the API calls).

I know this isn't like the best answer to give, but that is all I can do for you at the moment. I am really looking forward to release 2.12 one day (or maybe it would already be 3.0?) but yeah ... time time time ...





Greetings to all of you
Jonathan
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Xendelaar on Jun 25, 2019, 11:59 am
Thanks for the kind reply.  I will try to avoid sending data from the arduino to excel. I don't really need that information anyway.

I used my setup (arduino to excel odometer) last week during a sort of puzzle car rally. Everything worked pretty well... but after driving several hours I noticed that excel wasn't able to keep up writing the data from the arduino.
Excel only had to process two strings of text (date. Time. And wheel pulses) per second. It seems that after adding 17.000 lines Excel was having difficulty processing the data stream. I started noticing lag when I wasn't driving. Eventually it crashed.
Maybe removing the data and timer function will solve the problem. I'll have to test this.
 I used version 1.x last year (without prompting the data en timer) and that version seemed to be very stable.
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

I hope you'll have nice trip! Take care.
I'll be looking forward to any updates! :)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: joan1211 on Jul 29, 2019, 09:32 pm
Hello NetDevil,,

I am a new user of Arduino, and definitely not a developper. So for me its not easy.

Im trying to make a temperature/humidity data logger.

Its working fine with the aduino and the included serial monitor.
I would like to use your PLX-DAQ, but its not working.

Im with Windows 10 and Excel 2010. When I lounch it, i have this message:



(https://zupimages.net/up/19/31/pzq5.png)



And after clicking yes i have this message:



(https://zupimages.net/up/19/31/yez1.png)




Do you have any idea how to proceed?

Thanks a lot for your help
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: joan1211 on Jul 30, 2019, 12:31 am
Finally i managed. Apparently Excel 2010 is not supported.

With Excel 2016 it works. I have now to learn how to use it properly to do graphics.

Thanks for this software :)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: joan1211 on Jul 30, 2019, 12:50 am
Now i am stuck with the code.

is there anyone who could help me with the code that i should write in the arduino in order to have my Excel recognizing my datas?

PLX-DAQ is working, but i do not know what to write in the LABEL and column of the excel sheet, and also in the code of the arduino...

Some help would be necessary. Thanks

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: joan1211 on Jul 30, 2019, 01:36 am
Just to let you know, i found this code. and its working properly :)

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.

:)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jul 30, 2019, 09:03 am
Hi Joan,

puh - a lot to answer :)

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

Greetings

Jonathan
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Power_Broker on Jul 31, 2019, 12:07 am
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 (https://github.com/)? 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).
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Jul 31, 2019, 10:28 am
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 :)





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 :)
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.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: chis on Aug 04, 2019, 10:56 pm
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.

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Aug 05, 2019, 09:24 am
Hi 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 (https://forum.arduino.cc/index.php?topic=437398.msg3251256#msg3251256) (at the end of the post)

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

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 (https://forum.arduino.cc/index.php?topic=437398.msg4122457#msg4122457) my response to Brilliantgp.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: chis on Aug 05, 2019, 01:43 pm
Hi Net Devil

Thanks for coming back so quickly :-)

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!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Aug 05, 2019, 02:42 pm
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: https://stackoverflow.com/questions/12254378/how-to-find-the-serial-port-number-on-mac-os-x (https://stackoverflow.com/questions/12254378/how-to-find-the-serial-port-number-on-mac-os-x)

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?
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: chis on Aug 05, 2019, 05:05 pm
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!!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Aug 08, 2019, 10:51 am
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: https://forum.arduino.cc/index.php?topic=437398.msg3480930#msg3480930 (https://forum.arduino.cc/index.php?topic=437398.msg3480930#msg3480930)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: Power_Broker on Aug 09, 2019, 06:13 am
@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).
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: ranbros on Aug 23, 2019, 12:29 pm
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
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Aug 23, 2019, 01:00 pm

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)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: ranbros on Aug 23, 2019, 03:54 pm
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
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: OneLeafAutumn on Aug 26, 2019, 08:20 pm
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
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Aug 27, 2019, 04:58 pm
- 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.
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: ToniLab on Sep 05, 2019, 12:15 pm
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
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Sep 12, 2019, 02:06 pm
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 (?)
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: TonyParakka on Sep 18, 2019, 11:36 pm
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!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: jdechow on Sep 19, 2019, 01:33 pm
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"); */
}

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: jdechow on Sep 19, 2019, 01:43 pm
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
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: TonyParakka on Sep 20, 2019, 09:44 pm
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
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Sep 23, 2019, 08:51 am
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
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: TonyParakka on Sep 24, 2019, 09:17 pm
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
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: BunnyTee on Sep 25, 2019, 06:20 pm
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 -
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: tgod2100 on Sep 30, 2019, 09:08 am
Hi NetDevil, i have a problem here...

I downloaded PLX-DAQv2.11, uploaded the PLX-DAQ-v2-DefaultSketch to UNO R3, and opened the excel file PLX-DAQ-v2.11. After execution, an excel file is automatically saved and called 450-Line-File. However, I can't open this file. A window displays "Excel can't open file '450-Line-File.xlsm'. Because the file format or file name is invalid, please make sure the file is not damaged, and the file name matches the file. format"

I would like to ask how to solve this problem, thank you
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Sep 30, 2019, 01:46 pm
Hi folks,
took me some time but let's get started:



@Tony:,

your second approach sounds good:
Quote
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.
You need to check how Excel handles the deletion of the rows with regards to the data set of the diagram. In case your diagram is set to e.g. A2:A42, then deleting rows may result in moving the grid to A1:A41.
In my PowerDemo (included in the ZIP file) I used to set the data grid anew with every data read. The command is a bit cryptic and reads something like this:
Code: [Select]
ChartObjects("MyMainDiagram").Chart.FullSeriesCollection(1).XValues = "='Simple Data'!$C$" & IIf(newRow - 1 <= maxRows, "2", newRow + 1 - maxRows) & ":$C$" & newRow
Just try with dummy data: put 40 data sets in manually, set the data grid of your diagram to those 40 rows, delete row #2 and check the data set settings of your diagram again. then add another row and check again. I guess it will start off good but row by row get smaller and smaller until there is simply no data left to display. And that could be why you need to align the data set after every data input.




@BunnyTee:

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.
Correct :)


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 (?).
Both correct, but best to use the "Pause/Resume logging" button as it will correctly close the connection and allow proper reconnection. Killing Excel will result in an unstable state of the COM connection.


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)
You can put the logging commands FROM Arduino TO Excel in your loop function to constantly get data. Every now and then (use a counter, e.g. every 50 steps) you can jump into a sub routine and use "CELL,GET" to query a certain cell from Excel. In said sub routine you have to wait as long as the data is received. That time long no data will be send from Arduino to Excel. It might take about half a second or so.


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)?
You can use the SAVEWORKBOOKAS command to save the current workbook by a new name (and stay in it). That way you can kind of leave a "trail" of historic data. On the other hand you could also copy the data to a new workbook which can be saved (all fully automatic of course). Please take a look at this post (https://forum.arduino.cc/index.php?topic=437398.msg4288597#msg4288597) (response to OneLeafAutumn) where I explained how to build this into PLX DAQ as a new command. You need to exchange the CSV references to your desired data format (xlsm or xlsx).


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.
You should save first and clear then. Doing that is a good idea in case you don't need the historic data but only the current 500 values). The command CLEARSHEET removes all data from the sheet (including headlines), whereby CLEARDATA only removes starting at row 2 downwards.


4. And lastly, when uploaded (Arduino), PLX-DAQ can only be manually connected?
I don't quite get that question. But I guess you mean to ask if there is any way to automatically start and connect PLX DAQ e.g. after a new code is uploaded to Arduino? In that case no, there currently is no function to do that. It will be tricky though as there can always only be one active connection to the Arduino via the COM port and uploading will block this (naturally) thus PLX DAQ can not listen to what is going on on the port as well.




@tgod2100:

However, I can't open this file. A window displays "Excel can't open file '450-Line-File.xlsm'. Because the file format or file name is invalid, please make sure the file is not damaged, and the file name matches the file. format"
That one is tricky. It is a good sign that the file gets created, thus all code is running fine. Which version of Excel are you using? And can you please post the full file name that gets created? Most likely it does not store as ".xlsm"?



Cheers to everyone!
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: BunnyTee on Sep 30, 2019, 05:38 pm
Quote
Both correct, but best to use the "Pause/Resume logging" button as it will correctly close the connection and allow proper reconnection. Killing Excel will result in an unstable state of the COM connection.

I've done this. However, it does not do what I've wanted originally, partly. I want to make the Arduino stops sending data to PLX-DAQ at 11:55:00 pm and then resume logging at 12:00:00 mn automatically. I've read from your reply #26 at page 2 of this thread, a somehow of what I want to do but not with Sensorvalue but rather based at the real-time clock of the pc/laptop.

Quote
You can put the logging commands FROM Arduino TO Excel in your loop function to constantly get data. Every now and then (use a counter, e.g. every 50 steps) you can jump into a sub routine and use "CELL,GET" to query a certain cell from Excel. In said sub routine you have to wait as long as the data is received. That time long no data will be send from Arduino to Excel. It might take about half a second or so.
Is this doable, say all the data from Cell D?

Quote
You can use the SAVEWORKBOOKAS command to save the current workbook by a new name (and stay in it). That way you can kind of leave a "trail" of historic data. On the other hand you could also copy the data to a new workbook which can be saved (all fully automatic of course). Please take a look at this post (https://forum.arduino.cc/index.php?topic=437398.msg4288597#msg4288597) (response to OneLeafAutumn) where I explained how to build this into PLX DAQ as a new command. You need to exchange the CSV references to your desired data format (xlsm or xlsx).
Okay, I'll try looking into it. But just in case, is it possible to save it to another specific folder? Since from the guide, it says that the new workbook will be saved in the same folder as the current.

Quote
You should save first and clear then. Doing that is a good idea in case you don't need the historic data but only the current 500 values). The command CLEARSHEET removes all data from the sheet (including headlines), whereby CLEARDATA only removes starting at row 2 downwards.
Oh, in this question, I mean, I will save the whole 500 data first, save it into another excel file and then CLEARDATA* the current excel and then starts logging again.

Quote
I don't quite get that question. But I guess you mean to ask if there is any way to automatically start and connect PLX DAQ e.g. after a new code is uploaded to Arduino? In that case no, there currently is no function to do that. It will be tricky though as there can always only be one active connection to the Arduino via the COM port and uploading will block this (naturally) thus PLX DAQ can not listen to what is going on on the port as well.
Yeah, this is what I meant. Sorry for the vague question.

And thanks for replying and reading my long posts :) Thanks for your effort.


I've did some work while waiting for your response, and here's the code I've made.

Code: [Select]

#include "EmonLib.h"
// Include Emon Library
EnergyMonitor emon1;
// Create an instance

unsigned long previousMillis = 0;
const long interval = 60000;

void setup()
{
  Serial.begin(9600);
  Serial.println("CLEARDATA");
  Serial.println("LABEL,Date,Time,Current,Power,millis()");
 
  emon1.current(1, 85.1);             // Current: input pin, calibration.
}

void loop()
{
double Irms = emon1.calcIrms(2580);  // Calculate Irms only
double Prms = Irms*230.0;
unsigned long currentMillis = millis();

 if (currentMillis - previousMillis >= interval) {
   
  Serial.print(Prms);           // Apparent power
  Serial.print(" ");
  Serial.println(Irms);             // Irms
  Serial.println(" ");

  Serial.println( (String) "DATA,DATE,TIME," + Irms + "," + Prms + "," + millis() + ",AUTOSCROLL_30");
   
  previousMillis = currentMillis;
 
  }
}



Quote
I've done this. However, it does not do what I've wanted originally, partly. I want to make the Arduino stops sending data to PLX-DAQ at 11:55:00 pm and then resume logging at 12:00:00 mn automatically. I've read from your reply #26 at page 2 of this thread, a somehow of what I want to do but not with Sensorvalue but rather based at the real-time clock of the pc/laptop.
I've searched that the delay() function has limited uses and that millis() function is the better choice when working with intervals. But I can't seem to make this work (the one above). And the time frame of 11:55:01 pm to 11:59:59 pm, I will save all the data gathered in that day into an excel file and then use another excel to resume logging at 12:00:00 mn
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: tgod2100 on Oct 05, 2019, 10:42 am
@tgod2100:
That one is tricky. It is a good sign that the file gets created, thus all code is running fine. Which version of Excel are you using? And can you please post the full file name that gets created? Most likely it does not store as ".xlsm"?

@NetDevil:

Hi,NetDevil

The version of Excel I am using is 2003.

The full file name is 450-Lines-File.xlsm
Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: JackSilva on Oct 08, 2019, 03:06 pm
hi Net Devil

I'm Brazialian

I have a problem, with your software

My excel hangs when I put for a grafics.

I use Win10 and Excel 365

Can you help me?

Title: Re: PLX-DAQ version 2 - now with 64 bit support! (and further new features)
Post by: NetDevil on Oct 17, 2019, 12:53 pm
Hi there,
I kind of feel like it is becoming my signature move to reply to a couple of questions with nearly two weeks delay all the time....





@BunnyTee:
Quote
I want to make the Arduino stops sending data to PLX-DAQ at 11:55:00 pm and then resume logging at 12:00:00 mn automatically
You can use the real time clock as a module to connect to your Arduino, yes. On the other hand you could use one cell within Excel as a "Do sending: yes/no" information that is passed back and forth from Excel to Arduino. Nevertheless you need you Arduino to run 24/7 as well as your PC and they need to be connection with each other throughout the time.
What I would is to use a cell e.g. A10 and write a "Yes" or "No" in the cell by VBA based on the PC time. You can use the loops running in PLX DAQ for that. In Arduino I would use a millis counter to send a query for cell A10 like every one minute. Based on what is returned to the Arduino it should or shouldn't send data to Excel.

Quote
Is this doable, say all the data from Cell D?
"D" is not a cell but a whole column. Getting all data from one column is tricky and would require some change in code. However getting only the data from cell D7 (or as above A10) is within the standards of PLX DAQ. The Beginners Guide does have some example data for that.

Quote
Okay, I'll try looking into it. But just in case, is it possible to save it to another specific folder? Since from the guide, it says that the new workbook will be saved in the same folder as the current.
well kind of yes I guess. The code in PLX DAQ is
Code: [Select]
ThisWorkbook.SaveCopyAs ThisWorkbook.Path & "\" & DataVal(1) & ".xlsm"
whereby DataVal(1) is what you pass as a file name.
Let's say "ThisWorkbook.Path" is equal to C:\Users\YourName\Desktop", then:
- passing "NewFile" would result in storing a copy of the workbook as C:\Users\YourName\Desktop\NewFile.xlsm
- passing "folder\NewFile" would result in storing a copy of the workbook as C:\Users\YourName\Desktop\folder\NewFile.xlsm [the subfolder needs to already exist !!]
- passing "..\NewFile" would result in storing a copy of the workbook as C:\Users\YourName\NewFile.xlsm

So by building the path you can change it, but in any way the current folder is the reference and starting point.

Quote
Oh, in this question, I mean, I will save the whole 500 data first, save it into another excel file and then CLEARDATA* the current excel and then starts logging again.
Sure that is possible. After every 500 lines send by Arduino (you need to make the counter in the Arduino code) you can send a SAVEWORKBOOKAS command followed by a CLEARDATA command

Quote
I've searched that the delay() function has limited uses and that millis() function is the better choice when working with intervals. But I can't seem to make this work (the one above). And the time frame of 11:55:01 pm to 11:59:59 pm, I will save all the data gathered in that day into an excel file and then use another excel to resume logging at 12:00:00 mn
Delay will typically pause the whole code running on Arduino for the time that should be waited. Total disaster of course as you want to continue logging . Using millis is better as you can just save the current value of millis, add (1000*60*60*25) to it (one full day) and place in variable x and in your loop function check if the current millis is larger then x (thus the day has passed). However this will result in pretty large numbers. I might think that my way (Cell A10 with Yes/No value) is a bit more stable.





@tgod2100:
yeah I would totally suggest this to be an issue with the old Excel version. That version of Excel is older then many users on this board  :smiley-mr-green:  :smiley-mr-green:
Do you have any option to try to switch to a more up to date version? Maybe 2013?





@JackSilva:
Brazilian, nice :) I should start a world map and put pins in and try to get as many continents as possible :)
My first guess is that Excel 365 is a problem. However I haven't used it myself... it is a native running client or a cloud service? Does PLX DAQ work with it in general (fetching / receiving data) but crashes only when using graphics?
Just to be sure: by graphics you mean graphs and plots and diagrams? Not pictures? But your goal is to receive data and visualize it? Does your graph auto-update while receiving data or do you receive data, stop the connection, then create a graph of the data and by that Excel crashes?





Cheers everyone!
(see you in 2 weeks time  :smiley-confuse:  :smiley-roll-blue:  :smiley-eek: )