OSP-P200/P200A/P300/P300A Osp Api Kit INSTRUCTION MANUAL (2nd Edition)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

OSP-P200/P200A/P300/P300A

OSP API KIT


INSTRUCTION MANUAL (2nd Edition)
Pub No. SE51-045-R2 Oct. 2022
Contents

1. Overview ......................................................................................................................................1
2. OSP-API ......................................................................................................................................1
2-1. System Configuration ............................................................................................................1
2-1-1. Operating Environment ....................................................................................................1
2-1-2. Reference Documents .....................................................................................................1
2-2. Client Computer Settings ......................................................................................................2
2-2-1. COM Registration ............................................................................................................2
2-2-2. Canceling COM Registration ...........................................................................................2
2-3. OSP-P Settings .....................................................................................................................3
2-3-1. Setting the Computer Name ............................................................................................3
2-3-2. Network Address Settings................................................................................................5
2-3-3. Adding a User Account ....................................................................................................7
2-3-4. Shared Folder Settings ....................................................................................................9
2-3-5. COM Security Settings .................................................................................................. 11
2-3-6. Windows Firewall Settings .............................................................................................17
2-4. Checking Settings ...............................................................................................................18
3. THiNC-API .................................................................................................................................19

♦ Unauthorized copying from this manual is prohibited.


♦ Changes may be made to the specifications and so forth without prior notice as a result of
NC or machine improvements.
♦ When creating applications using this function, ensure to conduct sufficient testing to
confirm safety prior to use.
♦ This document will be the resources for software developers. Descriptive content is the
setting example, depending on the settings, there is a possibility that the Windows or
application may not work correctly. Please check the effects of settings.

Microsoft, Windows, Visual Studio, Visual Basic and Visual C++ are registered trademarks of
Microsoft Corporation in the U.S. and other countries.
1. Overview
With OSP API KIT, users can develop applications linked with OSP using OSP-API and THiNC-API.
Chapter 2 and subsequent chapters describe OSP-API and THiNC-API.

2. OSP-API
OSP-API (Application Programing Interface) is an API that runs on a client computer, and is for
running a Windows application for accessing OSP data via the network.
This document describes the setup procedure at Windows 10.
The screen details may differ if using another version of Windows. If this is the case, specify
settings as they appear on the screen for the applicable Windows OS.

2-1. System Configuration


OSP-API uses COM (Component Object Model) technology, and can be used to create
applications using a wide range of development environments (programming languages such as
Visual C++ and Visual Basic) that support COM.

Client computer OSP-P Series

Client RxOSPAPI NC software


application component

Work program MD1


File sharing

Client application: Application created by user


RxOSPAPI component: COM component used to access NC data
File sharing: The transfer of work program files from the client computer
to OSP is performed using Windows file sharing.

2-1-1. Operating Environment


The setting procedures, and components and sample operation described in this manual have
been verified on Windows XP, Windows 7, and Windows 10 operating systems.

2-1-2. Reference Documents


Refer to the OSP-P Operation Manual or SPECIAL FUNCTIONS MANUAL for details on data
obtained and set with this interface for application development.

- 1 -
2-2. Client Computer Settings
Administrator privileges (Administrator, etc.) are required to log on to the client computer.
The following command must be executed with administrator privileges. (*)

* Executing the command with administrator privileges when using Windows 10


The administrator should run Command Prompt (select Start - [Windows System], right-click
[Command Prompt], and select "Run as an administrator" from the menu), enter the command,
and then execute.
(The path name should be the same as the folder in which "RXOSPAPI.EXE" is located.)

2-2-1. COM Registration


To use the API from the client computer, it is necessary to register it using the following
procedure.
Copy "RXOSPAPI.EXE" to an arbitrary folder.
Execute the registration command using the following procedure.
Run [Command Prompt] from the Start menu, move to the folder to which the file was copied,
and then execute the following command at Command Prompt.

RXOSPAPI /RegServer

2-2-2. Canceling COM Registration


If COM is no longer required, use the same procedure as described above, and then execute
the following command.

RXOSPAPI /UnregServer

- 2 -
2-3. OSP-P Settings

[Note] Specify the computer name and network address settings before connecting the
machine to the network.
Set these parameters after first checking with the system administrator.
[Note] The setting examples given in this manual are specified in consideration of ease of
connection, and do not necessarily offer complete security. If necessary, specify
settings which take security into consideration after checking with the system
administrator.

2-3-1. Setting the Computer Name


Select Start * - (1) [Control Panel] - (2) [System and Security] - (3) [System]. (*: Press the
[CTRL] and [Cancel] keys simultaneously to display.)

