niScope_read and niScope_fetch are blocking functions. They put a lock on the niScope session, so other functions like abort won't work. It will either wait until the trigger occurs, or the timeout expires. These are the only two options. In order to be able to exit your loop instantaniously, you will need more control logic. For example, this is what I would reccomend:
.....
niScope configure functions
bool terminate_loop=false;
...
for{
niScope_InitiateAcquisition
while( niScope_AcquisitionStatus != "NISCOPE_VAL_ACQ_COMPLETE" && !terminate_loop);
If(termnate_loop)
break;
else
niScope_fetch
}
The main idea behind the code above is to not call niScope_fetch until you know a trigger has been recieved and the acquisition is complete. If an acquisition is complete, then the read and fetch functions will not timeout, but return immediately, because the data is already available.
Also, note that I'm using fetch instead of read. Read is a single function that initiates the acquisition, waits for it to complete, and retrieves the data. With my code exerpt, we do all these tasks separately ourselves, so we can be more in control of "wait for it to complete".
I hope this helps!
Nathan
Systems Engineer
SISU