I'm trying to control capturing stream of data through oscilloscope 2206 but I'm unsure how to stop it capturing because if i just exit the thread it obviously doesn't finish with the file so there's nothing in it.
I'm calling the stream functions in a DLL from a c# GUI program. and it works but i can't stop it, so how can i set _kbhit to make it exit the while loop and finish the function?
Any ideas on this welcome
Thank you for the help
Last edited by ARC on Wed Aug 29, 2012 2:38 pm, edited 1 time in total.
The C DLL is from the SDK so its inside the main while loop taking readings and printing them to the txt file, so it can't sleep until key press otherwise no samples will be recorded? unless im understanding this wrong?
my c# code is windows app so console commands dont work, sorry i realised i didnt mention this and edited my first post to include this.
so it errors saying "InvalidOperationException was unhandled" "Cannot see if a key has been pressed when either application does not have a console or when console input has been redirected from a file".
because im calling the DLL in a thread my C# program continues which is fine my issue is causing the C DLL which is a cut down version of the ps2000con.c in the SDK to exit the collect data while loop, which looks like:
You need an additional function in PS2000A.con which sets a global variable, say g_manualStop, and this value can be checked by the data collection function instead of _kbhit().
This function can be called from your C# GUI by pressing a button.