(2)

(1)

(3)

- 3 -
(4) Click “Change settings”.

(4)

Select the “Computer Name” tab at the “System Properties” screen.

(5) Press the [Change...] button.


(6) Enter a new computer name in “Computer name:”.

(6)

(5)

(7)

(7) Click the [OK] button to return to the “System Properties” screen, and then press [OK] again to
close the screen.

Restart Windows.

* OSP can be added to the domain (Active Directory).


Set the group to which OSP belongs, and then enter the domain name.
However, if adding OSP to the domain, it is necessary to set OSP auto logon again.
Refer to “SECTION 7 AUTO LOGON SETTING” in the Reference Manual.

- 4 -
2-3-2. Network Address Settings
Select Start * - (1) [Control Panel] - (2) [Network and Internet] - (3) [Network and Sharing
Center]. (*: Press the [CTRL] and [Cancel] keys simultaneously to display.)

(1)
(2)

(3)

(4) Click “Change adapter settings”.

(4)

(5) Double-click “Ethernet”.

(5)

- 5 -
(6) Click “Internet Protocol Version 4 (TCP/IPv4)”, and click the (7) [Properties] button.

(6)

(7)

(8) Select the “Use the following IP address:” option button, and set the (9) “IP address:” and
“Subnet mask:”, etc.

(8)
(9)

(10) Click the [OK] button. (10)

* If a DHCP server such as a Windows server or Internet router exists on the network, and
if able to automatically obtain the IP address from the server, select the "Obtain an IP
address automatically" option button.

- 6 -
2-3-3. Adding a User Account
Add a user account with the same user name and password as that used at the client computer
to OSP. This is necessary to access the communication interface when accessing the work
program folders on OSP from a client computer.
Select Start * - (1) [Control Panel] - (2) [System and Security] - (3) [Administrative Tools].
(*: Press the [CTRL] and [Cancel] keys simultaneously to display.)

(2)

(1)

(3)

(4) Double-click “Computer Management”.

(4)

- 7 -
(5) Select “Local Users and Groups” - “Users”.
(6) Select “New User...” from the “Action” menu.

(6)

(5)

(7) Enter the “User name:”.


(8) Enter the “Password:”, and then enter it again in “Confirm password:”.
(9) Select the “Password never expires” check box.
(10) Click the [Create] button.
(After creating the new user, all settings will be cleared.)

(7)

(9) (8)

(10)

(11)
(11) Click the [Close] button.

- 8 -
2-3-4. Shared Folder Settings
Share the folder for work program files on OSP to enable operation from the client computer.
The “D:¥MD1” folder is assigned to the folder for work program files on OSP. The settings
required to share this folder with shared name "MD1" are as follows.

Select Start * - (1) [Explorer]. (*: Press the [CTRL] and [Cancel] keys simultaneously to display.)

(1)

(2) Select “D:¥MD1”.


(3) Select “Properties” from the “Home” menu.

(3)

(2)

(4) Click the “Sharing” tab.


(5) Click the [Advanced Sharing...] button.

(4)

(5)

- 9 -
(6) Select the “Share this folder” check box.
(7) If necessary, enter the “Share name:”. (The default is the same as the folder name.)
(8) Press the [Permissions] button.
(6)

(7)

(8)

(9) Select from “Group or user names:” (“Everyone” in this example).


(10) Select the relevant access permissions. (“Full Control” has been selected in this example.)

(9)

(10)

(11)

(11) Click the [OK] button.

[Note] In the above example, full control has been granted to everyone. Please note that in
order to enhance security, it is recommended that permissions should only be granted
to those specific users or groups added in "2.3.3 Adding a User Account".

- 10 -
2-3-5. COM Security Settings
Refer to the DCOMCNFG Help function for details on operation and settings for this tool.
Display the Start * menu, enter (1) "DCOMCNFG", and click the (2) “DCOMCNFG” item that
appears to run the DCOM configuration tool.

(2)

(1)

I. Overall computer security settings

(1) Select “Component Services” - “Computers” - “My Computer”.


(2) Select “Properties” from the “Action” menu.

(2)

(1)

(3) Select the “Default Properties” tab.


(4) Ensure that the “Enable Distributed COM on this computer” check box is selected.

(3)

(4)

- 11 -
(5) Select the “COM Security” tab.

(5)

(6)

(9)

(6) Click the [Edit Limits...] button under "Access Permissions".


(7) Select "Everyone", and ensure that the "Allow" check boxes are selected for both (8) "Local
Access" and "Remote Access".

(7)

(8)

