Tightening machine as a PLC device

From PlcWiki

Jump to: navigation, search

The most important properties of a tightening machine defined as a PLC device are its name and channelnumber. These two entries uniquely identify a tightening machine or its spidle.

channelnumber is a logical ID of single tightening spindle connected to a PLC client. It can be any non-zero positive integer as it's only purpose is to assign the tightening tool to appropriate operation. It has no other meaning.

Be aware to use channelnumber setting, not channel. channel is a deprecated setting with many side effects and should not be used anymore.

When a tightening machine has more than one spindle, this setting applies to the first of them. Other spindles' channelnumbers are assigned in sequential order. E.g. if this option is set to 3 and the machine has 2 spindles, then the first spindle has the channelnumber 3 and the second one has the channelnumber 4. The next usable channenumber value is 5.

.settings.channelnumber should match operation's .ChannelNumber value and the device name (i.e. tmachine_1) should match operation's .Device value.

Contents

CLEVER & OpenProtocol

Generally we send these messages to controllers however it also depends on the configuration:

MID 1 (rev 3) Communication start
MID 60 (rev 2) Last tightening result data subscribe
MID 14 Parameter set selected subscribe
MID 17
Parameter set selected unsubscribe
MID 34 Job info subscribe
MID 37
Job info unsubscribe
MID 70
Alarm subscribe
MID 18 Select Parameter set
MID 38
Select job
MID 127
Abort job
MID 16 Parameter set selected acknowledge
MID 43 Enable tool
MID 42 Disable tool
MID 9999 Keep alive message
MID 62 Last tightening result data acknowledge
MID 50
Vehicle ID Number download request
MID 19
Set Parameter set batch size
MID 224
Set digital input function


We accept any MID from the controller, the most important MIDs for us are these:


MID 5 Command accepted
MID 61 Last tightening result data
MID 15 Parameter set selected
MID 35 Job info






The communication starts like this:


PC direction controller meaning
MID 1 ->
Communication start

<- MID 2 Communication start acknowledge
MID 60 ->
Last tightening result data subscribe

<- MID 5 Command accepted
MID 14 ->
Parameter set selected subscribe

<- MID 5 Command accepted
MID 34 ->
Job info subscribe

<- MID 5 Command accepted
MID 70 ->
Alarm subscribe

<- MID 5 Command accepted

That's the initial handshake.

Then communication is driven by the needs of the client.

A typical conversation using parameter sets looks like this:

PC direction controller meaning
MID 42
->
Disable tool

<- MID 5
Command accepted
MID 18
->
Select Parameter set

<- MID 5 Command accepted

<- MID 15 Parameter set selected
MID 43
->

Enable tool

<-
MID 5
Command accepted

<-
MID 61
Last tightening result data

<-
MID 61 Last tightening result data

<-
MID 61 Last tightening result data
MID 42
->
Disable tool

<- MID 5
Command accepted



A typical conversation using jobs looks like this:

PC direction controller meaning
MID 42
->
Disable tool

<- MID 5
Command accepted
MID 127
->
Abort job

<- MID 5 Command accepted
MID 38
->
Select job

<- MID 5 Command accepted
MID 37 ->
Job info unsubscribe

<- MID 5 Command accepted
MID 34 ->
Job info subscribe

<- MID 5 Command accepted

<-
MID 35
Job info
MID 43
->

Enable tool

<-
MID 5
Command accepted

<-
MID 61
Last tightening result data

<-
MID 61 Last tightening result data

<-
MID 61 Last tightening result data
MID 42
->
Disable tool

<- MID 5
Command accepted



We need to send "Abort job" before selecting one to make sure there is no job in progress.
Also the unsubscribe/subscribe trick is used to force sending "Job info" even if the job isn't changed, we need this message as a confirmation of successful job selection and as a flag we are good to enable the tool (Only Stanley controllers need this trick, AtlasCopco sends "Job info" in all cases after "Select job").




Georges Renault :

# Georges Renault
#include "drivers/GR_IXPIO_COMBO.inc"
workplace.devicehub.tmachine_io_combo_1 = yes
workplace.devicehub.tmachine_io_combo_1.settings.debug_mode = yes
workplace.devicehub.tmachine_io_combo_1.high_level.device.tmachine_1.settings.channelnumber = 1

# Only results from given spindle are delivered
workplace.devicehub.tmachine_io_combo_1.high_level.device.tmachine_1.settings.accept_spindle = 2

# Spindle reported by the tightening machine will be overridden by given value
workplace.devicehub.tmachine_io_combo_1.high_level.device.tmachine_1.settings.spindle_override = 1

Atlas Copco 3000 :

#include "/usr/local/plc/etc/drivers/AC3000_R2.drv"
#include "/usr/local/plc/etc/drivers/AC3000E_R2.drv"
workplace.device.ac3000_1 = yes
workplace.device.ac3000_1.driver = AC3000E_R2
#workplace.device.ac3000_1.driver = AC3000_R2
workplace.device.ac3000_1.settings.host = 10.8.4.180
#workplace.device.ac3000_1.settings.tty = /dev/ttyS1
workplace.device.ac3000_1.settings.log_file = /usr/local/plc/log/ac3000_1.log
workplace.device.ac3000_1.settings.debug_mode = yes
workplace.device.ac3000_1.settings.channelnumber = 1

Atlas Copco 6000 :

As Atlas Copco 3000 + this additional line:

workplace.device.ac6000_1.settings.ac6000_mode = yes

Stanley :

As Atlas Copco 3000 + these parameters are also available:

workplace.device.ac3000_1.settings.ac3000_spindle = 01
workplace.device.ac3000_1.settings.ac3000_scanner = yes

Desoutter

#include "/usr/local/plc/etc/drivers/AC3000E.drv"
workplace.device.ac3000_dessoutter = yes
workplace.device.ac3000_dessoutter.driver = AC3000E
workplace.device.ac3000_dessoutter.settings.host = 192.168.1.10
workplace.device.ac3000_dessoutter.settings.log_file = /usr/local/plc/log/tmachine_dessoutter.log
workplace.device.ac3000_dessoutter.settings.debug_mode = yes
workplace.device.ac3000_dessoutter.settings.channelnumber = 1
workplace.device.ac3000_dessoutter.settings.requestresenddelay = 0
workplace.device.ac3000_dessoutter.settings.waitforgroupchange = no
workplace.device.ac3000_dessoutter.settings.commstart_revision = 1
#workplace.device.ac3000_dessoutter.settings.looseningjobnumber = 07
Personal tools