Remote API Interface
Remote API Interface
Remote API Interface
ca
as
bL
bL
as
ca
automation
cab FL+
Remote API Interface
Art.-Nr.: 9009856
2 2
3 Inhaltsverzeichnis 3
1 Preface..................................................................................................................................................... 5
2 Introduction............................................................................................................................................. 7
2.1 Notes......................................................................................................................................................... 7
2.2 Intended Use............................................................................................................................................. 7
3 Introduction............................................................................................................................................. 8
3.1 General Functional Description................................................................................................................. 8
3.2 Using the Remote API Interface................................................................................................................ 8
3.3 API Communication Diagram.................................................................................................................... 9
3.4 Connecting to the device using TCP/IP.................................................................................................. 10
3.5 Notes on cab PLC Demo Programs.........................................................................................................11
3.5.1 Hard- and Software..................................................................................................................................11
3.5.2 Information on Sample Programs............................................................................................................11
3.5.3 Establishing the Network Connection..................................................................................................... 13
4 Sample Programs.................................................................................................................................. 14
4.1 Sample 1................................................................................................................................................. 14
4.1.1 Description.............................................................................................................................................. 14
4.1.2 Layout..................................................................................................................................................... 14
4.1.3 PLC Sample Program............................................................................................................................. 14
4.1.4 Flowchart................................................................................................................................................. 15
4.2 Sample 2................................................................................................................................................. 16
4.2.1 Description.............................................................................................................................................. 16
4.2.2 Layout..................................................................................................................................................... 16
4.2.3 PLC Sample Program............................................................................................................................. 16
4.2.4 Flowchart................................................................................................................................................. 17
4.3 Sample 3................................................................................................................................................. 18
4.3.1 Description.............................................................................................................................................. 18
4.3.2 Layout..................................................................................................................................................... 18
4.3.3 PLC Sample Program............................................................................................................................. 18
4.3.4 Flowchart................................................................................................................................................. 19
4.4 Sample Program 4.................................................................................................................................. 20
4.4.1 Description.............................................................................................................................................. 20
4.4.2 Layout..................................................................................................................................................... 20
4.4.3 PLC Sample Program............................................................................................................................. 20
4.4.4 Flowchart................................................................................................................................................. 21
13 Service................................................................................................................................................... 65
13.1 Reference Documents............................................................................................................................ 65
13.2 Revision History of Sample Programs.................................................................................................... 65
13.3 Contact.................................................................................................................................................... 65
5 1 Preface 5
Edition: 2019/02
Contents of Delivery
Contents of delivery is specified in the shipping documents of the consignment..
The delivery has to be checked for completeness and flawless condition. For inconsistencies, the supplier has to be
informed immediately.
General
This manual contains neither instructions about basic operation of a computer, i.e. programmable control, nor about
basic functions of operating systems Windows® or Mac OS®.
For more detailled information how to operate your computer, please refer to the manuals of the computer and its
operating system.
Manufacturer
cab Produkttechnik GmbH & Co KG
Wilhelm-Schickard-Str. 14
D-76131 Karlsruhe
Phone: +49 (0)721/66 26 0
Fax: +49 (0)721/6626 249
http://www.cab.de
e-mail: [email protected]
6 1 Preface 6
Copyright
This documentation as well as translation hereof are property of cab Produkttechnik GmbH & Co. KG.
The replication, conversion, duplication or divulgement of the whole manual or parts of it for other intentions than
its original intended purpose - in particular the procurement of spare parts for products sold by cab - demand the
previous written authorization by cab.
Each possible software that represents part of this system is made available under license and may become use or
copies only in agreement with the license conditions.
Trademark
Microsoft® is a registered trademark of the Microsoft Corporation.
Windows XP® , Windows Vista®, Windows 7®, Windows 8® und Windows 10® are registered trademarks of the
Microsoft Corporation.
TrueTypeTM is a registered trademark of Apple Computer, Inc.
All other itemized company names and product names and its trademark are protected property of the respective
proprietors.
Editor
For any question or comments please contact cab Produkttechnik GmbH & Co. KG, Germany.
Autor
Dipl.-Ing. (FH) Mario Hiss, Mehmet Seker
Topicality
Due to further development of our products, discrepancies between documentation and product may occur. Please
refer to www.cab.de for the current issue.
2.1 Notes
Important information and instructions are designated as follows:
Danger!
Draws attention to an exceptionally great, imminent danger to your health or life due to hazardous
voltages.
Danger!
! Draws attention to a danger with high risk which, if not avoided, may result in death or serious injury.
Warning!
! Draws attention to a danger with medium risk which, if not avoided, may result in death or serious injury.
Caution!
! Draws attention to a danger with low risk which, if not avoided, may result in minor or moderate injury.
! Attention!
Draws attention to potential risks of property damage or loss of quality.
i Note!
Advices to make work routine easier or on important steps to be carried out.
Environment!
Handling instructions
i
Note!
If not already available, all example programs and files related to this Programmer's Guide may be
downloaded here.
i
Note!
The Remote API interface is available either as TCP/IP socket connection or serial interface RS-232.
i
Note!
Sending new commands without waiting for a response from the Host will result in communication
problems and might lead to undefined behavior.
i
Note!
All commands must end with „Carriage Return“ and „Line Feed“ (0X0D & 0X0A, <CR>&<LF> oder ASCII
13 & 10). All responses must end with „Carriage Return“ and „Line Feed“ (0X0D & 0X0A, <CR>&<LF> oder
ASCII 13 & 10).
i
Note!
For all commands, character data must be sent using either 7-Bit Encoding ASCII 0-127 or 8-Bit Encoding
ASCII0-255.
9 3 Introduction 9
Get and set commands enable to check and set status and properties of the host. To be able to change porperties, the
client needs to be connected to the host via TakeHostControl.
i
Note!
To gain access to the Host use the command TakeHostControl.
i
Note!
To finish access to the Host use the command ReleaseHostControl.
10 3 Introduction 10
TCP/IP is a networking protocol and has the abililty to communicate over local area networks (LAN – Local Area Network)
or wide area networks/Internet (WAN – Wide Area Network). In order for programs and computer to communicate with
the laser control and the remote server, the remote server needs to make itself available on a specified Port, and the IP
address of the remote server has to be known.
It is this IP address and Port that ensures any message sent reaches the proper destination.
The laser control makes the Remote API Interface service available on Port 12500. The laser control can be configured
to use a Static IP address, or to request an IP address each time it starts from a DHCP server. It is recommended in
situations where the Remote API is used, to configure Static IP addressing for the laser control. Using this approach, the
connection settings between Client and Host are statically set and may be used to connect again without any problem,
in case of having f. ex. the devices switched off.
Any client computer that supports TCP/IP networking can establish remote control of the laser control. Only one computer
or system can simultaneously control the laser. Clients may be installed in all networks running MS Windows or Linux.
i
Note!
When the device is delivered, configured IP address is 192.168.1.11.
i
Note!
The laser control LEC is using Port 12500 for sending and receiving the commands.
i
Note!
Using the Remote API it is recommended to configure a static IP address for the laser control.
i
Note!
Only one computer or system can simultaneously control the laser.
i
Note!
IP address settings or any other settings for communication will not become active until the next restart.
11 3 Introduction 11
Manufacturer: Siemens
Hardware: CPU 1511-1PN
Programming software: Tia Portal V13 SPS1 Update 6
The project is saved unter the file name „FL+ Remote API Library_YYYYMMDD“. The indexing YYYYMMDD informs
about the revision date and checks on the currentness.
As the project includes four sample programs in all and these shall be made ready to be selected, the entry condition
"Start Sample" in the networks 4 is made available and must be activated to gain access to the laser.
i
Note!
Only one computer or system can simultaneously control the laser. Using Siemens CPUs of other series,
the program can be converted via the TIA portal.
i
Note!
When activating the entry condition "Start Sample" in the sample program, the laser software cabLase
simultaneously has no access to the laser.
The operating block Main OB1 defines the basic program flow. Using Startup OB100 specifies the behavior of the PLC
program when switching the CPU on/off.
The sample programs 1 to 4 dealt with in this programmer's guide can be found in the following function blocks:
Sample1[FC1]
Sample2[FC2]
Sample3[FC3]
Sample4[FC4]
In addition to the actual Remote API command structure, the sample programs provide details on switching on and
controlling the laser based on the digital interfaces of the laser CON2, CON3 and CON4.
Network 1 in the sample is about switching on the laser. The laser can be switched on, as soon as safety circuit CON4
is closed, the "Power" signal at interface CON3 is present and no error messages are issued at the digital interfaces
CON2 and CON3.
Network 5 in the sample program is about analyzing the laser safety circuit at interface CON4. Opening the laser shutter
and, consequently, emission of laser radiation is only possible, if the laser circuits are closed.
Each of the sample programs have the entry condition „Start Sample“ in Network 4 that needs to be activated to gain
access to the laser and to enable the sample program to be applied. Cancelling this entry condition enables to establish
a connection to the laser with the software cabLase instead of the PLC.
Response_Codes [FC5] Responsible for the evaluation of the API Response Codes received from the laser.
Communication block TCON for establishing a connection between PLC and laser is specified in function block FB1.
There is also defined how data are sent / received to / from the laser.
Data block DB[2] includes a list of function blocks of all Remote API commands dealt with in this programmer's guide.
These may be copied for any kind of interlinking for a customer-oriented programming.
The data received from the PLC are stored in the data block DB[3] into „Receive_Data“ geschrieben. Should received
data of the data block DB[3] be cancelld, the flag 5.4 „Reset_Receive_Data“ has temperorarily to be set to „high“.
In DB[3] under field 8 „Response Code String“ includes a field prepared for issuing potential error messages as description.
The issued description may f. ex. be used for the visualization in an user interface.
Conversion of the numerical API Response messages is made in DB[4]. This library is used to have clear text messages
assigned to the numerical codesI that may be adapted, for ex. when choosing a foreign language.
Block PLCVariablen/CON2 includes a register that has assigned the digital in- and outputs of the interface CON2 to
the wiring diagram.
Block PLCVariablen/CON3 includes a register that has assigned the digital in- and outputs of the interface CON3 to
the wiring diagram.
i
Note!
Sample program 3 has not realized synchronization and control of the laser processing via wiring of interface
CON2, but via Remote API. Hardware wiring is not necessary. Switching on and controlling the laser is realized
via CON3.
i
Note!
If a different IP address is configured, this must be adapted in block TCON to establish a connection.
If communication block TCON made available by cab, attention should be paid that the data received are
correctly referenced to data block DB[3].
13 3 Introduction 13
i
Note!
When the device is delivered, configured IP address is 192.168.1.11.
14 4 Sample Programs 14
4.1 Sample 1
4.1.1 Description
Here, task is to realize the marking with a data matrix code, generating a sequential 6 digit serial number. When starting
production the starting number shall be handed over and then be incremented by 1. Incrementation is done by the PLC.
The layout can be found in the flash memory of the laser control unter the file name Sample1.dat. When starting the
program the layout is automatically loaded, edited, activated and synchronized with the digital inputs at interface CON2.
Once, when starting the process the laser is switched on automatically via interface CON3 and later on controlled via
CON3 and CON2.
4.1.2 Layout
i
Note!
If the program is working correctly the serial number is counting up during marking.
i
Note!
Attention should be paid that the entry condition "Start Sample" is provided in Network4. This condition
must be activated to allow access to the laser and to apply the sample program.
i
Note!
After the release of „Start Sample“ access to the laser via cabLase 5 is not possible.
15 4 Sample Programs 15
4.1.4 Flowchart
i
Note!
Blue elements equal the Remote API commands.
16 4 Sample Programs 16
4.2 Sample 2
4.2.1 Description
Here, task is to realize the marking of a typeplate containing performance data and test certificates GS, TÜV and DIN.
Depending on the production control, the various test logos shall be switched on/off.
The layout can be found in the flash memory of the laser control under Sample2.dat. When starting the program the
layout is automatically loaded, edited, activated and nd synchronized with the digital inputs at interface CON2. At the
end of the process all marking jobs are deleted from the order memory.
Once, when starting the process the laser is switched on automatically via interface CON3 and later on controlled via
CON3 and CON2.
4.2.2 Layout
i
Note!
If the program is working correctly, the test symbols are selectively switched on and off.
i
Note!
Attention should be paid that the entry condition "Start Sample" is provided in Network4. This condition
must be activated to allow access to the laser and to apply the sample program.
i
Note!
After the release of „Start Sample“ access to the laser via cabLase 5 is not possible.
17 4 Sample Programs 17
4.2.4 Flowchart
i
Note!
Blue elements equal the Remote API commands.
18 4 Sample Programs 18
4.3 Sample 3
4.3.1 Description
Here, task is to realize the marking of a component of different versions with respect to the positioning of the marking
on the part. Depending on the model version marking of the arrow shall be moved and turned to different coordinates
in x- and y direction.
The layout can be found in the flash memory of the laser control under Sample3.dat. When starting the program the
layout is automatically loaded, edited, activated and synchronized via Remote API by and the command GetAllIOWord.
Once, when starting the process the laser is switched on automatically via interface CON3 and later on controlled via
CON3 and CON2.
4.3.2 Layout
i
Note!
If the program is working correctly the arrow moves anticlockwise around the code.
i
Note!
Attention should be paid that the entry condition "Start Sample" is provided in Network4. This condition
must be activated to allow access to the laser and to apply the sample program.
i
Note!
After the release of „Start Sample“ access to the laser via cabLase 5 is not possible.
19 4 Sample Programs 19
4.3.4 Flowchart
i
Note!
Blue elements equal the Remote API commands.
20 4 Sample Programs 20
4.4.2 Layout
i
Note!
If the program is working correctly the text next to the data matrix code changes from Sample_4_1 to
Sample_4_2 and Sample_4_3.
i
Note!
Attention should be paid that the entry condition "Start Sample" is provided in Network4. This condition
must be activated to allow access to the laser and to apply the sample program.
i
Note!
After the release of „Start Sample“ access to the laser via cabLase 5 is not possible.
21 4 Sample Programs 21
4.4.4 Flowchart
i
Note!
Blue elements equal the Remote API commands.
22 5 Establishing a TCP/IP connection with cabLase Editor 5 22
i Note!
In the event that there are more network adapters available, connection sequence for the network adapter
under Windows shall be so that the laser marker FL+ is the first to be connected! Documentation
Windows
Example Windows 7
XX Select "Control panel > Network and sharing center > Change adapter settings".
XX Select menu "Advanced > Advanced settings".
XX Select under "Connections" the connection that is used for connecting the FL+.
XX Use the arrow keys next to the window to move the connection selected to the top line.
XX Click on "OK".
The network connection connected to the device must be set as default in cabLase Editor 5.
XX Select "Connections > Manage" in the main menu bar.
XX Select the tab "Network adapters".
i Note!
If the subnets are incompatible the marking laser FL+ adds an temporary IP address to the default PC
network adapter. Once the PC is restarted this temporary address will be deleted.
24 5 Establishing a TCP/IP connection with cabLase Editor 5 24
i Note!
Before connecting cabLase Editor 5 with the marking laser FL+ a network connection must be created.
i Note!
Make sure that the marking laser FL+ has been switched on at the power switch!
After having started the software the message "Searching for laser devices" under the window "Laser System Viewer"
is displayed.
i Note!
Setting up the automatic connection can be carried out even later.
25 5 Establishing a TCP/IP connection with cabLase Editor 5 25
This is followed by transmitting the configuration settings of the marking laser FL+ to the local PC. The downloading
status is shown in the "Pending connections viewer".
Symbol Status
Available in the network
PC software incompatible
Moving the mouse cursor over the laser device detected shows its status of connection:
i Note!
Click on "Disconnect" to close an active connection.
26 5 Establishing a TCP/IP connection with cabLase Editor 5 26
XX Select menu "Connections" > Manage". This is followed by the input/output window:
i Note!
When starting the software, cabLase Editor 5 now always set up automatically connection with the marking
laser FL+ selected.
27 5 Establishing a TCP/IP connection with cabLase Editor 5 27
! Attention!
Incorrect settings of the IP address may result in losing connection and only might be restored by
changing the settings at the local PC
XX Select and right-click within the window on the marking laser FL+ detected and click on "Default settings".
XX Select "Network".
XX Select under mode "Address type: Manually configured" and enter the IP address to be used.
28 5 Establishing a TCP/IP connection with cabLase Editor 5 28
! Attention!
Faulty settings of the IP-Address may result in loosing the connection and can only be corrected by
changing the settings at the local PC.
XX During the installation of cabLase Editor 5 the „LEC Remote Admin“ tool is automatically installed
XX Start the application and enter the current IP-Address of the laser into the „Device Address“ field
XX Confirm your entry with "Connect"
i Note!
Device_Port "Remote API(12500)" is preset by default.
i Note!
Make sure that the laser marking system FL+ is switched on at the power switch.
29 5 Establishing a TCP/IP connection with cabLase Editor 5 29
XX Under Connectivity enter the parameters required for „IP address“, „Subnet mask“ & „Default gateway“
XX Confirm your entry with „Save“
i Note!
You need to restart the laser to ensure that the IP settings are accepted.
30 5 Establishing a TCP/IP connection with cabLase Editor 5 30
6.1 General
The marking laser FL+ provides the ability to mark jobs without data transmission from the PC (stand-alone
operation). In this case, a higher-level control (e.g. PLC) completely handles the operation of the marking laser FL+.
For this purpose, the "Remote Command API" (Application Programming Interface) and "COM Automation Server"
( Scope of delivery software) are available and additionally allow access to stored data via the "Job Select" signal.
To operate the marking laser FL+ in the stand-alone operation job files and laser character fonts need to be saved in
binary format in the memory of the FL+ controller and called via subroutine or system explorer.
Note!
Editing and modifying is only possible with *.wlj files.
i When transmitting data into the memory of the marking laser FL+, these are automatically converted via
cabLase Editor 5 into binary *.dat job files.
The laser system explorer can be used to copy available *.dat files from the marking laser FL+ to a local PC.
The example requires two job files on the PC, named 1.wlj and 2.wlj.
i Note!
To call marking layouts stored in the internal memory via digital coding, the input "Job Select" on CON2 of
the marking laser FL+ needs to be activated!
Access via "Remote Command API" and "COM Automation Server" is always possible.
32 6 Establishing Stand-Alone Operation with cabLase Editor 5 32
i
Note!
Default directory for laser font files installed on the local PC is: c:\marker\marker\fonts.
Further information about converting Truetype fonts into laser fonts Documentation software.
i
Note!
To be able to use a layout via Remote API interface, it is necessary to check before, whether the fonts used
in the layout are stored on the laser control.
Note!
To be able to use the fonts loaded, the laser system must be newly initialized. There are different possibi-
i lities to do this:
• Switch the laser off and on again
• Carry out a reset at the operation panel
• Release a reset from the external control vial CON3 - PIN10
34 7 Remote API Commands 34
i
Note!
All commands must be terminated by „Carriage Return“ and „Line Feed“ (0X0D & 0X0A, <CR>&<LF> oder
ASCII 13 & 10).
i
Note!
Commands with multiple parameters are sent to the Host in comma-delimited format.
i
Note!
Responses with multiple parameters are returned in comma-delimited format.
i
Note!
All responeses must be terminated by „Carriage Return“ and „Line Feed“ (0X0D & 0X0A, <CR>&<LF> oder
ASCII 13 & 10).
7.1 Abort
Command Abort
Purpose Stops the execution of a job
Implementation 1 or 1,blocking
Parameter Parameter blocking: (integer value)
0 - to immediately stop, f. ex.: 1,0
1 - to stop after having finished the current job, f. ex.: 1,1
API Return messages 0 = Success, 1 = Idle
Comments There are two possibilties to perform the command Abort. The first task is to immediately
stop the execution of an in-process job. The second task is to stop after having completed
and processed all queued data. Using the parameter 0, for immediate stop, the laser stops
without regard to loss of data. Using parameter 1 the command waits until the whole process
is completed. When calling 1, the shorter syntax version of the command, the paramter is
automatically set to 1.
i
Note!
Always use parameter blocking=1, to allow a synchronized processing and clear data assignment (serial
number / tracking and tracing).
35 7 Remote API Commands 35
7.2 ClearJobList
Command ClearJobList
Purpose Removes all loaded jobs from memory.
Implementation 200
Parameter -
API Return messages 0 = Success
Comments Used to delete all marking jobs from the order memory. The command also applies to the
currently in-process job.
i
Note!
By using ClearJobList the marking job activated via MakeJobActive is deleted from the memory.
7.3 ConnectNetworkShare
Command ConnectNetworkShare
Purpose Makes a connection to a network resource
Implementation 523,Remotesharename,Username,Password
Parameter Remotesharename:
Specifies the network resource to connect to (256 characters maximum). The Remotes-
harename has to be entered in an exemplary manner in the format \\ServerDaten\
Laserstation.
Username:
Specifies the user name for making the connection (49 characters maximum)
Password:
Specifies the password to be used when making the connection (63 characters maximum)
API Return messages If the command fails because of a network connectivity error (NetworkConnectFail), the
response is in the form 33,extendederrorinfo. The error messages are created by the Windows
API. For example, if the call fails because of an access denied, the response will be 33,5.
Please refer to the Windows documentation for more details.
Comments This command only supports the “Microsoft Windows Network” provider. The share cannot
be located directly on a Domain.
i
Note!
Complete functionality of the command in the area "extendederrorinfo" is only provided with Windows-
compatible networks.
7.4 Echo
Command Echo
Purpose Delivers a return message of the control on any string
Implementation 37,String
Parameter String:
A string to send that will echoed back by the laser control (3000 characters maximum).
API Return messages Equal to the string value sent
Comments This command can be used to verify communications, and, in activated power saving mode,
for keep-alive purposes of the control.
36 7 Remote API Commands 36
7.5 EnableObject
Command EnableObject
Purpose Enable / disable execution of the specified object
Implementation 106,Objectindex,State
Parameter Objectindex:
Equals to the integer object index
State:
0 means, the object will not be marked
1 means, the object will marked
API Return messages 0 = Success
Comments To execute this command the marking job must not be in process.
i
Note!
In case of disabling a large number of objects it might be better to reload the layout instead of reactivating
the objects.
i
Note!
Object index equals to the object number visualized in cabLase, reduced by 1.
7.6 ExecuteJobContinuous
Command EcecuteJobContinuous
Purpose Starts the execution of the active job and will execute the job in an infinite loop.
Implementation 208, cacheobjects
Parameter Cacheobjects: (Integer value 0 or 1)
0 does not cache marking objects, but wait for the StartMark from the internal FIFO memory
signal
1 cache objects in the FIFO memory immediately after the command for marking is called
API Return messages 0 = Success, 2 = Busy, 109 = NoActiveJob
Comments The client must call TakeHostControl before making this call. The marking job has to be loaded
in the job memory of the laser control and activated by MakeJobActive. The control waits to
start marking until a digital start marking signal is received and will continue repeating this
process until the command Abort is called.
Cacheobjects = 0 and cacheobjects = 1 differ from each other as to the time in which objects
and commands for the FIFO memory are processed and sent. When calling cacheobjects =
1 the control does not wait for the external start signal.
Calling cacheobjects = 0 is useful, if for example objects in the layout shall be controlled by
digital input signals. Usual case is cacheobjects = 1.
i
Note!
In the event of using ExecuteJobContinuous the external start signal must be activated when creating the
marking layout.
i
Note!
In case of the repeatedly marking of a job the command must be called again.
37 7 Remote API Commands 37
7.7 ExecuteJobOnce
Command EnableObject
Purpose Starts the execution of the active job and runs it once without repeat
Implementation 207,cacheobjects
Parameter Cacheobjects: (Integer value 0 or 1)
0 do not cache marking objects, but wait for the StartMark from the internal FIFO memory signal
1 cache objects in the FIFO memory immediately after the command for marking is called
API Return messages 0 = Success, 2 = Busy, 109 = NoActiveJob
Comments After having called the command the control will wait to start marking until an external
start signal at Interface CON2 is received and will continue repeating this precess until the
command „Abort“ is called, even is the marking has not yet started. Calling cacheobjects
= 0 is useful, if for example objects in the layout shall be controlled by digital input signals.
Usual case is cacheobjects = 1.
i
Note!
In the event of using ExecuteJobOnce the external start signal must be activated when creating the
marking layout.
i
Note!
In case of the repeatedly marking of a job the command must be called again.
38 7 Remote API Commands 38
7.8 GetAllIOWords
Command GetAllIOWords
Purpose Delivers the state of all the digital inputs and outputs as two WORDS.
Implementation 31
Parameter -
API Return messages StandardWord,ExtendedWord
StandardWord:
Bit 0: User In 1 Bit 10: User Out 1
Bit 1: User In 2 Bit 11: User Out 2
Bit 2: User In 3 Bit 12: User Out 3
Bit 3: User In 4 Bit 13: User Out 4
Bit 4: Start Marking Bit 14: Marking in Progress
Bit 5: Job Load Bit 15: Job Busy
Bit 6: Interlock 1 Bit 16: System Error
Bit 7: Interlock 2 Bit 17: Ready
Bit 8: Interlock 3
Bit 9: Interlock 4
ExtendedWord:
i
Note!
In the event of calling ExtendedWord, bits 4-15 and bits 20-31 are not active for the FL+.
39 7 Remote API Commands 39
7.9 GetFlashJobFileList
Command GetFlashJobFileList
Purpose Delivers a comma-delimited list of all jobs stored in the flash memory of the laser control
Implementation 203
Parameter -
API Return messages 0,job1,jobX
job1
is equal to the 1st name of the marking job in the memory
jobX
is equal to the umpteenth name of the marking job in the memory
Comments The internal flash memory is the system-internal memory at the laser control. Reading from
and writing to the memory may be effected via cabLase or in the FTP mode.
i
Note!
Please refer to Chapter 6.2 for more information about reading and from and writing marking jobs to the
internal flash memory.
i
Note!
Should the internal flash memory is not readable, the control delivers an API response ErrorCode.
7.10 GetFontFileList
Command GetFontFileList
Purpose Gets a comma-delimited list of all font files stored in the flash memory of the laser control
Implementation 48
Parameter -
API Return messages 0,Fontfile1,…,fontfileN
Fontfile1 is equal to the first font in the list
FontfileN is equal to the laset font in the list
Comments The flash memory is the internal storage memory of the laser control that is accessed via
cabLase or FTP server.
i
Note!
Please refer to Chapter 6.2 or to the assembly instructions of the marking laser FL+ for more information
about access to the internal flash memory.
40 7 Remote API Commands 40
7.11 GetKFactor
Command GetKFactor
Purpose Delivers the calibration factor of the current F-Theta lens configuration
Implementation 10
Parameter -
API Return messages KFactor: delivers the calibration factor of the lens configuration in field units (bits)/mm.
Comments Use this command to discover the conversion between the measurement unit mm and the
laser-specific field units.
i
Note!
Please keep in mind, that Platform 6 and Platform 7 boards maintain native coordinates in μm.
7.12 GetNetworkJobFileList
Command GetNetworkJobFileList
Purpose Gets a comma-delimited list of all marking jobs stored in a network storage location.
Implementation 221,Subfolder
Parameter Subfolder:
is the path specification for the network drive
221, transmits the data in the root directory
221,\Arbeitsdateien transmits the data in the directory \Arbeitsdateien
API Return messages 0,job1,jobX
job1
is equal to the 1st name of the marking job in the network
jobX
is equal to the umpteenth name of the marking job in the network
Comments A connection must already exist to the network drive by using the command
ConnectNetworkShare.
i
Note!
It is obligatory to use the command ConnectNetworkShare to initialize a network connection before calling
GetNetworkFileList.
7.13 GetObjectCenter
Command GetObjectCenter
Purpose Delivers the geometric center of the specified object in field units
Implementation 104,Objectindex
Parameter Objectindex:
Is the integer number of the indexed object
API Return messages X,Y
X is equal to the x coordinate of the object center, in bits
Y is equal to the y coordinate of the object center, in bits
Comments To be able to use this command, the marking job must not be in process. The marking field
is set up as cartesian coordinate system originating in the center.
41 7 Remote API Commands 41
7.14 GetUSBJobFileList
Command GetUSBJobFileList
Purpose Gets a comma-delimited list of all marking jobs stored in a USB drive
Implementation 204
Parameter -
API Return messages 0,job1,jobX
job1
Is equal to the 1st name of the marking job in the memory
jobX
Is equal to the umpteenth name of the marking job in the memory
Comments If no USB drive is found, NoDrive is returned from the control. USB drives differ in terms of
format, memory size and addressing. Should you have problems in accessing please change
the storage medium or contact the manufacturer.
i
Note!
If the USB storage medium can not be read an ErrorCode will be returned.
7.15 HardwareReset
Command HardwareReset
Purpose Performs a reset of the laser control
Implementation 8
Parameter -
API Return messages No response, as the laser control will be newly initialized
Comments After receiving this command, the laser control will perform a soft reset. Before booting the
socket connection to the client will be automatically closed and must be reconnected after
initialization. You also need to start again with the command TakeHostControl. Any changes
made to the IP address parameters will be applied at this time.
i
Note!
All jobs in the RAM will be deleted and have to loaded and activated again. Transmitted variables are lost.
i
Note!
During the boot procedure a connection to the laser control can be established, however there is no
data exchange available. Whether booting is terminated or not may be asked via status query or digital
interface.
i
Note!
Initialization via HardwareReset may take up to 90 seconds.
42 7 Remote API Commands 42
7.16 LoadFlashJob
Command LoadFlashJob
Purpose Loads a job from flash memory into RAM, and sets the job as the ActiveJob.
Implementation 205,jobname
Parameter jobname: (Stringwert)
Is the file name of the layout with the extension, for example Circle.dat.
API Return messages 0 = Success, 3 = NoJob
Comments There can be multiple jobs loaded in RAM simultaneously. Before interacting with a job
(editing or modifying a layout), it must be made active with the MakeJobActive command.
i
Note!
Multiple marking jobs can be loaded in the RAM of the control simultaneously.
i
Note!
Before interacting with a job, for example editing or modifying variables, objects or other features), the
layout must be made active with the MakeJobActive command.
7.17 LoadNetworkJob
Command LoadNetworkJob
Purpose Loads a job from a network location into RAM, and sets the job as the ActiveJob.
Implementation 222,jobname
Parameter jobname: (Stringwert)
Is the path and file name of the layout with the extension, for example \Arbeitsdateien\
Circle.dat.
API Return messages 0 = Success, 3 = NoJob
Comments The job name can contain subfolder locations relative to the connected network drive.The
network drive is defined with the ConnectNetworkShare command and must not be speci-
fically stated!
To load the file circle.dat from the network drive server01 in the path \Arbeitsdateien\, use:
222,\Arbeitsdateien\circle.dat
Acess is made via:
\\Server01\Arbeitsdateien\circle.dat
Multiple marking jobs can be loaded in the RAM of the control simultaneously. Before inter-
acting with a job (editing or modifying a layout), it must be made active with the MakeJob-
Active command.
i
Note!
Network drives are defined independent of the command LoadNetworkJob with the ConnectNetworkShare
command.
i
Note!
Drive names and server are not specified in the jobname, but only the relative subfolders.
43 7 Remote API Commands 43
i
Note!
There can be multiple jobs loaded in RAM simultaneously.
i
Note!
Before interacting with a job (editing or modifying a layout), it must be made active with the MakeJobActive
command.
7.18 LoadUSBJob
Command LoadUSBJob
Purpose Loads a marking job from an external USB drive into RAM
Implementation 206,jobname
Parameter jobname: (Stringwert)
Is the file name of the layout with the extension, for example Circle.dat
API Return messages 0 = Success, 3 = NoJob
Comments Multiple marking jobs can be loaded in the RAM of the control simultaneously. Before inter-
acting with a job (editing or modifying a layout), it must be made active with the MakeJob-
Active command.
i
Note!
There can be multiple jobs loaded in RAM simultaneously.
i
Note!
Before interacting with a job (editing or modifying a layout), it must be made active with the MakeJobActive
command.
44 7 Remote API Commands 44
7.19 MakeJobActive
Command MakeJobActive
Purpose Sets a job currently loaded into RAM as the ActiveJob
Implementation 201,jobname
Parameter Jobname: (Stringwert)
Is the file name of the layout with the extension, for example Circle.dat.
API Return messages 0 = Success, 2 = Busy, 3 = NoJob
Comments Before changes, i.e. variables can be accepted, the layout must first be activated. If there are
multiple layouts in RAM, the marking job that is activated with the command will be processed.
i
Tip!
Multiple marking jobs can be loaded in RAM simultaneously. Switching with MakeJobActive minimizes the
processing time.
7.20 RemoveJob
Command RemoveJob
Purpose Deletes the current marking job from the memory.
Implementation 202
Parameter -
API Return messages 0 = Success, 3 = NoJob
Comments The routine allows deleting the current marking job in RAM activated with the MakeJobActive
command. To delete several marking jobs, these must be activated separatly.
i
Note!
RemoveJob deletes the activated marking jobs from RAM, but not the marking layouts which are stored at
the laser control.
7.21 RemoveObject
Command RemoveObject
Purpose Deletes an object in the currently activated marking job
Implementation 141,objectindex
Parameter objectindex: (Integerwert)
Is the consecutive number of the object in the marking layout.
API Return messages 0 = Success, 10 = ArgOutOfRange, 104 = NoObject
Comments Executing the command is only possible, if there is no marking job in process.
i
Note!
To recall the objects it is necessary to reload and activate the layout again.
45 7 Remote API Commands 45
7.22 ReleaseHostControl
Command ReleaseHostControl
Purpose Closes the connection of a client established to the host and resets the control back to the
stream mode
Implementation 3
Parameter -
API Return messages 0 = Success
Comments Does a remote API client break the connection to the control, the control will be automatically
switched into stream mode. This kind of data transfering interface is used with the help of
the marking software cabLase.
i
Note!
If multiple clients shall execute data exchange with a laser control, it is important to have each of the instances
terminated with ReleaseHostControl.
7.23 ResetObject
Command ResetObject
Purpose Deletes the vector list of an object after a transformation and restores the original, initial vectors.
Implementation 111,objectindex
Parameter Objectindex:
Equals to the integer object index
API Return messages 0 = Success, 104 = NoObject
Comments To be able to execute the command the marking job must not be in process. This command
deletes the vectors of the transformed objects and creates the vector list of an object in its
original status without transformation.
i
Note!
This command deletes the vectors generated after the transformation based on the current value of the object,
for example serial number. Should the original status be restored, it is necessary to reload the marking job.
7.24 ResetUserTransform
Command ResetUserTransform
Purpose Resets a object transformation and restores the original status
Implementation 112,objectindex
Parameter Objectindex:
Equals to the integer object index
API Return messages 0 = Success, 104 = NoObject
Comments To be able to execute the command the marking job must not be in process. This command
cancels the transformation. To additionally delete the generated vector list corresponding to
the object, it is necessary to additionally apply the command ResetObject.
i
Note!
For deleting the active vector list of an object already transformed it is necessary to use the command Reset-
Object additionally to the commandResetUserTransform.
46 7 Remote API Commands 46
7.25 SetExternalStartMode
Command SetExternalStartMode
Purpose Sets the current ExternalStart mode of the active job.
Implementation 215,Mode
Parameter Mode:
0 = Starts, if input is set to High
1 = Starts, if input is set to Low
2 = Starts after transition from Low to High
3 = Starts after transition from High to Low
API Return messages 0 = Success, 3 = NoJob
Comments To be able to execute the command the marking job must not be in process. The command
controls what type of signal transition on the Start Process at the digital interface CON2 will
trigger the start of job execution.
i
Note!
Generally, the digital start signal at interface CON2 is used to start a synchronized process. If mode = 1 is
used, the execution of the marking job already starts with the ExecuteJobOnce command.
7.26 SetObjectString
Command SetObjectString
Purpose Sets the string value of a string based marking object contained in the active job
Implementation 100,objectindex,newstring
Parameter objectindex: (integer value)
Specifies the respective index number of the object from the layout
i
Note!
Not the object name, but it's index number is relevant to the assignment of variables. The index number can
be determined in the software cabLase.
i
Note!
Please take into account that, in the event of creating layouts, inserting objects will change the respective
index number of subsequent objects.
i
Note!
Object indexing starts with 0. The index number is each reduced by 1 and starts with "0".
i
Note!
The marking job must not be in process when modifying variables. The ExecuteJobOnce command must not
be called before the variables' modification.
47 7 RemoteAPI Commands 47
i
Note!
To imbed control characters for the object type data matrix code, use the tilde ( ~ ) character before the control
code. To imbed an actual ~ character, use two tilde characters in a row ( ~~ ). To imbed an ASCII 0 character,
use ~@ instead of the ASCII 0. Refer to the software manual cabLase Editor 5, "Formatted String", for more
detailed information.
7.27 TakeHostControl
Command TakeHostControl
Purpose Allows exclusive control of the laser control from external
Implementation 2
Parameter -
API Return messages 0 = Success, 4 = InControl
Comments A client or the software cabLase cannot gain exclusive control of the laser control, if it is busy
processing a marking job. In this case, the other client must terminate the connection, the
software must close or wait until the current marking job is processed.
i
Note!
Use the ReleaseHostControl command to terminate an exisiting connection.
i
Note!
Use the GetJobStatus command to determine, if there is a job currrently being processed.
i
Note!
Terminate the software cabLase before starting the Remote API interface to enable release of the common port.
48 7 Remote API Commands 48
7.28 TransformObject
Command TransformObject
Purpose Applies rotation, scaling and offset to the specified object
Implementation 102,Objectindex,Rotation,Rotationscenterx,Rotationscentery,Xscale,Yscale,
Xoffset,Yoffset
Parameter Objectindex:
Equals to the integer object intex of the object
Rotation:
Specifies the rotation angle, in degrees, valid range -360 to +360
RotationcenterX:
Specifies the coordinate position representing the center of rotation in the x-axis, in bits, valid
range -2147483648 to +2147483647.
RotationcenterY:
Specifies the coordinate position representing the center of rotation in the y-axis , in bits,
valid range -2147483648 to +2147483647.
Xscale:
Specifies the amount to scale the object in the x-axis. Vailue must be greater than 0.
Yscale:
Specifies the amount to scale the object in the y-axis. Vailue must be greater than 0.
Xoffset:
Specifies the amount to move the object in the x-axis, in bits, valid range -2147483648 to
+2147483647.
Yoffset:
Specifies the amount to move the object in the y-axis, in bits, valid range -2147483648 to
+2147483647.
API Return messages 0 = Success, 10 = ArgOutOfRange
Comments Both the Object outline and the Object fill are transformed with this call. Transformation remains
the same, even if for example a SetObjectString command is called or if the object is a serial
number field. Subsequent calls of the command will be relative to the last transformation
performed. Transformations may effect that an object is outside the specified marking field.
To check, whether an object is within the legal marking field or not, the GetObjectRectangle
command in combination with the size of the marking field can be called. The marking field
is structured as cartesian coordinate system orginating in the center.
i
Note!
Coordinates for movement and rotation center must be converted into bits.
i
Note!
Using this command it is the responsibility of the programmer to insure that after an object has
been transformed, it is within the legal marking field.
! Attention!
Repeated calls of TransformObject lead to a relative transformation. To clear all transforms and to reset the
layout you have to call the ResetUserTransform command.
49 8 Numerical Listing Remote API Commands 49
8.1 Control
Command Description
Control
1 Abort
2 TakeHostControl
3 ReleaseHostControl
4 GetHostControlStatus
5 GetHostInControl
6 EnableBroadcasting
7 LoadHardwareDefaults
8 HardwareReset
9 GetRemoteIP
10 GetKFactor
14 SetPerformanceGlobals
15 ResetPerformanceGlobals
16 OpenCOMPort
17 CloseCOMPort
18 COMWriteLine
19 GoToZ
20 GoToXYZ
21 SetMOTFEncoderRate
22 SetMemBuffer
23 GetMemBuffer
24 GetAvailableRAM
27 COMWriteChar
29 SetUserOutBit
30 GetUserInWord
31 GetAllIOWords
32 SetUserOutInitWord
33 GetUserOutInitWord
34 SampleMOTFEncoderCount
35 ClearMOTFEncoderCount
36 GetMOTFEncoderCount
37 Echo
38 GetLensFileList
39 LoadLensFile
40 SetUserOutPreferences
41 GetUserOutPreferences
42 SetUserOutWord
43 GetVersions
44 GetLaserFileList
45 LoadLaserFile
46 GetMotionFileList
47 LoadMotionFile
48 GetFontFileList
49 GetActiveLaser
50 8 Numerical Listing Remote API Commands 50
Command Description
Control
50 GetActiveLens
52 GetAvailableDiskSpace
56 ClearCommandCache
57 TurnLaserOn
58 TurnLaserOff
59 GetMotionDeviceNames
60 GetMotionCalFactors
61 SendMotionCommand
63 GetMotionErrorCodes
64 GetMotionHomedOnceFlags
65 GetMotionStatus
66 GetProfileFileList
67 GetLastInterlockWord
70 PulseUserOutBit
71 COMWriteBinarychar
72 COMWriteCarEx
73 COMWriteLineEx
74 COMReadLineEx
75 CloseCOMPortEx
76 SetZOffsetRWU
77 SendMotionCommandEx
i
Note!
Please refer to the separate manual to get the complete documentation of all Remote API commands.
51 8 Numerical Listing Remote API Commands 51
8.2 Objects
Command Description
Objects
100 SetObjectString
102 TransformObject
103 GetObjectRect
104 GetObjectCenter
105 GetObjectType
106 EnableObject
107 GetObjectString
108 GetObjectName
109 SetObjectUserData
110 GetObjectUserData
111 ResetObject
112 ResetUserTransform
113 TransformObjectByName
114 TransformObjectByNameEx
115 SetObjectProfile
116 GetObjectProfile
117 SetObjectProfileFromFile
118 GetObjectNumPasses
119 SetObjectNumPasses
120 GetObjectMarkMode
121 SetObjectMarkMode
122 GetObjectNumMarkingPasses
123 AddObjectMarkingPass
124 DeleteObjectMarkingPass
125 SetObjectPassSettings
126 GetObjectPassSettings
127 TransformObjectNewFill
128 TrnsformObjectByNameNewFill
136 NewObject
137 SetObjectUnicodeString
138 GetObjectUnicodeString
139 GetObjectVectors
140 SetObjectVectors
141 RemoveObject
142 GetObjectExecuteTime
143 SetObjectName
144 SetObjectProperties
145 GetObjectProperties
146 SetObjectOutlineSettings
147 GetObjectOutlineSettings
148 SetObjectFillSettings
149 GetObjectFillSettings
151 GetObjectFontMetrics
52 8 Numerical Listing Remote API Commands 52
i
Note!
Please refer to the separate manual to get the complete documentation of all Remote API commands.
53 8 Numerical Listing Remote API Commands 53
8.4 Administration
Command Description
Administration
500 SetAdminPIN
501 GetAdminPIN
502 SetDHCPMode
503 GetDHCPMode
504 SetLocalGateway
505 GetLocalGateway
506 SetLocalIP
507 GetLocalIP
508 SetNodeFriendlyName
509 GetNodeFriendlyName
510 SetSubnetMask
511 GetSubnetMask
512 SetUserPIN
513 GetUserPIN
514 SetCOMPortSpeed
515 GetCOMPortSpeed
516 SetCOMPortAssignments
517 GetCOMPortAssignments
518 SetLocalTime
519 GetLocalTime
523 ConnectNetworkShare
524 SetCOMPortSpeedEx
525 GetCOMPortSpeedEx
526 GetLocalDeviceList
527 SetActiveLocalDevice
528 SetCOMPortMode
529 GetCOMPortMode
i
Note!
Please refer to the separate manual to get the complete documentation of all Remote API commands.
54 9 Remote API Host Response Codes 54
The following table shows possible API Response Codes returned from the Host to the client. Response Codes are
used for fault detection in case of difficulties in flow control.
Value Short description Description
0 Success The operation completed successfully
1 Idle idle mode, no marking job in process
2 Busy A marking job is currently in process
3 NoJob The specified job was not found
4 InControl The requesting client has exclusive control of the Host
The requesting client does not have exclusive control of the
5 NotInContrl
Host
6 LicenseUnavailable No valid license was found
Access denied. The current license does not allow the
7 LicenseAccessDenied
requested feature
8 BadCommand The API command was not recognized
9 BadArg A specified argument was invalid
10 ArgOutOfRange A specified argument was out of range
The specified time zone cannot be found when setting up the
11 UnkownTimeZone
system
12 Reserved Reserved
Transmission error. Error while converting between multi-byte
13 BadConversion
and Unicode characters
14 RegistryError A Windows CE Registry read or write operation failed
15 TimeZoneFileError A Time Zone File operation failed
16 ResetInterlock An interlock was signaled and must be reset by calling Abort
17 ListNotOpen An operation was attempted on a list that has not been opened
18 ListAlreadyOpen The list is currently open
19 BadData The data in the specified file was not in the correct format
20 APIException The Remote API caused an unexpected exception
21 JobAborting The job is currently aborting from a previous abort command
22 FPGALoadFail An attempt to load the FPGA with instructions failed
23 JobManagerInitFail The Job Manager failed to initialize properly
24 LaserLoadFail The specified laser configuration failed to load properly
25 LensLoadFail The specified lens configuration failed to load properly
The specified Performance Matrix configuration failed to load
26 PMLoadFail
properly
27 MotionLoadFail The specified motion configuration failed to load properly
28 HostManagerInitFail The Host Manager failed to initialize properly
29 InvalidIPAddress The specified IP address is not a valid IPv4 IP address
30 DataUnknown The format of the data is not recognized
31 BadChecksum The data failed a checksum test
There was an attempt to use a network resource, but no
32 NetworkShareNotConnected
connection exists
55 9 Remote API Host Response Codes 55
i
Note!
It may happen that an error message in textform is received instead of the numerical value expected.
59 10 Remote API System Error Messages 59
The following are System Error Codes that may be returned by the Remote API command GetLastError.
The laser marking software cabLase 5 uses different object types to create the layouts. In the event of addressing via
Remote API interface the various obect types are not transmitted in form of a name, but as integer value.
The following are the values for different object types.
Value Short description
0 Polyline
1 Barcode
2 Text
3 Bitmap
4 Vector Graphic
5 Point
6 Line
7 Polygon
8 Rectangle
9 Rounded Rectangle
10 Spiral
107 Laser Control
108 Set Port
109 Time Delay
110 Wati Port
111 Alignment
115 Rotary Motion
116 Linear Motion
117 XY Motion
i
Note!
Please note that for addressing objects via Remote API interface the continuous index number is relevant
and not the type or name of the object.
61 12 Integration Interfaces 61
Pin 1 Pin 13
Pin 14 Pin 25
Pin 8 Pin 1
Pin 15 Pin 9
Remote Interface
Power switch
X don‘t care
Pin 5 Pin 1
Pin 9 Pin 6
i Note!
There is no marking possible without having connected the inputs Interlock In (Pin 4) and E-Stop In (Pin 6).
13.3 Contact
Name Company Function / Department email
Mehmet Seker cab GmbH & Co. KG Service / Support [email protected]
Lukas Schmid cab GmbH & Co. KG Service / Support [email protected]
Hans Löhner cab GmbH & Co. KG Software / Support [email protected]