EasyManua.ls Logo

Omron TJ2-MC64 - PROGRAMMING User Manual

Omron TJ2-MC64 - PROGRAMMING
362 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #226 background imageLoading...
Page #226 background image
Communication protocols
PROGRAMMING MANUAL 220
Revision 1.0
4.3.4 User-defined protocol
You can implement a user-defined communication protocol with these
commands:
/i
Example
Assume a set-up with:
A Trajexia system with a TJ2-MC64.
An OMRON Vision system F500.
A connection from the serial port of the TJ2-MC64 to the F500. The
serial port uses RS232 (port 1) communication.
This program sends a Vision command through the serial port, reads the
response from the Vision system, writes it to VR variables and prints the
results in the Terminal window of Trajexia Tools.
' In the STARTUP program
' Setting RS232 port for the vision system
SETCOM(38400,8,1,0,1,0)
' In the application program
loop:
' Trigger, rising edge in virtual system
WAIT UNTIL IN(30)=0
WAIT UNTIL IN(30)=1
' Clear screen
PRINT CHR(27);"[2J"
' Clear buffer
GOSUB clear_buffer
' Send command to the serial port according to VR(10)
IF vision_command=v_measure THEN
PRINT #1, "M"
PRINT ">> M"
ELSEIF vision_command=v_date THEN
PRINT #1, "DATE"
PRINT ">> DATE"
ELSEIF vision_command=v_scene THEN
PRINT #1,"SCENE ";scene_n
PRINT ">> SCENE"
ENDIF
'Check response
GOSUB read_buffer
GOTO loop
read buffer:
count=0
resp_status=0
k=-1
TICKS=5000
REPEAT
IF KEY#1 THEN
count=count+1
GET#1, k
'PRINT k;count
TABLE(count,k)
'PRINT count
ENDIF
UNTIL TICKS<0 'OR k=13
BASIC command Description
SETCOM SETCOM configures the serial communication port, and it enables
the Host Link protocols.
GET GET assigns the ASCII code of a received character to a variable.
INPUT INPUT assigns numerical input string values to the specified varia-
bles.
KEY KEY returns TRUE or FALSE, when a character has been received
or has not been received.
LINPUT LINPUT assigns the ASCII code of received characters to an array
of variables.
PRINT PRINT outputs a series of characters to a serial output device.
Question and Answer IconNeed help?

Do you have a question about the Omron TJ2-MC64 - PROGRAMMING and is the answer not in the manual?

Omron TJ2-MC64 - PROGRAMMING Specifications

General IconGeneral
ManufacturerOmron
CategoryController
Number of Axes64
Power Supply Voltage24 VDC
Humidity10 to 90% RH (non-condensing)
ModelTJ2-MC64
SeriesTJ2
Communication InterfaceUSB, RS-232

Summary

About this manual

Functions supported by unit versions

Safety warnings and precautions

Intended audience

Defines the target personnel for this manual, focusing on those with electrical systems knowledge.

Safety precautions

Highlights critical safety measures to prevent electrical shock and damage during operation.

Operating environment precautions

Details precautions for operating the unit in various environmental conditions to prevent malfunction.

Application precautions

Covers precautions related to system application, wiring, and power supply to ensure safe operation.

Trajexia system

Introduction

Introduces Trajexia as OMRON's motion platform, highlighting its flexibility, scalability, and core components.

BASIC programming

Explains the structure of the BASIC language for controlling the TJ2-MC64, including commands, functions, and parameters.

Motion execution

Describes how tasks manage motion commands and the role of the motion generator and its buffers.

BASIC commands

Categories

Lists and categorizes all available BASIC commands for quick reference.

All BASIC commands

Provides a comprehensive alphabetical listing and description of all BASIC commands.

Axis commands

Details commands related to controlling and manipulating individual axes.

Axis parameters

Describes parameters that define and monitor the behavior of each axis.

Communication protocols

Available interfaces

Lists the available communication interfaces for the Trajexia system.

Ethernet

Details the Ethernet port configuration and usage for PC connectivity.

Serial protocol

Explains the serial ports and supported protocols like Host Link and ModbusRTU.

DeviceNet

Describes the DeviceNet protocol and its communication setup.

CANopen

Covers the CANopen networking system and communication setup procedures.

Examples and tips

How-to’s

Provides practical guidance and step-by-step instructions for common operations.

Startup program

Explains how to create and set a startup program for system initialization.

Setting the UNITS axis parameter and gear ratio

Details how to set the UNITS parameter for axis conversion and gear ratio.

Origin search

Describes the origin search or homing functionality for axis positioning.

Practical examples

Presents real-world application examples and code snippets.

SHELL programs and Trajexia Studio

Guides on creating and using SHELL programs for application management.

Troubleshooting

Voltage and analysis tools

Covers checks for power supply voltage and using analysis tools for diagnosis.

TJ2-MC64

Details system errors, axis errors, unit errors, and configuration errors for the TJ2-MC64.

System errors

Explains system errors displayed on the TJ2-MC64 LED display and their causes/solutions.

Axis errors

Describes axis errors shown on the TJ2-MC64 LED display, including causes and solutions.

Unit errors

Details unit errors shown on the TJ2-MC64 LED display, including causes and solutions.

TJ1-PRT

Covers system errors and I/O data communication problems for the TJ1-PRT.

System errors

Lists system errors for the TJ1-PRT and their corresponding problems and solutions.

TJ1-DRT

Details system errors and I/O data communication problems for the TJ1-DRT.

System errors

Lists system errors for the TJ1-DRT, including their causes and solutions.

TJ1-CORT

Covers system errors and I/O data communication problems for the TJ1-CORT.

System errors

Lists system errors for the TJ1-CORT, including their causes and solutions.

TJ1-ML__

Details system errors and bus errors related to the TJ1-ML__ unit.

System errors

Lists system errors for the TJ1-ML__, including causes and solutions.

GRT1-ML2

Covers unit power supply, I/O power supply, unit, and SmartSlice I/O errors.

Unit power supply errors

Explains issues related to the GRT1-ML2 unit power supply status.

I/O power supply errors

Details issues related to the external I/O power supply for SmartSlice I/O Units.

Unit errors

Lists unit errors during GRT1-ML2 initialization, including causes and solutions.

SmartSlice I/O errors

Covers errors related to SmartSlice I/O communication and configuration.

GRT1-ML2 timing

Timing concepts

Explains I/O timing issues and concepts like refresh cycles and paging.

Refresh cycles

Details the refresh cycles between TJ2-MC64, GRT1-ML2, and SmartSlice I/O Units.

Examples

Provides examples illustrating I/O timing calculations for SmartSlice I/O Units.

Example 1

Illustrates I/O timing calculations for GRT1-ID4 and GRT1-OD4 SmartSlice units.

Example 2

Shows I/O timing calculations for a more complex setup with multiple SmartSlice units.

Revision history

Related product manuals