I tried to install Pascal Scada on the Pi but it wont compile as I am using to new FPC and Lazarus.What does the compiler say? "won't compile" without any other information isn't helpful...
I tried to install Pascal Scada on the Pi but it wont compile as I am using to new FPC and Lazarus.What does the compiler say? "won't compile" without any other information isn't helpful...
I suppose the bottlenecks are Bgracontrols and Bgrabitmap, that currently do not compile for arm (fpc 3.2 and fpc trunk 43374 + ).
It does not compile when I try to install from the online lib manager and it breaks when it wants to install those components.Try to just download PascalSCADA and install packages manually with opening each package and deleting dependencies to BGRA packages. Then report if that helped.
There some instructions by qemu on windows like as below link but not tested:No, I mean a simulator for hardware. Not the OS. Avra knows what I mean.
https://projects-raspberry.com/simulation-raspberry-pi-emulator-for-windows-10-using-qemu/ (https://projects-raspberry.com/simulation-raspberry-pi-emulator-for-windows-10-using-qemu/)
Yes, something like that (at first glance) tnx!
I have Scada running on my RPi2. With FPC/Laz trunk.Yes! Before I could not get it to work. If it works on 2 it should work on 3 and 4.
See screenshot.
Could this be of any help ?
Also if your OS is windows you can create a virtual com port by com0com project http://com0com.sourceforge.net/ (http://com0com.sourceforge.net/)IMHO not working on an actual Win10/64 because the drivers are not (correct)signed. My windows refused it.
I have Scada running on my RPi2. With FPC/Laz trunk.
See screenshot.
Could this be of any help ?
There is another library for modbus:
https://sourceforge.net/projects/mbutils/ (https://sourceforge.net/projects/mbutils/)
Do you know a good emulator? (I know there is one from Siemens but that feels uncomfortable - and is not free!)For Siemens Simatic S7 you can download archive from https://sourceforge.net/projects/snap7/files/1.4.1/ and use serverdemo. It does not emulate full PLC, just S7 protocol and DB1, DB2 and DB3. That is enough for most of the tests. You will find there raspberry binaries too, and even clientdemo whis is really, really good and useful.
I have Scada running on my RPi2. With FPC/Laz trunk.How did you install PascalSCADA and BGRA dependencies? Via FpcUpDeluxe or via OPM? Was it a smooth install or you had to solve some issues first?
Thaddy it would be great if you could build a Modbus library without the dependancy on GUI elements.What GUI dependency are you talking about? Delphi ModBus TCP library depends on Indy, and mbutils depends on Synapse and even comes with console demo application. As I understood Thaddy, he mentioned elimination of 3rd party communication lib dependencies.
Your links are really helpful.I am really glad I was of some help. Happy coding! O:-)
This library seems to only handle integer values. https://sourceforge.net/projects/mbutils/
The Modbus protocol can only transmit words (16 bits) or in some functions bits, this does not mean you can not get a float or a string even, you just need to know the size and the address of the data you want to read and then type casting to the value of your internal format, for example a type single is 32 bit, so you need to read 2 words.Actually you can, because the protocol should be interpreted as bit patterns. So consequently 16 bit float values are possible. If you really need that is another matter. Same goes for - 2 char - string encodings: as long as you encode to a bitpattern you have 2 chars. And indeed: casting will suffice to get back and forth. (one of the reasons I wrote some helper functions for sysutils, a bit simpler than Avra's bit manipulation library. Both are on this forum, both are written with hardware control in mind)
Actually you can, because the protocol should be interpreted as bit patterns. So consequently 16 bit float values are possible. If you really need that is another matter. Same goes for - 2 char - string encodings: as long as you encode to a bitpattern you have 2 chars. And indeed: casting will suffice to get back and forth. (one of the reasons I wrote some helper functions for sysutils, a bit simpler than Avra's bit manipulation library. Both are on this forum, both are written with hardware control in mind)Thaddy, you are saying the same I remark, the protocol itself is made to transmit 16 bit integer, but no one stop you to handle those 16 bit with the format you want.
Basically any type that can be expressed as a 16 bit value or less can - of course - be used. It is up to the programmer to interpret such encoding.
I don't use the absolute directive but instead a record with variant parts.Then you will probably like BitHelpers from my signature ;)
@AvraI don't use the absolute directive but instead a record with variant parts.Then you will probably like BitHelpers from my signature ;)
I started with a simple test program but I am not sure what all the steps should be.Do you really need console application? There are several GUI modbus demos in Examples directory. It would be much easier if you examine them and try to adapt them to your needs. You can even use some of the mentioned MODBUS slave simulators for a quick startup convenience. From your code and guessed expectations I think that one of the 2 mentioned libraries would be more appropriate.
Maybe we should integrate each others code for my suggested patch (there is a willingness to accept it for sysutils helpers from devel's)Feel free to use whatever you want from my code. If discussion is needed, then PM me or open a new thread. On the other hand I use almost every features from BitHelpers so if merge is not feature rich (especially custom format data printing) then I can simply continue using original BitHelpers. Not a problem, as long as there are no conflicts.
Maybe we can work together and use some of your code for the helpers? My code is more basic, bare essentials, and your code has more features.
Yes I need cli as the pi wont have a gui desktop. It runs the light Os without any gui stuff on it.
That has already been addressed in the patch(es), but the original request is somewhat obfuscated by unnecessary comments.
MyWord.Byte[1].Bit[7] := true; // %0000000100000010 MyWord equals 258 (Beware!!! This DOES NOT set a bit in MyWord !!!)
If there is no Modbus Lib for CLI only then there is a gap for one as a lot of IOT edge devicesDid you read my previous message at all about 2 other MODBUS libraries and one even comming with CLI demo?
If there is no Modbus Lib for CLI only then there is a gap for one as a lot of IOT edge devicesDid you read my previous message at all about 2 other MODBUS libraries and one even comming with CLI demo?
https://forum.lazarus.freepascal.org/index.php/topic,47289.msg338661.html#msg338661
Then you will probably like BitHelpers from my signature ;)
As there is no documentation I have no idea how they work to read a float from a register.You should check with your hardware device manual, but floats are usually with single precision (32 bit) and stored in two registers next to each other. You find address of it in the documentation, and load starting register (16 bits) and following register (also 16 bits). Usually you use MODBUS function with parameters like first register address and number of registers to read. Then you read directly 32 bits from 2 registers and cast them to single float type. Beware that your device may have different endianess - if it does you have to adapt to that. That's all.
What I known very well is your pasettimino library, it save me a lot of work in one of my projects, it was very helpful to have the communication with Siemens PLC done without any dependencies in external dlls.I am always glad to see pasettimino being used. It is based on Arduino lib so it is not thread safe yet. Hopefully I will catch time to change that.
By the way, I am the guy who send you the patches for the Linux compatibility of the library.Nice to see you here too, Victor - and thank you once again for the patches. :D