cancel
Showing results for 
Search instead for 
Did you mean: 

Reading a MKI109V3 with a MKI210V2K module using C# from a console program.

Macneacail
Associate III

If I deploy this accelerometer into the field, say a long way from anyone it needs to be a simple start on reboot of the computer. UNICO GUI and LITE are not easy reboots.

UNICO GUI does not provide a time stamp on records nor a record count, so one cannot use the TXT output file for FFT - no idea of the timestep.

Plus there are existing methods that have a common CSV file format for data. In the development of montoring for major infrastructure this is critical.

I used the C# UNICO LITE to understand how to code a console project. But your UNICO LITE is a long way from complete, it does not read the accelerometer at all.

In my code, I can get the standard calls like *ver to work, and I have followed the instructions in your PDF files but even getting whoami to work is impossible for me. In UNICO LITE you have to hit two buttons to get the 68 response, *start and then *write. It is less than intuitive.

How do I get the time, temperature, tilt, gyro and accelerometer values? I am doing something wrong but three days of playing have not shown me my mistake on writing and reading from registers.

Here is the C# solution folder and a sample of the output.

sp.WriteLine(writeWA3 + "\n\r");

text = sp.ReadExisting();

if (text == "")

{

     text = "Text is empty!";

}

Console.WriteLine("\n\r           Write to 1E :: Return is :: " + text, Color.Linen);

Anything but ReadExisting hangs the code.

A sample of the output.

I have written a lot of code in C# for accelerometers, this is the hardest so far.

0693W00000LyyzXQAR.png 

5 REPLIES 5
Macneacail
Associate III

looks like this is going to turn into a probono project.

I downloaded a port sniffer and fired up the old UNICO GUI. The data after the port is opened.

0693W00000Lz8AoQAJ.pngSo this is the long hard way, but it is ok.

Macneacail
Associate III

This is not actually answered with this previous answer.

But now I have a working C# program that will collect the data from the MKI device after setting the correct registers.

I include here a copy of the current program. As it is now published in the open domain with out a copyright notice anyone is free to use it.

it runs at 100 hz, although I thought I had the registers set to 1.6kHz.

I fail to understand why UNICO GUI needs 156 writes to registers to set only a few.

Also UNICO GUI sends a

    static string writeVDE = "*ver*dev";

which I fail to understand.

It is easy to put a menu on this program and it lists the register settings for you.

I need to continue as it does not write all the data yet.

Any comments really welcome.

Macneacail
Associate III

Interesting little problem on the measurement of the response time per read cycle. The maximum cycles per second is in the range of 400.

Whether I use UNICO GUI or my STREAD, I cannot get past this limit, there is no where in any of the litearatrue can find that says what the limit is.

Anybody got any ideas on the answer?

Macneacail
Associate III

I now have a working program. Interesting challenges.

Macneacail
Associate III

The GUI and the manuals are challenging to use to develop the program. If you are going to play with this little device you will need a serial packet sniffer and a hex calculator like the HP 16C.

I am going back into play with the data output.