Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: USB data logging

  1. #11
    Join Date
    Mar 2008
    Location
    Gold Coast
    Posts
    369
    Total Downloaded
    0
    Thanks for that, on the data log screen you pick the interval from a drop down box from 1s to 1000s.
    Any idea how I would get to the code to modify it?

    Quote Originally Posted by Ferret View Post
    On your link is some supplied C# sample code for interrogating the device. You are going to have to use it or modify it to change the sampling rate.

    If you look at that code you will find in method "start_button_Click" the relevant piece of code to modify. (I think)

    // Parse the wait time between data collection, and put the while loop to short sleeps while waiting.
    int waitTime = 0;
    int.TryParse(waitTime_textBox.Text, out waitTime);
    int count = 0;
    do
    {
    Thread.Sleep(50);
    Application.DoEvents();
    count++;
    }
    while (count < waitTime * 20);

    The 'Sleep' parameter and the value of 'waitTime' have some influence on how fast the software samples data from the device. I think

    The value of 'waitTime' is being set in a 'Textbox', ie it is a value you type in when you run this code so you may be lucky and not need to modify anything at all - again I think.

  2. #12
    Join Date
    Feb 2007
    Location
    Perth
    Posts
    3,919
    Total Downloaded
    0
    Download the sample code 'PX409USB_SampleCodeForCustomers.rar' from your link. Extract it to a new directory of your choice.

    Download 'Visual C# 2010 Express' from here and install it.

    Ensure you have the latest updates to the .Net framework installed ~ version 4.something

    Looking at the code you will probably need to have installed 'Microsoft Chart Controls for Microsoft .NET Framework 3.5'. If not get from here

    Open visual studio express. From the 'File' menu choose 'Open Project' and select from within the folder where you extracted the sample code the file named 'PX409USB_AppDemo.sln'. After a conversion process all the sample code will available for you to modify as you wish.

    If all the above is gobbilty gook then your on a very steep learning curve. Rather than trying to modify it Just try this.

    In the folder where you extracted 'PX409USB_SampleCodeForCustomers.rar' look for a sub folder named

    '\PX409USB\Omega PX409USB Sample App (VS.Net 2008)\PX409USB_WinApp\bin\Debug'

    you should find a file there named 'PX409USB_WinApp.exe'. double click that ensuring first your device is plugged in and your drivers are loaded. With any luck a window should open looking something like this



    Enter your wait time (0.25, I assume in your case - 4 samples / second). Press start. when you have your data, press Export Data. The code says you will be prompted to save your data to a CSV file.

    All this is theory - I can't run anything because I don't have the device to test anything. Good luck.
    2024 RRS on the road
    2011 D4 3.0 in the drive way
    1999 D2 V8, in heaven
    1984 RRC, in hell

Page 2 of 2 FirstFirst 12

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search AULRO.com ONLY!
Search All the Web!