Coder Social home page Coder Social logo

modrssim2's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

modrssim2's Issues

MOD_WRITE_MULTIPLE_COILS doesn't works!

File: MODEthCommsProcessor.cpp @ line 587.

Practically the code uses count instead of byteCount that despite the name means number of bits!

The correct code is the following:

             case MOD_WRITE_MULTIPLE_COILS  :
                // unpack into the SIM memory on WORD of sim memory for every BIT in the data 
                //WORD numBytes;

                 numBytesInReq = modMsg.**byteCount**/8; // byteCount == bit count
                 if (modMsg.**byteCount**%8)  // if we overflow a byte
                    numBytesInReq++;

                 {
                 CString deb;
                    deb.Format("Write multiple outputs coils from %d for %d bits.\n", modMsg.address, modMsg.**byteCount**);
                    OutputDebugString(deb);
                    SockDataMessage(deb);
					if (m_CommsDecodeShow) CRS232Port::WriteToFile(deb);  // Added statement on 2016-12-26 by DL to save to Log file
                 }
                 numRegs = numBytesInReq * 8;   // repaint X bits // 2015-01-19 Multiplied by 8 to get total BITS by DL

                 for (i=0;i<numBytesInReq;i++)
                 {
                 WORD bitOffset;
                    for (bitOffset=0;bitOffset<8;bitOffset++)
                    {
                       if ((i*8)+bitOffset < modMsg.**byteCount**)  // Changed <= to only < by DL on 2018-11-27
                       {
                          if (*(BYTE*)modMsg.dataPtr & (0x01<<bitOffset))
                             PLCMemory.SetAt(requestMemArea, seperationOffset + modMsg.address+(i*8)+bitOffset, 1);
                          else
                             PLCMemory.SetAt(requestMemArea, seperationOffset + modMsg.address+(i*8)+bitOffset, 0);
                       }
                    }
                    modMsg.dataPtr++;
                 }
                 break;

Please don't ask me to create a pull request... I'm developing a modbus code for my own program and I have no time to do that.
If you want to insert the suggested changes help yourself and test them!
To verify I have used this document: Modbus_Application_Protocol_V1_1b3.pdf found on modbus.org

See you,
Bob

Enhancement: Unplugging USB cable with RTU could be handled better

I've toyed with a gaggle of simulators and this one is one of the better ones I have found, glad to see you have resurrected and it lives on.

One issue that I notice that could be handled better is when testing in Modbus RTU mode, if the USB cable is unplugged, the module starts chucking with the error shown in the screenshot. It would be nice if when we plugged back in, the program would recover and perhaps the log would not be spammed during the disconnect. Right-now we have to restart the program to recover.

image

New Feature: Add ability to inject error on demand

I like that there's the option to simulate various error scenarios but it would be awesome if we could click a button to force an error to occur on demand. Currently the program allows adjusting the frequency slider but we have to wait for the simerror, it'd be nice to be able to have some more granular control over "when" these happen.

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.