HP-41C HP-IL REMOTE & LOCAL commands
06-03-2018, 07:55 PM (This post was last modified: 06-03-2018 09:14 PM by Sylvain Cote.)
Post: #1
 Sylvain Cote Senior Member Posts: 963 Joined: Dec 2013
HP-41C HP-IL REMOTE & LOCAL commands
Hello,

I just spend several hours trying to understand why I was not able to successfully configure a HP-82164A RS-232 interface with a HP-41C while it was a walk in the park with a HP-71B.

The default configuration of the interface is: 9600 bauds, 8 bits, no parity, 1 stop bit, no protocol, no hardware handshake
My new configuration for the interface is: 4800 bauds, 8 bits, no parity, 1 stop bit, no protocol, no hardware handshake

In my test programs, I could have chosen to change the baud rate only, but I decided to set all the parameters just in case, anyway as you will see, that is not the issue here.

My HP-IL setup is: IL-Controller (71B/41C) <-> HP-82164A <-> back-to-IL-Controller
My RS232 setup is: HP-82164A <-> DB25-to-DB9-adapter <-> NULL-modem-adapter <-> DB9-to-USB-dongle <-> MacBookPro <-> Serial-macOS-Program (cfg: 4800,8,n,1)

The following three blocks was my starting point ...

HP-82164A remote commands subset (82164A OM Rem Cmd P.37 to P.40)
Code:
SB8;  // 1200 bauds SBA;  // 2400 bauds SBC;  // 4800 bauds SBE;  // 9600 bauds SW0;  // 8 bits P4;   // no parity SS0;  // 1 stop bit C0;   // no protocol SL0;  // use CTS(4), DCD(8) & DSR(6) SL2;  // use CTS(4) SL4;  // use DCD(8) SL6;  // use DSR(6) SL7;  // no hardware handshake

HP-71B program (working)
Code:
10 RESTORE IO 20 REMOTE :RS232 30 OUTPUT :RS232 ; "SBC;SW0;P4;SS0;C0;SL7;" 40 LOCAL 50 OUTPUT :RS232 ; "HELLO WORLD"

HP-41C program (<' means append) (not working)
Code:
01 LBL "CFG232" 02 AUTOIO 03 1   04 SELECT 05 REMOTE 06 "SBC;SW0;P4;" 07 <"SS0;C0;SL7;" 08 OUTA 09 LOCAL 10 "HELLO WORLD" 11 OUTA 12 END

When I ran the HP-71B program I saw the expected "HELLO WORLD" message on the terminal application but not so for the HP-41C.
I tried several configuration changes but to no avail, in the end I had no choice but to go into the low level stuff, the RAW HP-IL messages. 8-)

I changed my physical setup to a debugging one:

HP-IL setup: IL-Controller <-> PILBox#1 [pyilper --instance one with Scope] <-> HP-82164A <-> PILBox#2 [pyilper --instance two with Scope] <-> IL-Controller
RS232 setup: HP-82164A <-> DB25-to-DB9-adapter <-> NULL-modem-adapter <-> DB9-to-USB-dongle <-> MacBookPro <-> Serial-macOS-Program (cfg: 4800,8,n,1)

Then I traced the HP-IL messages and manually mapped them to their high level commands for both IL-Controllers (71B & 41C)
After that I compared both logs taking into account the small IL management differences between both IL-Controler and found why it was not working with the HP-41C.

This is what I have found:

HP-71B REMOTE command issue a HP-IL REN (Remote Enable) message (as expected)
HP-41C REMOTE command issue a HP-IL REN (Remote Enable) message (as expected)

HP-71B LOCAL command issue a HP-IL NRE (Not Remote Enable) message (as expected)
HP-41C LOCAL command issue a HP-IL GTL (Go To Local) message (totally unexpected for me)

I then checked the 82160A manual and it is correctly specified that the LOCAL command issue a GTL message, so the command works as specified.

