jfraire / device-modbus Goto Github PK
View Code? Open in Web Editor NEWPerl distribution to implement Modbus communications
License: Artistic License 2.0
Perl distribution to implement Modbus communications
License: Artistic License 2.0
Here is another simple example how I read values from one device with different results
root@raspberrypi:/opt/kronometrix/bin# ./rs485rec_2
^@Unit number is invalid at /opt/kronometrix/perl/lib/site_perl/5.20.3/Device/Modbus/RTU.pm line 105.
root@raspberrypi:/opt/kronometrix/bin# ./rs485rec_2
<-$VAR1 = bless( {
'unit' => 1,
'crc' => 22239,
'message' => bless( {
'values' => [
17386,
32768,
16553,
39322,
16834,
26214,
16916,
26214,
469,
53,
243,
371
],
'code' => 4,
'bytes' => 24,
'function' => 'Read Input Registers'
}, 'Device::Modbus::Response' )
}, 'Device::Modbus::RTU::ADU' );
Im not sure I do understand yet but I see the following, if I set in my client the device default speed, 19200 my client almost never succeeds in getting any values from the device, but rather some sporadic errors:
If I set on my client 9600, Im starting to see light:
$VAR1 = bless( {
'crc' => 57400,
'unit' => 1,
'message' => bless( {
'function' => 'Read Input Registers',
'bytes' => 24,
'values' => [
17360,
0,
16585,
39322,
16859,
13107,
16901,
39322,
416,
63,
274,
334
],
'code' => 4
}, 'Device::Modbus::Response' )
}, 'Device::Modbus::RTU::ADU' );
Im planning to build a Raspberry Pi as a modbus server. I have some questions, maybe you can help me, please:
Thanks
We are experimenting with a MODBUS device, for Indoor Air Quality. The device works nice and supports MODBUS RTU.
For some reason it takes forever until I see some values back from this device on screen. Not sure why.
Can I somehow put a debug on the RTU line and see more about whats happening within ?
When trying to read data from an IAQ senzor, Im getting these, different results, all the time. Sometimes it does work, sometimes not.
root@raspberrypi:/opt/kronometrix/bin# ./rs485rec_2
<-$VAR1 = bless( {
'message' => bless( {
'values' => [
1,
4,
1,
49152,
0,
0,
0,
16752,
0,
0,
1,
0,
0,
16968,
0,
0,
0,
17096,
0,
0,
0,
16880,
0,
0,
5000
],
'bytes' => 50,
'function' => 'Read Holding Registers',
'code' => 3
}, 'Device::Modbus::Response' ),
'unit' => 1,
'crc' => 40150
}, 'Device::Modbus::RTU::ADU' );
root@raspberrypi:/opt/kronometrix/bin# ./rs485rec_2
Unimplemented function: <0> at ./rs485rec_2 line 25.
root@raspberrypi:/opt/kronometrix/bin# ./rs485rec_2
^@Unit number is invalid at /opt/kronometrix/perl/lib/site_perl/5.20.3/Device/Modbus/RTU.pm line 105.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.