Using server class for emulating PLC, data not available #439
Replies: 2 comments 2 replies
-
I've realized that the server class has a |
Beta Was this translation helpful? Give feedback.
-
I used the following to register some data at DB block 100 on the fake PLC server: db_data = ctypes.c_int8 * len(bytearray(1000)
db_data = db_data.from_buffer(some_bytearray)
server.register_area(
area_code=srvAreaDB,
index=100,
userdata=db_data
) However, after a successful connection via my client, the following command Does anyone know why the first line fails to properly register anything? |
Beta Was this translation helpful? Give feedback.
-
I am attempting to stand up a fake PLC server for development purposes. I am having some trouble likely due to my lack of understanding with PLC devices generally.
I can stand up a server locally and connect to it fine, but attempting to populate it with some data fails.
It appears that my client has connected fine, though I get
RuntimeError: b'CPU : Item not available'
when trying to read the data I set viaregister_area()
. I do not wish to use the default data provided just by runningpython -m snap7.server
, I would like to specify my own.Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions