Communication protocols
PROGRAMMING MANUAL 221
Revision 1.0
PRINT "Received ";count[0];" characters"
FOR i=1 TO count
IF TABLE(i)<>13 THEN
PRINT CHR(TABLE(i))
ELSE
PRINT "'cr'"
ENDIF
NEXT i
IF TICKS<0 THEN
PRINT "Timeout in the communication with the F500"
resp_status=3
ELSEIF TABLE(count-2)=79 AND TABLE(count-1)=75 THEN
PRINT "Response OK"
resp_status=1
ELSE
PRINT "Response Uncorrect"
resp_status=2
ENDIF
PRINT "Response Status is :";resp_status[0]
RETURN
clear_buffer:
PRINT "Clearing..."
WHILE KEY#1
GET#1,k
PRINT k
WEND
PRINT "Cleared!!"
RETURN
4.4 PROFIBUS
4.4.1 Introduction
PROFIBUS is an international open fieldbus standard. The Trajexia TJ1-
PRT enables the Trajexia system to communicate with a PROFIBUS
network. It exchanges data between the PROFIBUS master and the TJ2-
MC64. For this, it uses the Trajexia VR variables.
4.4.2 Communication set-up
The TJ1-PRT has two node number selectors. You can use the node
number selectors to assign a PROFIBUS network address to the TJ1-PRT.
You must assign an address to the TJ1-PRT before you set the power of the
Trajexia system on.
To initialise the TJ1-PRT, use the BASIC PROFIBUS command:
PROFIBUS(unit_number, 2, 1, output_start, output_count, input_start,
input_count)
where:
• unit_number is the number of the TJ1-PRT unit.
• output_start is the start address of the output data range of VR
variables.
• output_count is the number of VR variables in the output data range,
maximum 122 variables.
• input_start is the start address of the input data range of VR variables.
• input_count is the number of VR variables in the input data range,
maximum 122 variables.
After you have executed the command PROFIBUS(unit_number, 2, ...),
data arrays are automatically exchanged. The data exchanged between the
TJ1-PRT and the PROFIBUS master is in 16-bit integer format. Each word
exchanged ranges from -32768 to 32767.
A VR variable can hold a 53-bit number, and it can also hold fragments. The
exchange with the PROFIBUS master does not support values outside the
range -32768..32767 and fragments.
An example sequence to configure the TJ1-PRT unit, is as follows:
1. Set the unit number with the two rotary switches of the TJ1-PRT unit.