occasions in the industrial automation, programmable logic controller and drive more and more widely, the traditional control method is generally used PLC's digital input and output terminals to drive the input and output terminals, PLC analog input and output point control inverter analog input and output, this approach is actually taking up valuable PLC input and output points, in particular, analog interface, the fee is costly (PLC output point 30-50 dollars / points, analog output 300 -500 yuan / Road). With the development of PLC and inverter, in particular, the expansion of communications capacity, the drive comes with the current general communication interface 485, while the PLC communication function has also been considerable development, so consider using PLC and inverter directly through communication connected, should be a more economical method. The question is: a large number of drive manufacturers, due to technical and market reasons, the communication protocol varied, poor compatibility with each other. For this situation, Japan's Koyo Electronics (KOYO) with The so-called absence of agreement, which is free agreement, the agreement of the format defined by the user, so users can organize data protocol format the drive to realize the communication with the drive. SN series Koyo Electronics PLC, is a small integrated scalable PLC, a powerful communication features, the basic configuration has two communication interfaces (one RS232, one RS485), in addition to support communication without protocol, but also supports MODBUS protocol, CCM agreement, K agreement. This paper introduces the non-protocol communications.
SN Communication Function:
SN series PLC communication ports with 2 body, one for RS-232C port, and the other for the RS485 port can be used with a variety of equipment with a serial port communication.
communication functions of the communications port as follows:
Port0 (programming port):
communication: RS-232C
communication speed: 300bps ~ 38.4Kbps
connection: 6 pin telephone jack
support agreement: K protocol (S), no agreement (M / S), CCM2 (S)
transmission distance: hand-held programmer (9600bps, 38400bps) 1.5m or less
DirectSOFT (9600bps) 5m or less
no agreement, CCM (9600bps) 15m or less
Port1 (Universal communication port):
communication: RS-485
communication speed: 300bps ~ 38.4Kbps
connection: 3P Terminal
support agreement: CCM2 (M / S), CCM3 (M / S), no agreement (M / S), K protocol (S)
transmission distance: 9600bps and a maximum 1km
(19200bps or more, the maximum 500m)
no agreement that:
communication protocol to be no need to set the parameters of the following table:
setting item
initial settings
, range
protocol
no protocol communication
-
communication
X-ON/X-OFF Invalid RTS signal control is invalid
X-ON/X-OFF invalid / valid RTS signal control ineffective / effective
communication speed
9600bps
300/600/1200/2400/4800/9600/19200/38400bps
data bit
8bit
7bit/8bit
START-digit
1bit
fixed
STOP bits
1bit
1bit/2bit
parity
no parity
odd (ODD) / even (EVEN) / No (NONE)
end time set by the letter
3 character time
3 character time
RTS ON Delay
0ms
0/2/5/10/20/50/100/500ms
RTS OFF Delay
0ms
0/2/5/10/20/50/100/500ms
PORT0 register number
PORT1 register number
function
data
R7640
R7650
finished code is stored settings
A55A (H): Fixed
R7641
R7651
data format
data length, stop bit length, parity
R7642
R7652
transceiver mode settings
A type, B type, variable-format
R7643
R7653
end of the code set
prepared to receive over code, for example: CR (0DH)
R7644
R7654
prepared to receive the data storage register
register number (binary)
R7645
R7655
protocol settings
K protocol / CCM / MODBUS / no agreement
R7646
R7656
communication speed, response delay time
300/600/1200/2400/4800/9600/19200/38400bps
R7657
set over code
set over code 0050/00A0/00E0 (PORT0) 0500/0A00/0E00 (PORT1)
Set the following parameters register:
reference to the specific parameters set Koyo Electronics (Wuxi) Co., Ltd.
communication routines:
following procedure for the SN series PLC and drive communication DANFOSS example
PLC 05
ISG S0 / / initial level: Set the communication parameters
LD SP0
LDS K10
OUTW R7655 / / select no agreement
LDS K55
OUTW R7656 / / set the baud rate to 9600, the response delay 50mS
LDS K500
OUTW R7657 / / set the end code
LDS K6
OUTW R7651 / / select the data format for the 8,1, EVEN
LDS K70
OUTW R7652 / / transceiver mode: Variable format
LDS K0
OUTW R7653 / / end of code: D? 0 & D
LDR O4000
OUTW R7654 / / receive data starting register: R4000
LDS Ka55a
OUTW R7650 / / set the finished code
LDS K0
OUTW R4000 ; / / Clear receive data register
JMP S1
SG S1 / / write the data-level operating frequency to send
LDN SP116
LDC Ke0020e02 / / Inverter Board number: 2
OUTD R2000 / / inverter parameter No.: 215
LDC Kd7
OUTD R2002
LDW R3000 / / R3000 deposit register write operation frequency
ANDC Kff00
OUTW R2004
LDW R3000
ANDC Kff
OUTW R2005
LDS K0
OUTW R2006
LDW R2000 / / calculated checksum
XORW R2001
XORW R2002
XORW R2003
XORW R2004
XORW R2005
XORW R2006
OUTW R2030
LDW R2030
ANDC Kff
OUTW R2031
LDW R2030
ANDC Kff00
SHFR K8
OUTW R2032
LDW R2031
XORW R2032
ANDC Kff
SHFL K8
OUTW R2007 / / checksum storage register
LDS Kf101 / / use PORT1 communication port to send
LDS K16 / / send 16 bytes of data
LDR O2000 / / data to be transmitted starting register for the R2000
WX TA0 / / send data
JMP S11
SG S11 / / data reception class
LDEQ R4000 K80 / / receive data, such as the right to carry out data processing
LDW R4006
ANDC Kff00
OUTW R4030
LDW R4007
ANDC Kff
ORW R4030
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
SHFR K8
OUTW R2032
LDW R2031
XORW R2032
ANDC Kff
SHFL K8
OUTW R2007
LDS Kf101 / / send data using RPORT1
LDS K16 / / send the bytes as 16
LDR O2000 / / send the starting register for the R2000
WX TA0 / / send data
JMP S12 / / transfer data reception
SG S12
LDEQ R4000 K80
ANDEQ R4001 K10 / / receives the correct data, data processing
LDW R4006
ANDC Kff00
OUTW R4030
LDW R4007
ANDC Kff
ORW R4030
OUTW R3202 / / read out the current operating frequency of storage registers R3202
LDS K0
OUTW R4000
JMP S1
LD SP1
TMR T1 K4 / / Delay 400mS
LD T1
LDNEQ R4000 K80
ANDNEQ R4001 K0
ORLD
LDS K0
OUTW R4000 / / If you can not receive data correctly, the next communication
JMP S1
END / / end of the process
NOP
application:
programming ideas based on the above method, just change the drive to send the program parameter address, you can control other parameters of the drive (inverter parameters can be changed through communication.) Jump slightly modified procedure, you can control multiple parameters. When using more than one drive, just the drive is set to a different mailing address on it. This method has been drawing machinery, textile machinery (dyeing and finishing equipment, sizing machine) and other equipment has been applied not only to save the PLC analog module, but also solve the analog input channels drive limit, not both changes in multiple parameters of the problem, cost is obvious. Note that, PLC and inverter need to use shielded twisted-pair connections, and reliable ground to address the electrical interference may cause communication failure.
Reference:
SN Series User Manual
DANFOSS VLT5000 Series User Manual
DANFOSS Communications Handbook
No comments:
Post a Comment