POEM Stepper Organizer calling interface


There are two types of dialog:

1. String Mode - by simple ASCII string with Command as letter (or word where only first letter is significant) and numerical Parameters separated by comma (Also can be Remark separated by semicolon).

Example 1: Set current position of Y to 100:

P ,100,,
Position ,100 ; Set current position of Y to 100

Example 2: Set Output 0 to High and Output 3 to Low:

O 1,,,0
Output 1,,,0 ; Set Output 0 to High and Output 3 to Low, Other unchanged

Returns numerical
Parameters separated by comma.

Note 1: Each string is only one command.

Note 2: It is possible to type numerical Parameters also in hex form.
I.e. instead of
decimal 100 may be: $64 or 64h or 0x64.
2. Direct Mode - by sending computer internal type data (Fast way). This data structure described by type PoemAr:

In Pascal:

type PoemRec=record

PoemAr=array[0..4] of PoemRec;

In C:

typedef struct

long Value;
} PoemRec;

typedef PoemRec PoemAr[5];

Command definition is PoemAr[0]. Parameters is PoemAr[1] to PoemAr[4].
To call set PoemAr[0].Present to true (1), PoemAr[0].Value to
Command Number.

Example: Set Current position of Y to 100:






Returns answer in the same form but (if connection with driver OK)
sets PoemAr[0].Present to false (0) and PoemAr[0].Value to 1112098124.

Dialog type defined by DealType parameter.

If DealType is 0 to 31: this is a String Mode with ASCII string terminated by DealType character.
I.e. for C Language string (ASCIIZ) DealType=0.
If DealType is 32:   this is a String Mode with string where first byte describing string length (Pascal string, LString).
If DealType is 255:   this is a Direct Mode.

In case of multidriver usage (more than one Poem driver at the same time) the suggestion is to switch between drivers by '*' Command in String Mode or Command Number 99 in Direct Mode. It depends on Your sotware but...


DOS Interface

Provided by call to resident POEM.EXE through INT 17H.

Terms: PoemData - sent/delivered data buffer: String or PoemAr,
  DealType - Dialog type,
  AddFnc - Driver Number (Required on loading each driver TSR).

In Assembler:

push es    
push di    
push ax    
push ds    
pop es    
lea di,offset PoemData ; es:di - points to PoemData
mov al,DealType ; al - defines Dialog type
mov ah,0e0h+AddFnc ; ah - selects Driver Number
int 17h    
pop ax    
pop di    
pop es    


Windows Interface

Provided by calling PoemDeal procedure in POEMxx.DLL.

Terms: DealType - Dialog type,
  PointIn - pointer to sent data buffer: String or PoemAr,
  PointOut - pointer to delivered data buffer: String or PoemAr.

PoemDeal (DealType : char; PointIn, PointOut : pointer);

Note: Multidriving in Windows provided by renaming/relocating DLLs.

? Aryeh Eiderman <leib@inter.net.il>