(9) Click the [Edit Limits...] button under "Launch and Activation Permissions".
(10) Select "Everyone", select the "Allow" check boxes for (11) "Local Launch", "Remote Launch",
"Local Activation", and "Remote Activation".

(10)

(11)

[Note] In (7) and (10) above, the “Allow” check boxes for "Local Access", “Local
Launch”, and “Local Activation” selected for “Everyone” must not be cleared.
(Windows will no longer start up normally if cleared.)
If necessary to enhance security, specify the settings indicated in “II. Individual
security settings”.

- 12 -
II. Individual security settings

(1) Select “DCOM Config”.


(2) Select “RxOspApi”.
(3) Select “Properties” from the “Action” menu.

(3)

(1) (2)

(4) Select the “Security” tab.


(5) Select the “Launch and Activation Permissions” - “Customize” option button, and click the (6)
[Edit...] button.

(4) (6)

(5)

(7) Click the [Add...] button.

(7)

- 13 -
(8) Click the [Advanced...] button.

(8)

(9) Click the [Find Now] button.


(10) Select a user (or group) from the search results at the bottom. (In the example, "Everyone" is
selected.)
(11) Click the [OK] button.

(9)

(11)
(10)

(12) Ensure that the selected user (or group) has been entered for "Enter the object names to
select", and then click the [OK] button.

(12)

(13) Select the added user.

- 14 -
(14) Select the "Allow" check boxes for "Local Launch", "Remote Launch", "Local Activation", and
"Remote Activation" in the permissions area below, and then click the [OK] button.

(13)

(14)

[Note] In order to enhance security, it is recommended that permission should only


be granted for specific users (or groups) instead of "Everyone" at [Edit
Limits...] above.

- 15 -
□ Settings at other tabs
The default settings for other tabs are as follows.

- 16 -
2-3-6. Windows Firewall Settings
The Windows firewall should generally be set to the default "Off" setting. (OSP default status)

□ Checking the firewall status


(1) Select [Control Panel] - [System and Security] - [Windows Firewall].
(2) Select “Turn Windows Firewall on or off”.
(3) Ensure that the “Turn off Windows Firewall” check box is selected.
The default status is off for both “Home or work (private) networks” and “Public
networks”.
If the settings are changed, the location of connected networks will change.

□ Exception settings when firewall on


If turning on the firewall, add the following items as exceptions.
“Add Port...”: Port No. 135/TCP (DCOM)
“Add Program...”: C:¥OSP-P¥VOLANTE¥CRAD¥RXOSPAPI.EXE

(1) Click “Advanced settings” at “Windows Firewall”.


A “Windows Firewall with Advanced Security” window appears.
(2) Click “Inbound Rules”.
(3) Click “New Rule...” at the “Actions” window.
A “New Inbound Rule Wizard” appears.
(4) Select “Port” under “What type of rule would you like to create?”, and click [Next].
(5) Select “TCP” and “Specific local ports:”, enter “135” for “Specific local ports:”, and click
[Next].
(6) Select “Allow the connection” at the “Action” page, and click [Next].
(7) Select the profile for which the rule applies at the “Profile” page, and click [Next].
(Select an appropriate profile based on the location of the connected network.)
(8) Enter an appropriate name (“DCOM”, etc.) in the “Name:” box at the “Name” page, and
click [Finish].

- 17 -
2-4. Checking Settings
To check the settings specified at previous sections, run a script file (MacId.VBS) used to obtain
the machine name at the client computer.
Run [Command Prompt] and jump to a folder containing a sample.
Execute a command in the following format.
> cscript MacId.vbs [/M] Remote

If the connection destination is machining, specify "/M".


Enter the connection destination OSP computer name or IP address for the “Remote” section.
If the machine type and machine ID appear as follows, settings up to this point are correct.

The causes of any errors are as follows.


Error Cause
Microsoft VBScript runtime error: ActiveX
The communication interface has not been
component can't create object:
installed.
‘RXOSPAPI.DATAL’
Microsoft VBScript runtime error: Permission
The security settings are incorrect.
denied: ‘CreateObject’
Microsoft VBScript runtime error: The remote The computer name or IP address settings are
server machine does not exist or is unavailable: incorrect.
‘CreateObject’ The cable is not connected.

- 18 -
3. THiNC-API
THINC-API is an API for creating Windows applications that access OSP data running on OSP.
Leveraging the Microsoft .NET Framework, it is possible to create applications using a variety of
programming languages such as VB.NET, C #, MC ++, or compatible .NET languages. There is a
sample program and help in "program files¥okuma¥THINC API" on the THINC-API DVD. Please
refer to these for details.

- 19 -

You might also like