Go Down

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

jremington

Most likely, you are sending too much data through the serial port too quickly and Excel can't keep up.

NetDevil

after run about 10 second, excel close and nothing happen later, before that the data showing in excel is a bit weird. Can you tell me what problem and can i solve that.
Hi Vu_Tran,
as jremington pointed out flooding PLX DAQ or Excel with too much data kills the COM port communication. Looking at your code you have attached I see you are using a baud rate of 115200 with a 5ms delay in your loop function. This will be way too much. If the 5ms really is needed then I strongly suggest to reduce the baud rate. Typically 9600 is fine. But generally speaking it is better to increase the delay value.

Would love to hear if any of this helped.

Have fun and cheers

Jonathan

markes51

Hello

I'm from Brazil, and you is  making a great job here, and helping a lot of people. Your software is working great im my Excel.

But I have a question( that I didn't find the answer here) in  Time is showing  , for instance,  1:10:35 PM.
Here in Brazil we use 24h to show time..can I change it to 24 h...without AM or Pm??

thank you

NetDevil

But I have a question( that I didn't find the answer here) in  Time is showing  , for instance,  1:10:35 PM.
Here in Brazil we use 24h to show time..can I change it to 24 h...without AM or Pm??
Hi marke51,

thanks for the kind words :)

And yeah you are right, the default setting is set to AM/PM format. By using "CLEARDATA" or "CLEARSHEET" command it will get reset to format "General" which should adopt to your local setting.

This is a valid point for some future improvements, but for the time being I would suggest the following: format the column where the Time shall be put in Excel the way you want it (with standard Excel functions). Afterwards alter the code of the "clearData" and "clearSheet" function in Excel and remove the line responsible for resetting the format.
I have given a short explanation how to Dominique here: https://forum.arduino.cc/index.php?topic=437398.msg4579983#msg4579983

If this does not really help I could consider adding a fix that would allow custom time format to be added on runtime but this would take a couple of days and I would need you for beta testing.

Cheers

whyareallthrowawaynamestaken

Hi NetDevil,

Thanks for the PLX-DAQ version 2! Looks like it might be able to save me a lot of time.
There's an old Excel file (I did not make) that stopped working last year when Office got upgraded and I have now been asked to "fix it".

Question 1: when "upgrading" an old PLX-DAQ (V1) Excel sheet to V2, can I just copy the sheet over and expect it to work or are there old calls that won't work anymore?


Question 2: your Beginner's Guide says that you shouldn't copy the "Simple Data" sheet, but does that mean I can't remove it either?
Simply put, what can and can't I remove/write over in the V2 Excel file without breaking the functionality of V2.


Thanks in advance!

PS. Awesome dedication that you're still supporting it! You sir, are something special.

NetDevil

Thanks for the PLX-DAQ version 2! Looks like it might be able to save me a lot of time.
There's an old Excel file (I did not make) that stopped working last year when Office got upgraded and I have now been asked to "fix it".

(....)

Thanks in advance!

PS. Awesome dedication that you're still supporting it! You sir, are something special.
Hi ... I guess nameless or so?  :D
Thank you very much for your kind words. I really try to dedicate some of my spare time to at least support the product although I haven't been able to further develop it over the years. But I am glad it still helps people with their projects :)


Question 1: when "upgrading" an old PLX-DAQ (V1) Excel sheet to V2, can I just copy the sheet over and expect it to work or are there old calls that won't work anymore?
So I just checked my changelogs as I was not sure myself. I tried to have all commands do the same they use to and only increase possibilities here and there. The only things I could find were that I removed the 4 stamp checkboxes and introduced 3 own; I also removed the commands RESET and CMD (just in case you were ever using them); modified CLEARSHEET to kill all data and introduced CLEARDATA to leave the column headers.

I guess most of all v1 codes and projects should still work with v2. Just give it a try :)

Question 2: your Beginner's Guide says that you shouldn't copy the "Simple Data" sheet, but does that mean I can't remove it either?
Simply put, what can and can't I remove/write over in the V2 Excel file without breaking the functionality of V2.
I think you can remove it, but you will loose the button to show the UI. Of course you can copy that button to the new sheet first and be on the safe side. The problem with coping the Simple Data sheet from e.g., v2.7 to v2.11 is that Excel will copy the old macro code as well. Thus you will have 2.7 code in 2.11 sheet which is a problem of course.
Maybe the most secure option will be just to hide the sheet in Excel.
In case you want to delete it please first create the new sheet, hit the "Load" button on the UI, select the new sheet as active, remove the old sheet and refresh via "Load" button again.

----------------------

In case of any questions just feel free to ask :)

Kind regards

Jonathan

NetDevil

NetDevil and all,
Hello Martin - Jonathan here,

long time no see :) I guess the last time the two of us talked was November 2016, nearly 3 1/2 years ago via email. I must admit I am a bit confused you are not contacting me via email again but choose to post on this board but nevertheless, nice to speak to you again. As you have something important to say and I have some questions about it let's just dive into it.




This release violated mine and Parallax Inc's copyright, which states that while it may be modified and redistributed, it can only be done under a different name and with credit to the original author of course, which was NOT done.
Please excuse me if I did something wrong here. Having a look at the original v1 I did not see and do not see now where this limitation is stated and was glad once you gave me the written approval back in 2016 that "I have no financial interest in the software and would happy to see a solution for all." as well as "I'm find if anyone would like to tackle the problem". (I assume you meant "fine" there)
I was under the impression to do you a favor by a) keeping the name PLX DAQ to show the heritage to your product and b) I did put references to you and your company right in the code. Please see the screenshot attached.
Of course I am totally fine with adjusting to everything wanted. If you require a name change or a more visible reference (e.g. on the main UI) that will be absolutely no problem. Please just lend me a hand here.




While I commend you on modifying the software for 64-bit issues and removing the control (something I did recently as well - way too slow in doing it), and commend you on your enhancements to it, it is not only a violation of copyright, it was done without credit (in the software and the docs) to the original author and WITH a logo for Parallax, Inc, another controller company.
Yes, you are right there. I got mixed up with the logos and looks like I never even realized it. As said before I really wanted to give you and your company the credit they deserved for the origins of the software but I just included the wrong logo and never really noticed... That can of course be fixed right away if it is ok with you?
And again, the mention is also in the code. "Also" as in "I thought I added the correct logo"....




Be smart - get permission and release with due credit and within terms of the copyright as befitting programmers with some ethics.
I really really really assume you did not intentionally called me stupid here as well as unethical and immoral? ;) Because I did ask for permission in the first place and did try to credit to the best of my knowledge.




I released the original with the the macro unlocked and accessible for those wishing to modify it. Please be respectful of other's work and be a courteous net-citizen.
That is great news! Do you mind sharing with us the link for the version?
As you said above it took you a while to update your version to modern technology needs but in the meantime through the feedback of the community the needs on functionality have also advanced which I tried to cover with the different versions of the macro. Maybe we can combine those two branches and make this piece of software what it really deserves to be: stable running, multi functional and well used!




As I can see you are new to the Arduino board I might guess you have not had any contact with Arduino already? At the moment this thread and the current version of this software is used multiple times by hundreds if not more people. Never ever had I received any financial benefits from it (no, not even a single beer!) and never ever would I have taken any money.
What I have received are several feedback messages from home users all the way to university teachers being grateful for having a tool that allows them to visualize data more easily and get people to work on their projects more efficiently.

What this v2 has helped people achieve over the last years since I invested my spare time without any financial benefit is, in my mind, really great and I was and still am very passionate about it.
That said I think it will be a great loss if we throw all that work in the trash and instead I would suggest to join forces and lift the good old macro to a whole new level.

Do you agree?

Really looking forward to your answer and with most kind regards

Jonathan

mhebel

* slinks off into a corners and cries from shame *

Jonathan, so very sorry!

People have been badgering me for years to update it and I kept putting it off while assuming the permissions I gave over the years never went anywhere!

