|
Seems like C# got bloated without really doing any of this.
is it really such a bad idea for example to do
public component Foo { // implements IComponent, IPropertyNotify, IDisposable etc
public Bar { get; set; } // generates OnBarChanged/BarChanged, etc
};
and save all of that code? You can't really make that into a library. At best you're using a C# Source Generator and some sort of input document.
or even
public entity Contact { // implements all of the data bound stuff
};
And if that's too much, what about simply the ability to extend the grammar via Source Generators so you could create or install these (as nuget packages) to extend the language as the project requires?
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
What you describe is exactly why I think MSFT is on point with the "targetted models" approach to AI-assist in code.
|
|
|
|
|
Now that's interesting. It occurred to me that AI might be able to insert itself here with some benefit to the developer but I wouldn't know enough about it - having not even used CoPilot for example - to really say so this is news to me.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
That is what IDEs should help with.
They will write all of that boiler plate for you.
The new AI generators might help, too. I have not used them directly, but I have watched team mates flounder trying to have AI generate simple commands that I was able to find in the man page.
|
|
|
|
|
I mean, I think it would be better if the boilerplate didn't have to exist, if possible, simply because even if generated, it still creates a maintenance point.
If some of the boilerplate were baked in as language constructs, or if the language was extensible, you could eliminate that boilerplate at the last mile .i commented to some others here giving an example that a library couldn't solve in C#, but the IDE approach, while it would solve it and does, even with like Winforms tech and InitializeComponent(), now you have InitializeComponent() to maintain. Not the greatest example because it round trips from the designer but most of the time with most tools that's not the case.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
The product is expensive, but I haven't seen anything to compete with it, and I need the ability to sniff MODBUS commands and responses on a RS-485 bus, interpret them correctly, and save them to a log. This item looks like it will do the job, but it needs to be connected to a PC to perform. I'm thinking I can build or buy a single board computer small enough to be deployed in the field inside a weather-proof box for a week or two to search for missing commands or spurious ones. It would be very helpful to hear from previous users, though, before I embark on this course.
IO Ninja Hardware Manual (NHM)[^]
Will Rogers never met me.
|
|
|
|
|
I haven't, but they do have a forum which might be a good place to duplicate this request?
Home | IO Ninja Forum[^]
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Thanks! I'll spend some time surfing the forum!
Will Rogers never met me.
|
|
|
|
|
|
Interesting, but as with most MODBUS products, it wants to be either a Master or a Slave. I just need to log everything on the bus.
Will Rogers never met me.
|
|
|
|
|
|
Nice system! If I was working on developing devices it would be very helpful. But I need something I can hang in a cabinet in the field and let it run. I have a solar array (840 kW) connected to a battery (1 MW / 2 MWh), both controlled by a Site Controller. There have been some anomalous events over the past few months, and I suspect communications issues. With 14 inverters, three diesel generators and one big battery, it's hard to isolate which unit is having problems, especially when I can't get confirmation that the controller even sent the proper commands! Seriously, who would build a system controller that has no logging capability? I expected better of Tesla!
Will Rogers never met me.
|
|
|
|
|
You *could* in theory make one of these. I'm not sure what it costs, but if it's expensive and you're not sure you could produce one yourself with some work.
I made something similar, but it was simply for a basic serial UART, not RS-485.
i2cu Take Two: Serial and I2C Probe in a Handy Package[^]
You could adapt code like that using code like this:
GitHub - zivillian/esp32-modbus-gateway: ESP32 Modbus RTU/TCP Gateway[^]
Just a thought, even though it may not be realistic for you. I'd do it, but then I'm a bit crazy.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
I was thinking something like passing it through a pi kind of akin to a proxy. Just echo the traffic out the other side.
A simple device to do only that might have market because splitting it means you could have the traffic sent to logging and the device, or maybe to a 'real device' and also a device under development/testing.
They build something like this in a pizza box rack mount style, though I don't recall what it was called. PC feeds all serial to it and it then feeds the serial wherever you configure/connect it.
|
|
|
|
|
I would use a realtime MCU rather than a Pi for that. I just don't trust what is essentially a tiny PC to have the regular latency to keep a clean, uninterrupted signal. It probably will, I'm just paranoid. Part of it too is I think an RPI would be overkill when a cheapo ESP32 could easily handle it.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Yeah, it'd definitely fail from what I get about all this. But temp diagnostic tool vs production component maybe?
Sounds like it'd be just plug it in and capture the broadcast packets and throw them on disk. At least that way failure just means losing the logging you had it doing.
|
|
|
|
|
There is no need to pass data through it at all. All that does is unnecessarily add another potential point of failure. This is RS-485 which is inherently multi-drop so it would be much better to have a listen-only device.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
Ahh... broadcast to all on subnet... I hear.
|
|
|
|
|
If I had the time, I'd do it, too! There's never enough hours in the day...
Will Rogers never met me.
|
|
|
|
|
I dealt with MODBUS 30+ years agoβ¦ I donβt remember it having checksums/CRCs/hashes.
Or is that covered on the wire protocol?
Put large, power conditioner capacitors on all electric supplies?
Sounds like the wild west/rats nest
|
|
|
|
|
The MODBUS protocol includes a 16-bit CRC at the end of every message. Given the noisy environments where it's often used, that's probably a good thing.
Will Rogers never met me.
|
|
|
|
|
There are (at least) two variants of the protocol. One is called RTU and has the checksum because it sends the data purely in a binary format. The other is called ASCII and as the name implies it sends the data in ASCII hexadecimal mode with two bytes for each byte of data. It has also been adapted for use with TCP and that data is sent in binary mode but it relies on the TCP packet checksum so there isn't an explicit one sent with the data.
That reminds of a funny old story. Sorry, I'm an old codger and I have a million of 'em.
In the late 1980s I was working on automation projects that used VAXes as controllers. We were polling a bunch of actual RTUs with a VAX-750 and the CRC calculation was taking the CPU to its knees. DEC was aware of the problem so they decided to do the CRC calculation in hardware using the table lookup method. To implement the instruction(s) required them to retrofit the CPU boards of the computer and to do that they sent out their local service representative. He proceeded to remove the CPU circuit board, which was about a two foot square, and he changed a whole bunch of wire-wrapped lines on the board. This was a bit-slice architecture minicomputer using AMD 4-bit wide chips. I was truly blown away seeing this transpire as I had never seen anything like it before or since. It worked too as we used much less of the CPU after the changes.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
Wordle 1,102 4/6
π©β¬π¨β¬β¬
π©π©β¬β¬β¬
π©π©π¨β¬β¬
π©π©π©π©π©
|
|
|
|
|
Wordle 1,102 4/6*
π©β¬π¨β¬β¬
π©β¬π¨β¬β¬
π©π©β¬β¬β¬
π©π©π©π©π©
|
|
|
|
|
β¬π¨π¨β¬β¬
π¨β¬β¬β¬π©
β¬π©π©π©π©
π©π©π©π©π©
American spelling caught me out twice
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
modified 25-Jun-24 2:40am.
|
|
|
|