Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4.0 Checklist #242

Closed
5 of 7 tasks
alexbuczynsky opened this issue Jul 10, 2019 · 17 comments
Closed
5 of 7 tasks

v4.0 Checklist #242

alexbuczynsky opened this issue Jul 10, 2019 · 17 comments

Comments

@alexbuczynsky
Copy link
Collaborator

alexbuczynsky commented Jul 10, 2019

Wanted to consolidate v4.0 discussions and create a common todo list

Todos:

  • Provide Typescript examples to compliment javascript examples
  • Update Javascript examples if needed
  • Use values or valuesAsBuffer (where values is the coils or uin16 representation)
  • CLI Tools like jsmodbus fc03 0:10 --repeat=50
  • Scripts for Long Term Testing
  • Support for more Function Codes
  • Integrate into the typescript code the changes that fixed Read holding registers CRC mismatch #243 once Fix for Issue#243 CRC Missmatch, v3.1.4 #244 or something similar fixes the bug.
@alexbuczynsky
Copy link
Collaborator Author

@stefanpoeter I know you have a couple of items you wanted to add to the 4.0 milestone. Any thoughts on those?

@stefanpoeter
Copy link
Member

A quick one before Work catches me:

  • Command Line Requests like jsmodus fc03 0:10 --repeat=50 (ms). for example

I'll come Back to this

@stefanpoeter
Copy link
Member

I added some items to the list. Unfortunatly work gets the better of me right now so I'll won't have much time.

@alexbuczynsky
Copy link
Collaborator Author

alexbuczynsky commented Jul 18, 2019

I have been caught up with work as well.

Which function codes did you want to tackle? I have not personally used any outside of the main function codes (1-6, 15, 16), so I am wondering how often they are used...

alexbuczynsky pushed a commit that referenced this issue Aug 17, 2019
- added examples that mimic the original javascript
  examples.

going towards issue #242
alexbuczynsky pushed a commit that referenced this issue Aug 18, 2019
makes sure that the private properties
- _valuesAsArray
- _valuesAsBuffer
Always return the correct type and never
undefined. Instead of returning undefined,
the already existing exception message
'InvalidType_MustBeBufferOrArray' will
be thrown.

going towards issue #242
@alexbuczynsky
Copy link
Collaborator Author

alexbuczynsky commented Aug 18, 2019

@stefanpoeter I completed a couple of the items I wanted to get to such as creating working examples in typescript and making sure that the _valuesAsBuffer and _valuesAsArray types are always set correctly.

For the CLI tool, were you thinking of using something like commander? If so, I have created CLI tools in the past and would be more than happy to get started on it.

As far as additional function codes, I would assume you are talking about FC 7-8, 11-12, 17, 20-24, etc. as listed here Modbus Application Protocol Spec V1.1b? If so do you want this for 4.0 or for future version such as 4.1? (on a selfish note, I would like to get 4.0 out so that my department can start using the typescript based version in production)

@stefanpoeter
Copy link
Member

Hi @alexbuczynsky

sorry for the late reply.

I would use command for the CLI tools thats right.

Regarding the other FCs, if you are in a hurry these can be added in later minor versions. Unfortunatly I am still busy with other projects and there is currently not that much time left for this version on my side.

@alexbuczynsky
Copy link
Collaborator Author

alexbuczynsky commented Oct 16, 2019

@stefanpoeter

Sorry I have been held up with work projects...

I added the changes you made from #244 into the 4.0 branch. Just fyi, it won't be as clean of a merge when we bring the 4.0 branch into the master, since the new code base is in typescript.

I added a basic cli based on what you were describing. It only does read requests over TCP. The template is there, so if you want to add requests for RTU or write requests feel free. Here are the options when you type jsmodbus --help

Usage: jsmodbus [options] [command]

Options:
  -V, --version                           output the version number
  -h, --help                              output usage information

Commands:
  fc01 [options] <host> <unitId> <range>  Read Coils
  fc02 [options] <host> <unitId> <range>  Read Discrete Inputs
  fc03 [options] <host> <unitId> <range>  Read Holding Registers
  fc04 [options] <host> <unitId> <range>  Read Input Registers

Here are the options for the function calls (jsmodbus fc03 --help)

Usage: jsmodbus fc03 [options] <host> <unitId> <range>

Read Holding Registers

Options:
  -p, --port <port>        Modbus Port (502 by default)
  -r, --repeat <time>      Repeat interval in milliseconds
  -b, --buffer             Print output as buffer
  -t, --timeout <timeout>  connection timeout in milliseconds (2000 by default)
  -bm, --benchmark         show timestamp benchmark information
  -h, --help               output usage information

@stefanpoeter
Copy link
Member

Hey @alexbuczynsky,

since you've been investing some time in this i would say it is more than fair to publish this as 4.0. Since I need some time to get used to typescript I would ask you to take care of issues concerning this version. Is that ok for you?

@stefanpoeter
Copy link
Member

And by the way, the CLI looks awesome. Great work. :-)

@stefanpoeter
Copy link
Member

I am not sure we need to bring this branch into the master. I would simply tag this as v4.0.0 and I assume npm does the rest. So we do not need to merge this into the master branch. But I'll check that.

@stefanpoeter
Copy link
Member

I've just published a v3.1 version from the v3.1-dev branch. It seems to work so the v4.0-dev branch is the place to put your changes in and I'll tag and publish it then.

@stefanpoeter
Copy link
Member

What about the Standard Code Style in the README. Is there anything like it for TypeScript?

@alexbuczynsky
Copy link
Collaborator Author

However you want to handle the release cycle / branch management is for sure your prerogative. Doesn't matter to me as long as NPM can handle the changes :)

Yes, I would be fine helping with issues concerning the 4.0 release. I will probably defer to you on when I am not sure about the underlying original code base in cases where I am not sure how it was originally programmed.

Standardjs actually supports typescript allegedly... See here https://standardjs.com/#can-i-use-a-javascript-language-variant-like-flow-or-typescript. We would have to use eslint as the linter and install the plugin as they suggest on their website. I would have to test it out first and then get back to you.

alexbuczynsky pushed a commit that referenced this issue Oct 16, 2019
alexbuczynsky pushed a commit that referenced this issue Oct 16, 2019
standardjs plugin for tslint was added and
now the code base requires these linting practices
to be followed just like the former js code did.

references #242
@alexbuczynsky
Copy link
Collaborator Author

I figured out how to add the linting standards. I am using two packages tslint and tslint-config-standard to apply the linting. The linting is applied before running the test / watch scripts. I then had to fix all the linting errors in the typescript code which took a hot minute. Anyway we can keep the badge on the readme.

@alexbuczynsky
Copy link
Collaborator Author

I will run a couple checks to make sure that the npm package will compile both the commander file and the dist code base correctly. I will let you know once I have checked the tarball file is correctly packaged and then I should be good to go on my end.

@alexbuczynsky
Copy link
Collaborator Author

Had to add the bin folder to the final package. It should be good to go now!

@stefanpoeter
Copy link
Member

It's done :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants