Technical Manual

I need to prepare some sort of technical manual that would provide a means of debugging a particular board. I was originally planning for it to contain a theory of operation, but also a guide that would provide detailed debug info for the test program. In particular, for each type of failure, it would point to various test points for probing and indicate the nature of the signal to be expected.

I'm thinking of the medium that this would be easiest in. The test program is in Forth on a PC and could incorporate the detailed instructions and the decision tree. It might be a bit harder to bring up the images showing where to probe and the signals expected in the console. But I'm wondering if there's a way to send HTML to a browser page to display this?

Anyone familiar with one application sending HTML to a browser on the same machine? I guess this being more of a hardware group, this might not be the best place to ask.

Reply to
Ricky
Loading thread data ...

onsdag den 18. maj 2022 kl. 23.05.33 UTC+2 skrev Ricky:

windows or linux?

Reply to
Lasse Langwadt Christensen

Windows

Reply to
Ricky

if you can execute a system command like "start filename.html" it should open filename.html in the default browser (or bring bring up the chose application menu)

Reply to
Lasse Langwadt Christensen

Is "start" an actual command? I think I understand what you mean. Like the file was double clicked in Windows, it would be opened by the default browser... even Microsoft Edge. I'll ask in the Forth group how to run a file. Thanks

Reply to
Ricky

Before I retired (10+ years ago) I was testing some HTTP client s/w by using, IIRC, Microsoft IIS to serve up HTML to it using a freebie interceptor the name of which I have not yet remembered. It was an ordinary dictionary word, I think, not invented or acronym...

Reply to
Mike Coon

It is, but I think it is a built-in of CMD.EXE. Powershell may have a different version.

It looks up the default double-click action in the registry for that file type. You can give it options to simulate other actions, like "do whatever is configured for right-click Edit".

There is also a C API that does the same thing for you.

However, because of default security settings of some browsers, starting a file.html won't necessarily load or run the associated Javascript files. This depends on the browser and operating system. Test it, but if you have a problem you might need to incorporate a tiny HTTP server.

Clifford Heath

Reply to
Clifford Heath

Yes, I looked it up and START does exactly what I want. I can run that using CMD which I'm pretty sure I can invoke from my program. I just need to make sure I don't create any infinite loops with that in it! lol I'd hate to have my computer crash from an infinite number of new command line programs running. lol

Thanks.

Reply to
Ricky

I believe there's an API that does the same thing without having to make a new process or execute CMD, but I'd have to go searching some old code for an example.

Clifford Heath

Reply to
Clifford Heath

As soon as you say API, I assume you are talking about something in C. I'm not using C, so running a command through a Windows call is fine. In fact, I have example code for that, which is excellent. I need to get something going quickly, only a couple of weeks or so to make it useful, then I can guild the lily further.

Reply to
Ricky

Surely your Forth can load a DLL and call any function inside it, especially if it only take a single string as an parameter? That's pretty basic stuff I would expect from any scripting language...

CH.

Reply to
Clifford Heath

formatting link
There are a number of functions to create processes or threads and manage them.

At one time you could use the IE COM interface to control it. I haven't used Forth in years but it was fairly easy in Pytnon. Chrome can be automated with the new WebDriver but it's more complex.

Reply to
rbowman

Ok, what would be an example of that? Do you know of any code that does that? I don't.

Forth does many, many things. I am limited to using the things I know of and know how to use. The basic language is a basic language. It is up to the designer of the Forth implementation to provide the various bells and whistles.

Do you have documentation for the API you are talking about? I have no problem with using a CMD approach. None, in fact, it can be very advantageous to separate the testing, the generation of the HTML and the display of the HTML.

That's my thinking anyway. If you have more information, I'm happy to listen.

Reply to
Ricky

"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" "C:\Program Files\PCHealthCheck\ux\resources\de\license.html"

Danke,

Reply to
Don

This was the API I was thinking of:

formatting link

It's defined in shell32.dll. I would expect that most scripting languages could be told to open that DLL, find that named entry point, and construct a function call frame using the required parameters (two integers, four C strings). This kind of dynamic loading and function call is pretty basic stuff. Sometimes it's implemented using an "FFI" layer - see if your Forth supports FFI. There are "interesting" APIs that are hard to support using FFI, but this one is very simple.

Another way would be if you can add a small C extension to define a ShellExecute word for your Forth.

Clifford Heath.

Reply to
Clifford Heath

That uses Edge, not the users default browser. You need to use ShellExecute to get the default browser.

CH

Reply to
Clifford Heath

yeah, in windows it's something like

system('start filename.htm');

in linux

system('xdg-open filename.html')

Reply to
Jasen Betts

In MS-Windows. If I associate a .txt file with a particular editor, the editor is opened with this file if I state the name of the text file on the command prompt. I would expect the same happens if you associate a .html file with a browser.

(A unix shell could do the same, if a html is marked executable, they could start the preferred mime association. There is no such shell as far as I know.)

Caveat, the last MS-Windows I use is Windows XP. Maybe it has changed in the meantime.

Reply to
albert

Check out ciforth. It runs any subroutine on any dll that is present on your machine.

formatting link
can inspect the example of midi events. (openmidi sendmidi closemidi). If you are not happy with ciforth, you can even copy the source implementation for win32forth. Read the sections DLL and DLL-calls-internal in
formatting link
Documentation on this level about dll's is hard to come by, however. There are datastructures defined in C, that must be passed around.

Groetjes Albert

Reply to
albert

Thanks for the reply. I've decided it is not so important to link the debug instructions with the test program. The debug process for anything in the audio paths is pretty much the same, so one large HTML file with lots of images of schematic and PWB layouts showing where to probe.

I still have the rest of the board (purely digital) to do, so that is next. Two files that cover pretty much anything that goes wrong.

Thanks for the advice.

Reply to
Ricky

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.