Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

General

Resources

Ruter

The Modbus

Vi valgte å koble opp en egen ruter for å opprette et LAN som Wago PLS-en og roboten kunne kobles til. Da blir det også mulig å koble seg til systemet med PC-en trådløst, på det lukkede nettverket.

Image Removed

protocol is one of the most widely used fieldbus communication protocols in the industry. The main reason for this is that no licence is needed and it is free to any user. Many producers of automation equipment have it as a standard integration into their in devices.
Modbus is a master-slave protocol that transmits over a bus through serial lines, ethernet or a wireless network. It can mainly be classified in RTU and TCP mode, where RTU directly transmits binary data over serial communication, while TCP allows transmission over a network. The figure shows a combination of the different modes using gateways.

Image Added
A Modbus message being sent from the master includes what action it is to perform in a function code. It could be read registers and would have information of which register to start at. In the message there is an error check field that allows the slave to check the message's integrity.


The function code from the master should be echoed back in a normal response, with the data collected by the slave. This would be as register values or status. Additionally, the code can be changed to respond there is an error, if one has been detected. Videre måtte vi grave oss inn i kommunikasjonsoppsettet til modbus protokollen. Det var mange manualer fra både CodeSys sin side:

 og TM FLOW:

For å kunne finne roboten måtte man ha en eldre versjon av TM FLOW, altså system versjon 1.88.2400.

Etter mange timer med prøving og feiling ble det endelig forstått hvordan oppsettet på Modbus dataen skulle legges inn.

I CODESYS blir det lagt inn

  • Holding registers for å lese data (DWORD) fra OMRON PLS-en inn til WAGO-en
  • Coils for å lese BOOL
  • Input registers for å sende DWORD
  • Discrete inputs for å sende BOOL

Image Removed

For å sette innstillinger for variablene måtte det settes opp slik. Antallet avhenger av hvor mange variabler man trenger:

Image Removed

For å lese inn data måtte variablene deklareres slik som i den øverste figuren og bli koblet til en variabel i et kjørende program (kan ikke bare mappes direkte til en global variabel).

Image Removed

For variabler som skal sendes til OMRON kan de bare mappes til variabelen.