After that I checked the 82164A manual and this is what I found:
Code:
There are two command messages that set the interface back into Local mode: Go To Local and Not Remote Enable.  Go To Local is a device specific command, which means that only devices that are currently listeners will respond to the message.  If your interface is a listener and it receives a Go To Local message, it changes back to Local mode.  Remember that your interface is still remote enabled, so if it becomes a listener again, it will then change back to Remote mode. The Not Remote Enable command not only puts the device back into Local mode, but it also disables the device from going back into Remote mode if it is made a listener.

Ha! Ha! This is why it was not working with the HP-41C.
Because the LOCAL command was not putting the interface in local mode for good (NRE) but only temporary (GTL), the next time it will receive data in listening mode, the interface will go back into remote mode and try to interpret the data as instructions instead of passing it through.

Here is the proof ...

LOCAL
Code:
AAU     RFC     AAD  1  // reconfiguring the loop LAD 01  RFC             // selecting 82164A as listener GTL     RFC             // tell 82164A to go into LOCAL mode temporary UNL     RFC             // unselecting 82164A as listener

'HELLO WORLD' OUTA
Code:
AAU     RFC     AAD  1  // reconfiguring the loop TAD 01  RFC             // selecting 82164A as talker SAI     DAB 42          // requesting its accessory ID UNT     RFC             // unselecting 82164A as talker AAU     RFC     AAD  1  // reconfiguring the loop LAD 01  RFC             // selecting 82164A as listener and at the same time going back into REMOTE mode 8-(                         // the following data (my "HELLO WORLD" message) is not passed through DAB 48  DAB 45  DAB 4C  DAB 4C  DAB 4F  DAB 20  DAB 57  DAB 4F  DAB 52  DAB 4C  DAB 44  DAB 0D  DAB 0A   UNL     RFC             // unselecting 82164A as listener

The only way I found to solve the issue is to use the NOTREM (Not Remote Enable) command from the 82183A Ext.I/O ROM module.

NOTREM
Code:
AAU     RFC     AAD  1  // reconfiguring the loop NRE     RFC             // telling every device in the loop to go back to local mode

HP-41C program (<' means append) (working)
Code:
01 LBL "CFG232" 02 AUTOIO 03 1   04 SELECT 05 REMOTE 06 "SBC;SW0;P4;" 07 <"SS0;C0;SL7;" 08 OUTA 09 NOTREM 10 "HELLO WORLD" 11 OUTA 12 END

Sylvain

Edit: changed the faulty 71B program from "40 LOCAL :RS232" to "40 LOCAL" (see the next post from Jean-François)
06-03-2018, 08:32 PM (This post was last modified: 06-03-2018 08:42 PM by J-F Garnier.)
Post: #2
 J-F Garnier Member Posts: 293 Joined: Dec 2013
RE: HP-41C HP-IL REMOTE & LOCAL commands
Hello Sylvain,

Yes it was a common pitfall at the time.
The HP41 with the HPIL module only is unable to set the parameters of the HP82164, and also of the HP82165/166 GPIOs (that requires the use of DDL/DDT commands).
The extended I/O module was mandatory with these interfaces -unless using the default configuration.

I believe the behavior of the REMOTE/LOCAL commands has an historical explanation.
They comes from the HP-IB (aka IEEE488) world in instrumentation applications, and intended to enable or disable the remote control of the instrument from a computer rather than from the front panel. Once the instrument remote commands were enabled, it was possible to temporary go back to local (front panel commands) until a new command is received.

When the remote/local were used to select between commands and data for interfaces, the same behavior was kept unfortunately.

To make the things even worst:
on the 71, "LOCAL" uses NRE (Not Remote Enable),
but "LOCAL :1" uses GTO (Goto Local) !
(same on the 75).
Your HP71 code should NOT work !

And there is also this LOCAL LOCKOUT command :-)

