Discussion:
[Kst] Kst - data export
Huber, Jörg
2015-10-21 13:01:18 UTC
Permalink
Hello Barth,

is there any possibility to export data of vectors from Kst to a specified file – e.g. csv-file?

The aim would be to export different vectors at a given time depending cursor position of x-axis.

In mode “Highlight Data Points” data point moves over vector vs x-axis (time).

While moving over curve data of defined vector(s) should be exported for use in another application.



See example below:



Data vectors in Kst (logged PLC data)

1. DateTime

2. speed

3. current

4. torque

5. faults 01-16*

6. faults 17-32*

7. faults 33-48*

.

.

.



*16 x Boolean, which can’t be displayed in a Kst plot

Boolean 16-1 => value e.g. = 0000000011111111, Bit 1-8 = “1”, Bit 9-16 = “0”

To reduce amount of column fault messages are summarized to 16 per column (data source input file)





curves displayed in Kst:

1. speed vs time

2. current vs time

3. torque vs time



defined data vectors to export to csv while moving over curve in mode “Highlight Data Points”:

DateTime

faults 01-16*

faults 17-32*

faults 33-48*





data to CSV file:

DateTime faults 01-16 faults 17-32 faults 33-48

2015/04/27 07:37:02.620 0000000011111111 1100100011111111 0000110010011111



Data should be automatically updated depending on cursor position of “Highlight Data Points”.

Dataset of csv-file shown above could be used to display all active faults at a given time (highlighted data point)

in plaintext (fault message) with another application.



Have you got any idea to realize this with Kst?



Thanks a lot



Best Regards

Jörg
Best regards
Jörg Huber
Graduate Engineer
electrical engineering
____________________________________________________
Herrenknecht AG
Schlehenweg 2
77963 Schwanau-Allmannsweier
Germany
(+49 (7824) 302 5440
7+49 (7824) 302 2940
mailto:***@herrenknecht.de
http://www.herrenknecht.de<http://www.herrenknecht.de/>
















Registergericht / Register Court: Freiburg HRB 390485
Vorsitzender des Aufsichtsrates / Chairman of the Supervisory Board:
Hans-Jörg Vetter
Vorstand / Board of Management:
Dr.-Ing. E. h. Martin Herrenknecht, Vorsitzender / Chairman
Dipl.-Ing. Gebhard Lehmann, Stellvertreter / Vice Chairman
Betriebswirt (VWA) Kurt Stiefel, CFO
Dipl.-Ing. (FH) GÃŒnter Richter
Dipl.-Ing. (FH) Ulrich Schaffhauser
Dipl.-Wirtsch.-Ing. Michael Sprang
Barth Netterfield
2016-01-04 14:18:43 UTC
Permalink
Hi Jorge,

Happy new years!

Sorry about the relatively high level of silence from my end. It looks like I
will be able to spend a lot more of my subway time on kst this spring
however :-)

I can not see a way to implement this in kst currently.
-We can't currently access fields in a data source as strings.
-We can't currently trigger a python script from within kst2.
-The scripting currently doesn't have any access to mouse coordinates.

But:

Are you imagining that the external file is constantly appended to as you
move the mouse? Or would the user do something (eg, hit a key?) to
trigger an event.

I think a semi-general approach would be to add a PyKst call that would
return a structure with lots of useful state information (frame information,
cursor position, list of key/mouse events since the last call). Then a
python script could poll kst2 waiting for whatever you want, then the
python could go off and parse files to its heart's content. Sound ok?

In a couple of commutes, I could add something to PyKst to make this
possible if you think it would be useful. I think it could be pretty cool.

Are you running windows? If so, I might need some help in getting it all
working there. I /think/ python scripting works fine in windows, but... I don't
run windows (the Win 10 upgrade has managed to bork my windows
partition) myself.

cbn
Post by Huber, Jörg
Hello Barth,
is there any possibility to export data of vectors from Kst to a specified
file – e.g. csv-file?
The aim would be to export different vectors at a given time depending
cursor position of x-axis.
In mode “Highlight Data Points” data point moves over vector vs x-axis (time).
While moving over curve data of defined vector(s) should be exported
for use
Post by Huber, Jörg
in another application.
Data vectors in Kst (logged PLC data)
1. DateTime
2. speed
3. current
4. torque
5. faults 01-16*
6. faults 17-32*
7. faults 33-48*
.
.
.
*16 x Boolean, which can’t be displayed in a Kst plot
Boolean 16-1 => value e.g. = 0000000011111111, Bit 1-8 = “1”, Bit
9-16 =
Post by Huber, Jörg
“0”
To reduce amount of column fault messages are summarized to 16 per
column
Post by Huber, Jörg
(data source input file)
1. speed vs time
2. current vs time
3. torque vs time
defined data vectors to export to csv while moving over curve in mode
DateTime
faults 01-16*
faults 17-32*
faults 33-48*
DateTime faults 01-16
faults 17-32 faults 33-48
2015/04/27 07:37:02.620 0000000011111111
1100100011111111 0000110010011111
Data should be automatically updated depending on cursor position of
“Highlight Data Points”.
Loading...