LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

error4823: invalid task ID for SI play after SO clear

Hello everybody,

I created the attached VI with LABVIEW 8.2 using a standard internal sound card. The VI is supposed to show a continious spectrogram at any time except when:

1) a command(16 pings) is sent
OR
2) one ping is sent

Therefore I stop the Sound input vi with SI stop vi. After the command or the ping has sent, I use the the SI start VI to start the data aquistion of the spectrogram. Sometimes it happens that the error 4823: invalid task ID occurs.

I have no idea why. Sometimes it does, sometimes it doesn't. I guess it is related to the performance of the PC because the error occurs very often at my low performance laptop but not that much on my desktop PC.

I tried a lot of stuff to fix the problem:

a) create new task IDs every time after sending command and pings(then labview is completely confused and crashes all the time)
b) reduce the amount of data in memory helps but doesn't fix completely the problem.

I really hope somebody can help me because this problem is very annoying since I cannot figure out what it causes.

Thanks a lot,
Martin
0 Kudos
Message 1 of 8
(4,880 Views)
I think you need to do some code clean up first.
 
You have a lot of unnecessary sequence structures.
The wires are running in numerous directions, up down left right making it hard to see what is the source and where it goes.
A lot of wires wind up hidden behind other structures and don't line up with their tunnels.  Use right click clean up wires a lot.
 
You have case structures which pass one wire through and not others.  I think you are missing some shift registers, but it is hard to tell.  I am guessing that these two things are why you have invalid task ID's.  They are getting lost.  The wires for device ID and task ID are getting branched and recreated numerous times.  Try to consolidate them.  I think in some instantces you are feeding the same device ID into multiple VI's and mixing and matching the task ID's that come out.
 
It uses up a lot of screen space, so it is hard to see the whole architecture.  Try tighening up the code in the process.
 
I would recommend doing all of this first, then it may be easier to see structure.
 
Also, there is a compound arithmetic function you can set to OR to eliminate the combinations of OR's.

 

Message Edited by Ravens Fan on 07-03-2007 09:09 PM

0 Kudos
Message 2 of 8
(4,874 Views)
Hi Ravens Fan,

I cleaned the whole code. You are right that the code is very messy.(because I removed some parts actually to simplify it) Sorry about that.

Hopefully you can see the whole architecture now. The biggest main sequence structure has three frames:

1st frame: setting up the sound card for sound input for a 'perfect start' of the continious spectogramm(no bucking during the first few seconds of the spectrogram)

2nd frame: contains a big while loop where everything happens:

    -continous spectrogram(standard case) OR
    -ping if ping button is pressed
    -send command if send command button is pressed

3rd frame: clearing the sound input task after the big while loop of the second frame was exited by user by pressing QUIT button.

For the ping and the send command functions I also use sequence structure to set up the sound card BEFORE sending the ping or the command to make sure that the VI can focus ONLY on sending the super precise command(a couple of pulses with super precise timing and duration(a few ms)) to avoid bad timing due to computations which could be done before or after sending a command.

Hopefully you can figure out why I get the error 4823  invalid task id SOMETIMES. If there is something very wrong in my code I should get this error everytime, but that is not the case...

Thank you so much,
Martin

Message Edited by LabviewHans on 07-05-2007 12:21 PM

0 Kudos
Message 3 of 8
(4,862 Views)
Okay,  I took your code and cleaned it up a bit more.
 
I simplified some structures.  You used value signalling property nodes in some places.  This isn't necessary as you aren't using event structures.  So I redefined them as local variables.
 
One thing I wonder about is the task ID wire running through your producer loop.  (I realigned the loops to show better left to right reading of hte wires.)  It passes in, through the read sound VI, then out the top, then it goes to the top two sequences.  Where as other device ID is passed in from outside the loop.  This may be by design, but something seems out of place with the architecture.
 
I think your big problem is that you may have a race condition if the ping and send command sequences are running simultaneously.  I don't know if both configure VI's create the same task ID.  But if they did, it would get cleared at the end of one sequence while the task ID in the other sequence is still executing through some of the other VI's.
 
You may want to put all of the sound configure VI's outside of the main program loop and just feed in the task ID's and keep them through shift registers.  Clear the task's outside of the main program loop.  Use the stop functions instead of clear task at the end of the sequences.
 
I suspect why you may have an erratic error (and I don't know exactly how the configure sound VI's work) is that you may occasionally get the same task ID created between those two loops and one gets cleared while it is still needed in the other loop.  It looks like task ID's are created sequentially.
 
Just some ideas, but I ran the program for a while and didn't have any errors pop up.
0 Kudos
Message 4 of 8
(4,851 Views)
Hello RavensFan,

I tried to put all of the sound configure VI's outside of the main program loop and just to feed in the task ID's and to keep them through shift registers.  I still have this error.  😞

It turns out that sending a ping is ok(no errors), but if you send a command you will ALWAYS have an error at the sound INPUT stop VI. That's very strange, isn't it?

I also figured out, when I delete the spectogram computation without changing anything else, the probablity of the error 4823 is much much lower.

There are a few thing I just want to make clearer:

----------------------------------------
The he ping and the sending command are not supposed to run simultaneously. The programm should be only in exactly one mode:

ping
OR
send command
OR
spectogram

The error 4823 usually only occurs at the Sound INPUT stop or play VI and NOT at the Sound output VIs.
------------------------------------------

Do you have any other hints how I can fix this weared problem?

Thanks a lot!!!
Martin

0 Kudos
Message 5 of 8
(4,841 Views)
Hi Martin,

I tried running your VI on my PC and I did not receive any errors at first. This made me think that you were perhaps facing a PC performance issue. To confirm this I tried to run the VI while moving around my mouse and opening different programs. This threw the 4823 error. In order to prevent this from happening, I reduced the sample rate. When I did this I was able to move around my mouse and open/close programs and did not see an error. Could you please let me know if reducing the sample rate eliminates the error? Thanks!

Best regards,

Steven C
0 Kudos
Message 6 of 8
(4,835 Views)
Hi Steven,

as I stated in my first posting I also think that this problem can be PC performance related because the error occurs more frequently at my low performance notebook compared to my good performance desktop pc.

BUT that doesn't help me. Even if I use RavensFan cleaned up code and a lower sampling rate, the error still occurs occasionally(for example: spectrogramm runs for a couple of minutes, then I send a command, then a couple of pings and then it happens right after I send another ping).

I think an ACER travelmate notebook with 1.46GHz processor and 512MB RAM should be able to handle that since I stop the spectrogram that there is enough performance for sending pings or commands. If you check the memory usage of the VI, you can see that the amount of data and the VI itself is definetely not intense.

I'm afraid that there are some internal labview problems since I use sound input and output in one VI at the same time with multipe stop and play VIs. For example, my last posted VI does this crazy thing: if you hit the ping button it pings usually without an error. If you hit the send command button, there is always an error even it has the same architecture like the ping function.

So, I changed the VI to a VI for low performance notebook / PC, but I still have these errors occasionally...

What else can I do?

Thank you very much,
MArtin
0 Kudos
Message 7 of 8
(4,831 Views)

Martin,

For a few more suggestions, try reading this forum post.

Craig D
Applications Engineer
National Instruments

 

0 Kudos
Message 8 of 8
(4,800 Views)