Get Connected With SoftWIRE

This is the first EE-Evaluation Engineering article based entirely on an editor’s personal evaluation of a technical product—in this case, SoftWIRE™. And, I’m the ideal candidate for the job. I am not familiar with Visual Basic (VB); don’t have a working knowledge of methods, properties, and classes; and only vaguely understand that ActiveX is a good thing.

I do have a couple of engineering degrees, can draw flowcharts, and have written simple programs in the past. So, compared to the nearly zero prerequisites claimed necessary by the SoftWIRE brochure, I’m already overqualified.

I started by printing and reading a copy of the 41-page SoftWIRE Graphical Programming for Visual Basic booklet. Initially, I was struck by the claimed simplicity of the process—just string together icons and build a VB program. Now, that is impressive: to construct a program in a recognized language without knowing the language.

On the other hand, there are 135 SoftWIRE-enabled ActiveX controls that do all the work. They are grouped logically, but nevertheless, 135 is a large number. Contemplating all those controls reminded me of the endless vocabulary that accompanied unsuccessful past attempts to improve my meager German and Italian. I suspect that true proficiency in SoftWIRE, as in spoken languages, comes only with practice and that it soon passes without continued use.

Stumbling Block 1

You must have Version 6.0 of VB installed and running before you can start SoftWIRE. Like many businesses, this magazine’s publishing company maintains an information technology (IT) department, and some of the programmers thought there was a copy of VB somewhere. If there was, it probably wasn’t Version 6.0. The pragmatic solution was to order the VB6 Programming Starter Kit for $49 from SoftWIRE. It works with Windows 95/98 and NT 4.0.

I ordered it Friday using a company credit card and had it and a SoftWIRE Version 2.0 CD the following Tuesday morning by 10 a.m. The starter kit allows you to learn how to use VB and SoftWIRE, but you cannot compile and distribute programs you may have written. To do this, you need either the Enterprise or Professional versions of VB. Also, SoftWIRE is free only for the first 60 days. After that, you must obtain a proper single-user license, currently $195 for one year or $495 for an unlimited time. Corporations and universities should contact SoftWIRE for the appropriate multiuser rates.

By lunchtime, I had installed VB6 and SoftWIRE with no problems. I simply followed the steps presented by the installation wizard and accepted all the suggested default directory and file names. Then I tried to get SoftWIRE to run.

Stumbling Block 2

Reading the instruction booklet is not enough. You must perform the actions as they are listed. To run SoftWIRE, start VB6 and then, from the VB6 new-project window, double-click on the SoftWIRE icon. If you do, you will be presented with a blank SoftWIRE diagrammer window in which you can build your project.

Instead of starting VB6 first, I noticed that I could run SoftWIRE from my PC’s start button and then launch VB6. What a great idea. This feature is used only if you want to work on two or more SoftWIRE projects simultaneously. As I later learned, it doesn’t work as an alternative to starting VB6 first.

Soon, I had mastered the control of an LED by a toggle switch. Building a project really is as easy as finding the controls you want and clicking on them. Both the LED and the toggle switch are under the graphical user interface (GUI) tab. Clicking on them causes the symbols to appear on the diagrammer window, but placement is more or less random.

You use the left mouse button to select a control on the window and drag it to the desired location. A toggle-switch control only has one output, and an LED control only has one input. I had no confusion about where to connect each end of the wire I drew between them. However, most controls have other connections (properties) as well.

Inputs enter a symbol from the left, and outputs exit from the right. In addition, a control-in pin is located at the top of the control and a control-out pin at the bottom. You use the control pins to establish the order of program execution.

Generally, the control-out event is the last thing executed by the software associated with a control. For example, if you wanted to access successive locations in an array after each press of a command button, you would want an address counter to increment first. Then, after the counter had changed, the proper array element should be read. You could use the control-out pin from the counter to accomplish this.

On the other hand, maybe you wouldn’t accomplish it.

Stumbling Block 3