J-F
06-03-2018, 09:22 PM
Post: #3
 Sylvain Cote Senior Member Posts: 963 Joined: Dec 2013
RE: HP-41C HP-IL REMOTE & LOCAL commands
Hello Jean-François,

(06-03-2018 08:32 PM)J-F Garnier Wrote:  I believe the behavior of the REMOTE/LOCAL commands has an historical explanation.
They comes from the HP-IB (aka IEEE488) world in instrumentation applications, and intended to enable or disable the remote control of the instrument from a computer rather than from the front panel. Once the instrument remote commands were enabled, it was possible to temporary go back to local (front panel commands) until a new command is received.
When the remote/local were used to select between commands and data for interfaces, the same behavior was kept unfortunately.
This make a lot of sense.

(06-03-2018 08:32 PM)J-F Garnier Wrote:  Your HP71 code should NOT work !
You are right, in my program I only have LOCAL and not LOCAL :RS232, I probably did a copy/paste when I wrote the initial post (now corrected).
I was curious, I tested both variant and it did what you explained, the thing is that although I do not remember it, I surely knew this back in the 1980's.

Thanks for your precious information and for the error correction.

Best regards,

Sylvain
06-05-2018, 08:42 AM
Post: #4
 Garth Wilson Senior Member Posts: 341 Joined: Dec 2013
RE: HP-41C HP-IL REMOTE & LOCAL commands
(06-03-2018 08:32 PM)J-F Garnier Wrote:  Hello Sylvain,

Yes it was a common pitfall at the time.
The HP41 with the HPIL module only is unable to set the parameters of the HP82164, and also of the HP82165/166 GPIOs (that requires the use of DDL/DDT commands).
The extended I/O module was mandatory with these interfaces -unless using the default configuration.

I believe the behavior of the REMOTE/LOCAL commands has an historical explanation.
They comes from the HP-IB (aka IEEE488) world in instrumentation applications, and intended to enable or disable the remote control of the instrument from a computer rather than from the front panel. Once the instrument remote commands were enabled, it was possible to temporary go back to local (front panel commands) until a new command is received.

That's probably why I never had any trouble with it. My original purpose for getting the 41 and HP-IL in 1986 was to control IEEE-488 equipment on the workbench through the HP82169A HPIL-to-HPIB interface converter. The equipment consisted of things like signal generators, DMMs, and relay units, and they mostly had their own front-panel controls, so they could be used manually without external computer control, or under computer control for automated test setups. During program development, I might occasionally want to press the LOCAL button on one piece of equipment or another to check something by changing settings from the equipment's own front panel. I always used the 41 in MANIO (manual I/O address selection), because the HPIL-to-HPIB interface converter, although mostly transparent, did not have the autoaddressing like HP-IL does; so each piece of equipment on the IEEE-488 (HP-IB) had to be addressed with SELECT. There was no choice about that; and all of their addresses had to be above the number of things on HP-IL, and the interface converter had to be the last thing on the loop. Printer, mass storage, and anything else I had must come before the HP82196A.

I have the FSI164A which was almost identical to the HP82164A except that it came with two RS-232 channels standard, and up to eight if you paid extra, and could be powered with batteries. I originally used it to control an EPROM programmer, and later, interfaced to other things on the workbench. I don't remember ever having any problem with it, although I heard it has a bug with even parity (which I never tried).

Sylvain, I do find it a bit curious that you would use AUTOIO and then 1 SELECT.

06-06-2018, 12:28 AM (This post was last modified: 06-06-2018 12:33 AM by Sylvain Cote.)
Post: #5
 Sylvain Cote Senior Member Posts: 963 Joined: Dec 2013
RE: HP-41C HP-IL REMOTE & LOCAL commands
Hello Garth,

(06-05-2018 08:42 AM)Garth Wilson Wrote:  Sylvain, I do find it a bit curious that you would use AUTOIO and then 1 SELECT.

My original intention was to use it as a loop continuity check, but as you will see, it does not add anything to the final solution.

Your question made me realize that I should have traced all the 82160A & 82183A functions long ago.
Actually I did it in the 1980s with the HP-IL Dev. ROM (MONITOR) when it became available.
Being completely away from the HP calculator world between 1989 and 2011 made me lose most of that deep knowledge.
I am slowly rebuilding it, but doing part time takes forever ...

As you will see, in this specific case, SELECT generate the same set of HP-IL messages as MANIO and AUTOIO commands.
It is special to see AUTOIO generating twice the same set of messages.
So here it is ... (for simplicity’s sake, I have not included IDY and ETO frames)

HP-41 Command Sequence
Code:
MANIO 1 SELECT AUTOIO 1 SELECT

MANIO
Code:
AAU     RFC     AAD  1  TAD 01  RFC     SAI     DAB 2E  LAD 01  RFC     UNL     RFC

1 SELECT
Code:
AAU     RFC     AAD  1  TAD 01  RFC     SAI     DAB 2E  LAD 01  RFC     UNL     RFC

AUTOIO
Code:
AAU     RFC     AAD  1  TAD 01  RFC     SAI     DAB 2E  LAD 01  RFC     UNL     RFC      AAU     RFC     AAD  1  TAD 01  RFC     SAI     DAB 2E  LAD 01  RFC     UNL     RFC

1 SELECT
Code:
AAU     RFC     AAD  1  TAD 01  RFC     SAI     DAB 2E  LAD 01  RFC     UNL     RFC

Above HP-IL messages explanation
Code:
AAU     RFC     AAD  1  // loop reconfiguration TAD 01  RFC             // first device on the loop becomes the talker SAI     DAB 2E          // request accessory id from the talker LAD 01  RFC             // first device on the loop becomes a listener UNL     RFC             // deactivate listeners

Regards,

Sylvain
06-06-2018, 02:08 AM
Post: #6
 rprosperi Senior Member Posts: 3,153 Joined: Dec 2013
RE: HP-41C HP-IL REMOTE & LOCAL commands
Those results are certainly unexpected!

I like your description of AUTOIO sending the identical sequence twice: "Special".

Initially I wondered if the sequence is sent twice due to possible latency in some of the early HP-IL devices, but then realized HP-IL is literally bit-serial, so failures replying (due to delays) to the initial sequence would hang the loop even on the first time around.

The docs for the 41 IL modules was weak, especially for the Extended IO and Devel ROMs. No help there....

In the end, did you find any practical difference in the loop behavior after setting the different modes?

--Bob Prosperi
06-06-2018, 03:01 AM
Post: #7
 Sylvain Cote Senior Member Posts: 963 Joined: Dec 2013
RE: HP-41C HP-IL REMOTE & LOCAL commands
(06-06-2018 02:08 AM)rprosperi Wrote:  I like your description of AUTOIO sending the identical sequence twice: "Special".
Well, it's probably my fren-glish here, we have the same word in both languages but with potentially different usage.

(06-06-2018 02:08 AM)rprosperi Wrote:  In the end, did you find any practical difference in the loop behavior after setting the different modes?
I am just restarting to trace all the commands, but I expect to have some behavioural differences between manual and auto modes later on.
I will post traces here as I do them and I will create an article when it's complete enough.
Just be patient, these traces will be done when I have free time between the other projects that are themselves done in my personal free time, which I do not have in abundance.
06-06-2018, 07:43 AM
Post: #8
 J-F Garnier Member Posts: 293 Joined: Dec 2013
RE: HP-41C HP-IL REMOTE & LOCAL commands
(06-06-2018 02:08 AM)rprosperi Wrote:  The docs for the 41 IL modules was weak, especially for the Extended IO and Devel ROMs. No help there....

There is a whole section about the auto and manual modes in the HP82160 manual (p.46 english ed.).

In the code from Sylvain, AUTOIO is not strictly mandatory (the code would run fine in MANIO), but I always advised to use AUTOIO unless there is a special need (°). SELECT is needed, to select the destination of OUTA. It could be omitted here if the interface is the first device but the general sequence is:
AUTOIO "HP82164" FINDID SELECT
and there would be a difference here between MANIO and AUTOIO if the 82164 is not the 1st device in the loop. The explanation is somehow hidden in the HP82160 manual, page 53 :-)

(°) One need (and the only real one I encountered) is to use the printer functions (PRA, PRP, LIST, ...) to print to a non-printer device such as the HP82166 GPIO/converter (or DOSLINK in ILPer).

J-F
06-06-2018, 01:04 PM
Post: #9
 rprosperi Senior Member Posts: 3,153 Joined: Dec 2013
RE: HP-41C HP-IL REMOTE & LOCAL commands
(06-06-2018 07:43 AM)J-F Garnier Wrote:
(06-06-2018 02:08 AM)rprosperi Wrote:  The docs for the 41 IL modules was weak, especially for the Extended IO and Devel ROMs. No help there....

There is a whole section about the auto and manual modes in the HP82160 manual (p.46 english ed.).

In the code from Sylvain, AUTOIO is not strictly mandatory (the code would run fine in MANIO), but I always advised to use AUTOIO unless there is a special need (°). SELECT is needed, to select the destination of OUTA. It could be omitted here if the interface is the first device but the general sequence is:
AUTOIO "HP82164" FINDID SELECT
and there would be a difference here between MANIO and AUTOIO if the 82164 is not the 1st device in the loop. The explanation is somehow hidden in the HP82160 manual, page 53 :-)

(°) One need (and the only real one I encountered) is to use the printer functions (PRA, PRP, LIST, ...) to print to a non-printer device such as the HP82166 GPIO/converter (or DOSLINK in ILPer).

J-F

Yes, that section does describe the modes clearly, at a high (operational) level, but nothing about how this occurs at lower (HP-IL frame) levels. When using more than simply 1 tape drive and 1 printer with the 41, I was always frustrated that there was no way to see what occurred at lower levels. Eventually I got the Devel ROM which provided a (frustrating to use) loop scope, but I had moved on to the 71b so never really pursued it enough to grasp it all.

As Sylvain suggests, a frame-by-frame breakdown of each high-level command is the best way to understand and use them, and I always thought such documentation should have been provided by HP, even if only in a separately purchased "advanced" manual or something similar.

Thinking more about the example above, the sequences likely would have differed if there were more than 1 device connected, but still I always thought things were more 'different' at lower levels.

Since I have a choice (for play) I'll stick with the 71b for HP-IL use.

--Bob Prosperi
06-07-2018, 12:40 PM
Post: #10
 J-F Garnier Member Posts: 293 Joined: Dec 2013
RE: HP-41C HP-IL REMOTE & LOCAL commands
(06-06-2018 01:04 PM)rprosperi Wrote:  As Sylvain suggests, a frame-by-frame breakdown of each high-level command is the best way to understand and use them, and I always thought such documentation should have been provided by HP, even if only in a separately purchased "advanced" manual or something similar.
On the 41, the HP-IL is deliberately automated as much as possible, contrary to the 71 where you have a more precise control of the HP-IL.
First the loop addresses are re-assigned in almost all HP-IL commands so you can add/remove devices at any time, and everything will still work - on the 71 you have to do a RESTORE IO to re-assign the addresses.
Then, the HP41 checks for a printer almost every time it does something, to check for instance the trace mode on the 82162.
And, worst, if a printer is on the loop and in AUTOIO, the HP41 continuously emits IDY frames to check if the user pressed a key on the 82162 (even if that printer is not actually present).

So if you want to look at the low-level frames related to a high-level HP-IL command, I recommend to put the printer switch of the 82160 module in the disable position.

J-F
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)