It seems that deleting channels from a sampled data file/time view does not work until the file is closed and reopened. Attached is a demo script that samples one waveform channel, attempts to delete it, fails, saves the file, attempts to delete the channel, fails, closes and reopens the file, and finally succeeds with deleting the channel.
The error returned is "The file is being sampled" though it's not anymore.
If done through GUI, there is no Delete channel option in the pop-up menu until the file is reopened.
I can't see any mention of that in help, so is it a bug?
This is in 9.08b.
Code: Select all
var l%[1];
SampleClear(); 'Set standard sampling state
SampleOptimise(0, -1, 9); 'No optimise, set 1401 type, (do first)
SampleUsPerTime(10);
SampleTimePerAdc(50);
SampleSeqCtrl(1, 0); ' Seqencer jump control
SampleWaveform(1, 0,2000); ' chan, port, ideal rate
SampleTitle$(31,"Keyboard");
SampleOptimise(1,1,9,1,50); 'Set optimise mode (do this last)
SampleMode(1); 'Continuous sampling
FileNew(0,1);
SampleStart();
SampleStop();
PrintLog("stopped:\n");
PrintLog(Error$(ChanDelete(1)) + "\n");
PrintLog(ChanList(l%, 1));
FileSaveAs("cdtest.smrx", -1, 1);
PrintLog("saved:\n");
PrintLog(Error$(ChanDelete(1)) + "\n");
PrintLog(ChanList(l%, 1));
FileClose();
FileOpen("cdtest.smrx", 0);
PrintLog("reopened:\n");
PrintLog(Error$(ChanDelete(1)) + "\n");
PrintLog(ChanList(l%, 1));