Why doesn’t this control work like it should? How should it behave? From the diagrammer window, if you right-click on a control, you can review and alter its properties.

For complex controls such as Excel read, the control’s settable fields are presented. For this Excel control, you can enter the file name containing the workbook and the worksheet number within it. You also can enter the column and row start values, the number of rows and columns, the end row, and the end column. But after several attempts, it still didn’t work.

How do you know that it didn’t work? In a text-based language, you can add print statements at judicious points in the code to see if conditions are as expected. Or, you can set break points and examine register values. Single-stepping may help.

It would be important to understand the available debugging utilities thoroughly if I were serious about using SoftWIRE long-term. Instead of spending the time to do that, I attached a strip-chart control to the output of the Excel read control to see what was happening. As suggested in the SoftWIRE booklet, I also connected the control’s error output pin to a map-errors-to-text control under the system tab and its output, in turn, to a text display.

Unfortunately, these steps didn’t help much, so I revisited the SoftWIRE help page for this control. The help information is very detailed for all the controls, and I returned often.

The booklet that accompanies the starter kit contains several example programs that demonstrate operation of some of the controls. Of course, they may not deal with the one you need, and the examples in the booklet are necessarily simplified.

On the other hand, additional examples showing the use of each control are included on the SoftWIRE disk. You can run them and examine the various connections and controls to understand their operation in detail.

Eventually, I called the SoftWIRE help number. Alternatively, I could have looked on the website. It turned out that a patch is required for the Office 2000 version of Excel that I was running. I downloaded it from the website and only ran it once. Then the control worked properly. The company claims that SoftWIRE 2.1 operates correctly with Excel 2000 without a patch.

Clicking on the command button I had connected to the control-in pin on the Excel read control caused my dummy Test_1.xls spreadsheet to be opened and read. The strip-chart recorder showed a 45° line corresponding to the list of consecutive numbers from 1 to 20 that I had entered in the spreadsheet.

Support

I wanted to transfer data from my test spreadsheet to an array in SoftWIRE. I reasoned that then I could apply some of the math and logic controls to the array elements. I planned to explore the kind of analysis you might perform on values read from a data acquisition board even though I didn’t have one. You can do this, but you need a good understanding of the operation of the more complex controls before attempting to use them.

For example, the Excel read control only worked correctly when its input pins were disconnected. Under these conditions, operation was governed by the values I had entered into the parameters page. After more visits to the help page and more time spent studying examples, I again called the help line.

The day after I called, the company confirmed by e-mail that it had found a problem with the control’s code. Passing a value to the row start input pin unintentionally caused the number of rows to default to an incorrect value unless the end row value also was changed. I was given a work-around and assured that the problem will be fixed in a later version.

Ideally, SoftWIRE users wouldn’t need any support beyond that provided by the plentiful examples and the detailed help pages. On the other hand, SoftWIRE is very new when compared to venerable graphical programming languages such as National Instruments’ LabVIEW and Agilent VEE, so maybe it’s not surprising that I required some help.

I don’t know if the time from an afternoon to the following morning is a typical or reasonable period to wait for a reply in the design software business. Obviously, if you needed help on a number of issues, your frustration and project time scale could quickly grow.

An Example

Figure 1 shows a SoftWIRE program I built to calculate the factorial products corresponding to numbers in an Excel array. It may not be something you would instinctively think of doing with SoftWIRE, but it demonstrates the operation of several types of controls.

Clicking on the Cmd (command) button causes the Excel read control to read all 20 numbers from column A of the Test_1.xls spreadsheet (Figure 2, see below). The name of the spreadsheet and the file in which it is located as well as the number of rows and the column reference are input on the control’s properties page.

Figure 2. Test_1.xls Spreadsheet

A B 1 1 1 2 2 2 3 3 6 4 4 24 5 5 120 6 6 720 7 7 5040 8 8 40320 9 9 362880 10 10 3628800 11 11 39916800 12 12 4.79E+08 13 13 6.23E+09 14 14 8.72E+10 15 15 1.31E+12 16 16 2.09E+13 17 17 3.56E+14 18 18 6.40E+15 19 19 1.22E+17 20 20 2.43E+18

All 20 values are passed to the get element array control. The control-in pin on the Excel read control activates it. Because the control-in pin is not used on the get element control, it responds directly to changes on its array and element address input pins.

After all data has been passed, the Excel read control control-out pin starts a timer. That’s the last action the Excel read control takes. Timer pulses are output every second—controlled by entering a value on the properties page—and counted by the counter. This generates a read address that’s applied to the get element control to access the array values one at a time.

Because the array index starts at zero and the counter starts at one, a subtraction element is required. Rather than use a separate constant control, I set the subtrahend to one on the properties page. Alternatively, the starting value of the get element array index could have been changed on its properties page.

The value read from the get element array serves as the upper index of the for loop, which counts down from that value to one. Each value of the for loop is applied to a multiplier that has its output fed back to one of the inputs. This is the way the factorial is computed.

Resetting the multiplier after each factorial has been completed uses the inherent OR capability of control input pins. After the Excel write control has written the current factorial value to column B of the Test_1.xls spreadsheet, its control-out pin triggers the constant control to output a one. This forces the input of the multiplier that is fed back from its output to become one.

Because the for loop counts down, it already is at one. Now a new factorial can be calculated. The two numerical text controls labeled 12.34 display the factorial value and its output address.

A couple of aspects of program flow are important to note. In hardware terms, inserting the multiplier between the Excel write and for controls has created a race condition. Nevertheless, the order of execution is correct. I don’t know enough about SoftWIRE to say what the limitations are to flow control using control-out/control-in pins. That’s an area I would want to understand more thoroughly before attempting more involved programs, especially ones involving events happening in real time.

The hardware appearance of the diagram is another area of concern to nonprogrammers. If you think of the data paths as physical wires, then you also have to accept that the signals on them are transients. The values are passed from one control to another and stored for later use depending on how the receiving control is triggered. If the receiving control’s control-in pin is not connected, action will be taken immediately upon receipt of the new input data.

Conclusion

SoftWIRE really does live up to most of its claims. I happened to use the Excel read control and found the code required a patch and had a real error. The need for a patch was well documented on the company’s website, but I hadn’t checked there for known problems before phoning the help line. The company responded quickly to the real error once it was alerted to it.

It’s true that I developed a working program without knowing VB. Of course, if I did understand VB, I could resolve my uncertainty about flow control. Also, there are positions reserved in each control’s code for custom routines you may require. And, you can even create your own complete controls.

My evaluation really is only an account of my experience getting started with SoftWIRE. The program is much more powerful than my simple example shows. The fact that you can customize controls, add new ones, or add VB code makes it very programmer friendly.

Finally, about those 135 controls. No, I didn’t explore them all, but because the use of many is intuitive, the effective number is well under 100. And, you only need to use specialized functions such as the network or I/O controls if your program requires those features. Learning how to use controls is greatly aided by similar operating rules and the use of familiar symbols. 
To prove the point, Figure 1 has no control labels, yet most of it is readily understandable. For example, the Excel read control has an Excel “X” in one corner, a spreadsheet-like background grid, and a magnifying glass over the data being read. The Excel write control has a pencil pointing at the cell being written, and the get element array control shows a list with an output arrow.

I’m not sure what to try next, but I am confident that I can do it with SoftWIRE. Maybe some Fibonacci numbers or a palindromic magic square calculator…

To get connected with SoftWIRE Technology, call 508-946-8900 or visit www.softwiretechnology.com.

Return to EE Home Page

Published by EE-Evaluation Engineering
All contents © 2001 Nelson Publishing Inc.
No reprint, distribution, or reuse in any medium is permitted
without the express written consent of the publisher.

April 2001

Sponsored Recommendations

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!