I wish you'd emailed me yours, I would gladly have sent to Parallax as a replacement for that community too! I guess I didn't recall ever having given permission to use the same name as it stands for "Parallax DAQ" and they more or less hold the trademark on the name. I typically state it can't be released under that name, but if I asked your pick up the reigns..... Can't blame you there.

I downloaded the software and your docs and couldn't find any credits anywhere. Though I admit I got confused over the sheer number of files.

I actually posted this under the name I was logged in on- my school Email account for SIU in Illinois where I teach - which I never used much here. I should have used my SelmaWare user name which has more use and would have made more sense.

Anyways, I agree, great job, you did have permission. I should have PM's from SelmaWare since I didn't know who this was.

I think you accomplished everything mine does - I Used API's, that's about it. I called it "Release 2" since I didn't really update anything new with it.

Well, let me talk to Parallax and see what they's like to do.  Yours is probably better though more complex. Some users like things simple!!

Apologies once more, I've put my foot in my mouth more than once over assuming too quickly. But let me know you made progress next time lol. Took me about 8 hours to update mine... so not huge loss.

-Martin

NetDevil

Hi Martin,

oh boy wow this really did an unexpected turn to the better :) I am so grateful for your answer! :)
First of all, no damage done, all is good and I really still appreciate you replying to my mail 3 1/2 years ago and being where we are now due to your kind actions back then.

Actually I have written an email to the webmaster of Parallex in November 2016 informing them about this "new version" and asked them if they would be fine with placing a link on their download section - but never received an answer :-/ I just wasn't sure to write you as well... guess there went some potential down the drain, sorry for that...

Yeah so next to replacing the Stamp with the API calls and extending it to be 64 bit ready (PointerSafe) I implemented some more function calls and configuration possibility. I totally agree that it gets kind of "overloaded" on the UI even though I tried to hide the DirectDebugWindow by default.

I was always looking at some improvements in the API calls since this version comes with some stability issues with regards to high input of data (e.g. receiving data every 5ms). If I would have ever found the time to tackle that general API handling with promising looking other code I found I would have thought about an UI rework as well. But yeah, never actually found the time and most people could live with 9600 baud and adding a 100ms delay to their code.

That said, if you really get in touch with Parallex and would like to give the program a new boost I will gladly assist and try to arrange some time for it. I once even started a "backlog" over the now 28 pages to collect improvement ideas and community requests. Just saying ;)

Really looking forward hearing from you and all the best from Germany

Jonathan

mhebel

Jonathan,
It can't push 9600 baud or data faster than 5mS?

In tests on my new release I was running 256000 with no Arduino delay, getting a string processed every .667 mS. Now, any disruption in it's processing would cause it to crash lol. But that's the trade off.

I used a comms API module written by David M. Hitchner (with permission). Took a break from recoding, totally from scratch, MakerPlot in Java to do it

NetDevil

No no, don't get me wrong. Technically it can receive way faster baud rates. I have had successful tests with an Arduino Uno and 1.000.000 baud.
But it is important to have a balance between baud and delays as I have had reports about crashes over the years when way too much data was being received in way too little time.

The code that is running in v2 is also from David M. Hitcher (as mentioned in the credits :) ) but as said has some problems with buffering I guess. I was never able to get the perfect balance with baud to delay or figure out where in the code the problems were. I don't think you will go through all pages of this thread but there are several issues mentioned as well as some excessive back-and-forth testing with different values (especially in the early days).


So this other implementation I once found is sadly of unknown source. <Edit: ok, board told me I can not upload xlsm files - will send it to you via mail>
They rather used a "click to fetch data" approach instead of a constant stream. But I did some tries with spamming the "Empfangen" (receive) button top left hand side and it never crashed. So I wanted to try to adopt that API implementation into v2 as it looks promising.

imagination *-*

Hi NetDevil,

First of fine work. Pardon me as I did not really go through all conversations on this thread but I would like to know if your PLX-DAQ v2 is able to auto save file?

Some context of my project,

It is a datalogger logging 24/7 by the second. Sorry if this is too much to ask but,

1. Can it auto save current excel file after a daily set time with a specific file name (lets say today's date)?

2. Then it deletes all data and start from 1st row again.

3. Once it reaches its daily set time once again (the next day), this cycle repeats.

And I would have something like this shown in attached picture. I'm able to do this if I save to SD (I have a sd card logger shield) but really uncertain about doing it through serial as I'm making this wireless using NRF24L. I want to eliminate the need to manually collect the data from the SD card shield which is located far away.



I'm doing this because I want daily data file. Thus since by the seconds in a day, meaning max about 86400 rows per excel file.

I've tried using Teraterm through log rotate. It's sort of close but isn't really what I'm looking for and am not satisfied haha. It just adds .1, .2, .3 to the file once it reaches a specific file size limit.


Thank you for reading and much thanks NetDevil or any others whom are able to help me out.

NetDevil

Hi imagination,

thanks for the kind words and sure, I can not expect anyone to go through 28 pages of thread to find each and every information :)

Let's go for it:

Quote
1. Can it auto save current excel file after a daily set time with a specific file name (lets say today's date)?
You can use the SAVEWORKBOOKAS command, this will store a copy of the current workbook by a name passed from Arduino to Excel. Please take a look at the Beginners Guide of PLX DAQ included in the downloadable ZIP file.
E.g. serial.println("SAVEWORKBOOKAS","today"); will save a "today.xlsm" copy. In case you are using a Real Time Clock module on your Arduino and have the date you can use it as a parameter. Otherwise you could only take a counter for the files. Or if you are familiar with coding (which I guess you are :) ) you can take a quick look at the code of PLX DAQ (open Excel, hit F11, expand forms, right click on frmStampDAQ and view code) and take a look at the "SAVEWORKBOOKAS" command
Code: [Select]
ThisWorkbook.SaveCopyAs ThisWorkbook.Path & "\" & DataVal(1) & ".xlsm"
with e.g.
Code: [Select]
ThisWorkbook.SaveCopyAs ThisWorkbook.Path & "\" & "myExcels_" & Replace(Date, ".", "-") & ".xlsm"
By that it would save as "myExcels_2020-07-04.xlsm" or however you would like to have it.
But generally speaking this is a valid extension I should add in the next version, yes.

Quote
2. Then it deletes all data and start from 1st row again.
sure, just use code "CLEARDATA" ==> serial.println("CLEARDATA");

Quote
3. Once it reaches its daily set time once again (the next day), this cycle repeats.
Not by default. no. The command has to come from Arduino. Once more, in case you are using a Real Time Clock you can take that.
In case you just want to save every 24h you could use millis() and every 86,400,000 you just send the SAVEWORKBOOKAS command.

Something like this (caution! pseudo code!)
Code: [Select]


unsigned long lastSave:

void start() {
lastSave = millis(); // inital start
}

void loop() {

if (millis() - lastSave >= 84000000) { // do something every day
   serial.println( (String) "SAVEWORKBOOKAS","myName");
   serial-println("CLEARDATA");
   lastSave = millis();
}
if( millis() < lastSave) { lastSave = 0; } // after 49 days millis rolls over, revert lastSave as well


As it takes millis 49 days to overflow I tried to come up with a way to handle that and revert lastSave back to 0 as well. But by that you might have more then 1 day between the intervals as it rolls over at 49-something days. Let's say there is half a day missing. Next save will be one day later then, thus that day would be 1,5 days long.... To avoid that it would get complicated. You could store the diff from lastSave to overflow in a separate value and add that to millis() for the new day 1 save.
Or just restart your Arduino every 49 days :)




In case of any further questions please feel free to ask.

Greetings

Jonathan

imagination *-*

Hi imagination,

thanks for the kind words and sure, I can not expect anyone to go through 28 pages of thread to find each and every information :)

Let's go for it:
You can use the SAVEWORKBOOKAS command, this will store a copy of the current workbook by a name passed from Arduino to Excel. Please take a look at the Beginners Guide of PLX DAQ included in the downloadable ZIP file.
E.g. serial.println("SAVEWORKBOOKAS","today"); will save a "today.xlsm" copy. In case you are using a Real Time Clock module on your Arduino and have the date you can use it as a parameter. Otherwise you could only take a counter for the files. Or if you are familiar with coding (which I guess you are :) ) you can take a quick look at the code of PLX DAQ (open Excel, hit F11, expand forms, right click on frmStampDAQ and view code) and take a look at the "SAVEWORKBOOKAS" command
Code: [Select]
ThisWorkbook.SaveCopyAs ThisWorkbook.Path & "\" & DataVal(1) & ".xlsm"
with e.g.
Code: [Select]
ThisWorkbook.SaveCopyAs ThisWorkbook.Path & "\" & "myExcels_" & Replace(Date, ".", "-") & ".xlsm"
By that it would save as "myExcels_2020-07-04.xlsm" or however you would like to have it.
But generally speaking this is a valid extension I should add in the next version, yes.
sure, just use code "CLEARDATA" ==> serial.println("CLEARDATA");
Not by default. no. The command has to come from Arduino. Once more, in case you are using a Real Time Clock you can take that.
In case you just want to save every 24h you could use millis() and every 86,400,000 you just send the SAVEWORKBOOKAS command.

Hi Jonathan,

Much thanks for your reply. I have now attached a DS3231 rtc module onto my arduino and now I can set at what time during the day I would like it to run the command SAVEWORKBOOKAS.

However when I tried it with your mentioned code that I changed in the PLZ DAQ code,



It doesn't work to save as a new file under today's date :/  but if i revert back to original alt+f11 code it does save as to filename specified (eg. "file"). In both cases the CLEARDATA works fine.


What could I be doing wrong here? :'(  I don't think I quite understand how the code in alt+f11 works haha. I'm not so familiar with coding as per you assumed sorry  :smiley-sweat:

Also if i open the saved as file while current PLX DAQ is still running collecting data, it sorts of interferes with it? As in if i close that opened saved as file, it'll disconnect my serial connection and when I want to reconnect, it'll give me this error prompt.



Does this mean I can't open any other excel files while PLX DAQ is running?  :smiley-sad-blue:

NetDevil

Hi imagination,

well yeah, Excel is very picky when it comes to running multiple instances while one is doing heave operations (e.g. macros). Basically if you have one workbook open and are writing in a cell you can't even open a second workbook as long as you do not jump out of that active cell. It is a mess in Excel ....

And while the macro is running and you are starting a second instance it will interfere with the two same macros being in both books -.-
So a way would be to store the copy without macros. It is a bit tricky but give it a try with this code:

Code: [Select]

    Application.DisplayAlerts = False
    Dim name As String
        name = "myTestFile"
    ThisWorkbook.SaveCopyAs ThisWorkbook.Path & "\" & name & ".xlsm"
    Dim Wb As Workbook
    Set Wb = Application.Workbooks.Open(ThisWorkbook.Path & "\" & name & ".xlsm")
    Wb.SaveAs ThisWorkbook.Path & "\" & name & ".xlsx", xlOpenXMLWorkbook
    Wb.Close SaveChanges:=False
    Kill ThisWorkbook.Path & "\" & name & ".xlsm"
    Application.DisplayAlerts = True


This just suppresses any warnings from excel, then saves a copy with macros (xlsm), opens that file in background and saves without macros (xlsx) and then deletes the temporary macro excel and allows warning messages again.

Of course we need to solve your issue with the date not being displayed.
In VBA editor, hit Ctrl+G and a window will appear at the bottom (direct window or something like that, also available via menu 'view' => 'direct window'). There type "msgbox date" and hit enter. It will show you a textbox of your date format. If you go with "msgbox replace(date,".","-")" it should give you a date format but replace all dots with hyphens. My idea was to have a cleaner filename while storing.
If it causes troubles you can just go with

Code: [Select]

Dim name As String
        name = "myDownTime_" & Date

Go Up