GithubHelp home page GithubHelp logo

Question: S7-200 about gos7 HOT 4 CLOSED

robinson avatar robinson commented on July 30, 2024
Question: S7-200

from gos7.

Comments (4)

robinson avatar robinson commented on July 30, 2024

Hi there,

I have not tested with S7-200 but as far as I know S7-200 has no rack/slot . Therefore just put 0/0. Try to take some test and let me know the result. If you have any improvement please feel free to sharing. Cheers, R

from gos7.

localleon avatar localleon commented on July 30, 2024

Okay, so i just found my TSAP in a capture of the COTP Protocol. I currently just hardcoded it into the source to fix my issue. If i am able to resolve/understand the root cause i will provide you with more information and maybe an pull request.

Could you share some Sample Code for setting Merkers? My Endgoal is to set Merker 2.4 to 1. Some Code would really help me out because im now just fiddling through the function AGWriteMB to find this out.

// TCPClient
	handler := gos7.NewTCPClientHandler(tcpDevice, rack, slot)
	handler.Timeout = 10 * time.Second
	handler.IdleTimeout = 10 * time.Second
	handler.Logger = log.New(os.Stdout, "tcp: ", log.LstdFlags)
	// Connect manually so that multiple requests are handled in one connection session
	handler.Connect()
	defer handler.Close()
	//init client
	client := gos7.NewClient(handler)
	// read Variable
	start := 2
	log.Println("merkerTest Merker as Byte:", byte(start))
	fmt.Println()
	size := 1
	buffer := make([]byte, 255)
	//AGWriteMB to Parameters
	err := client.AGWriteMB(start, size, buffer)
	log.Println("write mb error:", err)
	//AGWriteMB(start int, size int, buffer []byte) (err error)

Any examples would be from great interest. Thanks for you help.

from gos7.

localleon avatar localleon commented on July 30, 2024

The S7-200 is answering to both CPU and PLC Status Functions with an Error Code (CPU : Function not available 0). So these functions are maybe not supported on this model

from gos7.

localleon avatar localleon commented on July 30, 2024

So the S7-200 wants a bit instead of a byte for their data. In your libary the datatype is hardcoded to byte. Maybe we could introduce a parameter for AGWriteMB to change the Type.

For my problems, i just hardcoded everything to use bits. Thanks for your work

from gos7.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.