Quick steps on a simple way to use the Visual Lisp Debugger to trace program execution of the Spreadsheet–>PLC I/O AutoLISP utility in AutoCAD Electrical.
The last posting and the Autodesk webcast on the Spreadsheet –> PLC I/O utility in AutoCAD Electrical generated a lot of interest. One user wanted to take the plunge and consider customizing the source code for this utility (file “wdio.lsp”). But he wanted to get familiar with using the Visual Lisp debugger to trace this utility as it executes and builds the I/O drawings.
Here’s one simple way to launch the Spreadsheet –> PLC I/O utility from within the Visual Lisp environment.
- First, find the path to the wdio.lsp utility on your machine. One way to find this is to type this at the “Command:” prompt.
(findfile “wdio.lsp”) [Enter]
2. Now start the Visual Lisp editor. Type VLIDE [Enter] at AutoCAD “Command:” prompt. Select “Open File…” and browse to the wdio.lsp utility (path you’ve found above).
3. Select the “Load Text in Editor” option as shown here:
4. At this point you should be ready to go. Maybe set a breakpoint at a key spot in the program… let’s say where the utility first starts to insert the blank “ladders” into the active drawing. Search the wdio.lsp text file for the ladder API command substring “c:wd_in_ladder”. Pop in a breakpoint here as shown.
5. Now put your cursor back into the AutoCAD command window. Type wdio [Enter] at the Command: prompt. This should launch the program, now in the Visual Lisp debug environment, and it should stop and display at your first break point. Have at it!