Main

Programming Archives

December 16, 2006

Call it like it is!

Are you aware that SPLat, like any decent programming language, lets you use meaningful names for inputs, outputs, RAM variables etc? Which of the following fragments say the most to you:

      WaitOn    5
Off 3
or
      WaitOn    FullSensor
Off FillValve

Imagine now that you refer to the FullSensor 75 different times in your program. Then accidentally Production wire the sensor to input 4 rather than input 5 on 250 control boxes.
Which job will be easiest and safest:
1. Rewiring 250 boxes

2. Changing

      WaitOn    5
to
      WaitOn    4
in 75 places in a 3000 line program.

3. Changing

      FullSensor   iEQU    5
to
      FullSensor   iEQU    4
in one place?

And which form will it be easiest for you or someone else to read in 6 months or 6 years time?
One of the golden rules of programming, and a sign of a professional, is to write a program in a style that is clear and uncluttered. Use named "resources", use whitespace to effectively separate functional sub-blocks of code and use comments to describe what a block of code is doing.

This blog entry will not function fully without JavaScript
A very large number of websites rely on JavaScript to work properly. This one is no exception. If our website has worked for you in the past but just broke, you probably installed IE7, which seems to default to disabling JavaScript. There are good instructions for enabling JavaScript here. We recommend FireFox, the Open Source browser.


Multitasking in 4 easy steps.

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.

rub_and_tap.gifThe 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!

Continue reading "Multitasking in 4 easy steps." »

March 11, 2007

Comparing programming languages

Are you aware of our web page that compares SPLat's proprietary language with several other languages used for controls programming? I set that page up some time ago to show the same controller program written in several languages. I created a simple SPLat program that does 3 things concurrently using multitasking. A friend wrote me the equivalent in Dynamic C. I wrote the equivalent in Ladder (a horrid experience!).

Continue reading "Comparing programming languages" »

April 20, 2007

ModBus Master in VB2005 (.NET)

If you want to write a ModBus master program for the PC, using .NET, this may be for you.

Continue reading "ModBus Master in VB2005 (.NET)" »

May 13, 2007

No challengers for a year!

Just over a year ago (May 7 2006) I launched a web page comparing SPLat programming with other controller languages. At the same time I issued an open challenge to any competitors. So far no competitor has come forward. Here's the challenge:

Continue reading "No challengers for a year!" »

May 17, 2007

Tech Support: Bubble sorting

Kim wrote:

Hi David,

I'm trying to make a fault code which display onto the LCD.

I wish to make it like a circular buffer which has up to, say 10, faults recorded. Also I wish to display the most significant fault onto the LCD.

The way I visualise it, is that I give each fault a number, ie 0 to 255 (or to whatever the highest fault number is) and then sort the faults and display the highest priority first, until cleared, and then the next fault etc.

However, I'm having trouble doing a sort in splat, any ideas ?

Continue reading "Tech Support: Bubble sorting" »

March 9, 2008

New program management tool

We have just released a new project management tool called Builder. In brief Builder makes it convenient to break large SPLat programming projects up into a number of individual modules. These modules can contain their own test code, so they can be tested independently of other modules in the project. Builder then allows you to "glue" together all your individual modules, leaving out the test code and arranging the various segments of the modules into the correct order. For example, it will make sure all the NVEM0 stuff is at the end and all mEQU directives are at the beginning, before any defBYTE (etc).

In short, builder helps you to work in a more systematic and structured way on large projects.

Builder is part of latest SPLat/PC, just released here.

Builder documentation

builder1.gif

About Programming

This page contains an archive of all entries posted to In Control in the Programming category. They are listed from oldest to newest.

Preserving our Planet is the previous category.

SPLat applications and customers is the next category.

Many more can be found on the main index page or by looking through the archives.

Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 3.33