Closed alexbuczynsky closed 4 years ago
@stefanpoeter I know you have a couple of items you wanted to add to the 4.0 milestone. Any thoughts on those?
A quick one before Work catches me:
I'll come Back to this
I added some items to the list. Unfortunatly work gets the better of me right now so I'll won't have much time.
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...
@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)
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.
@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
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?
And by the way, the CLI looks awesome. Great work. :-)
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.
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.
What about the Standard Code Style in the README. Is there anything like it for TypeScript?
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.
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.
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.
Had to add the bin folder to the final package. It should be good to go now!
It's done :-)
Wanted to consolidate v4.0 discussions and create a common todo list
Todos: