NUM 1060 PC MODULE Manual
NUM 1060 PC MODULE Manual
PC
MODULE
0101938928/2
09-97 en-938928/2
Despite the care taken in the preparation of this document, NUM cannot guarantee the accuracy of the information it contains and cannot be held
responsible for any errors therein, nor for any damage which might result from the use or application of the document.
The physical, technical and functional characteristics of the hardware and software products and the services described in this document are subject
to modification and cannot under any circumstances be regarded as contractual.
The programming examples described in this manual are intended for guidance only. They must be specially adapted before they can be used in
programs with an industrial application, according to the automated system used and the safety levels required.
2 en-938928/2
Table of Contents
1 General 7
2 System Architecture 9
2.1 PCNC 1060 Series II System Architecture 9
2.2 PCNC 1060 System Architecture 10
3 Card Layout in the Rack 11
3.1 Card Layout in the 1060 Series II Rack 11
3.2 Card Layout in the 1060 Rack 12
4 PCNC Configurations 13
4.1 PCNC 1060 Series II Configuration 13
4.2 PCNC 1060 Configuration 14
5 PC Module Characteristics 15
5.1 PC Module Version 1 Characteristics 15
5.2 PC Module Version 2 Characteristics 16
6 PC Module Connection Wiring Diagram 18
6.1 PC Module Version 1 Connection 18
6.2 PC Module Version 2 Connection 19
7 PCMCIA Module Characteristics 20
8 Cables 21
8.1 Video Cable 21
8.2 Diskette Drive Cable 23
8.2.1 PC Version 1 Module 23
8.2.2 PC Version 2 Module 24
9 Work on the PC Module 25
9.1 Replacing the Battery 26
9.2 Adding a DRAM Memory Module 26
9.3 Adding the PCMCIA Module 27
10 Using the PC 28
10.1 Applications Which Can Be Used by the PC 28
10.2 Using the PC 28
10.2.1 Config.sys 28
10.2.2 NUM Shutdown 29
10.2.3 Opening a User Application at Startup 31
10.2.4 NUM Task/User Task Toggle 31
10.2.5 Creating System Diskettes 32
10.2.6 Regenerating the Initial Configuration 32
10.2.7 Reinstalling the NUM Application 32
10.2.8 Backing up the NUM Application 32
10.2.9 Restoring a Disk: CHKDSK 32
10.2.10 Modifying the NUM Application Task
Priorities 33
10.2.10.1Description of the Threads 33
10.2.10.2Modifying the Priorities 33
10.2.10.3Entering the Parameters 34
10.2.11 Modifying the Colour Palette 34
en-938928/2 3
10.3 Development of Specific Applications 35
10.3.1 UNI-TE Primitives 35
10.3.1.1 Accessing UNI-TE: Open_Unite() Function 35
10.3.1.2 Opening Logic Ports: Get_Port() Function 36
10.3.1.3 Freeing Logic Ports: Free_Port Function 36
10.3.1.4 Sending a Request : Unito() Function 37
10.3.1.5 Receiving an Answer: Uniti() Function 38
10.3.1.6 Example of Use of UNI-TE Primitives in an
Application 39
10.3.2 Requests Accessible to the PC 40
10.3.2.1 List of CNC Requests 40
10.3.2.2 List of PLC Requests 42
10.3.2.3 Reading Part Programme Blocks 43
10.3.2.4 Writing Part Programme Blocks 44
10.3.2.5 Reserving Memory Space 45
10.4 Functional Description of the PCNC Server 46
10.4.1 OPEN-DOWNLOAD-SEQUENCE Request 46
10.4.2 WRITE-DOWNLOAD-SEGMENT Request 47
10.4.3 CLOSE-DOWNLOAD-SEQUENCE Request 48
10.4.4 OPEN-UPLOAD-SEQUENCE Request 48
10.4.5 READ-UPLOAD-SEGMENT 49
10.4.6 CLOSE-UPLOAD-SEQUENCE 50
10.4.7 "ICONIFICATION" (Minimise) Request 51
10.4.8 "RESTITUTION" (Restore) Request 51
10.4.9 "VERROUILLAGE/DEVERROUILLAGE"
(Lock/Unlock) Request 52
10.4.10 SHUTDOWN Request 53
10.4.11 START-APPLI Request 54
10.4.12 DELETE-FILE Request 54
10.4.13 READ-MEMORY-FREE 55
10.4.14 UNSOLICITED-DATA Request 56
4 en-938928/2
Record of Revisions
DOCUMENT REVISION
en-938928/2 5
6 en-938928/2
PC Module
1 General
The PC module is designed for integration in the PCNC 1060 architecture.
If provides the following functions:
- conventional functions of a PC operating under OS/2,
- functions associated with the operation of the CNC through specific applications.
The present document covers only the specific features regarding the integration and operation of the PC module.
The integration of a system including a PC module involves concepts developed in the following manuals:
- NUM 1060 Installation and Commissioning Manual (938816),
- UC SII Central Processing Unit Manual (938922) when a Series II PCNC 1060 is involved,
- Automatic Control Function Programming Manual in Ladder Language (938846) or Assembler (938817),
- UNI-TE Protocol Utilization Manual (938914),
- Parameter Manual (938818).
en-938928/2 7
! CAUTION
Up to version C2, the DNC library included only one file, LIB_UNIT.DLL.
It now includes two files (DNC.DLL and LIB_UNIT.DLL)
which must be loaded into directory C:\OS2\DLL.
The old file LIB_UNIT.DLL is now replaced by the new ones.
8 en-938928/2
PC Module
2 System Architecture
2.1 PCNC 1060 Series II System Architecture
Memory
S
II CNC function
RS 232 serial links
C
P
U Interrupt
PLC function
Analogue inputs/outputs
Serial bus /
optical fibre Machine
adaptation panel
Serial bus
System bus
Machine
panel
Inputs extension (I/O)
Outputs
Speed reference
Axes Measurement
Origin switch
Dedicated
interfaces
Graphic
P function
C
PC
function
Parallel link
en-938928/2 9
2.2 PCNC 1060 System Architecture
Interrupts
Machine Analogue inputs/outputs
processor Serial links
Remote
inputs
Serial bus /
optical fibre Remote
adaptation outputs
Serial bus
Inputs Machine
panel
System bus
Machine
panel
Outputs extension (I/O)
Memory
Speed reference
Axes Measurement
Origin switch
Dedicated
interfaces
Graphic
P function
C
PC
function
Parallel link
10 en-938928/2
PC Module
! CAUTION
The PC module occupies the two slots immediately to the left of the last CNC card installed,
or three slots if the PCMCIA card is connected to it.
7 6 5 4 3 2 1 0
PC module
PCMCIA
To left
of last
UC SII Central Processing Unit
CNC
card
Power supply
8 7 6 5
en-938928/2 11
3.2 Card Layout in the 1060 Rack
14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
To left of last
PC module
CNC card
PCMCIA
Machine processor
CNC processor
Power supply
Memory card
12 11 10 9 8 7 6 5
12 en-938928/2
PC Module
4 PCNC Configurations
4.1 PCNC 1060 Series II Configuration
Peripherals
Operator panel
Support for
type 1 and 2
PCMCIA cards
UC SII Central processing unit
Power supply
PC module
Axis card
PCMCIA
Input/
output DNC computer
cards
1 or 2 machine
panels
X
M01
CYCLE
START
CYCLE
STOP
Analogue inputs/outputs
Sensor or External interrupts
rule NUM and Customer
applications
Handwheel
Machine tool
Power cabinet
Automatic controls Servo-drive
Motor
en-938928/2 13
4.2 PCNC 1060 Configuration
Peripherals
Operator panel
Support for
type 1 and 2
PCMCIA cards
Machine processor
CNC processor
Power supply
Memory card
PC module
Axis card
Axis card
PCMCIA
DNC computer
1 to 4 machine
Input/output cards panels
X
M01
CYCLE
START
CYCLE
STOP
Analogue
Sensor or inputs/outputs
rule External interrupts
NUM and Customer
applications
Handwheel
Machine tool
Power cabinet
Automatic controls Servo-drive
Motor
14 en-938928/2
PC Module
5 PC Module Characteristics
5.1 PC Module Version 1 Characteristics
Power consumption 11 W maximum
Location Last two CNC board slots
(See Chapter 3)
External temperature 40 °C maximum
C
Two RS 232 serial lines (9-pin male connectors)
O Maximum input voltage ± 30 V
M VOL typical -9V
1 VOH typical +9V
Extreme loads 2000 pF, 5kΩ (about 10 m of cable)
Data rate 110 to 9600 bauds with the possibility of
increasing to 115 kbauds for local applications
C
O
M Parallel line
2
1 parallel line (25-contact female connector)
Mass MB
L Hard disk
P
T Local memory
1
8 or 16 MB DRAM
P
OS/2 operating system
A NUM graphic application
N
E
PC module version 1 is a 32-bit processor card with a 486 SX or 486 DX 20 MHz
L microprocessor.
! CAUTION
en-938928/2 15
5.2 PC Module Version 2 Characteristics
Power consumption 11 W maximum
Location Last two CNC board slots
(See Chapter 3)
External temperature 40 °C maximum
HD
Def. Serial lines
Floppy
Mass MB
P Hard disk
A
N F
E L Local memory
L O
P 8 or 16 MB DRAM
L P
I Y
N Software programs loaded on hard disk
K
OS/2 operating system
NUM graphic application
PC module version 1 is a 32-bit processor card with a 486 SX or 486 DX 20 MHz
Proc. PC microprocessor.
It communicates via the system bus with:
- the CNC and machine processors (in the 1060 system)
- the UC SII Central Processing Unit (in the 1060 Series II system)
It can communicate with peripheral equipment via the RS 232 COM1 and COM2
serial lines and a parallel line as well as with a diskette drive via the floppy disk
connector.
16 en-938928/2
PC Module
! CAUTION
en-938928/2 17
6 PC Module Connection Wiring Diagram
6.1 PC Module Version 1 Connection
Déf.
1
C
O
M
1
or
C
O
M
2 Peripherals
2
L
P
T
1
Printer
P
3
A
N
E
L
L
I
N
K
. PC Proc
Operator panel
18 en-938928/2
PC Module
2
HD
1 Def.
C
O
M
1
or C
O
M
Printer
2
Peripherals
L
P
T
1
4
3
P
A
N F
E L
L O
P
L P
I Y
N
K
en-938928/2 19
7 PCMCIA Module Characteristics
Location To the left of the PC card, assembled with it
(width 24 mm)
External temperature 40°C maximum
This module can only be connected to the PC version 2 card. The PC and PCMCIA
cards must be inserted together in the rack.
Polarising slot
Extracting the Network Card
NE RETIRER LA CARTE QU' AVEC
Interface socket: The Compaq Concerto software interface is used for the above
network cards (in the system configuration - selective installation of PCMCIA card
socket).
20 en-938928/2
PC Module
8 Cables
8.1 Video Cable
20 20
1 1
Video cables:
en-938928/2 21
Red
Red (white wire) Red (white wire)
7 7
RGround (black wire) RGround (black wire)
8 Green 8
Green (white wire) Green (white wire)
27 27
GGround (black wire) GGround (black wire)
28 Blue 28
Blue (white wire) Blue (white wire)
10 10
BGround (black wire) BGround (black wire)
11 White 11
HSync (white wire) HSync (white wire)
30 30
HSGround (black wiire) HSGround (black wire)
31 Black 31
VSync (white wire) VSync (white wire)
13 13
VSGround (black wire) VSGround (black wire)
14 Blue (0.6) 14
VDC VDC
1 Red (0.6) 1
VDC VDC
2 White (0.6) 2
GND GND
20 Black (0.6) 20
GND GND
21 21
Red (0.22) Red (0.22)
DATA DATA
17 White (0.22) White (0.22) 17
GND GND
Blue (0.22) Blue (0.22)
22 22
Black (0.22) Black (0.22)
CLOCK CLOCK
35 35
Wiring recommendations:
- clamp the cable on a half-cover,
- solder the pins on the other side,
- clamp the other side of the cable on a half-cover,
- solder the pins on the other side.
! CAUTION
For correct interference suppression of the system, the cable screening must be earthed
(on 360 degrees) in accordance with the instructions of Installation and Commissioning
Manual 938816.
The two clamps must be used to clamp the cable on the cover
22 en-938928/2
PC Module
36 35
2 1
Edge connector to
PC version 1 card
Pinout for connecting a 3 1/2" diskette drive (type TEAFC FD-235HF) to the PC V1 module
Maximum length: 1 metre
GND 1 1 GND
RPM/LC 2 2 RPM/LC
GND 3 3 GND
nc 4 4 nc
GND 5 5 GND
nc 6 6 nc
GND 7 7 GND
INDEX# 8 8 INDEX#
GND 9 9 GND
DRV0# 10 10 DRV0#
GND 11 11 GND
DRV1# 12 12 DRV1#
GND 13 13 GND
nc 14 14 nc
GND 15 15 GND
MTRON# 16 16 MTRON#
GND 17 17 GND
DIR 18 18 DIR
GND 19 19 GND
STEP# 20 20 STEP#
GND 21 21 GND
WDATA# 22 22 WDATA#
GND 23 23 GND
WGATE# 24 24 WGATE#
GND 25 25 GND
TRK0# 26 26 TRK0#
GND 27 27 GND
WRPRT# 28 28 WRPRT#
GND 29 29 GND
RDATA# 30 30 RDATA#
GND 31 31 GND
HDSEL 32 32 HDSEL
GND 33 33 GND
DSKCHG 34 34 DSKCHG
GND 35
VCC 36
2 GND
4 VCC
Protective
earth
en-938928/2 23
8.2.2 PC Version 2 Module
Solder side
37 19
20 1
37-contact male
connector
Pinout for connecting a 3 1/2" diskette drive (type TEAFC FD-235HF) to the PC V2 module
Maximum length: 1 metre. For wiring recommendations, see Sec. 8.1.
GND 1 1 GND
RPM/LC 20 2 RPM/LC
GND 2 3 GND
nc 21 4 nc
GND 3 5 GND
nc 22 6 nc
GND 4 7 GND
INDEX# 23 8 INDEX#
GND 5 9 GND
DRV0# 24 10 DRV0#
GND 6 11 GND
DRV1# 25 12 DRV1#
GND 7 13 GND
nc 26 14 nc
GND 8 15 GND
MTRON# 27 16 MTRON#
GND 9 17 GND
DIR 28 18 DIR
GND 10 19 GND
STEP# 29 20 STEP#
GND 11 21 GND
WDATA# 30 22 WDATA#
GND 12 23 GND
WGATE# 31 24 WGATE#
GND 13 25 GND
TRK0# 32 26 TRK0#
GND 14 27 GND
WRPRT# 33 28 WRPRT#
GND 15 29 GND
RDATA# 34 30 RDATA#
GND 16 31 GND
HDSEL 35 32 HDSEL
GND 17 33 GND
DSKCHG 35 34 DSKCHG
GND 18
VCC 37 2 GND
GND 19 4 VCC
Protective
earth COVER Protective
earth
24 en-938928/2
PC Module
4 1 2
1- Battery connector
2- Battery
3- Slot for DRAM memory module
4- Edge connector for diskette drive (PC version 1 module only)
en-938928/2 25
9.1 Replacing the Battery
Refer to the diagram showing the locations on the PC module (see previous page).
! CAUTION
The battery must be replaced within 15 minutes at most so as not to lose the data backed
up in the PC CMOS RAM. A special capacitor replaces the battery to supply the memories
during replacement.
1 - Disconnect the old battery (1) and remove it (2) from its housing.
2 - Insert the new battery (2) in its housing and connect it (1), ensuring the connector is in the right direction.
Notch
26 en-938928/2
PC Module
Post locations
PCMCIA module
connection zone
en-938928/2 27
10 Using the PC
10.1 Applications Which Can Be Used by the PC
The PC must have OS/2 operating system in version 2.1 or above.
This operating system allows the following types of applications to be executed:
- DOS applications in full screen mode or in a window of the Presentation Manager desktop,
- Windows applications in version 3 and 3.11 for OS2/Warp in a full screen session or a Desktop window of
Presentation Manager
- OS/2 16-bit applications developed under OS/2 versions 1.x,
- OS/2 32-bit applications developed under OS/2 versions 2.x.
All the applications are executed in protected mode. OS/2 is a multitasking pre-emptive shared time system affording
full memory protection between each application.
For more details on the OS/2 operating system, refer to the IBM documentation, especially as regards DOS and
Windows compatibility.
! CAUTION
The following command must mandatorily be included in config.sys:
SETRESTARTOBJECTS=STARTUPFOLDERSONLY, to guarantee that only the NUM
application contained in the STARTUP folder is started at system startup.
- Installation of a mouse. The user can connect a mouse to serial port 1 so that it is recognised by OS/2. The
config.sys file must be modified by deleting the letters REM at the beginning of certain lines:
DEVICE=C:\OS2\MDOS\VMOUSE.SYS
DEVICE=C:\OS2\MOUSE.SYS SERIAL=COM1
- To enable diskette drive a:
Delete the letters REM from the beginning of the following line in config.sys:
REM BASE DEV=IBM1FLPY.ADD
REMARK It is strongly recommended to copy the config.sys file into another directory
before making any changes to it.
The changes made to config.sys are not applied until the system is rebooted
(reset the system).
28 en-938928/2
PC Module
Important remark:
- If several instances of the same application are running simultaneously (e.g. C:\OS2\CMD.EXE corresponding
to an OS/2 session window), they are all killed.
- For Windows sessions, if several Windows applications are running in the same session, they are all killed,
since there is no way of identifying a given executable, and the entire session is therefore killed.
The NAMEAPP.EXE utility located in C:\NUM\GRAPHIC is used to identify the applications running when it is started.
It is necessary to use this utility to determine the exact names of the applications (especially for Windows applications).
If several Windows applications are running in the same DOS machine (Virtual DOS Machine), the only way of
identifying the VDM is by the name of the first Windows application started. This is the name which must be stored
in REINIT.CFG (to be checked with NAMEAPP.EXE). The complete VDM is killed.
en-938928/2 29
Shutdown
The SHUTDOWN.EXE Num executable was initially run from the NUM application by pressing keys Alt+F12. It killed
all the applications running in the system and started the OS/2 shutdown procedure. This was mainly for the purpose
of requiring the operator to confirm only the shutdown request. In addition, the server and pipeline also invoked
SHUTDOWN.EXE.
Now, pressing the same keys also runs SHUTDOWN.EXE, but this file kills the applications declared in REINIT.CFG,
stops the NUM graphic application, indicates to the other processors that the PCNC is stopping and runs the
SHUT.CMD file. SHUT.CMD contains the default command line START/N C:\NUM\GRAPHIC\KILLAPPS.EXE 6 in
which KILLAPPS.EXE is the executable that performs the final shutdown and stops the system.
It is necessary to specify a parameter when using KILLAPPS.EXE (6 in the above case). This parameter corresponds
to the process ID of the Num application. It can be obtained by running the NAMEAPP.EXE utility in directory
C:\NUM\GRAPHIC. This utility gives the name and ID of each process. In particular, when a network is loaded on
a PCNC under Warp before the NUM application, the parameter specified in SHUT.CMD is no longer 6, but the value
of the GR_PC.EXE process ID obtained from NAMEAPP.EXE.
This method preserves compatibility for the server and pipeline, since the same filename is always invoked. In addition,
it allows the user to edit the SHUT.CMD file, replacing the default line by a line with the format START/N pathname\user
_filename, where user_filename is the name of the user executable used to cleanly shut down the applications (e.g.
networks) and run either KILLAPS.EXE or the OS/2 SHUTDOWN.EXE located in C:\OS2\INSTALL. The main
difference between these two files is that the OS/2 SHUTDOWN.EXE file displays a confirm dialogue box for windowed
applications before proceeding to shutdown.
To summarise:
- If REINIT.CFG is empty, all the applications are killed by a reset (machine parameter modification, etc.)
- If REINIT.CFG is not empty, it should contain the names of all the applications (maximum 16) using 1060 system
resources (UNI-OS2, EDIT-PP, NUM-Bu, etc.).
30 en-938928/2
PC Module
! CAUTION
So as not to corrupt the hard disk, it is recommended to carry out a shutdown procedure
before turning off power.
During the shutdown, all the applications are closed without warning.
If an editor was open, any modifications made are lost. This is also the case for a reset
after modifying machine parameters.
en-938928/2 31
10.2.5 Creating System Diskettes
Available in OS/2 version 3 and above.
Since the PCNC is supplied with the software already installed and without installation diskettes, it is recommended
to created your own installation diskettes, in particular OS/2.
Use the following procedure:
- On the desktop, double-click the "Diskette Factory" icon
- In the window that opens, select the name of the product for which the installation diskettes are to be created
- Click "Create" and follow the instructions.
32 en-938928/2
PC Module
NumExcep
This thread scans the global system memory to check for:
- Reboot requests from other processors,
- Exceptions from the other processors.
It is always active, even when the application is minimised.
Its default priority is Class=2 and Delta=20:
DosSetPriority(2, 2, 20, NumExcep).
NumSelect
This thread reads the graphic command blocks placed in the global memory by the CNC processor, performs INTEL/
MOTOROLA conversion and handles display.
It is suspended when the application is minimised.
Its default priority is Class=2 and Delta=20:
DosSetPriority(2, 2, 20, NumSelect).
NumStat
This thread manages display in the STATUS window.
It is suspended when the application is minimised.
Its default priority is Class=2 and Delta=20:
DosSetPriority(2, 2, 20, NumStat).
NumThread
This thread manages Presentation Manager messages such as the window minimisation command and keyboard
entries transmitted to other processors.
It is always active, even when the application is minimised.
Its default priority is Class=3 and Delta=20:
DosSetPriority(2, 3, 20, NumThread).
en-938928/2 33
- NumStat Class
- NumStat Delta
- NumThread Class
- NumThread Delta.
If one of these parameters is missing or a ninth is added, the default priority definitions are applied.
The Class parameters must have a value ≥ 1 and ≤ 4 and the Delta parameters must have a value ≥ -31 and ≤ +31;
otherwise, the default values are applied.
34 en-938928/2
PC Module
Syntax
Description
This primitive lets the application communicate with the 1060 system in requester mode and access requests.
It must always be called at the start of the application before any requests are used.
Answer code
en-938928/2 35
Example
if { (error = Open_Unite ())
printf (("\n %d unite opening error", error);}
Syntax
Description
This primitive is used to allocate a logic port (number 0x70 to 0x7F) through which the requests are sent.
It returns a free logic port number which can be used by the application.
A port has to be opened in order to transmit requests.
Returned code
Example
for (i = 0 ; i < 15 ; i++)
{ if ( (error = Get_Port (&port[i])) !=0)
{ printf ("\n error %d opening port[%d]", error, i); }
else
{ printf ("\n OK port[%] =%x", i, port[i]); }
}
Syntax
Description
This primitive frees the port whose number is given as argument.
A port must not be freed until all the answers awaited have been received.
36 en-938928/2
PC Module
Returned code
Example
for (i = 0 ; i < 15 ; i++)
{ if ( (error = Free_Port (port[i])) !=0)
{ printf ("\n error %d freeing port[%]", error, i); }
}
Syntax
Description
This primitive allows a request to be sent to a server on one of the 16 source ports addressed by Get_Port.
The answer to a request must be requested before sending another request to the same port.
Returned code
Buffer start @
Buffer size
(1 word, not significant)
Request size
(1 word, maximum value 128)
Request
(128 bytes maximum) Written by the
user programme
1 word
en-938928/2 37
Example
BufferReq . ReqSize = yy ; /* size of request in bytes */
BufferReq . RequestCode = 0xnn ; /* Request code */
BufferReq . CategoryCode = mm ; /* Category code */
BufferReq . Segment = (UCHAR) Segment ;
BufferReq . Specific = (UCHAR) Specific ;
BufferReq . ObjectAddress = ObjectAddress ;
BufferReq . Quantity = Quantity ;
error = Unito (port[i], &BufferReq);
Syntax
Description
This primitive is used to receive an answer to a request sent from the same source port.
As long as code 0x08 is returned (processing of request by server not completed), the function must be repeated
periodically until the answer is obtained.
Returned code
Buffer start @
Buffer size Written by the
(1 word, answer size + 2) user programme
Answer size
(1 word, maximum value 128)
Answer
(128 bytes maximum) Written by the
NUM software
1 word
38 en-938928/2
PC Module
Example
BufferResp . BufferSize = xx ;
BufferResp . ReqSize = 0 ;
do { error = Uniti (port[i], &BufferResp);
} while (error == NO_MESSAGE);
en-938928/2 39
...
/* receiving a response */
BufferResp . BufferSize = xx ;
BufferResp . ReqSize = 0 ;
do { error = Uniti (port[i], &BufferResp);
} while (error == NO_MESSAGE);
...
/* closing of 16 ports */
for (i = 0 ; i < 15 ; i++)
{ if ( (error = Free_Port (port[i])) != 0)
{ printf ("\n error %d freeing port[%d]", error, i); }
}
...
}
40 en-938928/2
PC Module
en-938928/2 41
Requests Request code Additional request code
Write-Block 0xF5 0x51
Reserve-Memory 0xF5 0x52
42 en-938928/2
PC Module
Description
The Read-Block request is used to read a part programme block.
Transmission
Request code / Additional request code / Programme number / Block number / Block offset
Request code 1 byte: 0xF5
Additional request code 1 byte: 0x50
Programme number 1 long word: indexed programme number (programme number x 10 + axis group
number)
Block number 1 word: block number pointed to
Block offset 1 word: rank of block to be read after the previously selected block (0 to read this
block)
en-938928/2 43
Reception
Positive Answer
Negative answer
Answer code / Additional answer code
Answer code 1 byte: 0xF5
Additional answer code 1 byte: 0x80
Description
The Write-Block request is used to add, modify or delete a part programme block.
REMARK Unlike the other requests, the Write-Block request can contain up to 132 bytes
Transmission
Request code / Additional request code / Programme number / Block number / Block Offset /
Block length / Data
Request code 1 byte: 0xF5
Additional request code 1 byte: 0x51
Programme number 1 long word: indexed programme number (program number x 10 +
axis group number)
Block number 1 word: block number pointed to
Block offset 1 word: rank of unnumbered block pointed to after the previously
selected block (0 to stay on this block)
Block length 1 word: number of data bytes (120 maximum)
Data Character string (ASCII codes) forming the block to be sent
(the block must end with LF : ASCII code 0x0A)
- "-LF" to delete the block selected
- "+[block]LF" to insert the block after the block selected
- "#[block]LF" to substitute the block for the block selected
REMARK The block writing method is similar to the block modification method (see
Operator Manual).
44 en-938928/2
PC Module
Reception
Answer code / Additional answer code
Answer code 1 byte: 0xF5
Additional answer code 1 byte: 0x81
The answer code and the additional answer code are not significant: it is the code returned by the Uniti() function that
gives the request execution report.
Description
The Reserve-Memory request is used to reserve memory space for making modifications to an existing programme
without being in reset status.
Transmission
Request code / Additional request code / Programme number / Memory size
Request code 1 byte: 0xF5
Additional request code 1 byte: 0x52
Programme number 1 long word: indexed programme number (programme number x 10 + axis group
number)
Memory size 1 long word: size in bytes to be reserved for the program (0 to keep the program
at its present size)
Reception
Answer code / Additional answer code
Answer code 1 byte: 0xF5
Additional answer code 1 byte: 0x82
The answer code and additional answer code are not significant: it is the code returned by the Uniti() function that gives
the request execution report.
en-938928/2 45
10.4 Functional Description of the PCNC Server
The CNC can send requests to the PC module. In this case, the PC module is the server.
Whenever a request is sent to the PC, it is received by the driver, which wakes up the server task. This task recovers
the data, decodes the request, performs the necessary processing and acknowledges the request by updating the
control data.
Request Format
Request code/Category/File identifier/Extension code/Filename
Request code: 1 byte: 0x3A
Category: 1 byte
File identifier: 2 long words (long word 1 at the low address, long word 2 at the high address)
long word 1: file identifier
long word 2: not significant
REMARK The high byte of this long word gives the file type; type 9 corresponds to the
PCNC; the next three bytes are not significant.
Extension code: 1 byte: 0x01
Optional field (see next field)
Filename: table of bytes (ASCII character string beginning with a length byte)
Optional field present only if the Extension code is present and equal to 0x01
Syntax: "C:\filename" or "C:\path\filename"
REMARK The Filename field gives the filename and possibly also the pathname of the
files to be downloaded. It must always be specified in the case of the PCNC.
Answer Format
Answer code/Status
Positive Answer
Answer code: 1 byte: 0x6A
Status: 1 byte: 0x00
46 en-938928/2
PC Module
Negative Answer
Answer code: 1 byte: 0x6A
Status: 1 byte: 0x01: file already exists
0x02: other download in progress
0x03: memory full
0x08: error in filename/header
0x1C: system error
Description
This request is used to write data in a file that is already open.
Request Format
Request code/Category/Segment number/Segment length/Data
Request code: 1 byte: 0x3B
Category: 1 byte
Segment number: word
Segment length: word
Data: table of bytes
Answer Format
Answer code/Status/Segment number
Positive Answer
Answer code: 1 byte: 0x6B
Status: 1 byte: 0x00
Segment number: word
Negative Answer
Answer code: 1 byte: 0x6B
Status: 1 byte: 0x03: Memory full
0x04: no file open
0x08: download already in progress
0x09: data length inconsistent with request received
0x0B: a block has more than 120 characters
0x0D: incoherent data
en-938928/2 47
0x19: sequence error
0x1C: system error
Segment number: word
Definition
This request is used to close download of a file already open.
Request Format
Request code/Category
Request code: 1 byte: 0x3C
Category: 1 byte
Answer Format
Answer code/Status
Positive Answer
Answer code: 1 byte: 0x6C
Status: 1 byte: 0x00
Negative Answer
Answer code: 1 byte: 0x6C
Status: 1 byte: 0x04: file already closed
0x08: other download in progress
0x0B: the last block loaded does not end with "LF": file deleted
0x1C: system error
Definition
This request is used to start upload of a file from the PCNC.
Request Format
Request code/Category/File identifier/Extension code/Filename
Request code: 1 byte: 0x3D
Category: 1 byte
File identifier: 2 long words (long word 1 at the low address, long word 2 at the high address)
long word 1: file identifier
long word 2: not significant
48 en-938928/2
PC Module
REMARK The high byte of long word 1 specifies the file type. Type 9 corresponds to the
PCNC.
Byte 2 gives the subtype:
- value 0: file directory on the disk according to the pathname given in
Filename, syntax: "C:\*.*" or "C:\pathname\*.extension"
The data Read format is 8.3 (operates only on 8.3 format files in HPFS
mode) : a filename is encoded on 3 long words
- value 1: file stored on the disk.
The next two bytes are not significant.
Extension code: 1 byte: 0x01
Optional field (see next field)
Filename: table of bytes (ASCII character string beginning with a length byte)
Optional field present only if the Extension code is present and equal to 0x01
Answer Format
Answer code/Status
Positive Answer
Answer code: 1 byte: 0x6D
Status: 1 byte: 0x00
Negative Answer
Answer code: 1 byte: 0x6D
Status: 1 byte: 0x02: other download in progress
0x05: no such file
0x08: error in filename/header
0x1C: system error
10.4.5 READ-UPLOAD-SEGMENT
Definition
This request is used to upload data from a file that is already open.
Request Format
Request code/Category/Segment number
Request code: 1 byte: 0x3E
Category: 1 byte
Segment number: word
Answer Format
Answer code/Status/Segment number/Segment length/Data
en-938928/2 49
Positive Answer
Answer code: 1 byte: 0x6E
Status: 1 byte: 0x00: OK, more data to be transmitted
0x0F: OK, end of file (automatic close)
Segment number: word
Segment length: word
Data: table of bytes
Negative Answer
Answer code: 1 byte: 0x6E
Status: 1 byte: 0x04: no download in progress
0x08: other download in progress
0x09: buffer too small for the answer
0x19: sequence error
0x1C: system error
Segment number: word
Segment length: word
Data: table of bytes
10.4.6 CLOSE-UPLOAD-SEQUENCE
Definition
This request is used to close the upload of a file already open.
Request Format
Request code/Category
Request code: 1 byte: 0x3F
Category: 1 byte
Answer Format
Answer code/Status
Positive Answer
Answer code: 1 byte: 0x6F
Status: 1 byte: 0x00
50 en-938928/2
PC Module
Negative Answer
Answer code: 1 byte: 0x6F
Status: 1 byte: 0x04: file already closed
0x08: other download in progress
0x1C: system error
Request Format
Request code/Category/Additional request code/Reserved
Request code: 1 byte: 0xF5
Category: 1 byte
Additional request code: 1 byte: 0x62
Reserved: 1 byte: 0x00
Answer Format
Answer code/Additional answer or request code/Status
Positive Answer
Answer code: 1 byte: 0xF5
Additional answer code: 1 byte: 0x92
Status: 1 byte: 0x00
Negative Answer
Answer code: 1 byte: 0xF5
Additional request code: 1 byte: 0x92
Status: 1 byte: 0x04: application already minimised
0x1C: system error
Request Format
Request code/Category/Additional request code/Reserved
en-938928/2 51
Request code: 1 byte: 0xF5
Category: 1 byte
Additional request code: 1 byte: 0x63
Reserved: 1 byte: 0x00
Answer Format
Answer code/Additional answer or request code/Status
Positive Answer
Answer code: 1 byte: 0xF5
Additional answer code: 1 byte: 0x93
Status: 1 byte: 0x00
Negative Answer
Answer code: 1 byte: 0xF5
Additional request code: 1 byte: 0x93
Status: 1 byte: 0x04: application already restored to full screen
0x1C: system error
Definition
This request is used to inhibit access to the OS/2 desktop (the PCNC is locked on the application in the foreground).
Calling this request toggles the system status from locked to unlocked or vice versa.
Format Request
Request code/Category/Additional request code/Reserved
Request code: 1 byte: 0xF5
Category: 1 byte
Additional request code: 1 byte: 0x64
Reserved: 1 byte: 0x00
Answer Format
Answer code/Additional answer or request code/Status
Positive Answer
Answer code: 1 byte: 0xF5
Additional answer code: 1 byte: 0x94
Status: 1 byte: 0x00: OK, locked
0x01: OK, unlocked
52 en-938928/2
PC Module
Negative Answer
Answer code: 1 byte: 0xF5
Additional request code: 1 byte: 0x94
Status: 1 byte: 0x1C: system error
A second request of this type returns the system to its initial state.
REMARK Only operates for a full screen OS/2 application, but not for a DOS or Win/OS2
application.
10.4.10 SHUTDOWN Request
Request Format
Request code/Category/Additional request code/Reserved
Request code: 1 byte: 0xF5
Category: 1 byte
Additional request code: 1 byte: 0x66
Reserved: 1 byte: 0x00
Answer Format
Answer code/Additional answer or request code/Status
Positive Answer
Answer code: 1 byte: 0xF5
Additional answer code: 1 byte: 0x96
Status: 1 byte: 0x00
Negative Answer
Answer code: 1 byte: 0xF5
Additional request code: 1 byte: 0x96
Status: 1 byte: 0x1C
Reception of this request runs an executable that shuts down the PCNC and reports shutdown to the other processors.
REMARK Any changes made at OS/2 level (icon moved, session parameters changed)
are lost with this type of shutdown. To save them, the system must be shut
down using the conventional OS/2 shutdown procedure (accessible on the OS/
2 desktop context-sensitive menu).
en-938928/2 53
10.4.11 START-APPLI Request
Definition
This request is used to run an application (executable) present on the hard disk, and associated with the START-APPLI
file. This object must first be created by running the creatprg.cmd file from C:\num.
Request Format
Request code/Category/Additional request code/Reserved
Request code: 1 byte: 0xF5
Category: 1 byte
Additional request code: 1 byte: 0x65
Reserved: 1 byte: 0x00
Answer Format
Answer code/Additional answer or request code/Status
Positive Answer
Answer code: 1 byte: 0xF5
Additional answer code: 1 byte: 0x95
Status: 1 byte: 0x00
Negative Answer
Answer code: 1 byte: 0xF5
Additional request code: 1 byte: 0x95
Status: 1 byte: 0x05: no such application
0x1C: system error
Request Format
Request code/Category/Additional request code/File identifier/Extension code/Filename
Request code: 1 byte: 0xF5
Category: 1 byte
Additional request code: 1 byte: 0x46
File identifier: long word
Extension code: 1 byte: 0x01: Optional field (see next field)
54 en-938928/2
PC Module
Filename: table of bytes (ASCII character string beginning with a length byte)
Optional field present only if Extension code is present and equal to 0x01
Syntax: "C:\filename" or "C:\path\filename"
Answer Format
Answer code/Additional answer or request code/Status
Positive Answer
Answer code: 1 byte: 0xF5
Additional answer code: 1 byte: 0x76
Status: 1 byte: 0x00
Negative Answer
Answer code: 1 byte: 0xF5
Additional request code: 1 byte: 0x76
Status: 1 byte: 0x05: no such file
0x06: file protected
0x1C: system error
Example
Request: 245/0/70/9/01/H'08-43-3A-5C-41-4C-50-48-41
Answer: 245/118/06
245 = DELETE-FILE Request
0 = Category
70 = Additional request code
9 = File identifier
01 = Optional field
H'08 = Filename length (80 bytes)
H'43-3A-5C .... = C:\alpha (filename)
118 = Additional answer code
06 = Protected file
10.4.13 READ-MEMORY-FREE
Definition
This request returns the number of bytes available in the following memory areas:
- User programmes: areas 0, 1, 2 and 3,
- PLC programme (Ladder and C),
- MMI memory area,
- PC module hard disk
en-938928/2 55
Request Format
Request code/Category/Additional request code/Area
Request code: 1 byte: 0xF5
Category: 1 byte
Additional request code: 1 byte: 0x47
Area: 1 byte: 0 to 3: User programmes
7: PLC programme (Ladder or C)
8: MMI memory area
9: PC Module hard disk
Answer Format
Answer code/Additional answer or request code/Status/Value
Positive Answer
Answer code: 1 byte: 0xF5
Additional answer code: 1 byte: 0x77
Status: 1 byte: 0x00
Value: long word
Negative Answer
Answer code: 1 byte: 0xF5
Additional request code: 1 byte: 0x77
Status: 1 byte: 0x1C: system error
56 en-938928/2
PC Module
Request Format
Request code/Category/Object-address/Data-length/Data-specific
Request code: 1 byte: 0xFc
Category: 1 byte: 0x06
Object-address: 1 byte: (code giving the origin of the unsolicited data; optional except on a
network)
Index of the axis group
Data-length: 1 byte: number of bytes contained in the Data-specific field
Data-specific: table of bytes
Message contained in the part programme after $9
The message sent by the CNC is accessible via a port. Eight ports are available. Each port is assigned to an axis group:
- $90 for group 1,
- $91 for group 2,
- •••••
- $97 for group 8
$98 : unsolicited PLC data.
Answer Format
There is no answer to this request. It can, however, in the case of the CNC, be associated with another UNI-TE request
sent by the recipient of the unsolicited data. This request then acknowledges the unsolicited data. The method
described below can be used to cause a wait for this acknowledgement.
REMARK There is no possible acknowledgement in the case of unsolicited data sent by
the PLC.
Message Acknowledgement
After sending a blocking type message ($91), the CNC goes on wait for a report from the application. The report must
be sent by the application processing the unsolicited data to stop cyclic retransmission of the data (approximately once
every 10 seconds). This acknowledgement is generated by sending the UNITEWRITE-OBJECT request with segment
226 (and an object-address corresponding to the correct axis group). Writing of this segment can achieve two different
actions:
- Writing of the value 1 means that the message was received by the remote application. The CNC stops cyclic
retransmission of the message but part programme execution remains suspended,
- Writing of the value 2 cause execution of the part programme to be resumed.
en-938928/2 57
The use of the "Unsolicited data" request requires initialising the resources and allocating the port(s) corresponding
to the axis group(s) sending them. This is done by calling:
- USHORT Open_Buf_Uns_Data(void) which allows the application to obtain access to the unsolicited data. It must
be called at the beginning of the user application.
Return code: 0: OK
other: invalid system access.
- USHORT Get_Port_S(UCHAR*port,UCHART*typ_port) allows the allocation of ports:
typ_port: 0: requester mode; a port (from $70 to $7F) is returned,
1: Server mode; access to unsolicited data: it is then necessary to send a port number (from $90
to $98) in *port to specify where the unsolicited data are to be received.
Utilities
Two Windows utilities are available:
- EDIT-PP (see above) for managing files
- NUM Backup for backing up machine data and programmes accessible by item 6, Backup, of the CNC Utilities
menu.
These utilities each use one of the 16 UNITE ports to dialogue with the system and one dedicated pipeline (UNI-OS2).
On-line help is provided for using these utilities.
58 en-938928/2