Skip to content

Basic python module to control the input and output ports of a WAGO CC100.

License

Notifications You must be signed in to change notification settings

wago-enterprise-education/wago_cc100_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CC100IO

Basic python module to control the input and output ports of a WAGO CC100 (751-9301). Module can be used native on WAGO CC100 or in Docker Container running on WAGO CC100.

This repository is a development repository that was created as part of a student project and is not regularly maintained. It is neither a stable version nor an official repository of WAGO GmbH & Co. KG.

Contributors

Prerequisites

  • Firmware Version >= 21(03.09.04)
  • Python >= 3.7 on WAGO CC100

Installation

pip install CC100IO 

Example

import CC100IO
def armHoch():

    CC100IO.digitalWrite(3, True)
    if CC100IO.digitalReadWait(4, False):
        CC100IO.digitalWrite(3, False)
        return True

Description of functions

  • digitalWrite (output, value) :

    • output: Digital output to be switched (1-4)
    • value: Value which the selected output should be set to (True or False)
    • Function switches the output to the specified value.
    • Function does not check the current value of the output.
    • Function returns True if value is written, returns False if an error occured.
  • analogWrite (output, voltage) :

    • output: Analog output to be switched(1 or 2)
    • voltage: Voltage which the selected output should be set to (0 - 10000 mV)
    • Function switches the output to the specified voltage.
    • Function does not check the current value of the output.
    • Function returns True if value is written, returns False if an error occured.
  • digitalRead (input) :

    • input: Digital input to be read (1-8)
    • Function reads the input.
    • Function does not check the current value of the output.
    • Returns True or False depending on the value.
  • digitalReadWait (input, value) :

    • input: Digital input to be checked (1-8)
    • value: State to be queried at the input
    • Reads the specified input until the desired state is reached, by another Function or external factors and then returns True.
    • Function runs until the state is reached.
  • analogRead (input) :

    • input: Analog input to be read (1 or 2)
    • Function reads the input and returns the calibrated value in mV as an Integer.
  • delay (iTime) :

    • Function makes the programm in a period of time late or slow. (in ms)
  • tempRead (input) :

    • input: PT input to be switched ("PT1" or "PT2")
    • Function reads the input and returns the calibrated value in °C as an Integer.
  • serialReadLine():

    • Reads incoming message on RS485 Port till eol
  • serialReadBytes(n):

    • n: number of bytes to read
    • Reads n incoming message on RS485 Port
  • serialWrite(message):

    • message: String to write
    • Write message to RS485 serial interface
    • returns number of written bytes

Examples

Examples can be found in directory sample-scripts

About

Basic python module to control the input and output ports of a WAGO CC100.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages