08-13-2013 10:10 AM
Hi,
I have some log files which I need to process. For some of these files I will need to delete the beginning and the end of them. To do this I am planning to plot the the log and set 2 cursors, then the user will move the cursors in a way that he would leave the unwanted data out of the band and then he would click a button to proceed to delete the unwanted data from all the channels within the group.
So far I have plotted the data and set the band using the following script:
view.ActiveSheet.Cursor.Type = "band"
view.ActiveSheet.Cursor.Mode = "graphPoints"
view.ActiveSheet.Cursor.X1 = CMin("Y_Accel")+0.25*(CMax("Y_Accel")-CMin("Y_Accel"))
view.ActiveSheet.Cursor.X2 = CMin("Y_Accel")+0.75*(CMax("Y_Accel")-CMin("Y_Accel"))
Now I would like to use the positions where the cursors have been moved by the user to delete the data but I don't know how to read the cursor position. With it, I would use a function as DataBlDel or similar.
Does anyone have an idea of how to do this?
I am just starting with DIAdem so if someone spots that there is an easier way to do this please let me know.
Thanks,
Leo
Solved! Go to Solution.
08-14-2013 05:09 AM
Hi Leo,
If you're just starting out with DIAdem and scripting then the following article is a great resource. It discusses both user interactions and cursor data.
https://decibel.ni.com/content/docs/DOC-5771
Have a read and let me know if you have questions.
Best Regards,
Chris
08-14-2013 11:00 AM
Thank you Chris
08-19-2013 05:22 AM
Hi Chris,
I have made a script base on what you told me, it works. My issue now is that I want to update or refresh the View display in DIAdem View and I don't know how to do it. When I use "Debug VBS Script" the View display is refreshed after I finish the interaction and I can see what has been done but if I use "Run VBS Script" it won't refreshed the View display so I can not double check what has just been done.
Is there a command to do this?
Thanks.
Leo
08-19-2013 05:39 AM
Hi Leo,
I have to confess to not being an expert in DIAdem. Fortunately, this does seem to be a documented issue. The following knowledge base article describes why the values don't refresh automatically and what command you can use to fix it.
http://digital.ni.com/public.nsf/allkb/86256F0E001DA9FEC12571A7002D9DA5?OpenDocument
Regards,
Chris