Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trying to write value in String register #230

Open
QuakeString opened this issue Aug 21, 2022 · 5 comments
Open

trying to write value in String register #230

QuakeString opened this issue Aug 21, 2022 · 5 comments
Labels
question Further information is requested

Comments

@QuakeString
Copy link

QuakeString commented Aug 21, 2022

hi, I'm tyring to write string in ST22:3
but get this error
"Failed to create a writeable value for ST22:3 from this is simple text"
I used this code

with SLCDriver('192.168.1.10') as plc:
plc.write(('ST21:3', 'this is simple text'))

please help me out.

@QuakeString QuakeString added the question Further information is requested label Aug 21, 2022
@ottowayi
Copy link
Owner

Can you show the full stack trace or enable logging? The error that triggers that error will tell you what is wrong.

@QuakeString
Copy link
Author

I not yet got a chance to check that, I will do it tomorrow.
but I found another thing. when I'm reading string from ST22:1 and writing it back to ST22:2 then it shows that I wrote 82 charactor, actually in ST22:1 there is only 7 charactor,
also when I read ST22:1 and store it into my sqlite db, there also storing as a BLOB.
2022-08-28_10-13
string

@QuakeString
Copy link
Author

QuakeString commented Aug 29, 2022

Here is the output of

Can you show the full stack trace or enable logging? The error that triggers that error will tell you what is wrong.

Here is the output:

2022-08-29 09:01:26,700 [INFO] pycomm3.cip_driver.CIPDriver._register_session(): Session=3394028776 has been registered.
2022-08-29 09:01:26,701 [INFO] pycomm3.cip_driver.wrapped(): Attempting an Extended Forward Open...
2022-08-29 09:01:26,701 [INFO] pycomm3.cip_driver.CIPDriver.generic_message(): Sending generic message: forward_open
2022-08-29 09:01:26,770 [ERROR] pycomm3.cip_driver.CIPDriver.generic_message(): Generic message 'forward_open' failed: Service not supported
2022-08-29 09:01:26,771 [ERROR] pycomm3.cip_driver.CIPDriver._forward_open(): forward_open failed - Service not supported
2022-08-29 09:01:26,771 [INFO] pycomm3.cip_driver.wrapped(): Extended Forward Open failed, attempting standard Forward Open.
2022-08-29 09:01:26,771 [INFO] pycomm3.cip_driver.CIPDriver.generic_message(): Sending generic message: forward_open
2022-08-29 09:01:26,860 [INFO] pycomm3.cip_driver.CIPDriver.generic_message(): Generic message 'forward_open' completed
2022-08-29 09:01:26,861 [INFO] pycomm3.cip_driver.CIPDriver._forward_open(): Forward Open succeeded. Target CID=b'\x11^\xf9\xee'
2022-08-29 09:01:26,930 [INFO] pycomm3.cip_driver.CIPDriver.generic_message(): Sending generic message: forward_close
2022-08-29 09:01:27,030 [INFO] pycomm3.cip_driver.CIPDriver.generic_message(): Generic message 'forward_close' completed
2022-08-29 09:01:27,031 [INFO] pycomm3.cip_driver.CIPDriver._forward_close(): Forward Close succeeded.
2022-08-29 09:01:27,032 [INFO] pycomm3.cip_driver.CIPDriver._un_register_session(): Session Unregistered
2022-08-29 09:01:29,101 [INFO] pycomm3.cip_driver.CIPDriver._register_session(): Session=4234998010 has been registered.
2022-08-29 09:01:29,101 [INFO] pycomm3.cip_driver.wrapped(): Attempting an Extended Forward Open...
2022-08-29 09:01:29,101 [INFO] pycomm3.cip_driver.CIPDriver.generic_message(): Sending generic message: forward_open
2022-08-29 09:01:29,191 [ERROR] pycomm3.cip_driver.CIPDriver.generic_message(): Generic message 'forward_open' failed: Service not supported
2022-08-29 09:01:29,192 [ERROR] pycomm3.cip_driver.CIPDriver._forward_open(): forward_open failed - Service not supported
2022-08-29 09:01:29,192 [INFO] pycomm3.cip_driver.wrapped(): Extended Forward Open failed, attempting standard Forward Open.
2022-08-29 09:01:29,193 [INFO] pycomm3.cip_driver.CIPDriver.generic_message(): Sending generic message: forward_open
2022-08-29 09:01:29,291 [INFO] pycomm3.cip_driver.CIPDriver.generic_message(): Generic message 'forward_open' completed
2022-08-29 09:01:29,291 [INFO] pycomm3.cip_driver.CIPDriver._forward_open(): Forward Open succeeded. Target CID=b'\xfd\xa6\xcf\xe4'
2022-08-29 09:01:29,381 [INFO] pycomm3.cip_driver.CIPDriver.generic_message(): Sending generic message: forward_close
2022-08-29 09:01:29,471 [INFO] pycomm3.cip_driver.CIPDriver.generic_message(): Generic message 'forward_close' completed
2022-08-29 09:01:29,471 [INFO] pycomm3.cip_driver.CIPDriver._forward_close(): Forward Close succeeded.
2022-08-29 09:01:29,471 [INFO] pycomm3.cip_driver.CIPDriver._un_register_session(): Session Unregistered

@ottowayi
Copy link
Owner

ottowayi commented Sep 1, 2022

Hmm, it looks like I didn't put in an useable logging for the SLC driver. This driver doesn't get much attention so it's probably a bug. I will try to investigate and figure out what is going one

@mfastag
Copy link

mfastag commented Mar 7, 2024

Hi, I assume this read issue was resolved for the SLC driver (in "_slc_string_swap" I had to append a zero byte if data length is odd).... but when I write a string, although I don't an error the value does not take. any thoughts? was the SLC driver ever successful?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants