Go Down

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

Idahowalker

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


NetDevil

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

Idahowalker

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.


jj56379

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.


sumguy

Robin2 has a must read article for you

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

jj56379

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:

sumguy

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.

jj56379

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!

Snaggles

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

NetDevil

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


kcpilotguy

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


Idahowalker

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?

kcpilotguy

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

Xendelaar

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


Idahowalker

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.

Go Up