Communication handling for reading from a MotoLogix system.
Version history
2.0.0
Changes
commLatency
output for monitoring the communication latency
- library version number to
2.1.0
- PLC side
synchCounter
timeout setting increased to1000ms
- unused internal variables
- flickering
synchCounter
show full history
1.0.0
Changes
RemoteMode
signal handling
- library version number to
2.0.0
ServoOnReady
signal handling
0.1.0
Changes
- source code ported
- version number reset
- now using semantic versioning
Overview
kind | name | type | default | comment |
---|---|---|---|---|
input | FirstScan | BOOL | first scan after startup of plc | |
output | commLatency | INT | -1 | communication latency [ms] (-1=not connected) |
in_out | MLX_Input | ARRAY[0..435] OF USINT | ||
in_out | MLX | MLxData | The MLxData Controller Scope tag. |
Details
FirstScan
BOOL
Must be True
for the first scan after startup of plc.
commLatency
INT
Measured communication latency in ms
.
This is the time measured between the ReadPacket.synchCounter
increments.
It helps to understand what setting is needed for the robot controller
watchdog (S3C1380
) if you experience communication timeouts.
value | explanation |
---|---|
-1 | not connected |
0-999 | latency in ms |
MLX_Input
ARRAY[0..435] OF USINT
Input data buffer (mapped to fieldbus IO).
MLX
MLxData
The MotoLogix variable which acts as the shared memory for a MotoLogix system.
As the PLC runs through its scan cycle each active MotoLogix FB will read from- and write to this MotoLogix variable.
It is also used for processing the data red from- and sent to the robot controller.
There are a few important rules:
MLxCommunicationRead
must be called at the very beginning of the PLC scan cycle.MLxCommunicationWrite
must be called at the very end of the PLC scan cycle.- All other MotoLogix FB’s used in your application must be called inbetween.
- All off this must be handled by the same PLC task, respecting above rules.
Failing to follow above rules can lead to inconsistent data being sent to the robot controller which could result in unexpected motion.
Implementation
fbCommunicationRead : ARRAY[0..0] OF MLxCommunicationRead;
// fbCommunicationRead[0].FirstScan := ;
fbCommunicationRead[0]( MLX_Input := dummy, MLX := dummy );
// := fbCommunicationRead[0].commLatency;