I have been in the (electronic, controls, microprocessor) game for thir... erh..., a rather long time. Sometimes I have to remind myself that some of the things that I have developed hardwired circuitry for in my brain, are still new and perhaps confusing concepts for many people.
One of these concepts is multitasking. In SPLat we call our particular implementation MultiTrack.
The MultiTrack idea is very simple, but extremely powerful: It allows you to have the SPLat processor do two or more things at the same time. Try this: Stand up. Start rubbing your tummy with a circular motion. Now start tapping your head with the other hand. Do the two things at different speeds. Now reverse the rotation of the tummy rub without missing a head beat. That's multitasking!
Here's another way of thinking of it: Imagine that you have not one but 32 separate controllers, each running a different program. The programs could be totally independent of each other. One could control a bottle filler, one a capper and one a labeler. Now here's the magic: The filler can tell the capper when there's soda in a bottle, the capper can cap it and then tell the labeler to do its thing. So although the three tasks run independently of each other, they can coordinate their activities. The coordination is done by setting and testing semaphores (some call them flags, others call them internal relays). The very same thing can take place within a program controlling a single machine. For example, the filler may have separate tasks to control fluid measurement, valve timing, spigot movement, bottle indexing and overall coordination.
Here's a simple 4-step plan for you to get up to speed with MultiTrack programming and unleash the power of multitasking.
- In SPLat/PC go through the mini-tutorials in the help menu. There is one on MultiTrack, though you may need the others for a background. The mini-tutorials are short, interactive lessons that take about 15 minutes each.
- Master the FastTrack instructions. This is a set of just 14 instructions that will let you write simple tasks with timing and sequencing.
- Move on to the the MultiTrack tutorial in the SPLat Knowledge Base. There is a good example of intertask synchronization here.
- Spend a couple of hours making up your own very simple exercises. Work at it until you "get it".
